/* readthemandate.org
 *
 * One stylesheet, one copy of every rule. The sibling project's stylesheet is
 * duplicated end to end and partial fixes there left the other copy live three
 * times. Themes here change token values only; no rule is written twice.
 *
 * Colour carries two kinds of meaning and never a third:
 *   - hue says which section of the book a chapter belongs to;
 *   - fill weight says how closely an action matches a proposal.
 * Nothing says good or bad. There is deliberately no red/green scale: a
 * traffic light would render a verdict, which is the one thing this site does
 * not do. Every colour signal is paired with a written label.
 */

:root {
  color-scheme: light dark;

  --ink: #17171c;
  --ink-soft: #4a4a58;
  --ink-faint: #6f6f80;
  --page: #f9f6f1;
  --card: #ffffff;
  --rule: #e3e0d8;
  --rule-soft: #eeece6;

  --accent: #d4380d;
  --accent-ink: #ffffff;

  /* The five sections of the book. */
  --s1: #3f8f3f;
  --s2: #7048e8;
  --s3: #0b8f9c;
  --s4: #d97706;
  --s5: #be2a6b;
  --s1-wash: #ecf5ec;
  --s2-wash: #f1ecff;
  --s3-wash: #e6f5f7;
  --s4-wash: #fdf1e0;
  --s5-wash: #fdeaf2;

  --quote-bg: #fffdf5;
  --quote-edge: #e0c86a;
  --plain-bg: #eef5fd;
  --plain-edge: #6aa9e0;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 68ch;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 40, .06), 0 6px 20px rgba(20, 20, 40, .05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eceaf2;
    --ink-soft: #b6b3c2;
    --ink-faint: #8b8898;
    --page: #14141a;
    --card: #1c1c24;
    --rule: #33323e;
    --rule-soft: #26262f;
    --accent: #ff7a4d;
    --accent-ink: #1a0d06;
    --s1: #43a04b; --s2: #8370dc; --s3: #0d9dad; --s4: #c07f2a; --s5: #d25587;
    --s1-wash: #16281a; --s2-wash: #211d38; --s3-wash: #10282c;
    --s4-wash: #2c2113; --s5-wash: #2e1823;
    --quote-bg: #201e16; --quote-edge: #8a7526;
    --plain-bg: #17222e; --plain-edge: #3f6f9e;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
a:hover { text-decoration-color: currentColor; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.prose { max-width: var(--measure); }

/* ---- masthead ---------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--card);
  position: sticky; top: 0; z-index: 20;
  transition: transform .22s ease;
}
/* Out of the way going down, back on the way up. */
.masthead--away { transform: translateY(-104%); }
@media (prefers-reduced-motion: reduce) {
  .masthead { transition: none; }
  .masthead--away { transform: none; }
}

.totop {
  position: fixed; right: 18px; bottom: 18px; z-index: 30;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
  font-size: 1.1rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.totop--on { opacity: 1; visibility: visible; transform: none; }
.totop:hover { border-color: var(--accent); color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .totop { transition: none; } }
@media print { .totop { display: none; } }
.masthead .wrap {
  display: flex; align-items: center; gap: 16px;
  min-height: 68px; flex-wrap: nowrap;
}
/* The section strip sits directly above the masthead, so the wordmark needs
   room or it reads as crowded against it. */
.masthead .brand { padding: 10px 0; }
.brand {
  font-weight: 700; letter-spacing: -.02em; text-decoration: none; font-size: 1.05rem;
  display: inline-flex; align-items: center; gap: 9px;
}
.brandmark { display: block; width: 30px; height: 30px; }
/* The mark's generated ground is keyed out, so it sits on the masthead rather
   than in a tile of its own. */
.wordmark { display: inline-flex; flex-direction: column; line-height: 1; }
.wm-1 {
  font-size: .62rem; font-weight: 600; letter-spacing: .19em;
  text-transform: uppercase; color: var(--ink-soft);
}
.wm-2 {
  font-size: 1.16rem; font-weight: 800; letter-spacing: -.025em;
  text-transform: uppercase; color: var(--ink); margin-top: 2px;
}
.brand:hover .wm-2 { color: var(--accent); }

/* The generated lockup, used where it has room to be read. */
.hero--brand { padding-top: 34px; }
/* The generated lockup carries its own ground, and --page is set to the same
   value, so it sits on the page rather than in a faint rectangle. */
.lockup { display: block; width: min(400px, 74%); height: auto; margin: 0 0 10px -10px; }
.masthead nav { display: flex; gap: 16px; margin-left: auto; flex-wrap: nowrap; white-space: nowrap; }
.masthead nav a { font-size: .92rem; color: var(--ink-soft); text-decoration: none; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { color: var(--ink); }
.masthead nav a[aria-current="page"] { font-weight: 600; }

/* ---- the reading-mode switch ------------------------------------------ */

.modeswitch {
  display: inline-flex; gap: 2px; padding: 2px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--rule-soft);
}
.modeswitch button {
  font: inherit; font-size: .82rem; border: 0; cursor: pointer;
  padding: 5px 12px; border-radius: 999px; background: transparent; color: var(--ink-soft);
}
.modeswitch button[aria-pressed="true"] {
  background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow);
}

/* Both renderings are in the HTML; the switch chooses which is shown, so the
   page works with no JavaScript and search engines index the verbatim text. */
body[data-mode="plain"] .as-written { display: none; }
body[data-mode="written"] .in-plain { display: none; }

/* ---- headings and hero ------------------------------------------------- */

h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .4em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 2.9rem); }
h2 { font-size: 1.45rem; margin-top: 2.2em; }
h3 { font-size: 1.1rem; }

