:root {
    --navy: #10243f;
    --blue: #1a73e8;
    --blue-dark: #1258b8;
    --ink: #1b2836;
    --muted: #5e6d7e;
    --line: #e3ebf4;
    --bg: #eef3f8;
    --card: #ffffff;
    --red: #d92626;
    --ok-bg: #e8f7ee;
    --ok-ink: #146c36;
    --err-bg: #fdecec;
    --err-ink: #9d1c1c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Be Vietnam Pro", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    color-scheme: light;
}

.wrap {
    max-width: 920px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.topbar {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 8px 20px;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px 18px 16px 16px;
    box-shadow: 0 10px 30px rgba(16, 36, 63, 0.06);
}

.brand { text-align: center; }

.logo {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto;
    background: #041018;
    box-shadow:
        0 0 0 3px #fff,
        0 0 0 5px #2f80ed,
        0 8px 18px rgba(16, 36, 63, 0.22);
}

.app-meta {
    margin-top: 8px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.35;
    font-weight: 500;
}

.kicker {
    margin: 0 0 2px;
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 12px;
    color: var(--navy);
    font-size: 22px;
    line-height: 1.35;
    font-weight: 700;
}

.menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.menu a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--navy);
    background: #f5f8fc;
    border: 1px solid #dbe5f0;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 13.5px;
    font-weight: 600;
}

.menu a:hover {
    background: #e8f1ff;
    border-color: #b9d2f7;
    color: var(--blue-dark);
}

.menu a.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.menu a.login {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.menu a.login:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    color: #fff;
}

.panel {
    margin-top: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(16, 36, 63, 0.04);
}

.form-group { margin-bottom: 14px; }

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

input[type="url"],
input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d5deea;
    border-radius: 12px;
    font: inherit;
    color: inherit;
    background: #fbfcfe;
}

input[type="url"]:focus,
input[type="text"]:focus {
    outline: 3px solid rgba(26, 115, 232, 0.18);
    border-color: var(--blue);
}

.example {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
    word-break: break-all;
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 11px 16px;
    font: inherit;
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.btn:hover { background: var(--blue-dark); }

.btn.secondary {
    background: #eef4fb;
    color: var(--navy);
}

.btn.secondary:hover { background: #e1ebf7; }

.message {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14.5px;
}

.success { background: var(--ok-bg); color: var(--ok-ink); }
.error { background: var(--err-bg); color: var(--err-ink); }

.posted {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.posted a {
    color: inherit;
    font-weight: 600;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.search-bar {
    display: flex;
    gap: 10px;
}

.search-bar input { flex: 1; }

.list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.item {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 6px 16px rgba(16, 36, 63, 0.04);
}

.thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    background: #e8eef5;
}

.item-title {
    font-weight: 700;
    font-size: 16.5px;
    line-height: 1.4;
    margin-bottom: 6px;
}

.item-title a {
    color: var(--navy);
    text-decoration: none;
}

.item-title a:hover { color: var(--blue); }

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

textarea {
    width: 100%;
    min-height: 140px;
    padding: 12px 14px;
    border: 1px solid #d5deea;
    border-radius: 12px;
    font: inherit;
    color: inherit;
    background: #fbfcfe;
    resize: vertical;
}

textarea:focus {
    outline: 3px solid rgba(26, 115, 232, 0.18);
    border-color: var(--blue);
}

.choice {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.choice label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #dbe5f0;
    border-radius: 999px;
    background: #f5f8fc;
    font-weight: 600;
}

.choice label.is-disabled {
    opacity: 0.55;
}

.preview p {
    margin: 0 0 12px;
    text-align: justify;
}

.preview img,
.thumbs img {
    max-width: 100%;
    border-radius: 12px;
}

.thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.thumbs img {
    width: 180px;
    height: 120px;
    object-fit: cover;
}

.share {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.banner {
    display: block;
    margin-top: 18px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.banner img {
    display: block;
    width: 100%;
    height: auto;
}

.tooltip { position: relative; display: inline-block; }

.tooltip .tooltiptext {
    visibility: hidden;
    width: 140px;
    background: var(--navy);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 130%;
    left: 50%;
    margin-left: -70px;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 12px;
    font-weight: 500;
}

.tooltip:hover .tooltiptext,
.tooltip:focus-within .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.note {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 12px;
}

@media (max-width: 680px) {
    .topbar {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 18px 14px;
    }

    .menu { justify-content: center; }

    h1 { font-size: 20px; }

    .search-bar { flex-direction: column; }

    .item { grid-template-columns: 1fr; }

    .thumb { height: 180px; }
}
