/* Plat Reader — internal review tool. Calm, technical, trustworthy.
   Palette: deep survey-ink navy, paper white, brass accent (field-book brass). */

:root {
  --ink: #0f2438;
  --ink-soft: #33475b;
  --paper: #f7f8f9;
  --card: #ffffff;
  --line: #dde3e8;
  --brass: #b98a2e;
  --brass-soft: #f4e9d2;
  --good: #1d7a46;
  --good-bg: #e8f5ed;
  --warn: #a1560f;
  --warn-bg: #fdf1e3;
  --bad: #a8322e;
  --bad-bg: #fbeceb;
  --mono: "Consolas", "Cascadia Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ---------- launch gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100; background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  color: #fff; text-align: center; padding: 24px;
}
.gate-inner { max-width: 560px; }
.gate-mark { width: 52px; height: 52px; border-radius: 12px; box-shadow: 0 0 0 1px rgba(255,255,255,.18); margin-bottom: 18px; }
.gate-kicker {
  font-family: system-ui, sans-serif; font-size: .8rem; letter-spacing: .18em;
  text-transform: uppercase; color: #e8b64c; margin-bottom: 10px;
}
.gate-title { font-size: 1.6rem; line-height: 1.3; margin-bottom: 28px; }
.gate-count { display: flex; gap: 14px; justify-content: center; margin-bottom: 26px; }
.gc-cell {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px; padding: 12px 0; width: 86px;
}
.gc-cell span { display: block; font-family: var(--mono); font-size: 1.9rem; color: #e8b64c; }
.gc-cell label { font-family: system-ui, sans-serif; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.gate-sub { font-size: .98rem; opacity: .85; max-width: 460px; margin: 0 auto 20px; }
.gate-foot { font-family: system-ui, sans-serif; font-size: .75rem; opacity: .5; }
body.gated { overflow: hidden; }
@media (max-width: 480px) {
  .gc-cell { width: 68px; }
  .gc-cell span { font-size: 1.4rem; }
  .gate-title { font-size: 1.25rem; }
}

/* ---------- top bar ---------- */
.topbar { background: var(--ink); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }
.brand-name { font-size: 1.05rem; font-weight: 700; letter-spacing: .02em; }
.brand-sub { font-size: .74rem; opacity: .65; font-family: system-ui, sans-serif; }
.live-badge {
  font-family: system-ui, sans-serif; font-size: .72rem; padding: 4px 10px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.25); opacity: .85;
}
.live-badge.live { border-color: #7fd6a2; color: #b8ecd0; }
.live-badge.demo-only { border-color: #e8c98a; color: #f2ddb0; }

/* ---------- intro ---------- */
.intro { padding: 44px 0 28px; }
.intro h1 { font-size: 1.7rem; line-height: 1.25; max-width: 620px; }
.intro p { margin-top: 14px; max-width: 640px; color: var(--ink-soft); }
.proof-line { border-left: 3px solid var(--brass); padding-left: 14px; font-size: .95rem; }
.proof-line strong { color: var(--ink); }

/* ---------- uploader ---------- */
.uploader {
  background: var(--card); border: 2px dashed var(--line); border-radius: 12px;
  padding: 36px 24px; text-align: center; transition: border-color .15s, background .15s;
  margin-bottom: 28px;
}
.uploader.dragover { border-color: var(--brass); background: var(--brass-soft); }
.up-icon { width: 34px; height: 34px; color: var(--brass); margin-bottom: 8px; }
.up-main { font-size: 1.05rem; }
.up-sub { font-family: system-ui, sans-serif; font-size: .82rem; color: var(--ink-soft); margin: 6px 0 18px; }
.linklike {
  background: none; border: none; color: var(--brass); font: inherit;
  text-decoration: underline; cursor: pointer; padding: 0;
}
.btn {
  font-family: system-ui, sans-serif; font-size: .85rem; cursor: pointer;
  border-radius: 8px; padding: 9px 16px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); transition: background .15s;
}
.btn:hover { background: var(--paper); }
.btn-ghost { border-color: var(--brass); color: var(--brass); }
.btn-ghost:hover { background: var(--brass-soft); }
.sample-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-small { font-size: .78rem; padding: 6px 12px; }

/* ---------- queue ---------- */
.queue { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.queue-item {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  font-family: system-ui, sans-serif; font-size: .85rem;
}
.queue-item .qname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qstatus { color: var(--ink-soft); font-size: .78rem; }
.qstatus.working { color: var(--brass); }
.qstatus.done { color: var(--good); }
.qstatus.failed { color: var(--bad); }
.spinner {
  width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--brass);
  border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- results ---------- */
.results { display: flex; flex-direction: column; gap: 24px; padding-bottom: 40px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 1.1rem; }
.card-head .doc-notes { font-size: .85rem; color: var(--ink-soft); margin-top: 4px; }
.card-body { padding: 16px 20px; }

.verdict {
  font-family: system-ui, sans-serif; font-size: .88rem; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: baseline;
}
.verdict strong { font-size: .95rem; }
.verdict.good { background: var(--good-bg); color: var(--good); }
.verdict.warn { background: var(--warn-bg); color: var(--warn); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }

.parcel { margin-bottom: 22px; }
.parcel h3 { font-size: .98rem; margin-bottom: 8px; }
.parcel .src { font-family: system-ui, sans-serif; font-size: .76rem; color: var(--ink-soft); font-weight: normal; }

.calls-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.calls {
  border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: .8rem;
}
table.calls th {
  font-family: system-ui, sans-serif; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-soft); text-align: left;
  padding: 8px 10px; background: var(--paper); border-bottom: 1px solid var(--line);
}
table.calls td { padding: 6px 10px; border-bottom: 1px solid var(--paper); white-space: nowrap; }
table.calls tr:last-child td { border-bottom: none; }
table.calls td.num { text-align: right; }

.plot-row { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; align-items: flex-start; }
.plot-box { flex: 1 1 300px; min-width: 260px; }
canvas.traverse { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.closure-facts {
  flex: 1 1 220px; font-family: system-ui, sans-serif; font-size: .85rem;
  display: flex; flex-direction: column; gap: 6px;
}
.closure-facts .fact { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted var(--line); padding-bottom: 4px; }
.closure-facts .fact span:last-child { font-family: var(--mono); }

.ambiguities { margin-top: 4px; }
.ambiguities h4 { font-family: system-ui, sans-serif; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); margin-bottom: 6px; }
.ambiguities ul { list-style: none; }
.ambiguities li {
  font-family: system-ui, sans-serif; font-size: .83rem; background: var(--warn-bg);
  border-radius: 6px; padding: 7px 10px; margin-bottom: 5px; color: var(--warn);
}

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

.error-note {
  font-family: system-ui, sans-serif; font-size: .85rem; background: var(--bad-bg);
  color: var(--bad); border-radius: 8px; padding: 10px 14px;
}

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 26px 0 40px; margin-top: 20px; }
.foot p { font-family: system-ui, sans-serif; font-size: .8rem; color: var(--ink-soft); max-width: 640px; }
.foot-brand { margin-top: 10px; }
.foot a { color: var(--brass); }

@media (max-width: 560px) {
  .intro h1 { font-size: 1.35rem; }
  .topbar-inner { padding: 12px 16px; }
}