.eyebrow {
  font: 700 .78rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px;
}
.hero { padding: 46px 0 30px; border-bottom: 1px solid var(--rule); }
.hero p { color: var(--ink-soft); font-size: 1.08rem; max-width: var(--measure); }
.lede { font-size: 1.15rem; }

.rainbow { height: 5px; display: flex; }
.rainbow i { flex: 1; }
.rainbow i:nth-child(1) { background: var(--s1); }
.rainbow i:nth-child(2) { background: var(--s2); }
.rainbow i:nth-child(3) { background: var(--s3); }
.rainbow i:nth-child(4) { background: var(--s4); }
.rainbow i:nth-child(5) { background: var(--s5); }

/* ---- section colour ---------------------------------------------------- */

[data-section="1"] { --sec: var(--s1); --sec-wash: var(--s1-wash); }
[data-section="2"] { --sec: var(--s2); --sec-wash: var(--s2-wash); }
[data-section="3"] { --sec: var(--s3); --sec-wash: var(--s3-wash); }
[data-section="4"] { --sec: var(--s4); --sec-wash: var(--s4-wash); }
[data-section="5"] { --sec: var(--s5); --sec-wash: var(--s5-wash); }

.sectionhead {
  display: flex; align-items: baseline; gap: 12px;
  margin: 34px 0 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--sec);
}
.sectionhead h2 { margin: 0; font-size: 1.15rem; }
.sectionhead .num {
  font: 600 .72rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
  color: var(--sec);
}
.sectionhead .count { margin-left: auto; font-size: .82rem; color: var(--ink-faint); }

/* ---- chapter grid ------------------------------------------------------ */

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }

.chapcard {
  display: block; text-decoration: none; background: var(--card);
  border: 1px solid var(--rule); border-left: 4px solid var(--sec);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.chapcard:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(20,20,40,.09), 0 14px 34px rgba(20,20,40,.09); }
