/* TroveFill Web. The desktop app's palette, system type, no external anything. */
:root {
  --ink: #0C0F14;
  --panel: #141A22;
  --raised: #1A212B;
  --hairline: #232A35;
  --text: #E8E3D8;
  --muted: #8A94A6;
  --gold: #D9A441;
  --gold-deep: #B8862B;
  --ok: #4CC38A;
  --warn: #E5A83B;
  --danger: #E5654E;
  --body: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --data: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--ink);
  font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased;
  /* A faint vertical grain of light from above, drawn, not loaded. */
  background-image: radial-gradient(120% 60% at 50% -10%, rgba(217, 164, 65, .07), transparent 60%);
  background-attachment: fixed;
}
h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 1.08rem; }
h3 { font-size: .98rem; margin-top: 1.6rem; }
code { font: .86em var(--data); color: var(--gold); }
a { color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

/* ── header ── */
.bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 16px;
  padding: 12px 24px; background: rgba(12, 15, 20, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 8px; font: 600 1.02rem var(--display); }
.edition { color: var(--muted); font-weight: 400; }
.link { margin-left: auto; background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 4px 6px; }
.link:hover { color: var(--text); }
.link.licensed { color: var(--gold); }

/* The one loud thing: proof that nothing leaves the tab. */
.meter {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px;
  border: 1px solid rgba(217, 164, 65, .35); border-radius: 999px; background: rgba(217, 164, 65, .06);
  font-size: .86rem; color: var(--text);
}
.meter strong { font: 600 .95rem var(--data); color: var(--gold); }
.radar {
  width: 18px; height: 18px; border-radius: 50%; position: relative;
  background: conic-gradient(from 0deg, rgba(217, 164, 65, 0) 0 70%, rgba(217, 164, 65, .85) 100%);
  box-shadow: inset 0 0 0 1.5px rgba(217, 164, 65, .55);
  animation: sweep 2.8s linear infinite;
}
.radar::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--gold); }
.meter.alarm { border-color: var(--danger); background: rgba(229, 101, 78, .1); }
.meter.alarm strong { color: var(--danger); }
.meter.alarm .radar { background: var(--danger); animation: none; }
@keyframes sweep { to { transform: rotate(1turn); } }

/* ── desk ── */
.desk {
  display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); gap: 28px;
  max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px;
}
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { background: var(--panel); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 18px 18px 16px; }
.step h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.n {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--gold); color: var(--gold); font: 600 .8rem var(--data);
}
.hint, .note { color: var(--muted); font-size: .88rem; margin: 6px 0 10px; }
.note:empty { display: none; }
label { display: block; font-size: .86rem; color: var(--muted); margin: 10px 0 4px; }
input::placeholder { color: #5C6676; }
textarea, input[type=password], input[type=text], select {
  width: 100%; background: var(--ink); color: var(--text); border: 1px solid var(--hairline);
  border-radius: 8px; padding: 9px 10px; font: .92rem var(--body);
}
textarea { font-family: var(--data); font-size: .86rem; resize: vertical; }
textarea:focus, input:focus, select:focus { border-color: var(--gold); outline: none; }

/* ── buttons ── */
button, .file { font: 500 .9rem var(--body); cursor: pointer; border-radius: 8px; transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease); }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--hairline); padding: 8px 14px; margin: 8px 8px 0 0; display: inline-block; }
.ghost:hover { border-color: var(--muted); }
.ghost.danger { color: var(--danger); }
.gold { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #17120A; border: 0; padding: 10px 18px; font-weight: 600; }
.gold:hover:not(:disabled) { transform: translateY(-1px); }
.gold:disabled { opacity: .35; cursor: not-allowed; }
.file input { display: none; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.row > button, .row > .file { margin: 0; }

.tabs { display: flex; gap: 4px; padding: 3px; background: var(--ink); border: 1px solid var(--hairline); border-radius: 9px; margin-bottom: 8px; }
.tabs [role=tab] { flex: 1; background: none; border: 0; color: var(--muted); padding: 7px 8px; border-radius: 7px; }
.tabs [aria-selected=true] { background: var(--raised); color: var(--text); }

.drop {
  display: grid; place-items: center; min-height: 112px; margin: 0; padding: 16px; text-align: center;
  border: 1.5px dashed var(--hairline); border-radius: var(--radius); color: var(--muted); cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.drop input { display: none; }
.drop:hover, .drop.over { border-color: var(--gold); background: rgba(217, 164, 65, .05); color: var(--text); }
.drop.ready { border-style: solid; border-color: rgba(76, 195, 138, .5); color: var(--text); }

/* ── values ── */
.values { margin-top: 12px; }
.values ul { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; border-top: 1px solid var(--hairline); }
.values li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--hairline); font-size: .86rem; }
.values li span:last-child { font-family: var(--data); font-size: .82rem; overflow-wrap: anywhere; }
.values li.low span:last-child { color: var(--warn); }
.values li.abstain span:last-child { color: var(--muted); font-family: var(--body); }
.values .summary { color: var(--muted); font-size: .86rem; margin: 0 0 6px; }

/* ── result ── */
.result { padding: 8px 4px; min-width: 0; }
.result > h2 { font-size: 1.5rem; line-height: 1.25; max-width: 40ch; text-wrap: balance; }
.lede { color: var(--muted); max-width: 62ch; margin: 10px 0 18px; }
.result.ok > h2 { color: var(--text); }
.notice { border-left: 3px solid var(--warn); background: rgba(229, 168, 59, .07); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 10px 0; max-width: 72ch; }
.notice.bad { border-color: var(--danger); background: rgba(229, 101, 78, .08); }
.notice.good { border-color: var(--ok); background: rgba(76, 195, 138, .07); }

.coverage { list-style: none; padding: 0; margin: 8px 0 0; }
.coverage li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--hairline); font-size: .88rem; }
.coverage .dot { width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; border: 2px solid var(--muted); }
.coverage .Filled .dot { border-color: var(--ok); background: rgba(76, 195, 138, .3); }
.coverage .Held .dot { border-color: var(--warn); background: rgba(229, 168, 59, .3); }
.coverage .AlreadyFilled .dot { border-color: var(--gold); }
.coverage .NotFillable .dot { border-style: dashed; }
.coverage .why { color: var(--muted); }
.coverage .page { color: var(--muted); font: .78rem var(--data); }
details.group { margin-top: 6px; }
details.group summary { cursor: pointer; color: var(--muted); padding: 6px 0; }

.question { margin: 14px 0; max-width: 520px; }
.question .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.question .problem { color: var(--warn); font-size: .86rem; margin-top: 4px; }

.checklist { font-size: .86rem; margin-top: 8px; }
.checklist p { margin: 4px 0; }

dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 22px; max-width: 460px; width: calc(100% - 32px);
}
dialog::backdrop { background: rgba(5, 7, 10, .7); }

@media (max-width: 860px) {
  .desk { grid-template-columns: 1fr; padding: 18px 16px 48px; gap: 18px; }
  .bar { padding: 10px 16px; flex-wrap: wrap; }
  .meter { order: 3; width: 100%; justify-content: center; }
  .link { max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .result > h2 { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  .radar { animation: none; }
  * { transition: none !important; }
}
