/* =========================================================================
   ER Toolkit — design system
   Concept: "the chart speaks in risk."  Editorial / clinical-modern.
   Palette is the clinical risk scale: spruce = low, amber = caution, red = can't-miss.
   Type: Newsreader (display serif) + IBM Plex Sans (body) + IBM Plex Mono (chart).
   ========================================================================= */

/* ---- Tokens : light "paper" (default) --------------------------------- */
:root {
  --paper:      #F6F3EC;
  --paper-2:    #EFEBE1;
  --surface:    #FFFFFF;
  --surface-2:  #FBF9F4;
  --ink:        #16191F;
  --ink-2:      #3A414C;
  --muted:      #6A7280;
  --faint:      #6E7682;   /* WCAG AA: 4.6:1 on white (controls/placeholders) */
  --rule:       #E2DCCF;
  --rule-2:     #D3CCBC;

  --spruce:     #0F6E5A;   /* primary  — low risk / safe / brand        */
  --spruce-ink: #0A5142;
  --spruce-tint:#E4F0EC;
  --amber:      #8C5B07;   /* caution — intermediate (AA: 4.9:1 on amber-tint) */
  --amber-tint: #F6EBD6;
  --red:        #B42318;   /* can't-miss / high risk / danger (AA on red-tint) */
  --red-tint:   #F7E3DF;
  --plum:       #6E4A86;   /* rare accent for "data" category           */

  --shadow-sm: 0 1px 2px rgba(20,22,28,.06), 0 1px 1px rgba(20,22,28,.04);
  --shadow-md: 0 4px 14px rgba(20,22,28,.08), 0 2px 4px rgba(20,22,28,.05);
  --shadow-lg: 0 20px 48px rgba(20,22,28,.14), 0 6px 16px rgba(20,22,28,.08);

  /* Wide working canvas: the tools are information-dense worksheets, so the
     shell uses most of the screen. Long-form article text stays readable via
     its own .prose max-width (article.css), independent of this. */
  --maxw: 1400px;
  --radius: 4px;
  --radius-lg: 10px;

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

/* ---- Tokens : dark "ink" ---------------------------------------------- */
html[data-theme="dark"] {
  --paper:      #0E1216;
  --paper-2:    #0A0D11;
  --surface:    #161B21;
  --surface-2:  #1B2128;
  --ink:        #E9E7E0;
  --ink-2:      #C3C8CF;
  --muted:      #95A0AD;
  --faint:      #6B7682;
  --rule:       #2A323B;
  --rule-2:     #39434E;

  --spruce:     #43BBA0;
  --spruce-ink: #6FD3BC;
  --spruce-tint:#11302A;
  --amber:      #E0A53C;
  --amber-tint: #322714;
  --red:        #E8705F;
  --red-tint:   #34201D;
  --plum:       #B79AD0;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 56px rgba(0,0,0,.55);
}

/* ---- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Visible keyboard focus everywhere (keyboard users only — not on mouse click).
   Covers the disclosure headers, chips, links, and form controls. */
:focus-visible { outline: 2px solid var(--spruce); outline-offset: 2px; }
[data-theme="dark"] :focus-visible { outline-color: #4FD0B0; }

/* Skip link: off-screen until a keyboard user Tabs to it, then pinned top-left
   so they can jump past the nav straight to the page's content. */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  padding: .6rem 1rem; border-radius: 0 0 6px 0; text-decoration: none;
  background: var(--surface, #fff); color: var(--spruce);
  font: 600 .9rem var(--font-body, sans-serif);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
.skip-link:focus { left: 0; }
/* The content target gets tabindex=-1 so the link can move focus to it; don't
   draw a focus ring around the whole content block when it receives that focus. */
#main:focus { outline: none; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Paper grain + faint dot grid for atmosphere */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(circle at 1px 1px, var(--rule) 1px, transparent 0) 0 0 / 28px 28px;
  opacity: .35; pointer-events: none;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.025'/%3E%3C/svg%3E");
}

/* ---- Typography ------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 400; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
p { color: var(--ink-2); }
a { color: var(--spruce-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
em { font-family: var(--font-display); font-style: italic; }
strong { font-weight: 600; color: var(--ink); }
.serif { font-family: var(--font-display); }
.mono { font-family: var(--font-mono); }

/* Editorial eyebrow / section numbering */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--spruce); font-weight: 500;
  display: inline-flex; align-items: center; gap: .6rem;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--spruce); display: inline-block; }