.chapcard .n { font: 700 .74rem/1 var(--sans); letter-spacing: .08em; color: var(--sec); }
.chapcard h3 { margin: 6px 0 5px; font-size: 1rem; }
.chapcard .meta { font-size: .82rem; color: var(--ink-faint); }
.chapcard .authors { font-size: .82rem; color: var(--ink-soft); margin-top: 5px; }
.chapcard[data-indexed="no"] { opacity: .72; }
.chapcard[data-indexed="no"] .n::after {
  content: "not yet indexed"; float: right; letter-spacing: 0;
  font-weight: 500; text-transform: none; color: var(--ink-faint);
}

/* ---- proposals --------------------------------------------------------- */

.proposal {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 20px 22px; margin: 16px 0;
  box-shadow: var(--shadow); scroll-margin-top: 76px;
}
.proposal h3 { margin: 0 0 10px; font-size: 1.16rem; }
.proposal h3 a { text-decoration: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  font: 500 .76rem/1 var(--sans); padding: 5px 9px; border-radius: 999px;
  border: 1px solid var(--rule); color: var(--ink-soft); background: var(--rule-soft);
  white-space: nowrap;
}
.chip b { font-weight: 700; color: var(--ink); }
.chip--modality { background: var(--sec-wash); border-color: color-mix(in srgb, var(--sec) 35%, transparent); color: var(--ink); }
.chip--page { font-family: var(--mono); font-size: .74rem; }
.chip--page a { text-decoration: none; }

blockquote.says {
  margin: 0 0 14px; padding: 14px 16px;
  background: var(--quote-bg); border-left: 4px solid var(--quote-edge);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--serif); font-size: 1.06rem; line-height: 1.55;
}
blockquote.says p { margin: 0; }
blockquote.says footer {
  margin-top: 9px; font: 500 .78rem/1.4 var(--sans); color: var(--ink-faint);
}
.plainbox {
  margin: 0 0 14px; padding: 14px 16px;
  background: var(--plain-bg); border-left: 4px solid var(--plain-edge);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.plainbox p { margin: 0; }
.plainbox p + p { margin-top: .65em; }
/* The translation sits directly under the sentence it translates, tied to it by
   a shared edge, so the reader can see it is a rendering of those words and not
   a separate remark about them. */
.plainbox--translation { margin-top: -14px; border-left-style: dashed; }

.boxlabel {
  display: block; font: 700 .68rem/1 var(--sans); letter-spacing: .09em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px;
}
.summary { color: var(--ink-soft); margin: 0 0 14px; }

/* Disputed meaning. Deliberately not colored like a warning: an unresolved
   reading is a fact about the text, not a fault in it. */
.disputes {
  border: 1px dashed var(--rule); border-radius: var(--radius);
  padding: 13px 15px; margin: 0 0 14px; background: var(--rule-soft);
}
.dispute + .dispute { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.dispute b { font-size: .93rem; }
.dispute code { font-family: var(--mono); font-size: .86rem; }
.dispute p { margin: 4px 0 0; font-size: .93rem; color: var(--ink-soft); }

/* ---- match records ----------------------------------------------------- */

.matches { border-top: 1px solid var(--rule-soft); padding-top: 14px; margin-top: 4px; }
.matches > .boxlabel { margin-bottom: 10px; }
.match { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--rule-soft); }
.match:first-of-type { border-top: 0; }

/* Fill weight, not hue, carries how close a match is. Never a traffic light. */
.dot {
  flex: none; width: 15px; height: 15px; margin-top: 5px; border-radius: 50%;
  border: 2px solid var(--ink-soft);
}
[data-match="close"]    .dot { background: var(--ink-soft); }
[data-match="partial"]  .dot { background: linear-gradient(90deg, var(--ink-soft) 50%, transparent 50%); }
[data-match="diverges"] .dot { background: transparent; }
[data-match="contested"] .dot { background: transparent; border-style: dashed; }
[data-match="reverses"] .dot { background: transparent; border-style: double; border-width: 4px; }

.match .kind { font: 700 .74rem/1.5 var(--sans); text-transform: uppercase; letter-spacing: .07em; }
.match .body { min-width: 0; }
.match .body h4 { margin: 0 0 3px; font-size: .98rem; }
.match .body h4 a { text-decoration: none; }
.match .why { font-size: .92rem; color: var(--ink-soft); margin: 5px 0 0; }
.keylist .why { font-size: .9rem; color: var(--ink-soft); }
.match .cite { font: .78rem/1.5 var(--mono); color: var(--ink-faint); }

.nomatch { color: var(--ink-faint); font-size: .92rem; padding-top: 12px; border-top: 1px solid var(--rule-soft); }

/* ---- tracker ----------------------------------------------------------- */

.action {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 18px 20px; margin: 14px 0; box-shadow: var(--shadow); scroll-margin-top: 76px;
}
.action .when { font: 600 .78rem/1 var(--mono); color: var(--accent); }
.action h3 { margin: 7px 0 8px; font-size: 1.1rem; }

/* ---- notes, coverage, methodology -------------------------------------- */

.note {
  border: 1px solid var(--rule); border-left: 4px solid var(--accent);
  background: var(--card); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 18px; margin: 22px 0;
}
.note h2, .note h3 { margin-top: 0; }
.note ul { margin: 8px 0 0; padding-left: 20px; }
.note li { margin: 5px 0; color: var(--ink-soft); }

.keylist { list-style: none; padding: 0; margin: 14px 0 0; }
.keylist li { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule-soft); }
.keylist li:first-child { border-top: 0; }

