/* ACRONYM BANK - one stylesheet, no framework. */

:root {
    --bg:        #0e1013;
    --panel:     #171a1f;
    --panel-2:   #1e222a;
    --line:      #2a2f38;
    --text:      #e8eaed;
    --muted:     #8b93a1;
    --accent:    #7c9cff;
    --accent-dk: #5b7ce0;
    --danger:    #ff6b6b;
    --ok:        #4ade80;
    --radius:    12px;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg:      #f6f7f9;
        --panel:   #ffffff;
        --panel-2: #f1f3f6;
        --line:    #e2e6ec;
        --text:    #171a1f;
        --muted:   #6b7280;
        --accent:  #3b5bdb;
        --accent-dk: #2f49b0;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
    background: var(--panel-2);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.9em;
}

/* ---- header ---- */

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(124, 156, 255, 0.15);
}
.top nav { display: flex; gap: 18px; font-size: 14px; }
.top nav a { color: var(--muted); }
.top nav a:hover { color: var(--text); text-decoration: none; }

/* ---- layout ---- */

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.hero {
    margin: 0 0 6px;
    font-size: 34px;
    letter-spacing: -0.03em;
    text-align: center;
}
.sub {
    margin: 0 0 28px;
    text-align: center;
    color: var(--muted);
}

/* ---- search ---- */

.searchbar {
    display: flex;
    gap: 10px;
    margin-bottom: 32px;
}
.searchbar input {
    flex: 1;
    padding: 16px 18px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.searchbar input::placeholder {
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}
.searchbar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.18);
}
.searchbar button {
    padding: 0 22px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--accent-dk);
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
}
.searchbar button:hover { filter: brightness(1.1); }

/* ---- result ---- */

.result {
    padding: 28px;
    margin-bottom: 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    animation: pop .18s ease-out;
}
@keyframes pop {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}
.result.miss { border-left-color: var(--muted); }

.result-acronym {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 8px;
}
.result-full {
    font-size: 28px;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.result-meaning {
    margin: 14px 0 0;
    color: var(--muted);
}
.result-example {
    margin: 12px 0 0;
    padding-left: 14px;
    border-left: 2px solid var(--line);
    font-style: italic;
    color: var(--muted);
}

/* ---- lists ---- */

.section {
    margin: 32px 0 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 12px 4px;
    color: var(--text);
}
.list a:hover { text-decoration: none; background: var(--panel); }
.li-acronym {
    flex: 0 0 88px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.06em;
    color: var(--accent);
}
.li-full { color: var(--muted); font-size: 15px; }

.empty { text-align: center; color: var(--muted); margin-top: 40px; }

/* ---- cards / forms ---- */

.card {
    padding: 24px;
    margin-bottom: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.card h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; }
.card h2 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.01em; }
.card > h2 + .muted { margin-top: 0; }

body.plain {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
body.plain .card { width: 100%; max-width: 400px; margin: 0; }

.muted { color: var(--muted); font-size: 14px; }
.count {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: var(--panel-2);
    border-radius: 20px;
}

label {
    display: block;
    margin: 16px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}
label .muted { font-weight: 400; }

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 11px 13px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 9px;
    outline: none;
}
input[type="text"]:focus, input[type="password"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.15);
}

.stack .field { margin: 0; }
.stack .row {
    display: flex;
    gap: 14px;
}
.stack .row .field { flex: 1; }
.stack .row .field.short { flex: 0 0 150px; }
.stack .row .field.short input {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.actions { margin-top: 22px; display: flex; gap: 10px; }

.btn {
    display: inline-block;
    margin-top: 8px;
    padding: 11px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--accent-dk);
    border: 0;
    border-radius: 9px;
    cursor: pointer;
}
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn.ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
}

.link-btn {
    padding: 0;
    font: inherit;
    font-size: 14px;
    color: var(--accent);
    background: none;
    border: 0;
    cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

.hidden-form { display: none; }

/* ---- table ---- */

.table {
    width: 100%;
    margin-top: 14px;
    border-collapse: collapse;
    font-size: 14px;
}
.table th {
    padding: 8px 10px 8px 0;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}
.table td {
    padding: 11px 10px 11px 0;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.table tr:last-child td { border-bottom: 0; }
.td-acronym { font-weight: 700; letter-spacing: 0.05em; color: var(--accent); white-space: nowrap; }
.td-actions { text-align: right; white-space: nowrap; }
.td-actions a { margin-right: 10px; font-size: 14px; }

/* ---- requests ---- */

.requests { border-left: 3px solid var(--ok); }
.req-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
}
.req-list li {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 20px;
}
.req-acronym { font-weight: 700; font-size: 14px; letter-spacing: 0.05em; }
.req-hits { font-size: 12px; color: var(--muted); }
.req-list .link-btn { color: var(--muted); font-size: 16px; line-height: 1; }

/* ---- flash / errors ---- */

.flash {
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--ok);
    border-radius: 9px;
}
.flash-error { border-left-color: var(--danger); }
.error { color: var(--danger); font-size: 14px; margin: 12px 0 0; }
.warn, .warn-card {
    font-size: 14px;
    color: var(--muted);
}
.warn-card { border-left: 3px solid var(--danger); }
.warn code { display: inline-block; margin: 4px 0; }

@media (max-width: 560px) {
    .wrap { padding: 28px 16px 60px; }
    .hero { font-size: 27px; }
    .result-full { font-size: 23px; }
    .searchbar { flex-direction: column; }
    .searchbar button { padding: 13px; }
    .stack .row { flex-direction: column; }
    .stack .row .field.short { flex: 1; }
    .li-acronym { flex-basis: 66px; }
    .table td.muted, .table th:nth-child(3) { display: none; }
}