/* ---- Layout ----------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(.8rem, 2vw, 1.4rem); }
.narrow { max-width: 760px; }
section { position: relative; }
.divider { height: 1px; background: var(--rule); border: 0; }

/* ---- Top nav ---------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner { display: flex; align-items: center; gap: 1.4rem; height: 46px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); font-weight: 500; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 6px; flex: none;
  background: linear-gradient(145deg, var(--spruce), var(--spruce-ink));
  display: grid; place-items: center; color: #fff; font-family: var(--font-mono); font-weight: 700; font-size: .8rem;
  box-shadow: var(--shadow-sm);
}
.brand .tld { color: var(--muted); font-size: .82rem; font-family: var(--font-mono); align-self: flex-end; padding-bottom: 3px; }
.nav-links { display: flex; gap: .3rem; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--ink-2); font-size: .92rem; font-weight: 500; padding: .45rem .7rem; border-radius: var(--radius);
}
.nav-links a:hover { color: var(--ink); background: var(--paper-2); text-decoration: none; }
.nav-links a.active { color: var(--spruce-ink); }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink-2); cursor: pointer; display: grid; place-items: center;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--rule-2); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-links { position: fixed; inset: 46px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--rule); padding: .6rem; gap: .2rem;
    transform: translateY(-130%); transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: var(--shadow-md); }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: .8rem 1rem; }
  .nav-toggle { display: grid; }
}

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: .72rem 1.2rem; border-radius: var(--radius); border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .2s, background .15s, border-color .15s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--spruce); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--spruce-ink); box-shadow: var(--shadow-md); }
html[data-theme="dark"] .btn-primary { color: #06120F; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn-ghost:hover { background: var(--surface); border-color: var(--muted); }
.btn-arrow::after { content: "→"; transition: transform .2s; }
.btn-arrow:hover::after { transform: translateX(3px); }

/* ---- Risk chips / badges --------------------------------------------- */
.tag { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.tag-low  { background: var(--spruce-tint); color: var(--spruce-ink); }
.tag-mod  { background: var(--amber-tint); color: var(--amber); }
.tag-high { background: var(--red-tint); color: var(--red); }
.tag-data { background: color-mix(in srgb, var(--plum) 14%, transparent); color: var(--plum); }
html[data-theme="dark"] .tag-low { color: var(--spruce-ink); }

/* ---- Cards ------------------------------------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: 1.5rem; transition: transform .18s ease, box-shadow .2s, border-color .2s;
  position: relative; overflow: hidden;
}
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--rule-2); text-decoration: none; }
.card .kicker { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.card h3 { margin: .5rem 0 .4rem; }
.card p { font-size: .95rem; color: var(--muted); }
/* colored left rule that maps to risk language */
.card[data-accent]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.card[data-accent="spruce"]::before { background: var(--spruce); }
.card[data-accent="amber"]::before  { background: var(--amber); }
.card[data-accent="red"]::before    { background: var(--red); }
.card[data-accent="plum"]::before    { background: var(--plum); }

.grid { display: grid; gap: 1.1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ---- Footer ----------------------------------------------------------- */
.footer { border-top: 1px solid var(--rule); margin-top: 5rem; padding: 3rem 0 4rem; background: var(--surface-2); }
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer h4 { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: .9rem; }
.footer a { display: block; color: var(--ink-2); font-size: .92rem; padding: .22rem 0; }
.footer a:hover { color: var(--spruce-ink); }
@media (max-width: 720px) { .footer .cols { grid-template-columns: 1fr 1fr; } }
/* Site/legal links row, shown at the top of every footer */
.foot-links { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-bottom: 1.2rem; }
.foot-links a { display: inline; color: var(--muted); font-family: var(--font-mono); font-size: .78rem; letter-spacing: .02em; padding: 0; }
.foot-links a:hover { color: var(--spruce-ink); }

/* ---- Disclaimer banner ------------------------------------------------ */
.disclaimer {
  border: 1px solid var(--amber); border-left-width: 3px; background: var(--amber-tint);
  border-radius: var(--radius); padding: .9rem 1.1rem; font-size: .9rem; color: var(--ink-2);
  display: flex; gap: .7rem; align-items: flex-start;
}
.disclaimer .ico { color: var(--amber); flex: none; font-weight: 700; font-family: var(--font-mono); }

/* ---- Utilities -------------------------------------------------------- */
.center { text-align: center; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-2); line-height: 1.7; }
.muted { color: var(--muted); }
.pad-y { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.stack > * + * { margin-top: 1rem; }
.hairline-top { border-top: 1px solid var(--rule); }

/* staggered reveal on load */
.reveal { opacity: 0; transform: translateY(14px); animation: rise .7s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Tool switcher — cross-links between the interactive tools */
.tool-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1.1rem 0 .2rem; }
.tool-switch .ts-label { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: .15rem; }
.tool-switch a { font-family: var(--font-body); font-weight: 600; font-size: .85rem; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink-2); text-decoration: none; transition: all .12s; }
.tool-switch a:hover { border-color: var(--spruce); color: var(--spruce-ink); }
.tool-switch a.active { background: var(--spruce); border-color: var(--spruce); color: #fff; cursor: default; }
html[data-theme="dark"] .tool-switch a.active { color: #06120F; }

/* ---- Collapsible tool disclaimer (chrome diet) ------------------------ */
/* A one-line summary by default so the tool itself starts almost at the top;
   the full educational/legal text is one tap away. */
.tool-disc { font-size: .74rem; color: var(--muted); margin: .3rem 0 0; }
.tool-head .tool-disc { flex-basis: 100%; }
.tool-disc > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: .4rem; }
.tool-disc > summary::-webkit-details-marker { display: none; }
.tool-disc > summary .ico { color: var(--amber); font-weight: 700; font-family: var(--font-mono); flex: none; }
.tool-disc > summary .tdx { margin-left: .2rem; color: var(--spruce-ink); font-family: var(--font-mono); font-size: .68rem; }
.tool-disc[open] > summary .tdx::after { content: " ▾"; }
.tool-disc:not([open]) > summary .tdx::after { content: " ▸"; }
.tool-disc > div { margin-top: .45rem; line-height: 1.55; max-width: 76ch; }

/* On phones, drop the marketing lede so the working controls reach the top. */
@media (max-width: 940px) {
  .tool-head .lede { display: none; }
}

/* ---- Omni search (complaints + phrases + red flags, one box) --------- */
.omni { position: relative; max-width: 520px; }
/* Search-first hero: the box is the centerpiece, so size it up. */
.omni-hero { max-width: 560px; }
.omni-hero .omni-input { font-size: 1.2rem; padding: 1.05rem 1.2rem; }
.omni-input { width: 100%; font-family: var(--font-body); font-size: 1.05rem; padding: .85rem 1rem;
  border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lg); }
.omni-input:focus { outline: 2px solid var(--spruce); outline-offset: -1px; border-color: var(--spruce); }
.omni-results { position: absolute; left: 0; right: 0; top: calc(100% + .4rem); z-index: 60;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; max-height: 60vh; overflow-y: auto; }
.omni-row { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .7rem;
  align-items: baseline; padding: .6rem .85rem; text-decoration: none; border-bottom: 1px solid var(--rule); }
.omni-row:last-child { border-bottom: 0; }
.omni-row:hover, .omni-row.active { background: var(--surface-2); text-decoration: none; }
.omni-kind { grid-row: 1 / 3; align-self: center; font-family: var(--font-mono); font-size: .6rem; letter-spacing: .08em;
  text-transform: uppercase; padding: .2rem .45rem; border-radius: 999px; white-space: nowrap; }
.omni-kind-pack { background: var(--spruce-tint); color: var(--spruce-ink); }
.omni-kind-phrase { background: var(--amber-tint); color: var(--amber); }
.omni-t { font-family: var(--font-display); font-size: 1.02rem; color: var(--ink); line-height: 1.2; }
.omni-sub { grid-column: 2; font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }
.omni-sub .omni-rf { color: var(--spruce-ink); }
.omni-empty { padding: .9rem .85rem; color: var(--muted); font-size: .9rem; }

/* Risk-tool result: a filled chip so it reads distinctly from the tinted
   complaint/phrase chips. */
.omni-kind-tool { background: var(--spruce); color: #fff; }
/* Diagnosis result: a filled plum chip — distinct from the complaint/tool/phrase
   chips, signalling "start from a known diagnosis". */
.omni-kind-dx { background: var(--plum); color: #fff; }

/* Inline phrase tailoring: a phrase row expands into a live fill-in form with
   a Copy button, so it can be tailored without leaving search. */
.omni-phrase { cursor: pointer; }
.omni-expand { grid-column: 2; justify-self: start; font-family: var(--font-mono); font-size: .66rem;
  letter-spacing: .04em; color: var(--spruce-ink); margin-top: .15rem; }
.omni-row.active .omni-expand { color: var(--spruce); }
.omni-tailor { grid-column: 1 / -1; margin: .55rem 0 0; line-height: 1.9;
  font-family: var(--font-body); color: var(--ink); }
/* The fill-in controls reuse the Dotphrases compose styling (.cmp-sel/.cmp-fill). */
.omni-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: .8rem; margin-top: .55rem; }
.omni-copy.ok { background: var(--spruce); color: #fff; border-color: var(--spruce); }
.omni-open-dp { font-family: var(--font-mono); font-size: .72rem; color: var(--spruce-ink); }

/* Persistent nav search (wide screens only — phones use the ⌕ → dialog). */
.omni-nav { position: relative; max-width: none; display: none; }
.omni-nav-input { width: 340px; font-size: 1rem; padding: .55rem .9rem; box-shadow: none; }
/* On tighter desktop widths, give the box what room there is without crowding
   the nav links; it expands to the roomy width once there's space. */
@media (min-width: 720px) and (max-width: 1000px) { .omni-nav-input { width: 240px; } }
.omni-nav-results { position: absolute; right: 0; left: auto; width: min(420px, 80vw); top: calc(100% + .4rem); }
@media (min-width: 720px) { .omni-nav { display: block; } }

/* Site-wide omni dialog (Cmd/Ctrl+K) */
.omni-dialog { border: 0; padding: 0; background: transparent; width: min(620px, 92vw);
  margin: 12vh auto 0; }
.omni-dialog::backdrop { background: rgba(10, 14, 12, .45); backdrop-filter: blur(2px); }
.omni-dialog .omni { max-width: none; }
.omni-dialog .omni-results { position: static; margin-top: .5rem; }

/* ---- Travel-fever widget (standalone tool + embedded in the MDM builder) --- */
.tf-widget { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.4rem; align-items: start; }
.tf-widget.tf-compact { grid-template-columns: 1fr; }
@media (max-width: 880px) { .tf-widget { grid-template-columns: 1fr; } }
.tf-col { min-width: 0; }
.tf-picker { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .55rem; }
.tf-picker input { flex: 1 1 200px; font-family: var(--font-body); font-size: .95rem; padding: .55rem .7rem;
  border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--surface-2); color: var(--ink); }
.tf-picker input:focus { outline: 2px solid var(--spruce); outline-offset: -1px; border-color: var(--spruce); }
.tf-region-read { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); margin: 0 0 .55rem; }
.tf-region-read strong { color: var(--spruce-ink); font-family: var(--font-body); }
.tf-mapwrap { position: relative; width: 100%; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: .4rem; }
.tf-map { width: 100%; }
.tf-map svg { width: 100%; height: auto; display: block; }
.tf-map svg path, .tf-map svg g > path { fill: var(--surface-2); stroke: var(--rule-2); stroke-width: .4; cursor: pointer; transition: fill .12s; }
.tf-map svg .tf-hover path, .tf-map svg path.tf-hover { fill: var(--amber-tint); }
.tf-map svg .tf-sel path, .tf-map svg path.tf-sel { fill: var(--spruce); stroke: var(--spruce-ink); }
.tf-map svg .tf-pick path, .tf-map svg path.tf-pick { fill: var(--spruce-ink); }
.tf-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); font-family: var(--font-mono);
  font-size: .72rem; padding: .2rem .45rem; border-radius: 4px; white-space: nowrap; opacity: 0; transition: opacity .1s; transform: translate(-50%, -130%); z-index: 5; }
