/* HIGH CONTRAST - the web runner's face (design/starters/high-contrast/runner.css). Contract version 1.

   For every reader: 7 : 1 text, a thick focus ring, bigger targets, black borders.

   A STARTER DESIGN (designer-css-plan section 2.6): ours, read-only, loaded and changed and saved as a workspace's own
   design. Written ONLY against the --cv-* tokens and the data-cv-* parts, moments, turns, states and screens of
   design/contract.json - never a class name, never an !important. A design's CSS lands in the cascade layer cv.design (the
   server wraps it; on the go site's stage, Tests/Design/ShotCases.Starters.cs does), so it beats our default bundle
   without a specificity war. url() reaches only this package's own files.

   1. THE TOKENS - on the runner's root ([data-cv-face="runner"] - the <html> element). They equal manifest.json's
      tokens, value for value (Tests/Design/StarterLibraryTests).
   2. THE LOOK - every shape, glow, picture and motion is scoped to the conversation's own screen
      ([data-cv-screen="thread"]). A protected screen (confirm, consent, payment, sign-in) and a protected part (the
      verified note, Powered by, a signature, an action's confirm) take COLOURS ONLY, inside the contrast floor - so when
      the locked layer lands (P1) nothing here has to move. Motion runs only when the reader has not asked for less. */