footer.site {
  margin-top: 60px; border-top: 1px solid var(--rule); background: var(--card);
  padding: 26px 0 40px; font-size: .88rem; color: var(--ink-faint);
}
footer.site p { max-width: var(--measure); }
footer.site a { color: var(--ink-soft); }
.footnav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; }
.footnav a { text-decoration: none; }
.footnav a:hover { text-decoration: underline; }

.crumbs { font-size: .86rem; color: var(--ink-faint); padding: 16px 0 0; }
.crumbs a { text-decoration: none; }

@media (max-width: 620px) {
  body { font-size: 16px; }
  /* One row, always. The nav wrapping to its own line made the masthead take a
     quarter of a phone screen. */
  .masthead .wrap { gap: 10px; min-height: 60px; }
  .masthead nav { gap: 12px; font-size: .85rem; }
  .masthead nav a { font-size: .85rem; }
  .modeswitch button { padding: 5px 9px; font-size: .78rem; }
  .wm-1 { font-size: .55rem; letter-spacing: .16em; }
  .wm-2 { font-size: 1rem; }
  .brandmark { width: 26px; height: 26px; }
  .proposal, .action { padding: 16px; }
  .match { gap: 9px; }
}

@media print {
  .masthead, .modeswitch, footer.site { display: none; }
  .proposal, .action { break-inside: avoid; box-shadow: none; }
  body[data-mode] .as-written, body[data-mode] .in-plain { display: block; }
}


/* ---- charts ------------------------------------------------------------
   Built as semantic HTML rather than pictures of data: each row is a label, a
   bar and a value, so the figure is its own table view, works with no
   JavaScript, and reads correctly to a screen reader. Identity is never
   carried by color alone; every bar is directly labeled. */

.figure {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 18px 20px; margin: 18px 0;
  box-shadow: var(--shadow);
}
.figure > figcaption { margin: 0 0 4px; font-weight: 600; font-size: 1rem; }
.figure .subhead { margin: 0 0 14px; font-size: .88rem; color: var(--ink-faint); }

.bars { display: grid; gap: 9px; margin: 0; }
.bar-row {
  display: grid; grid-template-columns: minmax(90px, 12.5rem) 1fr auto;
  align-items: center; gap: 12px;
}
.bar-row .k { font-size: .89rem; line-height: 1.3; }
.bar-row .v { font-variant-numeric: tabular-nums; font-size: .86rem; color: var(--ink-soft); }
/* These are spans, so they need an explicit box or width and height are ignored. */
.track { display: block; background: var(--rule-soft); border-radius: 4px; height: 12px; overflow: hidden; }
/* Rounded data-end anchored to the baseline; thin mark; no gradient. */
.fill { display: block; height: 100%; border-radius: 0 4px 4px 0;
        background: var(--bar, var(--ink-soft)); min-width: 2px; }