.tf-loading { color: var(--muted); font-size: .9rem; padding: 1rem .2rem; }
.tf-attr { font-family: var(--font-mono); font-size: .66rem; color: var(--faint); margin: .4rem 0 .8rem; }
.tf-attr a { color: var(--faint); }
.tf-sxhead { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: .45rem; }
.tf-sxhead span { text-transform: none; letter-spacing: 0; }
.tf-symptoms { display: flex; flex-wrap: wrap; gap: .4rem; }
.tf-chip { font-family: var(--font-mono); font-size: .76rem; padding: .35rem .65rem; border-radius: 999px;
  border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: all .12s; }
.tf-chip:hover { border-color: var(--spruce); color: var(--spruce-ink); }
.tf-chip.on { background: var(--spruce); border-color: var(--spruce); color: #fff; }
html[data-theme="dark"] .tf-chip.on { color: #06120F; }
.tf-banner { display: flex; gap: .55rem; align-items: flex-start; padding: .6rem .75rem; border-radius: var(--radius);
  font-size: .86rem; line-height: 1.45; margin-bottom: .8rem; border-left: 3px solid var(--red); background: var(--red-tint); color: var(--ink); }
.tf-banner .ico { font-weight: 700; color: var(--red); }
.tf-banner-info { border-left-color: var(--amber); background: var(--amber-tint); }
.tf-banner-info .ico { color: var(--amber); }
.tf-results-head { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .5rem; }
.tf-results-head h3 { font-size: 1.02rem; }
.tf-results-head .where { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); }
.tf-dis { border: 1px solid var(--rule); border-radius: var(--radius); padding: .7rem .8rem; margin-bottom: .6rem; background: var(--surface); }
.tf-dis.dm { border-left: 3px solid var(--red); }
.tf-dis-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.tf-dis-name { font-family: var(--font-display); font-size: 1rem; color: var(--ink); }
.tf-badge { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .12rem .4rem; border-radius: 4px; background: var(--red); color: #fff; }
.tf-match { margin-left: auto; font-family: var(--font-mono); font-size: .68rem; color: var(--spruce-ink); }
.tf-inc { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); margin: .25rem 0; }
.tf-clue { font-size: .85rem; color: var(--ink-2); line-height: 1.45; }
.tf-work { font-size: .83rem; color: var(--ink); line-height: 1.45; margin-top: .35rem;
  padding: .4rem .55rem; background: var(--spruce-tint); border-radius: var(--radius); }
.tf-work .k { font-family: var(--font-mono); font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--spruce-ink); font-weight: 700; display: block; margin-bottom: .1rem; }
.tf-cite { font-family: var(--font-mono); font-size: .66rem; color: var(--faint); margin-top: .3rem; }
.tf-empty { color: var(--muted); font-size: .9rem; padding: .5rem 0; }
