:root {
    --bg: #eaf3ff;
    --bg-2: #ffffff;
    --card: #ffffff;
    --text: #12233d;
    --muted: #566a86;
    --line: #d3e0f1;
    --accent: #2f6bff;
    --accent-text: #ffffff;
    --accent-soft: #e4edff;
    --bad: #c62839;
    --good: #12805c;
    --shadow: 0 10px 34px rgba(29, 66, 130, .12);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1626;
        --bg-2: #14213a;
        --card: #16233b;
        --text: #eaf1fc;
        --muted: #9fb2cd;
        --line: #2a3b58;
        --accent: #6c9bff;
        --accent-text: #0a1426;
        --accent-soft: #1d2f50;
        --bad: #ff7b88;
        --good: #5fd6ad;
        --shadow: 0 10px 34px rgba(0, 0, 0, .35);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: linear-gradient(180deg, var(--bg) 0, var(--bg-2) 520px) no-repeat, var(--bg-2);
    font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); }

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 860px;
    margin: 0 auto;
    padding: 18px 20px;
}

.logo { color: var(--text); font-weight: 800; font-size: 1.15rem; text-decoration: none; }
.toplink { font-weight: 600; text-decoration: none; }
.toplink:hover { text-decoration: underline; }

main { max-width: 860px; margin: 0 auto; padding: 0 20px 56px; }

.hero { padding: 34px 0 26px; }

h1 {
    margin: 0;
    font-size: clamp(2.5rem, 8vw, 4.2rem);
    font-weight: 850;
    line-height: 1.05;
    letter-spacing: -.025em;
}

.lead { margin: 12px 0 26px; color: var(--muted); font-size: 1.15rem; }
.lead strong { color: var(--text); font-variant-numeric: tabular-nums; }

.drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 210px;
    padding: 28px 20px;
    border: 2px dashed var(--accent);
    border-radius: 20px;
    background: var(--card);
    box-shadow: var(--shadow);
    text-align: center;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease;
}

.drop:hover, .drop.is-over { background: var(--accent-soft); }
.drop.is-over { transform: scale(1.01); }
.drop:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-title { font-size: 1.2rem; font-weight: 700; }
.drop-sub { color: var(--muted); font-size: .92rem; }

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

.results { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.results:empty { display: none; }

.result {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
}

.thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--accent-soft);
    object-fit: cover;
    font-size: .72rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
}

.result-main { min-width: 0; }
.result-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.result-name a { text-decoration: none; }
.result-name a:hover { text-decoration: underline; }
.result-state { color: var(--muted); font-size: .85rem; }
.result.is-bad .result-state { color: var(--bad); font-weight: 600; }

.bar { height: 6px; margin-top: 6px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.bar span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .15s linear; }

.button {
    display: inline-block;
    padding: 10px 18px;
    border: 0;
    border-radius: 11px;
    color: var(--accent-text);
    background: var(--accent);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button:hover { filter: brightness(1.08); }
.button.is-done { background: var(--good); color: #fff; }

.linkbutton { padding: 0; border: 0; color: var(--muted); background: none; font: inherit; font-size: .88rem; text-decoration: underline; cursor: pointer; }

.panel { margin-top: 26px; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.panel h2 { margin: 0 0 6px; font-size: 1.4rem; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

details { margin-top: 8px; }
summary { font-weight: 600; cursor: pointer; }
ol { padding-left: 22px; }
li + li { margin-top: 6px; }
code { padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); font-size: .88em; overflow-wrap: anywhere; }

a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (max-width: 560px) {
    .result { grid-template-columns: 44px minmax(0, 1fr); }
    .thumb { width: 44px; height: 44px; }
    .result .button { grid-column: 1 / -1; text-align: center; }
    .panel { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

.toplinks { display: flex; align-items: center; gap: 16px; font-weight: 600; }
.toplinks a { text-decoration: none; }
.toplinks a:hover { text-decoration: underline; }
.toplinks form { margin: 0; }
.who { color: var(--muted); font-weight: 500; }
.button-big { padding: 14px 26px; font-size: 1.1rem; }
.button-ghost { color: var(--text); background: transparent; box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.page-title { margin: 14px 0 6px; font-size: 2.2rem; }
.notice { margin: 12px 0; padding: 12px 15px; border-radius: 12px; font-weight: 600; }
.notice-good { color: var(--good); background: var(--accent-soft); }
.notice-bad { color: var(--bad); background: var(--accent-soft); }
.result-actions { display: flex; align-items: center; gap: 12px; }
.result-actions form { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 10px 0 0; }
.facts dt { color: var(--muted); font-size: .84rem; }
.facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; color: var(--muted); }
.tabs { display: flex; gap: 6px; margin: 10px 0 0; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 600; text-decoration: none; }
.tabs a.is-on { color: var(--text); background: var(--accent-soft); }
.table-wrap { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { color: var(--muted); font-size: .8rem; font-weight: 600; text-align: left; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tag { padding: 1px 8px; border-radius: 99px; color: var(--accent); background: var(--accent-soft); font-size: .76rem; font-weight: 700; }
.tag-bad { color: var(--bad); }
.form-stack { display: grid; gap: 16px; margin-top: 12px; }
.form-stack .button { justify-self: start; }
.limit label { display: block; margin-bottom: 5px; font-weight: 600; }
.limit-row { display: flex; flex-wrap: wrap; gap: 8px; }
select, input[type=number] { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--bg-2); font: inherit; }
input[type=number] { width: 130px; }
input[hidden] { display: none; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin-bottom: 5px; font-weight: 600; }
.check { display: block; margin: 3px 0; }
.types { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.types .check { margin: 0; font-size: .92rem; }

@media (max-width: 560px) {
    .result-actions { grid-column: 1 / -1; justify-content: space-between; }
    .toplinks { gap: 10px; font-size: .9rem; }
    .who { display: none; }
}

.hero h1 + .drop { margin-top: 24px; }
