:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #1d232b; --muted: #5e6875; --line: #dde2e8;
  --accent: #1f5fa8; --accent-ink: #ffffff; --ok: #1d7a46; --warn: #9a6200; --bad: #b3261e; --soft: #eef3fa;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171b; --panel: #1c2026; --ink: #e6e9ed; --muted: #9aa4b1; --line: #2e343c;
    --accent: #6ea8ff; --accent-ink: #0d1520; --ok: #5ccf8a; --warn: #e2b04a; --bad: #ff8a80; --soft: #222a35; }
}
* { box-sizing: border-box; }
/* `hidden` must win over any display rule below (.who is flex), or a signed-out page shows "Sign out". */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); word-break: break-all; }
h1 { font-size: 1.35rem; margin: 0 0 .5rem; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1rem 0 .35rem; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; }
.top { display: flex; justify-content: space-between; align-items: center; padding: .75rem 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.brand { font-weight: 700; }
.who { display: flex; gap: .75rem; align-items: center; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.narrow { max-width: 420px; margin: 8vh auto; }
label { display: block; margin: .75rem 0; font-weight: 600; font-size: .9rem; }
label.filter, label.inline { font-weight: 400; display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
input[type=checkbox], input[type=radio] { width: auto; display: inline; margin: 0; }
textarea { min-height: 3.5rem; resize: vertical; }
button { font: inherit; cursor: pointer; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: .5rem .9rem; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
button:disabled { opacity: .5; cursor: not-allowed; }
.history { width: 100%; border-collapse: collapse; font-size: .9rem; }
.history th, .history td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
.blockbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; position: sticky; top: 52px; z-index: 1; }
.progress { display: flex; align-items: center; gap: .5rem; min-width: 200px; }
.bar { flex: 1; height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
#bar-fill { height: 100%; width: 0; background: var(--ok); }
.actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.returned { background: #fff4e0; color: #6b4400; border: 1px solid #f0c98a; border-radius: 8px; padding: .75rem 1rem; }
@media (prefers-color-scheme: dark) { .returned { background: #3a2c12; color: #f3d9a6; border-color: #6b5225; } }
.guide { margin: 1rem 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .6rem 1rem; }
.guide summary { cursor: pointer; font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin: .6rem 0; }
.card-head { width: 100%; display: grid; grid-template-columns: 3rem 1fr auto auto; gap: .75rem; align-items: center; text-align: left; border: 0; background: none; padding: .75rem 1rem; }
.card-head .pos { color: var(--muted); font-variant-numeric: tabular-nums; }
.card-head .title { font-weight: 600; }
.card-head .meta { color: var(--muted); font-size: .85rem; }
.chip { font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.chip.FOUND { background: #dcf3e5; color: #135c33; }
.chip.NOT_PUBLISHED, .chip.UNDETERMINED { background: #fdf0d5; color: #7a4d00; }
.chip.WRONG_PAGE { background: #fde2e0; color: #8c1d16; }
@media (prefers-color-scheme: dark) {
  .chip.FOUND { background: #173826; color: #8fe0ad; } .chip.NOT_PUBLISHED, .chip.UNDETERMINED { background: #3b2e14; color: #f0c870; }
  .chip.WRONG_PAGE { background: #3e1b19; color: #ffaaa3; }
}
.card-body { border-top: 1px solid var(--line); padding: 0 1rem 1rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } .card-head { grid-template-columns: 2.2rem 1fr auto; } .card-head .meta { display: none; } }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .75rem; margin: 0; font-size: .9rem; }
dt { color: var(--muted); }
dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
ul.items { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
ul.items li { margin: .25rem 0; overflow-wrap: anywhere; }
.quote { display: block; font-style: italic; color: var(--muted); border-left: 3px solid var(--line); padding-left: .5rem; margin: .2rem 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .9rem .9rem; margin: .9rem 0; }
legend { font-weight: 700; padding: 0 .3rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }
.verdicts { display: grid; gap: .35rem; margin: .5rem 0; }
.result { font-size: .88rem; margin: .3rem 0; }
.result.APPLIED, .result.SAME, .result.ACCEPTED, .result.RECORDED { color: var(--ok); }
.result.REFUSED, .result.REJECTED, .result.ERROR { color: var(--bad); }
.result.HELD_BACK, .result.DISAGREES, .result.CANDIDATE, .result.UNREAD { color: var(--warn); }
.hint { font-size: .82rem; color: var(--muted); font-weight: 400; }
.small { font-size: .85rem; }
