/* The annotator app: ink, paper, one highlighter, on the dark side.
   Tokens and components follow design/mockups/annotators.css (.dark). */
:root {
  --desk: #0b0b0c; --paper: #131315; --panel: #1b1b1e;
  --ink: #f4f4f1; --ink2: #c9c9c4; --ink3: #9b9b97;
  --hair: #34343a; --hair2: #232327; --line: #5a5a60;
  --hl: #ffe433; --ok: #5fd08f; --bad: #ff8a80;
  --sheet: #ffffff; --sheet-ink: #1d1d20; --sheet-ink3: #63636a; --sheet-desk: #f2f2ef;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, Menlo, monospace;
  --serif: Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--desk); color: var(--ink);
  font: 400 17px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
p, h1, h2, h3 { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--hl); outline-offset: 2px; }

/* type */
.hd { font-stretch: 72%; font-weight: 800; letter-spacing: -0.012em; line-height: 0.95; font-size: clamp(36px, 7vw, 52px); }
.eyebrow { font: 500 12px/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); }
.mono { font-family: var(--mono); }
.small { font-size: 14px; }
.muted { color: var(--ink3); }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-14 { display: flex; flex-direction: column; gap: 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-gap { display: inline-flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* logo: the wordmark over a stet line, caret yellow on ink */
.logo { display: inline-flex; text-decoration: none; color: var(--ink); --caret: var(--hl); font-stretch: 74%; font-weight: 800; font-size: 24px; letter-spacing: -0.01em; line-height: 1; }
.logo .w { display: inline-block; padding-bottom: 0.12em; white-space: nowrap; }
.logo .w > span { position: relative; }
.logo .w > span::after { content: ""; position: absolute; left: 50%; bottom: -0.05em; width: 0.1em; height: 0.1em; margin-left: -0.05em; border-radius: 50%; background: currentColor; }
.logo .w > span:last-child::after { width: 0.28em; height: 0.19em; margin-left: -0.14em; border-radius: 0; background: var(--caret); clip-path: polygon(0 100%, 50% 0, 100% 100%, 71.4% 100%, 50% 57.2%, 28.6% 100%); }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--desk); font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.yellow { background: var(--hl); border-color: var(--hl); color: #0f0f11; }
.btn.yellow .k2 { border-color: #0f0f11; color: #0f0f11; }
.btn.alt { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn.wide { width: 100%; }
.btn:disabled, .opt:disabled, .big:disabled { opacity: 0.45; cursor: default; }
.lnk { background: none; border: 0; padding: 0; min-height: 32px; cursor: pointer; color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; font-size: inherit; }
.k2 { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; font: 600 11px/1 var(--mono); border: 1px solid #6b6b70; border-bottom-width: 2px; color: var(--ink2); }
.phone .k2, .phone .legend { display: none; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; font: 600 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--ink); white-space: nowrap; }
.tag.fix { background: var(--hl); color: #0f0f11; border-color: var(--hl); }
.tag.ok { color: var(--ok); border-color: var(--ok); }
.tag.bad { color: var(--bad); border-color: var(--bad); }
.tag.mute { color: var(--ink2); border-color: var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1.2 var(--mono); color: var(--ink2); text-decoration: none; white-space: nowrap; }
.chip b { color: var(--ink); font-weight: 600; }
.chip.box { border: 1.5px solid var(--hair); padding: 7px 10px; }
.push { margin-left: auto; }
.msg { font-size: 14px; min-height: 0; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--ink2); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--hl); }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld label { font: 500 12px/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink2); }
input[type=email], input[type=password], input[type=text], textarea {
  font-size: 16px; line-height: 1.4; background: var(--desk); color: var(--ink); border: 1.5px solid var(--line); border-radius: 0; padding: 11px 12px; width: 100%; }
input:focus, textarea:focus { border-color: var(--ink); outline: none; }
textarea { resize: vertical; }

/* doors: signed out, verify, blocked */
.door { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 28px 16px; }
.door .card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; background: var(--paper); border: 1.5px solid var(--hair); padding: 28px 24px; }
.door .logo { font-size: 30px; }
.or { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; font: 500 13px/1 var(--mono); color: var(--ink3); }
.or::before, .or::after { content: ""; height: 1px; background: var(--hair); }

/* shell */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; min-height: 60px; padding: 8px 24px; border-bottom: 1.5px solid var(--hair); background: var(--paper); }
.tabs { display: flex; gap: 4px; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-size: 15px; color: var(--ink2); text-decoration: none; border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--hl); font-weight: 600; }
#page { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.sub { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; padding: 10px 24px; border-bottom: 1px solid var(--hair2); }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 16px; background: var(--hl); color: #0f0f11; font-weight: 600; font-size: 15px; }
.banner a { text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.banner .x { background: none; border: 0; font-size: 24px; line-height: 1; width: 44px; height: 44px; cursor: pointer; color: #0f0f11; }
.toast { position: fixed; left: 50%; width: max-content; top: calc(68px + env(safe-area-inset-top)); transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--ink); color: #0f0f11; padding: 12px 16px; font-size: 15px; font-weight: 600; z-index: 10; box-shadow: 0 6px 24px rgba(0,0,0,0.4); }
.state { flex: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 16px; max-width: 560px; width: 100%; margin: 0 auto; padding: 48px 24px; }

/* quick check: one card */
.quick { flex: 1; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 640px; margin: 0 auto; padding: 20px 20px 24px; min-height: 0; }
.qcard { position: relative; flex: none; min-height: 240px; display: flex; flex-direction: column; background: var(--sheet); color: var(--sheet-ink); border: 1.5px solid var(--ink); user-select: none; -webkit-user-select: none; }
.phone .qcard { flex: 1; }  /* on a phone the card fills the screen above the buttons */
.qcard.live { touch-action: pan-y; cursor: grab; }
.qcard.drag { cursor: grabbing; transition: none; }
.q-input { flex: 1; overflow: auto; padding: 22px 22px 18px; font: 400 18px/1.55 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }
.q-input.raw, .sheet.raw { font: 400 14px/1.5 var(--mono); }
.q-claim { border-top: 1.5px solid #0f0f11; background: var(--sheet-desk); padding: 16px 22px 18px; display: flex; flex-direction: column; gap: 6px; }
.q-q { font-size: 15px; color: #3a3a40; }
.q-ask { font-stretch: 85%; font-weight: 750; font-size: 24px; line-height: 1.15; }
.q-says { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--sheet-ink3); margin-top: 4px; }
.q-val { font-stretch: 78%; font-weight: 800; font-size: 30px; line-height: 1.1; }
.q-val.struck { text-decoration: line-through; text-decoration-thickness: 3px; color: var(--sheet-ink3); }
.q-hint { color: #3a3a40; }
.stamp { position: absolute; top: 18px; right: 16px; transform: rotate(8deg); border: 2.5px solid #0f0f11; padding: 6px 10px; font: 800 22px/1 var(--sans); font-stretch: 75%; letter-spacing: 0.04em; opacity: 0.55; pointer-events: none; }
.stamp.yes { left: 16px; right: auto; transform: rotate(-8deg); background: var(--ok); color: #0f0f11; }
.stamp.no { background: var(--hl); color: #0f0f11; }
.stamp.on { opacity: 1; }
.q-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.big { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font: 600 16px/1 var(--sans); cursor: pointer; }
.big.yes { background: var(--hl); color: #0f0f11; border-color: var(--hl); }
.big.yes .k2 { border-color: #0f0f11; color: #0f0f11; }
.q-pick { display: flex; flex-direction: column; gap: 10px; border: 1.5px solid var(--hair); background: var(--paper); padding: 14px; }

/* options, shared by the card and the workbench */
.opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.opts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opt { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border: 1.5px solid var(--hair); background: transparent; color: var(--ink); font: 400 15px/1.2 var(--sans); text-align: left; cursor: pointer; }
.opt.model { border-style: dashed; border-color: var(--line); }
.opt.sel { background: var(--hl); border: 1.5px solid var(--hl); color: #0f0f11; font-weight: 600; }
.opt.sel .k2 { border-color: #0f0f11; color: #0f0f11; }
.opt .ol { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.opt .od { font-size: 13px; color: var(--ink3); }
.opt.sel .od { color: #3a3a40; }
.opt .m, .pill .m { margin-left: auto; font: 500 11px/1 var(--mono); color: var(--ink3); }
.opt.sel .m { color: #3a3a40; }

/* workbench: the item beside its fields */
.bench { flex: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); min-height: 0; }
.doc { padding: 24px; border-right: 1.5px solid var(--hair); min-width: 0; }
.doc .sheet { position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow: auto; }  /* stays in view while you check fields */
.sheet { background: var(--sheet); color: var(--sheet-ink); border: 1.5px solid var(--ink); padding: 32px 40px; font: 400 17px/1.65 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }
.fields { display: flex; flex-direction: column; background: var(--paper); min-width: 0; }
.fields-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1.5px solid var(--hair); font-size: 17px; }
.doubt { color: var(--hl); }
.instr { border-bottom: 1px solid var(--hair); padding: 12px 20px; font-size: 15px; color: var(--ink2); }
.instr summary { cursor: pointer; font: 500 13px/1 var(--mono); color: var(--ink); min-height: 28px; display: flex; align-items: center; }
.instr p { margin-top: 8px; white-space: pre-wrap; }
.fbox { border-bottom: 1px solid var(--hair); padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.field { cursor: default; }
.field.on { background: var(--panel); box-shadow: inset 4px 0 0 var(--ink3); }
.field.doubted { box-shadow: inset 4px 0 0 var(--hl); }
.fbox-h { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; min-height: 24px; }
.fname { font-weight: 600; font-size: 14px; }
.flag { font: 500 12px/1 var(--mono); color: var(--hl); border-left: 1.5px solid var(--hl); padding-left: 8px; }
.finstr { color: var(--ink2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px 0 12px; border: 1.5px solid var(--line); font-size: 15px; background: transparent; }
.pill .x { background: none; border: 0; width: 36px; height: 36px; font-size: 20px; cursor: pointer; color: var(--ink2); }
.pill.gone { color: var(--ink3); text-decoration: line-through; padding-right: 12px; cursor: pointer; border-style: dashed; }
.addrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.b-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 16px 20px; }
.fields .msg { padding: 0 20px 16px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 10px 24px; border-top: 1.5px solid var(--hair); background: var(--paper); color: var(--ink3); }

/* record and setup */
.page { width: 100%; max-width: 980px; margin: 0 auto; padding: 32px 24px 48px; display: flex; flex-direction: column; gap: 20px; }
.page.narrow { max-width: 560px; }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1.5px solid var(--hair); background: var(--paper); }
.stats > div { padding: 20px 22px; border-right: 1px solid var(--hair); display: flex; flex-direction: column; gap: 6px; }
.stats > div:last-child { border-right: 0; }
.stats .k { font: 500 11px/1.3 var(--mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink3); }
.stats .v { font-stretch: 75%; font-weight: 800; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.stats .d { font-size: 13px; color: var(--ink3); }
.panel { border: 1.5px solid var(--hair); background: var(--paper); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.panel.warn { border-color: var(--bad); }
.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.steps { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--hair); }
.steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--hair); align-items: start; }
.steps li > div:not(.row-between), .steps li .row-between > div { display: flex; flex-direction: column; gap: 4px; }
.steps .no { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1.5px solid var(--ink); font: 600 14px/1 var(--mono); }
.steps .ico { display: inline-flex; align-items: center; gap: 8px; }
.appicon { border-radius: 13px; }
.appicon.sm { border-radius: 9px; }
.center { text-align: center; }
/* an example notification, on the notifications page */
.notice { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px; background: var(--panel); border: 1.5px solid var(--hair); }
.notice > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notice b { font-size: 16px; }
.notice .small:last-child { color: var(--ink2); }

/* Hover only where there's a real pointer; on touch screens it sticks after a tap. */
@media (hover: hover) {
  .btn:hover { background: var(--hl); border-color: var(--hl); color: #0f0f11; }
  .btn.yellow:hover .k2 { border-color: var(--desk); color: var(--desk); }
  .btn.yellow:hover { background: var(--ink); border-color: var(--ink); }
  .btn.alt:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
  .lnk:hover { color: var(--hl); }
  .chip.box:hover { border-color: var(--ink); }
  .big:hover { border-color: var(--hl); }
  .opt:hover:not(:disabled) { border-color: var(--ink); }
}

/* Hover only where there's a real pointer; on touch screens it sticks after a tap. */
@media (hover: hover) {
  .btn:hover { background: var(--hl); border-color: var(--hl); color: #0f0f11; }
  .btn.yellow:hover .k2 { border-color: var(--desk); color: var(--desk); }
  .btn.yellow:hover { background: var(--ink); border-color: var(--ink); }
  .btn.alt:hover { border-color: var(--ink); background: transparent; color: var(--ink); }
  .lnk:hover { color: var(--hl); }
  .chip.box:hover { border-color: var(--ink); }
  .big:hover { border-color: var(--hl); }
  .opt:hover:not(:disabled) { border-color: var(--ink); }
}

@media (max-width: 900px) {
  .top { padding: 8px 16px; gap: 12px 16px; }
  .top .logo { font-size: 20px; }
  .sub { padding: 10px 16px; }
  .bench { grid-template-columns: minmax(0, 1fr); }
  .doc { border-right: 0; padding: 16px; }
  .doc .sheet { position: static; max-height: none; }
  .sheet { padding: 22px 18px; font-size: 16px; }
  .fields { border-top: 1.5px solid var(--hair); }
  .fbox, .fields-h, .instr { padding-left: 16px; padding-right: 16px; }
  .b-actions { position: sticky; bottom: 0; background: var(--paper); border-top: 1.5px solid var(--hair); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .quick { padding: 14px 16px 18px; }
  .page { padding: 24px 16px 40px; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stats > div { border-right: 0; border-bottom: 1px solid var(--hair); }
  .stats > div:last-child { border-bottom: 0; }
  .legend { display: none; }
}
@media (max-width: 420px) {
  .tabs { display: none; }  /* the logo goes to work, the score chip to your record */
  .q-val { font-size: 26px; }
  .q-input { font-size: 17px; padding: 18px 18px 14px; }
}