[data-cv-face="runner"] {
  /* reference */
  --cv-color-brand: #0033cc;
  --cv-color-ink: #000000;
  --cv-color-paper: #ffffff;
  --cv-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cv-font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cv-radius-s: 6px;
  --cv-radius-m: 8px;
  --cv-radius-l: 12px;
  --cv-shadow-1: none;
  --cv-shadow-2: none;
  --cv-shadow-3: 0 0 0 2px #000000;
  --cv-motion-fast: 120ms;
  --cv-motion-slow: 240ms;
  /* semantic */
  --cv-surface: var(--cv-color-paper);
  --cv-on-surface: var(--cv-color-ink);
  --cv-accent: #0033cc;
  --cv-on-accent: #ffffff;
  --cv-muted: #1f1f1f;
  --cv-danger: #a00000;
  --cv-focus: #000000;
  --cv-bubble-me-bg: #0033cc;
  --cv-bubble-me-ink: #ffffff;
  --cv-bubble-them-bg: #ffffff;
  --cv-bubble-them-ink: #000000;
  --cv-field-font-size: 18px;
  /* component */
  --cv-header-bg: #ffffff;
  --cv-color-scheme: light;
  --cv-signin-bg: #000000;
  --cv-signin-picture: linear-gradient(#000000, #000000);
  /* the runner's palette - every tone the web runner paints with, from this design's surface, ink, accent and focus */
  --cv-on-surface-2: color-mix(in srgb, var(--cv-on-surface) 80%, var(--cv-surface));
  --cv-on-surface-strong: var(--cv-on-surface);
  --cv-placeholder: color-mix(in srgb, var(--cv-on-surface) 45%, var(--cv-surface));
  --cv-surface-subtle: color-mix(in srgb, var(--cv-on-surface) 5%, var(--cv-surface));
  --cv-surface-raised: var(--cv-surface);
  --cv-surface-hover: color-mix(in srgb, var(--cv-on-surface) 8%, var(--cv-surface));
  --cv-surface-active: color-mix(in srgb, var(--cv-on-surface) 13%, var(--cv-surface));
  --cv-panel: color-mix(in srgb, var(--cv-on-surface) 4%, var(--cv-surface));
  --cv-panel-muted: color-mix(in srgb, var(--cv-on-surface) 6%, var(--cv-surface));
  --cv-panel-hover: color-mix(in srgb, var(--cv-on-surface) 8%, var(--cv-surface));
  --cv-card-bg: #ffffff;
  --cv-line: color-mix(in srgb, var(--cv-on-surface) 16%, var(--cv-surface));
  --cv-line-2: color-mix(in srgb, var(--cv-on-surface) 26%, var(--cv-surface));
  --cv-line-light: color-mix(in srgb, var(--cv-on-surface) 11%, var(--cv-surface));
  --cv-accent-hover: color-mix(in srgb, var(--cv-accent) 85%, var(--cv-on-surface));
  --cv-accent-muted: color-mix(in srgb, var(--cv-accent) 14%, transparent);
  --cv-accent-soft: color-mix(in srgb, var(--cv-accent) 24%, transparent);
  --cv-accent-strong: color-mix(in srgb, var(--cv-accent) 78%, black);
  --cv-focus-ring: 0 0 0 3px color-mix(in srgb, var(--cv-focus) 35%, transparent);
  --cv-buttons-bg: #ffffff;
}

/* ── the page ──────────────────────────────────────────────────────────────────────────────────────────────────────
   The runner reads its colours from the tokens above on EVERY screen - the protected ones (the confirm, a payment,
   sign-in, the end) included, where a design sets colours only - so the page, the bar of buttons, the title and the pay
   button all wear this design. Shapes, pictures and motion stay on the conversation's own screen. */
[data-cv-face="runner"] body:has([data-cv-screen="thread"]) { background-color: var(--cv-surface); color: var(--cv-on-surface); }
[data-cv-screen="thread"] { background-color: var(--cv-surface); color: var(--cv-on-surface); font-family: var(--cv-font-body); }

/* ── the header (outside every screen - never protected) ───────────────────────────────────────────────────────── */
[data-cv-part="header"] { border-bottom-color: color-mix(in srgb, var(--cv-on-surface) 14%, transparent); }
[data-cv-part="header"] [data-cv-part="brand-name"] { color: var(--cv-accent); font-family: var(--cv-font-display); }
[data-cv-part="header"] button { background-color: transparent; color: var(--cv-on-surface); border-color: color-mix(in srgb, var(--cv-on-surface) 26%, transparent); }

/* ── a moment: its words, its choices, its answer ───────────────────────────────────────────────────────────── */
[data-cv-screen="thread"] [data-cv-part="question"] { color: var(--cv-on-surface); font-family: var(--cv-font-display); }
[data-cv-screen="thread"] [data-cv-part="extra-info"] { color: var(--cv-muted); }
[data-cv-screen="thread"] [data-cv-part="extra-info"] :is(a, button) { color: var(--cv-accent); }
[data-cv-screen="thread"] [data-cv-part="error"] { color: var(--cv-danger); }
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="option"] {
  background-color: var(--cv-surface); color: var(--cv-on-surface);
  border-color: color-mix(in srgb, var(--cv-on-surface) 24%, transparent); border-radius: var(--cv-radius-m);
}
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="option"] :is(i, svg) { color: var(--cv-accent); }
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="option"][data-cv-state="selected"] {
  background-color: color-mix(in srgb, var(--cv-accent) 14%, var(--cv-surface));
  border-color: var(--cv-accent); box-shadow: 0 0 0 1px var(--cv-accent);
}
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="answer"] :is(input, textarea, select) {
  background-color: var(--cv-surface); color: var(--cv-on-surface);
  border-color: color-mix(in srgb, var(--cv-on-surface) 26%, transparent); border-radius: var(--cv-radius-s);
  font-family: var(--cv-font-body);
}
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="answer"] button {
  background-color: var(--cv-surface); color: var(--cv-on-surface);
  border-color: color-mix(in srgb, var(--cv-on-surface) 18%, transparent); border-radius: var(--cv-radius-s);
  font-family: var(--cv-font-body);
}
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="answer"] button:disabled { color: color-mix(in srgb, var(--cv-on-surface) 38%, transparent); }