.bar-row[data-section="1"] { --bar: var(--s1); }
.bar-row[data-section="2"] { --bar: var(--s2); }
.bar-row[data-section="3"] { --bar: var(--s3); }
.bar-row[data-section="4"] { --bar: var(--s4); }
.bar-row[data-section="5"] { --bar: var(--s5); }
/* Modality is ordinal, not categorical, so it gets one hue light to dark. */
.bar-row[data-force="1"] { --bar: #7a3f12; }
.bar-row[data-force="2"] { --bar: #c2650a; }
.bar-row[data-force="3"] { --bar: #f0b072; }

.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.stat {
  flex: 1 1 150px; background: var(--card); border: 1px solid var(--rule);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .n { font-size: 1.9rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat .l { font-size: .84rem; color: var(--ink-faint); margin-top: 2px; }

.coverbar { display: flex; gap: 2px; height: 16px; margin: 4px 0 10px; }
.coverbar i { flex: 1; border-radius: 2px; background: var(--rule-soft); }
.coverbar i[data-done="yes"] { background: var(--sec, var(--accent)); }

@media (max-width: 560px) {
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-row .track { grid-column: 1 / -1; }
}


/* ---- home ---------------------------------------------------------------
   The home page introduces the site; the documents grid is where a reader
   picks what to open. It carries no document text, so it has no reading-mode
   switch and no plain/as-written split. */

.trackerlink {
  display: block; text-decoration: none; background: var(--card);
  border: 1px solid var(--rule); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 16px 18px; margin: 18px 0;
  box-shadow: var(--shadow); transition: transform .12s ease;
}
.trackerlink:hover { transform: translateY(-2px); }
.trackerlink b { display: block; font-size: 1.1rem; margin-bottom: 6px; }
.trackerlink p { margin: 0; color: var(--ink-soft); font-size: .93rem; }

.lede-sm { font-size: 1.06rem; color: var(--ink-soft); max-width: var(--measure); margin: 0 0 16px; }

/* Short statements rather than paragraphs: this section is scanned, not read. */
.facts { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.facts li {
  background: var(--card); border: 1px solid var(--rule);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: 13px 16px; font-size: .96rem; color: var(--ink-soft);
  max-width: var(--measure);
}
.facts b { color: var(--ink); }

.cta {
  display: inline-block; margin-top: 6px; font-weight: 600; text-decoration: none;
  padding: 11px 20px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
}
.cta:hover { filter: brightness(1.07); }

/* A worked example on the home page. Showing one real entry explains the site
   faster than describing the method does. */
.example {
  background: var(--card); border: 1px solid var(--rule);
  border-left: 4px solid var(--sec, var(--accent)); border-radius: var(--radius);
  padding: 20px 22px; margin: 28px 0 8px; box-shadow: var(--shadow);
}
.example h3 { margin: 4px 0 10px; font-size: 1.2rem; }
.example .opendoc { margin-top: 0; }
.example > p:last-child { margin-bottom: 0; }

.doccard {
  display: block; text-decoration: none; background: var(--card);
  border: 1px solid var(--rule); border-left: 4px solid var(--sec, var(--accent));
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.doccard:hover { transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(20,20,40,.09), 0 14px 34px rgba(20,20,40,.09); }
.doccard .n { font: 700 .74rem/1 var(--sans); letter-spacing: .08em;
  text-transform: uppercase; color: var(--sec, var(--accent)); }
.doccard h3 { margin: 8px 0 6px; font-size: 1.15rem; }
.doccard .meta { font-size: .86rem; color: var(--ink-faint); margin: 0 0 3px; }
.doccard .authors { font-size: .9rem; color: var(--ink-soft); margin: 9px 0 0; }
.opendoc { display: inline-block; margin-top: 12px; font-weight: 600;
  font-size: .92rem; color: var(--accent); }


/* ---- sharing ------------------------------------------------------------
   Every page has its own URL, its own card and its own share controls, so a
   shared link lands on the thing that was shared rather than the front door. */

.sharebar {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 14px 16px; margin: 20px 0; box-shadow: var(--shadow);
}
.sharelinks { display: flex; flex-wrap: wrap; gap: 8px; }
.sharelink {
  font: 500 .86rem/1 var(--sans); text-decoration: none; cursor: pointer;
  padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--rule-soft); color: var(--ink-soft);
}
.sharelink:hover { border-color: var(--accent); color: var(--accent); }
.sharecopy[data-copied="yes"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
@media print { .sharebar { display: none; } }


/* ---- admin -------------------------------------------------------------- */

.adminwrap { padding-top: 26px; }
.gate { max-width: 420px; margin: 20px 0; }
.gate input {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--card); color: var(--ink);
}
.gate button {
  margin-top: 10px; font: 600 .92rem var(--sans); cursor: pointer;
  padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
}
.gate button:hover { filter: brightness(1.07); }


/* ---- search and the question agent -------------------------------------- */

.searchbox { margin: 22px 0 26px; max-width: 720px; }
.searchfield { position: relative; display: flex; align-items: center; gap: 8px; }
.searchfield input {
  flex: 1; font: inherit; font-size: 1.02rem; padding: 14px 16px;
  border: 1px solid var(--rule); border-radius: 999px;
  background: var(--card); color: var(--ink); min-width: 0;
}
.searchfield input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
/* The typing placeholder. A real element, because the native placeholder
   attribute cannot carry a cursor. */
.ghost {
  position: absolute; left: 17px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--ink-faint); font-size: 1.02rem;
  white-space: nowrap; overflow: hidden; max-width: calc(100% - 110px);
}
.ghost::after {
  content: ""; display: inline-block; width: 2px; height: 1.05em;
  background: var(--accent); margin-left: 2px; vertical-align: -0.18em;
  animation: blink 1.05s step-end infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ghost::after { animation: none; } }
.searchfield input:not(:placeholder-shown) ~ .ghost { display: none; }

.askbtn {
  font: 600 .94rem var(--sans); cursor: pointer; white-space: nowrap;
  padding: 13px 20px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
}
.askbtn:hover { filter: brightness(1.07); }

.results { margin-top: 12px; display: grid; gap: 8px; }
.result {
  display: grid; gap: 3px; text-decoration: none; padding: 11px 14px;
  background: var(--card); border: 1px solid var(--rule);
  border-left: 4px solid var(--sec, var(--accent)); border-radius: var(--radius);
}
.result:hover { border-color: var(--accent); }
.r-t { font-weight: 600; font-size: .97rem; }
.r-c { font-size: .8rem; color: var(--ink-faint); }
.r-q { font-family: var(--serif); font-size: .92rem; color: var(--ink-soft); }
.noresult { color: var(--ink-faint); font-size: .93rem; margin: 4px 0 0; }

.answer {
  margin-top: 14px; background: var(--card); border: 1px solid var(--rule);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.answer p { margin: 0 0 10px; }
.answer p:last-of-type { margin-bottom: 0; }
.thinking { color: var(--ink-faint); font-size: .94rem; }
.answer-src { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule-soft); }
.answer-src a { display: block; font-size: .92rem; padding: 4px 0; text-decoration: none; }
.answer-src a span { color: var(--ink-faint); font-size: .82rem; }
.answer-foot {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule-soft);
  font-size: .84rem; color: var(--ink-faint);
}

@media (max-width: 560px) {
  .askbtn { padding: 13px 15px; }
  .ghost { max-width: calc(100% - 92px); font-size: .95rem; }
  .searchfield input { font-size: .95rem; }
}
