/* Layout and components. Mobile first (360 px and up, 16 px gutters, no sideways scroll); only
   the tokens from app.css or the skin are used for colour. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 17px/1.6 var(--font-body);
  overflow-wrap: break-word;
}
@media (min-width: 600px) { body { font-size: 18px; } }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--machine); outline-offset: 2px; }
.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
.skip-link { position: absolute; left: -9999px; top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link:focus { left: 16px; top: 8px; z-index: 10; background: var(--raised); color: var(--fg); padding: 8px 12px; border-radius: 8px; }

/* Header and footer on the field */
header.site { padding: 10px 0; }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { height: 34px; width: auto; display: block; }
.wordmark { font-family: var(--font-serif); font-size: 22px; font-weight: 500; }
.demo-tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; border: 1px solid var(--line-2, rgba(255,255,255,.3)); border-radius: 6px; padding: 2px 6px; color: var(--fg-2); }
.header-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.btn-quiet { background: transparent; color: inherit; border: 0; font: inherit; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; padding: 10px 8px; min-height: 44px; cursor: pointer; }
.btn-quiet:disabled { opacity: .6; cursor: default; }
footer.site { margin-top: 40px; padding: 28px 0 36px; font-size: 15px; }
footer.site .tagline { font-family: var(--font-serif); font-size: 22px; margin: 0 0 8px; }
footer.site .links, .tour .links { list-style: none; padding: 0; margin: 8px 0 12px; display: flex; flex-wrap: wrap; gap: 4px 18px; }
footer.site .links a, .tour .links a { display: inline-block; padding: 8px 0; }
.footer-line { color: var(--fg-2); margin: 6px 0; }
.disclaimers { margin: 12px 0; color: var(--fg-2); }
.disclaimers summary { cursor: pointer; padding: 8px 0; }

.demo-label { margin: 0; padding: 8px 16px; text-align: center; font-size: 14px; font-weight: 600; background: var(--bg-2); color: var(--fg); border-bottom: 1px solid var(--line); }

main { padding-top: 16px; padding-bottom: 16px; outline: none; }
h2, h3 { font-family: var(--font-serif); font-weight: 500; line-height: 1.15; }
h2 { font-size: 28px; margin: 8px 0 12px; }
h3 { font-size: 22px; margin: 24px 0 10px; }
@media (min-width: 600px) { h2 { font-size: 32px; } }
.eyebrow { font-size: 14px; color: var(--fg-2); margin: 0 0 4px; }
.hint { font-size: 15px; color: var(--fg-2); margin: 6px 0; }
.busy { min-height: 1.4em; font-size: 15px; color: var(--machine-text); margin: 4px 0; }
.mono { font-family: var(--font-mono); font-size: 14px; }
.wrap-any { overflow-wrap: anywhere; }
.fp { overflow-wrap: anywhere; }
.fp-mid { color: var(--fg-3); }
.honesty { font-family: var(--font-serif); font-style: italic; color: var(--fg-2); margin-top: 12px; }

/* Tour */
.tour { background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--r-card); padding: 16px; margin: 4px 0 16px; }
.tour h2 { font-size: 24px; margin: 4px 0 8px; }
.tour .done { font-family: var(--font-body); font-size: 15px; color: var(--fg-2); font-weight: 400; }
.tour p { margin: 8px 0; }
.tour-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.tour-off { margin: 4px 0 12px; }

