/* Docket Academy — a restrained, civic palette: ink navy, paper, a single amber accent.
   Deliberately not a framework default. System font stack, generous measure. */
:root {
  --ink: #16202e;
  --ink-soft: #3c4a5c;
  --paper: #f7f5f0;
  --card: #ffffff;
  --line: #dcd7cc;
  --accent: #b5641e;      /* amber — actions, the town stamp */
  --accent-ink: #7c3f10;
  --good: #1f6b4a;
  --bad: #a3321f;
  --gate: #6b7280;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22,32,46,.06), 0 6px 20px rgba(22,32,46,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: .5rem; background: #fff; padding: .5rem; z-index: 10; }

a { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }

/* Layout */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.25rem; background: var(--ink); color: #f4f1ea;
  position: sticky; top: 0; z-index: 5;
}
.topbar a { color: #f4f1ea; text-decoration: none; margin-left: 1rem; }
.topbar nav { display: flex; align-items: center; }
.topbar a.brand { display: inline-flex; align-items: center; gap: .6rem; margin-left: 0; }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-seal { fill: var(--accent); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-weight: 800; font-size: 1.3rem; letter-spacing: -.035em; }
.brand-sub { font-size: .62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .28em; margin-right: -.28em; color: #e3a86f; margin-top: .25rem; }
.who { opacity: .7; font-size: .85rem; margin-left: 1rem; }
.btn-ghost { border: 1px solid rgba(255,255,255,.3); padding: .3rem .7rem; border-radius: 6px; }

.wrap { max-width: 860px; margin: 2rem auto; padding: 0 1.25rem; }
.workspace { max-width: 1180px; margin: 1.5rem auto; padding: 0 1.25rem;
  display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; }
@media (max-width: 880px) { .workspace { grid-template-columns: 1fr; } }

.foot {
  max-width: 1180px; margin: 3rem auto 1.5rem; padding: 1rem 1.25rem 0;
  display: flex; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .8rem;
}
.specimen { font-variant: all-small-caps; letter-spacing: .06em; color: var(--accent-ink); }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.25rem;
}
.card h2 { margin-top: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }
.eyebrow { font-variant: all-small-caps; letter-spacing: .08em; color: var(--accent-ink);
  font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }

/* Flashes */
.flashes { max-width: 1180px; margin: 1rem auto 0; padding: 0 1.25rem; }
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .5rem; border: 1px solid; }
.flash-info { background: #eef4ff; border-color: #cdddff; color: #1b3a73; }
.flash-error { background: #fdecea; border-color: #f3c7bf; color: var(--bad); }

/* Buttons + forms */
.btn, button.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 0;
  padding: .6rem 1.1rem; border-radius: 8px; font-weight: 600; cursor: pointer;
  text-decoration: none; font-size: 1rem;
}
.btn:hover { background: var(--accent-ink); }
.btn-secondary, button.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover, button.btn-secondary:hover { background: #efece5; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=email], input[type=number], textarea, select {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 5rem; resize: vertical; }
label { font-weight: 600; display: block; margin: .8rem 0 .3rem; }
.field { margin-bottom: 1rem; }
.inline-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }

/* Mail / artifacts */
.mail { border-left: 4px solid var(--accent); padding: .3rem 0 .3rem 1rem; }
.mail .from { font-weight: 600; }
.mail .subject { color: var(--ink-soft); }
.artifact {
  background: #fbfaf7; border: 1px dashed var(--line); border-radius: 8px;
  padding: 1rem 1.1rem; position: relative;
}
.artifact .tag {
  position: absolute; top: -.6rem; right: .8rem; background: var(--ink); color: #fff;
  font-size: .7rem; padding: .1rem .5rem; border-radius: 4px; letter-spacing: .04em;
}
.stamp {
  display: inline-block; transform: rotate(-4deg); border: 2px solid var(--accent-ink);
  color: var(--accent-ink); font-weight: 700; padding: .1rem .5rem; border-radius: 4px;
  font-size: .7rem; letter-spacing: .08em; opacity: .8;
}

/* "Check the record" callout on questions that need verifying */
.verify-callout {
  display: flex; gap: .6rem; align-items: flex-start; text-decoration: none;
  background: #fff6e8; border: 1px solid #ecd3a6; border-left: 4px solid var(--accent);
  border-radius: 8px; padding: .65rem .8rem; margin: 0 0 .9rem; color: var(--ink);
  font-size: .93rem;
}
.verify-callout:hover { background: #fdeccd; }
.verify-callout .vc-icon { font-size: 1.1rem; line-height: 1.2; }
.verify-callout strong { color: var(--accent-ink); }

/* Reference panel */
.refpanel { position: sticky; top: 5rem; align-self: start; border-top: 3px solid var(--accent); }
.refpanel .ref-entry { border-bottom: 1px solid var(--line); padding: .6rem 0; scroll-margin-top: 5.5rem; border-radius: 6px; }
/* When a callout jumps here, flash the record so the link is unmistakable. */
.refpanel .ref-entry:target { animation: ref-flash 2.2s ease-out; }
@keyframes ref-flash {
  0%, 30% { background: #fff0d6; box-shadow: 0 0 0 3px rgba(181,100,30,.35); padding-left: .5rem; padding-right: .5rem; }
  100% { background: transparent; box-shadow: none; }
}
.refpanel .ref-entry:last-child { border-bottom: 0; }
.refpanel h3 { margin: 0 0 .3rem; font-size: .95rem; }
.refpanel ul { margin: .2rem 0 0; padding-left: 1.1rem; }
.refpanel li { margin: .15rem 0; font-size: .9rem; }

/* flag_error spans */
.spans { display: flex; flex-direction: column; gap: .4rem; margin: .6rem 0; }
.span-pick {
  text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: .55rem .75rem; cursor: pointer; font: inherit; color: var(--ink);
}
.span-pick:hover { border-color: var(--accent); background: #fffaf3; }

/* choices */
.choice { display: block; border: 1px solid var(--line); border-radius: 8px;
  padding: .6rem .8rem; margin: .4rem 0; cursor: pointer; background: #fff; }
.choice:hover { border-color: var(--accent); }
.choice input { margin-right: .5rem; }

/* redact chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; cursor: pointer; }
.chip input { margin-right: .4rem; }

/* teaching moment */
.teach { border-left: 4px solid var(--good); background: #f0f7f3; padding: .8rem 1rem;
  border-radius: 0 8px 8px 0; margin-top: .8rem; }
.teach.wrong { border-left-color: var(--bad); background: #fbefed; }
.verdict { font-weight: 700; }
.verdict.ok { color: var(--good); }
.verdict.no { color: var(--bad); }

/* progress + badges */
.tasklist { list-style: none; padding: 0; margin: 0; }
.tasklist li { display: flex; align-items: center; gap: .5rem; padding: .35rem 0; }
.dot { width: .8rem; height: .8rem; border-radius: 999px; border: 2px solid var(--line); }
.dot.done { background: var(--good); border-color: var(--good); }
.dot.current { border-color: var(--accent); }
.locked { color: var(--gate); }
.pill { display: inline-block; font-size: .75rem; padding: .1rem .5rem; border-radius: 999px;
  background: #eceff3; color: var(--ink-soft); }
.gauge { height: .6rem; background: #eceae3; border-radius: 999px; overflow: hidden; }
.gauge > span { display: block; height: 100%; background: var(--accent); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }

/* heatmap */
.heat-row { display: grid; grid-template-columns: 180px 1fr 70px; align-items: center;
  gap: .8rem; padding: .4rem 0; }
.heat-bar { height: 1.2rem; border-radius: 6px; background: linear-gradient(90deg, var(--bad), #e0a93f, var(--good)); position: relative; }
.heat-bar .mark { position: absolute; top: -3px; width: 3px; height: calc(100% + 6px); background: var(--ink); }

/* The day bar: clock, arc, exposure */
.daybar { background: linear-gradient(180deg,#fffdf8,#fbf9f2); }
.daybar-top { display:flex; align-items:center; justify-content:space-between; }
.clock { font-weight:700; font-size:1.3rem; letter-spacing:-.02em; font-variant-numeric: tabular-nums; }
.escalation { margin:.5rem 0 .8rem; font-size:1.02rem; color:var(--ink); font-style:italic;
  border-left:3px solid var(--accent); padding-left:.7rem; }
.small.btn { padding:.35rem .7rem; font-size:.85rem; }

.timeline { list-style:none; display:flex; gap:.4rem; padding:0; margin:.2rem 0 1rem;
  align-items:center; flex-wrap:wrap; }
.timeline li { position:relative; padding:.2rem 0; }
.timeline .tl-clock { font-size:.78rem; padding:.2rem .55rem; border-radius:999px;
  border:1px solid var(--line); background:#fff; color:var(--ink-soft); text-decoration:none;
  display:inline-block; font-variant-numeric:tabular-nums; }
.timeline li.done .tl-clock { background:var(--good); color:#fff; border-color:var(--good); }
.timeline li.now .tl-clock { background:var(--ink); color:#fff; border-color:var(--ink);
  box-shadow:0 0 0 3px rgba(181,100,30,.25); font-weight:700; }
.timeline li.locked .tl-clock { opacity:.5; }
.timeline li:not(:last-child)::after { content:"→"; color:var(--line); margin-left:.4rem; }

.meter-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.meter { flex:1; max-width:52%; }
.meter-label { display:flex; justify-content:space-between; font-size:.8rem;
  text-transform:uppercase; letter-spacing:.05em; color:var(--ink-soft); margin-bottom:.25rem; }
.meter-num { font-weight:700; }
.meter-track { height:.55rem; background:#eceae3; border-radius:999px; overflow:hidden; }
.meter-track > span { display:block; height:100%; background:var(--good); transition:width .4s; }
.tier-clean { color:var(--good); } .meter-track > span.tier-clean { background:var(--good); }
.tier-minor { color:#8a7320; } .meter-track > span.tier-minor { background:#d8b24a; }
.tier-rough { color:var(--accent-ink); } .meter-track > span.tier-rough { background:var(--accent); }
.tier-bad { color:var(--bad); } .meter-track > span.tier-bad { background:var(--bad); }

.assistant-dot { color:#2d8f5f; animation:pulse 1.6s infinite; }
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:1} }

/* Consequence scene (the payoff) */
.scene { border-radius:10px; padding:1rem 1.1rem; margin-top:.4rem;
  border:1px solid var(--line); animation:rise .35s ease-out; }
.scene-ok { background:#f0f7f3; border-color:#bfe0cf; }
.scene-bad { background:#fbefed; border-color:#f0c9c1; }
@keyframes rise { from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none} }
.scene-head { display:flex; align-items:center; gap:.7rem; flex-wrap:wrap; margin-bottom:.5rem; }
.exposure-delta { font-weight:700; color:var(--bad); font-size:.85rem;
  background:#fff; border:1px solid #f0c9c1; border-radius:999px; padding:.1rem .55rem; }
.held { font-weight:700; color:var(--good); font-size:.85rem;
  background:#fff; border:1px solid #bfe0cf; border-radius:999px; padding:.1rem .55rem; }
.scene-text { font-size:1.08rem; line-height:1.5; margin:.3rem 0 .6rem; }
.lesson { font-weight:600; color:var(--ink); margin:.4rem 0 .3rem; }
.realcase summary { cursor:pointer; color:var(--accent-ink); font-size:.85rem; font-weight:600; }
.realcase[open] summary { margin-bottom:.3rem; }
.next-card { background:var(--ink); }
.next-card .muted { color:#b9c2cf; }
.next-card .btn { background:var(--accent); }

.badge-chip { display: inline-flex; align-items: center; gap: .5rem; background: var(--ink);
  color: #fff; padding: .5rem .9rem; border-radius: 999px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 680px){ .grid-2 { grid-template-columns: 1fr; } }
.foot-links a { color: inherit; }

/* ---- Design pass (Docket_Design_ramsay.md #1, #2) ----------------------- */
/* Flag-the-error: highlight inside the reply itself. */
.flag-surface { margin: .6rem 0; padding: .9rem 1rem; background: #f3f1ec; border-radius: 10px;
  border: 1px dashed var(--line); line-height: 1.7; cursor: text; user-select: text; -webkit-user-select: text; }
.flag-surface::selection, .flag-surface *::selection { background: #fbe1c4; color: var(--ink); }
.flag-picked { background: #fff5e8; border-left: 3px solid var(--accent); padding: .45rem .7rem; border-radius: 6px; margin: .4rem 0 0; }

/* Reference Panel header + phone bottom sheet. */
.ref-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.ref-close, .ref-toggle { display: none; }
@media (max-width: 880px) {
  .ref-toggle { display: inline-flex; align-items: center; gap: .4rem; position: fixed; right: 1rem; bottom: 1rem;
    z-index: 30; background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: .75rem 1.1rem;
    font: inherit; font-weight: 700; box-shadow: 0 8px 24px rgba(22,32,46,.3); cursor: pointer; }
  .ref-toggle::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); }
  .refpanel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; margin: 0;
    max-height: 78vh; overflow-y: auto; border-radius: 16px 16px 0 0; transform: translateY(105%);
    transition: transform .25s ease-out; box-shadow: 0 -12px 40px rgba(22,32,46,.25); }
  .refpanel.is-open { transform: none; }
  .ref-close { display: inline-block; background: none; border: 1px solid var(--line); border-radius: 6px;
    padding: .3rem .7rem; font: inherit; font-size: .85rem; cursor: pointer; }
  .ref-head { position: sticky; top: -1.25rem; background: var(--card); padding-top: .25rem; z-index: 1; }
  body.ref-open { overflow: hidden; }
  .workspace { padding-bottom: 5rem; }
}
@media (prefers-reduced-motion: reduce) { .refpanel { transition: none; } }

/* Header and timeline on narrow screens. */
@media (max-width: 640px) {
  .topbar .who { display: none; }
  .topbar a { margin-left: .75rem; }
  .brand-mark { width: 34px; height: 34px; }
}
.timeline { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.timeline::-webkit-scrollbar { display: none; }
.timeline li { flex: none; }

/* Status card: Exposure and Trust side by side (Docket_Design_ramsay.md #4). */
.meter-row .meter { max-width: none; }
.meter-trust .meter-num { color: var(--ink); }
.meter-track .trust-fill { display: block; height: 100%; background: #3c6e91; border-radius: inherit; }
.daybar-headline { margin: .5rem 0 0; }

/* Hints: revealed server-side, cost applied automatically. */
.hints { margin-top: .8rem; }
.hint-form { margin: 0; }
.hint-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline;
  cursor: pointer; font: inherit; font-size: .85rem; }
.hint-shown { background: #fff5e8; border-left: 3px solid var(--accent); padding: .5rem .75rem; border-radius: 6px; margin: 0; }
.q-card { scroll-margin-top: 1rem; }

/* Finding 6: the question carries the weight; choices read at normal weight
   with a clear selected state. */
.q-prompt { font-weight: 700; font-size: 1.05rem; line-height: 1.45; }
.choice { font-weight: 400; display: flex; align-items: flex-start; gap: .6rem; padding: .7rem .9rem;
  cursor: pointer; transition: border-color .15s, background .15s; }
.choice input { margin: .3rem 0 0; accent-color: var(--accent); flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: #fff5e8; box-shadow: inset 3px 0 0 var(--accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Finding 7: a short briefing, warm-up one question at a time. */
.brief { max-width: 680px; margin: 1rem auto 1.5rem; }
.brief h1 { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.6rem); letter-spacing: -.025em; margin: .2rem 0 .8rem; }
.brief-lead { font-size: 1.15rem; line-height: 1.6; margin: 0 0 1rem; }
.brief-points { padding-left: 1.2rem; margin: 0 0 1rem; color: var(--ink-soft); }
.brief-points li { margin-bottom: .4rem; }
.brief-points strong { color: var(--ink); }
.brief-more { border-top: 1px solid var(--line); padding-top: .8rem; }
.brief-more summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); }
.brief-more p { color: var(--ink-soft); }
.quiz { max-width: 680px; margin: 0 auto; }
.quiz-step { border: 0; padding: 0; margin: 0 0 1.2rem; min-width: 0; }
.quiz-step legend { padding: 0; margin-bottom: .6rem; }
.quiz-count { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-soft); letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: .25rem; }
.quiz.is-stepping .quiz-step { min-height: 15rem; }

/* Finding 8: player home as shift cards. */
.home-head { max-width: 720px; margin: .5rem 0 1.5rem; }
.home-head h1 { font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.4rem); letter-spacing: -.025em; margin: 0 0 .4rem; }
.shift-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.shift-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem;
  display: flex; flex-direction: column; gap: .5rem; box-shadow: var(--shadow); }
.shift-card.is-active { border-top: 4px solid var(--accent); }
.shift-card h2 { margin: 0; font-size: 1.3rem; }
.shift-card p { margin: 0; }
.shift-card .btn, .shift-card form { margin-top: auto; align-self: flex-start; }
.shift-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.l-tier-pill { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent-ink); background: #f8e7d5; border-radius: 4px; padding: .15rem .5rem; }
.shift-status { font-weight: 600; font-size: .9rem; }
.progress { height: .45rem; background: #efebe2; border-radius: 999px; overflow: hidden; margin-top: .3rem; }
.progress span { display: block; height: 100%; background: var(--accent); }

/* Finding 9: manager screens. */
.note-task { padding-left: .8rem; border-left: 3px solid var(--line); }
.invite { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.invite label { margin-top: 0; }
.invite-row { display: flex; gap: .5rem; }
.invite-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.heat-preview { opacity: .55; }
.table-scroll { overflow-x: auto; }
form.inline-actions .field { margin-bottom: 0; }
form.inline-actions { align-items: flex-end; }

/* Finding 10: one visual language with the landing page. */
h1 { font-size: clamp(1.7rem, 1.25rem + 1.5vw, 2.3rem); letter-spacing: -.025em; }
h2 { letter-spacing: -.015em; }
.card-title { font-size: 1.15rem; margin: 0 0 .4rem; }
.mail-card .mail { border-left-width: 4px; }
.mail-card .mail .from { font-size: 1.05rem; }
/* The AI reply is the anchor of the task screen — styled like the landing mock. */
.reply-card { box-shadow: 0 2px 4px rgba(22,32,46,.06), 0 14px 36px rgba(22,32,46,.10); }
.reply-card .artifact { background: #f3f1ec; border: 0; border-radius: 12px; font-size: 1.02rem; line-height: 1.65;
  padding: 1.1rem 1.2rem; }
.reply-card .artifact .tag { background: var(--accent-ink); }

/* The hidden attribute must win over component display rules. */
[hidden] { display: none !important; }
input[type=date] { font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); min-height: 2.6rem; }

/* Picking what to ask: no live AI, so requests are written in advance. Long
   options must stay readable on a phone. */
.ask-select { width: 100%; max-width: 100%; text-overflow: ellipsis; }

/* Manager report */
.report-filters { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: flex-end; }
.report-filters .field { margin: 0; min-width: 14rem; flex: 1 1 14rem; }
.report-actions { margin: .8rem 0 0; }
th.sortable { cursor: pointer; white-space: nowrap; }
th.sortable::after { content: " ↕"; color: var(--gate); font-size: .8em; }
th[aria-sort="ascending"]::after { content: " ↑"; color: var(--ink); }
th[aria-sort="descending"]::after { content: " ↓"; color: var(--ink); }
.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li { padding: .6rem 0; border-top: 1px solid var(--line); }
.status-list li:first-child { border-top: 0; }

/* Printing (leadership summary and reports): hide site chrome */
@media print {
  @page { size: letter; margin: .5in; }
  body { background: #fff; }
  .topbar, .foot, .no-print, .skip-link, .flash { display: none !important; }
  main.wrap { max-width: none; padding: 0; margin: 0; }
  a { color: inherit; text-decoration: none; }
}