/* ── the moment kinds - each one looks like what it asks ────────────────────────────────────────────────────── */
/* A date, a date and a time: a page off a calendar - a band across the top. */
[data-cv-screen="thread"] :is([data-cv-moment="date"], [data-cv-moment="datetime"]) [data-cv-part="answer"] {
  border-top: 12px solid var(--cv-accent); border-radius: var(--cv-radius-m); padding: 14px 12px 12px;
  background-color: var(--cv-surface); color: var(--cv-on-surface); box-shadow: var(--cv-shadow-2);
}
/* The date's own figures sit on the page itself, in its ink. */
[data-cv-screen="thread"] :is([data-cv-moment="date"], [data-cv-moment="datetime"], [data-cv-moment="time"]) [data-cv-part="answer"] :is(div, span) {
  background-color: transparent; color: inherit;
}
/* A time: the face of a clock - a ring around the keys. */
[data-cv-screen="thread"] [data-cv-moment="time"] [data-cv-part="answer"] {
  border: 3px solid var(--cv-accent); border-radius: 28px; padding: 14px 12px;
}
/* A number, an amount: figures that line up. An amount sits on a ledger's double rule. */
[data-cv-screen="thread"] :is([data-cv-moment="number"], [data-cv-moment="currency"]) [data-cv-part="answer"] {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
}
[data-cv-screen="thread"] [data-cv-moment="currency"] [data-cv-part="answer"] { border-bottom: 3px double var(--cv-accent); padding-bottom: 8px; }
/* A place and a person's card: the accent's edge. */
[data-cv-screen="thread"] :is([data-cv-moment="location"], [data-cv-moment="contact"]) [data-cv-part="answer"] {
  border-left: 4px solid var(--cv-accent); padding-left: 12px;
}

/* A SIGNATURE is ink on paper - COLOURS ONLY (a protected part: designer-css-plan 5.2). */
[data-cv-screen="thread"] [data-cv-moment="signature"] [data-cv-part="answer"] { background-color: #ffffff; color: #000000; }
[data-cv-screen="thread"] [data-cv-moment="signature"] [data-cv-part="answer"] :is(canvas, div) { background-color: #ffffff; border-color: #000000; color: #000000; }
[data-cv-screen="thread"] [data-cv-moment="signature"] [data-cv-part="answer"] button { background-color: #ffffff; border-color: #000000; color: #000000; }

/* A PAYMENT is money - COLOURS ONLY (its screen and its pieces are protected): the amount due in the colours of a
   banknote; the pay button wears the accent and its ink, "Use a different card" the panel and the accent (the tokens). */
[data-cv-part="amount-due"] { background-color: #ffffff; color: #000000; border-color: #000000; }
[data-cv-part="amount-due"] strong { color: #000000; }

/* ── Back and Next ─────────────────────────────────────────────────────────────────────────────────────────── */
[data-cv-part="buttons"] button { background-color: var(--cv-surface); color: var(--cv-on-surface); border-color: color-mix(in srgb, var(--cv-on-surface) 22%, transparent); }
[data-cv-part="buttons"] [data-cv-part="next"]:where(:not([data-cv-state="muted"])) { background-color: var(--cv-accent); color: var(--cv-on-accent); border-color: var(--cv-accent); }
[data-cv-screen="thread"] [data-cv-part="buttons"] button { border-radius: var(--cv-radius-m); font-family: var(--cv-font-body); }

/* ── High contrast ─────────────────────────────────────────────────────────────────────────────────────── */

[data-cv-screen="thread"] [data-cv-part="question"] { font-size: 1.3em; font-weight: 800; }
[data-cv-screen="thread"] [data-cv-part="extra-info"] { color: #1f1f1f; }
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="option"] { min-height: 64px; border: 2px solid #000000; font-size: 18px; }
[data-cv-screen="thread"] [data-cv-part="moment"]:not([data-cv-moment="signature"], [data-cv-moment="action"], [data-cv-moment="payment"]) [data-cv-part="option"][data-cv-state="selected"] { background-color: #e6ecff; border: 4px solid #0033cc; box-shadow: none; }
[data-cv-screen="thread"] :is([data-cv-moment="date"], [data-cv-moment="datetime"], [data-cv-moment="time"]) [data-cv-part="answer"] { border: 2px solid #000000; border-top: 12px solid #000000; }
[data-cv-screen="thread"] :is([data-cv-moment="date"], [data-cv-moment="datetime"], [data-cv-moment="time"]) [data-cv-part="answer"] button { border: 2px solid #000000; min-height: 52px; font-size: 20px; color: #000000; }
[data-cv-part="buttons"] button { border-color: #000000; }
[data-cv-screen="thread"] [data-cv-part="buttons"] button { min-height: 52px; font-size: 18px; font-weight: 800; border-width: 2px; }
/* The thick ring - on the conversation's own screen; a protected screen keeps the runner's own. */
[data-cv-screen="thread"] :focus-visible, [data-cv-part="header"] :focus-visible { outline: 4px solid #000000; outline-offset: 2px; box-shadow: 0 0 0 8px #ffdd00; }