/* Status strip */
.status { border: 1px solid var(--line); border-radius: var(--r-card); padding: 10px 14px; background: var(--bg-2); font-size: 15px; }
.status-row { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.clock-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-top: 4px; }
.clock { color: var(--fg-2); }
.skip summary { cursor: pointer; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
.skip-buttons { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.state { font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin: 16px 0 0; border-bottom: 1px solid var(--line-2); }
.tabs [role="tab"] {
  flex: 1 1 0; min-width: 0; min-height: 48px; padding: 8px 6px; font: inherit; font-size: 15px; font-weight: 600;
  background: transparent; color: var(--fg-2); border: 0; border-bottom: 3px solid transparent; cursor: pointer; white-space: normal; line-height: 1.25;
}
.tabs [role="tab"][aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.panel { padding-top: 8px; }
.panel-title { margin-top: 16px; }
.section-title { border-top: 1px solid var(--line); padding-top: 18px; }

/* The order */
.order { margin: 8px 0 16px; }
.order-text { margin: 0; padding: 12px 16px; border-left: 3px solid var(--fg); background: var(--bg-2); border-radius: 0 var(--r-input) var(--r-input) 0; font-family: var(--font-serif); font-size: 19px; line-height: 1.45; }

/* Compose */
.compose { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: 15px; margin-top: 8px; display: block; }
.to-line { margin: 0; }
.case-line { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.case-line .docket { color: var(--fg-2); }
.case-line input { flex: 1 1 220px; }
input[type="text"], textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--fg); background: var(--raised);
  border: 1px solid var(--line-2); border-radius: var(--r-input); padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; line-height: 1.5; }
.check-label { display: flex; gap: 10px; align-items: center; font-size: 16px; min-height: 44px; }
.check-label input { width: 22px; height: 22px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }

/* Buttons: one gold action per screen (a person acts); ink for the rest */
.btn {
  font: inherit; font-size: 16px; font-weight: 600; min-height: 44px; padding: 9px 16px; cursor: pointer;
  border-radius: var(--r-control); border: 1px solid var(--line-2); background: var(--raised); color: var(--fg);
}
.btn-small { font-size: 15px; min-height: 40px; padding: 7px 12px; }
.btn-ink { background: var(--btn-ink-bg); color: var(--btn-ink-fg); border-color: var(--btn-ink-bg); }
.btn-human { background: var(--human); color: var(--navy); border-color: var(--human); }
.btn-quiet-inline { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; font-weight: 400; }
.btn:disabled { opacity: .6; cursor: default; }

/* Cards and states: colour never stands alone; every dot has its word */
.card { border: 1px solid var(--line-2); border-radius: var(--r-card); background: var(--raised); padding: 14px 16px; margin: 14px 0; }
.card p { margin: 8px 0; }
.card .lead { font-size: 18px; }
.card-refusal { border-left: 5px solid var(--refusal); }
.card-decision { border-left: 5px solid var(--human); }
.card-clear { border-left: 5px solid var(--machine); }
.card-staged { border-left: 5px solid var(--human); }
.card-proof { border-left: 5px solid var(--proof); }
.verdict { font-weight: 700; display: flex; align-items: center; margin-top: 0 !important; }
.card-refusal .verdict { color: var(--refusal-text); }
.card-decision .verdict, .card-staged .verdict { color: var(--human-text); }
.card-proof .verdict { color: var(--proof-text); }
.machine, .machine-text { color: var(--machine-text); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; flex: none; }
.dot-ink { background: var(--fg); }
.dot-machine { background: var(--machine); }
.dot-human { background: var(--human); }
.dot-proof { background: var(--proof); }
.dot-refusal { background: var(--refusal); }
.flagged { background: var(--gold-wash); border-bottom: 1.5px solid var(--human-text); padding: 0 2px; }
q { quotes: "\201C" "\201D"; }
.tips { margin: 6px 0; padding-left: 20px; }
.notice { display: flex; align-items: baseline; gap: 0; padding: 10px 14px; border-radius: var(--r-input); background: var(--bg-2); margin: 12px 0; }
.notice-refusal { color: var(--refusal-text); font-weight: 600; }
.notice .dot { transform: translateY(-1px); }

/* Thread: a person's words are plain text, never mono, bold or colour */
.thread { list-style: none; padding: 0; margin: 0; border-left: 1.5px solid var(--line-2); }
.msg { margin: 0 0 14px 14px; padding: 12px 14px; border-radius: var(--r-message); background: var(--bubble-in); border: 1px solid var(--line); position: relative; }
.msg-out { background: var(--bubble-own); }
.msg-head { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 15px; color: var(--fg-2); }
.msg-head .who { font-weight: 600; color: var(--fg); }
.recorded { display: flex; align-items: center; margin: 4px 0; font-size: 14px; color: var(--machine-text); }
.subject { font-weight: 600; margin: 6px 0 2px; }
.message-text { white-space: pre-wrap; margin: 6px 0; }
.label-line { font-size: 14px; color: var(--fg-2); margin: 4px 0; }
.attachments { font-size: 15px; padding-left: 20px; margin: 6px 0; }
.attachments li { margin: 4px 0; overflow-wrap: anywhere; }
.receipt summary { cursor: pointer; font-size: 15px; padding: 6px 0; }
dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 6px 0; font-size: 15px; }
dt { color: var(--fg-2); margin-top: 6px; }
dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) {
  dl { grid-template-columns: max-content minmax(0, 1fr); column-gap: 16px; }
  dt { margin-top: 4px; }
  dd { margin-top: 4px; }
}

/* Chris's inbox */
.mail-list { list-style: none; padding: 0; margin: 8px 0; border: 1px solid var(--line-2); border-radius: var(--r-card); overflow: hidden; }
.mail-list li + li { border-top: 1px solid var(--line); }
.mail-row { display: grid; width: 100%; text-align: left; gap: 2px; padding: 12px 14px; background: var(--raised); color: var(--fg); border: 0; font: inherit; cursor: pointer; min-height: 56px; }
.mail-row.open { background: var(--bg-2); }
.mail-subject { font-weight: 600; }
.mail-meta { font-size: 14px; color: var(--fg-2); overflow-wrap: anywhere; }
.mail { border: 1px solid var(--line-2); border-radius: var(--r-card); padding: 14px 16px; margin: 12px 0; background: var(--raised); }
.mail h3 { margin-top: 4px; border: 0; padding: 0; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-body); font-size: 15px; line-height: 1.55; background: var(--bg-2); border-radius: var(--r-input); padding: 12px; margin: 10px 0; }

/* Record and verifier */
.downloads { padding-left: 20px; }
.downloads li { margin: 6px 0; }
.verifier-frame { width: 100%; height: 1150px; border: 1px solid var(--line-2); border-radius: var(--r-card); background: #fff; margin-top: 12px; }
@media (min-width: 700px) { .verifier-frame { height: 1000px; } }

.about { margin: 28px 0 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.about summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.about li { margin: 8px 0; }

@media (forced-colors: active) {
  .dot { border: 1px solid CanvasText; }
  .btn-human, .btn-ink { border: 2px solid ButtonText; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
