/* ============================================================================
   Stop Propaganda — CN1C demo. Design system.
   Aesthetic: "patient librarian" — DeepL-meets-Wikipedia. Warm-neutral chrome,
   IBM Plex super-family, the five taxonomy colors carry all the meaning.
============================================================================ */

:root {
  /* type */
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* neutral chrome — warm grays */
  --ink: #1c1b19;
  --ink-soft: #4b4945;
  --muted: #78736c;
  --faint: #a8a29a;
  --line: #e8e4dd;
  --line-strong: #d8d3ca;
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-2: #f5f2ec;
  --surface-3: #efebe3;

  /* the five Solopova intent colors */
  --c-distort: #9D4EDD;
  --c-blame: #E63946;
  --c-delegit: #F77F00;
  --c-consent: #06A77D;
  --c-confuse: #FCBF49;

  /* entity broad colors */
  --e-protagonist: #06A77D;
  --e-antagonist: #E63946;
  --e-innocent: #3B82C4;

  /* sizing */
  --col: 940px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(28, 27, 25, .04), 0 1px 1px rgba(28, 27, 25, .03);
  --shadow: 0 4px 16px -6px rgba(28, 27, 25, .12), 0 1px 3px rgba(28, 27, 25, .05);
  --shadow-lg: 0 18px 50px -16px rgba(28, 27, 25, .22);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.serif {
  font-family: var(--serif);
}

.mono {
  font-family: var(--mono);
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

::selection {
  background: rgba(247, 127, 0, .18);
}

/* ---------------------------------------------------------------- layout -- */
.wrap {
  width: min(100% - 40px, var(--col));
  margin-inline: auto;
}

main {
  padding: 40px 0 96px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

/* ============================================================ disclaimer == */
.disclaimer {
  background: var(--ink);
  color: #f3efe8;
}

.disclaimer .wrap {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 0;
}

.disclaimer .dmark {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(243, 239, 232, .5);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  margin-top: 1px;
}

.disclaimer .dtext {
  font-size: 13.5px;
  line-height: 1.5;
}

.disclaimer .dtext b {
  font-weight: 600;
}

.disclaimer .dtext span {
  color: rgba(243, 239, 232, .72);
}

.disclaimer .ddismiss {
  flex: none;
  margin-left: auto;
  align-self: center;
  background: rgba(243, 239, 232, .12);
  color: #f3efe8;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}

.disclaimer .ddismiss:hover {
  background: rgba(243, 239, 232, .22);
}

.disclaimer.hidden {
  display: none;
}

/* ================================================================ header == */
header.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, .86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

header.top .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 104px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.logo-mark {
  height: 90px;
  width: 90px;
  display: block;
  flex: none;
  margin: -10px 0;
}

.logo-dots {
  display: grid;
  grid-template-columns: repeat(3, 7px);
  grid-auto-rows: 7px;
  gap: 3px;
}

.logo-dots i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.logo-dots i:nth-child(1) {
  background: var(--c-distort);
}

.logo-dots i:nth-child(2) {
  background: var(--c-blame);
}

.logo-dots i:nth-child(3) {
  background: var(--c-delegit);
}

.logo-dots i:nth-child(4) {
  background: var(--c-consent);
}

.logo-dots i:nth-child(5) {
  background: var(--c-confuse);
}

.logo-dots i:nth-child(6) {
  background: var(--line-strong);
}

.wordmark {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1;
}

.wm-pre {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.wm-big {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
  width: max-content;
  padding: 1px 7px;
  border-radius: 5px;
  background-image: linear-gradient(100deg, rgba(247, 127, 0, .40), rgba(252, 191, 73, .42));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  animation: hlsweep 6s ease-in-out infinite;
}

.brand:hover .wm-big {
  animation-duration: 1.6s;
}

@keyframes hlsweep {
  0% {
    background-size: 0% 100%;
  }

  14% {
    background-size: 100% 100%;
  }

  82% {
    background-size: 100% 100%;
  }

  100% {
    background-size: 0% 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wm-big {
    animation: none;
    background-size: 100% 100%;
  }
}

nav.tabs {
  display: flex;
  gap: 4px;
  margin-left: 6px;
}

nav.tabs button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}

nav.tabs button:hover {
  color: var(--ink);
  background: var(--surface-2);
}

nav.tabs button.active {
  color: var(--ink);
  background: var(--surface-3);
  font-weight: 600;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* language switcher */
.lang {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: border-color .15s, background .15s;
}

.lang-btn:hover {
  border-color: var(--faint);
}

.lang-btn .flag {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink);
}

.lang-btn .chev {
  color: var(--faint);
  font-size: 10px;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 180px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
  display: none;
}

.lang-menu.open {
  display: block;
}

.lang-menu .uihead {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
  padding: 8px 10px 4px;
  font-weight: 600;
}

.lang-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink-soft);
}

.lang-menu button:hover {
  background: var(--surface-2);
}

.lang-menu button.sel {
  color: var(--ink);
  font-weight: 600;
}

.lang-menu button .flag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  width: 20px;
}

.lang-menu button.sel .flag {
  color: var(--c-delegit);
}

.lang-menu .check {
  margin-left: auto;
  color: var(--c-consent);
  font-size: 13px;
  opacity: 0;
}

.lang-menu button.sel .check {
  opacity: 1;
}

/* =================================================================== hero == */
.hero {
  padding: 30px 0 8px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.015em;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.08;
  margin: 0 0 16px;
  max-width: 18ch;
}

.hero h1 em {
  font-style: italic;
  color: var(--c-delegit);
}

.hero .lead {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 60ch;
  line-height: 1.6;
  margin: 0;
  text-wrap: pretty;
}

/* ============================================================== composer == */
.composer {
  margin-top: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.composer-head .lbl {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.composer textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: vertical;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  padding: 20px 18px;
  min-height: 150px;
  background: var(--surface);
  display: block;
}

.composer textarea::placeholder {
  color: var(--faint);
  font-style: italic;
}

/* The study's reference examples run much longer than the site's quick tweet-style
   samples (full articles, 100-300+ words) — give the composer more room to read them
   without scrolling. The analyzer widget is the same DOM node moved between hosts, so
   this only applies while it's mounted inside the study section. */
#studyAnalyzerHost .composer textarea {
  min-height: 340px;
}

.composer-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border: 1px solid transparent;
  transition: transform .08s, background .15s, border-color .15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--ink);
  color: #faf8f4;
}

.btn-primary:hover {
  background: #000;
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink-soft);
  border-color: var(--line-strong);
  font-weight: 500;
}

.btn-ghost:hover {
  border-color: var(--faint);
  color: var(--ink);
}

.btn .kbd {
  font-family: var(--mono);
  font-size: 11px;
  opacity: .6;
}

.foot-spacer {
  margin-left: auto;
}

.char-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

/* ---- study-invite card: bottom-right, shown once after the first analysis ---- */
.study-invite {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: min(360px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 18px 20px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .35s cubic-bezier(.2, .7, .2, 1), transform .35s cubic-bezier(.2, .7, .2, 1);
}

.study-invite.show {
  opacity: 1;
  transform: none;
}

.study-invite .si-dots {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
}

.study-invite .si-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.study-invite h3 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -.01em;
}

.study-invite p {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0 0 14px;
}

.study-invite .si-actions {
  display: flex;
  gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .study-invite {
    transition: none;
  }
}

.coarse-note {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  max-width: 68ch;
  line-height: 1.55;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ================================================================ results == */
#results {
  margin-top: 30px;
}

#results.empty {
  display: none;
}

.result-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.result-head .kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
  font-weight: 600;
}

.result-head .meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.result-head .meta b {
  color: var(--muted);
  font-weight: 500;
}

/* verdict + category band */
.verdict-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: stretch;
  margin-bottom: 18px;
}

.verdict-pill {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 11px 20px 11px 16px;
  box-shadow: var(--shadow-sm);
  align-self: center;
}

.verdict-pill .vdot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: none;
}

.verdict-pill .vlabel {
  font-weight: 600;
  font-size: 15px;
}

.verdict-pill .vconf {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  padding-left: 11px;
  border-left: 1px solid var(--line);
}

.verdict-pill.prop .vdot {
  background: var(--c-delegit);
  box-shadow: 0 0 0 4px rgba(247, 127, 0, .14);
}

.verdict-pill.neutral .vdot {
  background: var(--c-consent);
  box-shadow: 0 0 0 4px rgba(6, 167, 125, .14);
}

/* category card */
.cat-card {
  flex: 1 1 360px;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 16px 22px;
  box-shadow: var(--shadow-sm);
}

.cat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--cat);
}

.cat-card .cc-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
}

.cat-card .cc-chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #fff;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--cat);
}

.cat-card .cc-kicker {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--faint);
  font-weight: 600;
}

.cat-card .cc-conf {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.cat-card .cc-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
  margin: 0 0 6px;
}

.cat-card .cc-goal {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
}

.cat-card .cc-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  margin-top: 12px;
  overflow: hidden;
}

.cat-card .cc-bar i {
  display: block;
  height: 100%;
  background: var(--cat);
  border-radius: 2px;
  transition: width .85s cubic-bezier(.2, .7, .2, 1);
}

.cat-card .cc-fine {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  font-size: 13.5px;
  color: var(--ink-soft);
}

.cat-card .cc-fine b {
  color: var(--ink);
  font-weight: 600;
}

.cat-card .cc-fine .src {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
}

/* ----------------------------------------------------------- panel block -- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 20px 0;
  flex-wrap: wrap;
}

.panel-head h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  flex: none;
  white-space: nowrap;
}

.panel-head .hint {
  font-size: 12.5px;
  color: var(--muted);
}

.panel-head .ent-key {
  margin-left: auto;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.ent-key .ek {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.panel-body {
  padding: 16px 20px 20px;
}

/* annotated source text */
.src-text {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.95;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
  position: relative;
}

.panel.ann .panel-body {
  overflow: hidden;
}

mark.hl {
  border-radius: 3px;
  padding: .08em .12em;
  cursor: help;
  border-bottom: 2.5px solid var(--mc);
  background-image: linear-gradient(var(--mbg), var(--mbg));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  color: var(--ink);
  text-decoration: none;
  transition: background-size .5s cubic-bezier(.2, .7, .2, 1), border-color .35s ease, filter .12s;
}

mark.hl:hover,
mark.hl.activept {
  filter: saturate(1.25);
  background-image: linear-gradient(var(--mbg-strong), var(--mbg-strong));
}

mark.hl.lowconf {
  opacity: .62;
  border-bottom-style: dotted;
}

/* inline entity-framing badge inside the annotated text */
.entref {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  vertical-align: top;
  position: relative;
  top: -.15em;
  margin: 0 1px;
  box-shadow: 0 1px 2px rgba(28, 27, 25, .18);
  cursor: help;
}

.entref.eb-protagonist {
  background: #6f6a63;
  color: #faf8f4;
}

.entref.eb-antagonist {
  background: var(--ink);
  color: #faf8f4;
}

.entref.eb-innocent {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
}

/* legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.legend .lg i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex: none;
}

/* spans detail table */
table.spans {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  font-size: 13.5px;
}

table.spans th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--faint);
  font-weight: 600;
  padding: 0 12px 8px 0;
  border-bottom: 1px solid var(--line);
}

table.spans td {
  padding: 11px 12px 11px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.spans tr:last-child td {
  border-bottom: none;
}

table.spans .c-phrase {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  max-width: 200px;
}

table.spans .c-intent {
  white-space: nowrap;
}

table.spans .c-intent .dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: -1px;
}

table.spans .c-why {
  font-family: var(--serif);
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.45;
}

table.spans .c-conf {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

table.spans .tname {
  font-size: 13px;
}

table.spans .tid {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

/* entity framing */
.entities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 10px;
}

.ent {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.ebadge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: var(--shadow-sm);
}

.ebadge--sm {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 11px;
  box-shadow: none;
}

.ebadge--xs {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 9px;
  box-shadow: none;
}

.ebadge.eb-protagonist {
  background: #6f6a63;
  color: #faf8f4;
}

.ebadge.eb-antagonist {
  background: var(--ink);
  color: #faf8f4;
}

.ebadge.eb-innocent {
  background: var(--surface-3);
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
}

.ent .ebody {
  min-width: 0;
  flex: 1;
}

.ent .ename {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ent .erole {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ent .erole .rtag {
  color: var(--ink);
  font-weight: 600;
}

.ent .econf {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  flex: none;
  align-self: flex-start;
  padding-top: 1px;
}

.empty-note {
  font-size: 14px;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
}

/* ============================================================== tooltip ==== */
#tooltip {
  position: fixed;
  z-index: 200;
  max-width: 320px;
  pointer-events: none;
  background: var(--ink);
  color: #f4f0e9;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 15px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .13s, transform .13s;
  font-size: 13px;
}

#tooltip.show {
  opacity: 1;
  transform: none;
}

#tooltip .tt-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

#tooltip .tt-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

#tooltip .tt-intent {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(244, 240, 233, .6);
  font-weight: 600;
}

#tooltip .tt-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
  line-height: 1.25;
}

#tooltip .tt-def {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(244, 240, 233, .82);
}

#tooltip .tt-conf {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(244, 240, 233, .16);
}

#tooltip .tt-conf .ttbar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(244, 240, 233, .18);
  overflow: hidden;
}

#tooltip .tt-conf .ttbar i {
  display: block;
  height: 100%;
  border-radius: 2px;
}

#tooltip .tt-conf .ttval {
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(244, 240, 233, .8);
}

/* ============================================================== taxonomy == */
.section-head {
  margin: 6px 0 26px;
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -.015em;
  margin: 0 0 12px;
}

.section-head p {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 64ch;
  margin: 0;
  line-height: 1.6;
  text-wrap: pretty;
}

.tax-subhead {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 40px 0 16px;
}

.tax-subhead h3,
.tax-subhead h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}

.tax-subhead .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

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

.intent {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s;
}

.intent:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.intent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--cat);
}

.intent .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cat);
  font-weight: 600;
}

.intent h4 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.2;
  margin: 4px 0 8px;
}

.intent .goal {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0 0 6px;
}

.intent .rat {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.intent .subs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.intent .subs span {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--ink-soft);
}

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

.tech {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: transform .12s, box-shadow .12s;
}

.tech:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tech .tnum {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  flex: none;
  padding-top: 1px;
  min-width: 22px;
}

.tech h5 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 3px;
  line-height: 1.25;
}

.tech p {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.roles-cols {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.role-col-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.role-col h4 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.role-col h4 i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.role-col .bdesc {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
  flex: 1 1 280px;
  min-width: 0;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 0 28px;
}

.role {
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.role .rname {
  font-size: 13.5px;
  font-weight: 600;
}

.role .rdef {
  font-family: var(--serif);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
}

/* ================================================================ about ==== */
.about-prose {
  max-width: 64ch;
}

/* .about-prose p {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
} */

.about-prose p strong {
  color: var(--ink);
  font-weight: 600;
}

.steps {
  display: grid;
  gap: 14px;
  margin: 26px 0;
}

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step .sn {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #faf8f4;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.step .stxt {
  font-size: 14.5px;
  color: var(--ink-soft);
  padding-top: 4px;
}

.step .stxt b {
  color: var(--ink);
  font-weight: 600;
}

.notlist {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.notlist .nl {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
  color: var(--ink-soft);
}

.notlist .nl::before {
  content: "\00d7";
  color: var(--c-blame);
  font-weight: 700;
  flex: none;
}

/* ============================================================== extension === */

/* fixed 2 columns (not auto-fill) so the 4 shots read as a 1-2 / 3-4 sequence
   left-to-right, top-to-bottom, matching the numbered steps above them */
.ext-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.ext-gallery figure {
  position: relative;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ext-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.ext-shot-n {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #faf8f4;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

.ext-gallery figcaption {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
}

/* ================================================================ privacy === */
.priv-section {
  margin-top: 40px;
}

.priv-section:first-of-type {
  margin-top: 32px;
}

.priv-section p {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0 0 12px;
  max-width: 72ch;
}

.priv-section p:last-child {
  margin-bottom: 0;
}

.priv-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.priv-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--faint);
  font-weight: 600;
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--line);
}

.priv-table td {
  padding: 13px 16px 13px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-soft);
  line-height: 1.5;
}

.priv-table tr:last-child td {
  border-bottom: none;
}

.priv-table td:first-child {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.priv-table .tdm {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.perm-grid {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.perm {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.perm-name {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--surface-3);
  white-space: nowrap;
  flex: none;
  align-self: flex-start;
  margin-top: 1px;
}

.perm-body {
  min-width: 0;
}

.perm-why {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.nope-list,
.yes-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.nope,
.yes {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
  color: var(--ink-soft);
}

.nope::before {
  content: "×";
  color: var(--c-blame);
  font-weight: 700;
  flex: none;
}

.yes::before {
  content: "✓";
  color: var(--c-consent);
  font-weight: 700;
  flex: none;
}

.updated {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  margin-top: 8px;
}

.scope-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.scope-chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--ink-soft);
}

/* ================================================================ footer === */
footer.foot {
  border-top: 1px solid var(--line);
  margin-top: 30px;
}

footer.foot .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 26px 0;
}

footer.foot .fdots {
  display: flex;
  gap: 5px;
}

footer.foot .fdots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

footer.foot .fnote {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 720px) {
  nav.tabs {
    margin-left: 0;
  }

  nav.tabs button {
    padding: 8px 9px;
    font-size: 13px;
  }

  .wordmark {
    display: none;
  }

  header.top .wrap {
    gap: 12px;
  }

  .verdict-row {
    flex-direction: column;
  }

  .ext-gallery {
    grid-template-columns: 1fr;
  }

  .result-head .meta {
    display: none;
  }

  .src-text {
    font-size: 17px;
    line-height: 1.85;
  }

  .composer textarea {
    font-size: 16px;
  }

  /* let Clear / Model / char-count wrap in reading order instead of the
     spacer punching a big gap into the middle of the wrapped row */
  .foot-spacer {
    display: none;
  }

  .composer-foot {
    row-gap: 12px;
  }
}

@media (max-width: 480px) {
  nav.tabs {
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  nav.tabs::-webkit-scrollbar {
    display: none;
  }

  nav.tabs button {
    flex: none;
    white-space: nowrap;
  }

  .lang-btn .lname {
    display: none;
  }
}

/* ===================================================== procedural reveal === */
/* staggered block reveal — only while #results has .anim */
#results.anim .rv {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s cubic-bezier(.2, .7, .2, 1), transform .55s cubic-bezier(.2, .7, .2, 1);
}

#results.anim .rv.show {
  opacity: 1;
  transform: none;
}

/* spans light up one at a time as the scan passes */
#results.anim mark.hl {
  background-size: 0% 100%;
  border-bottom-color: transparent;
}

#results.anim mark.hl.lit {
  background-size: 100% 100%;
  border-bottom-color: var(--mc);
}

/* soft scan-line sweeping the annotated text */
.src-text.scanning::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -180px;
  width: 180px;
  background: linear-gradient(90deg, transparent, rgba(247, 127, 0, .05), rgba(247, 127, 0, .20), rgba(247, 127, 0, .05), transparent);
  filter: blur(1px);
  pointer-events: none;
  animation: scan 1.15s cubic-bezier(.45, 0, .2, 1) forwards;
}

@keyframes scan {
  from {
    left: -180px;
  }

  to {
    left: 100%;
  }
}

/* pipeline processing card */
.proc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}

.proc-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.proc-spin {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink);
  animation: spin .7s linear infinite;
  flex: none;
}

.proc-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.proc-ms {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.proc-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 16px;
  margin: 16px 0 14px;
}

.pstage {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--faint);
  transition: color .25s;
}

.pstage .pdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
  position: relative;
  transition: background .25s, box-shadow .25s;
  flex: none;
}

.pstage .plabel {
  font-family: var(--mono);
  letter-spacing: .01em;
}

.pstage.active {
  color: var(--ink-soft);
}

.pstage.active .pdot {
  background: var(--ink);
  animation: pdot 0.7s ease-in-out infinite;
}

.pstage.done {
  color: var(--ink);
}

.pstage.done .pdot {
  background: var(--c-consent);
  box-shadow: none;
  animation: none;
}

.pstage.done .pdot::after {
  content: "✓";
  position: absolute;
  inset: 0;
  font-size: 7px;
  line-height: 1;
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--sans);
}

.proc-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}

.proc-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-delegit), var(--c-confuse));
  transition: width .3s ease;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pdot {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(28, 27, 25, .12);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(28, 27, 25, .03);
  }
}

@media (prefers-reduced-motion: reduce) {
  #results.anim .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }

  #results.anim mark.hl {
    background-size: 100% 100%;
    border-bottom-color: var(--mc);
  }

  .src-text.scanning::after {
    display: none;
  }

  .proc-spin,
  .pstage.active .pdot {
    animation: none;
  }

  .cat-card .cc-bar i,
  mark.hl {
    transition: none;
  }
}

/* Survey */

#userStudyParticipationInfo {
  max-width: 800px;
}

#userStudyParticipationInfo h3 {
  margin-bottom: 1rem;
}

#userStudyParticipationInfo p {
  margin-bottom: 2rem;
  color: var(--ink-soft);
}

.question {
  margin-bottom: 1.25rem;
}

.question>label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.input {
  width: 100%;
  max-width: 320px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 14px;
}

fieldset.question {
  border: none;
  padding: 0;
  margin: 0 0 2rem;
}

fieldset.question legend {
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.choice-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.choice-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.survey-nav {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
}

.likert-scale {
  display: grid;
  grid-template-columns: 180px repeat(5, 60px) 180px;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.likert-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.likert-anchor:first-child {
  text-align: right;
}

.likert-anchor:last-child {
  text-align: left;
}

/* =========================================
   User Study Progress
========================================= */

.study-progress {
  margin: 0 0 2rem 0;
}

.sp-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
  font-weight: 500;
}

.sp-track {
  display: flex;
  gap: 6px;
  width: 100%;
}

.sp-segment {
  height: 12px;
  border-radius: 999px;
  background: #e6e6ea;
  transition:
    background .25s ease,
    transform .25s ease;
}

.sp-segment.completed {
  background: #1a1a1a;
}

.sp-segment.active {
  background: #F77F00;
  transform: scaleY(1.15);
}


.question.invalid {
  border: 2px solid #dc3545;
  border-radius: 8px;
  padding: 1rem;
}

.question.invalid legend {
  color: #dc3545;
}

.validation-message {
  color: #dc3545;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.study-summary-panel {
  border: 1px solid #d9d9de;
  border-radius: 16px;
  padding: 1.5rem;
  background: #f7f7fb;
  margin-top: 2rem;
}

.study-summary-panel .section-head {
  margin-bottom: 1rem;
}

.study-summary-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.study-summary-status {
  color: #555;
  font-size: 0.95rem;
}

.study-summary-metrics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 1.5rem;
}

.study-summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}

.study-summary-card-label {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.study-summary-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

.study-summary-card-hint {
  margin-top: 0.55rem;
  color: var(--faint);
  font-size: 0.93rem;
}

.study-summary-charts {
  display: grid;
  gap: 1.15rem;
}

.study-summary-group {
  border: 1px solid var(--line);
  background: #fbfbff;
  border-radius: 16px;
  padding: 0.9rem;
}

.study-summary-group-header {
  margin-bottom: 0.75rem;
}

.study-summary-group-header h3 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.study-summary-group-header p {
  margin: 0.3rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.study-summary-group-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.study-summary-chart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.study-summary-chart h4 {
  margin: 0 0 0.65rem;
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.pie-chart {
  display: flex;
  justify-content: center;
}

.pie-chart-svg {
  width: min(100%, 200px);
  height: auto;
}

.pie-legend {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.6rem;
  max-height: 170px;
  overflow-y: auto;
}

.pie-legend-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.pie-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.study-summary-text-list {
  margin: 0.5rem 0 0 0.9rem;
  padding-left: 0.9rem;
  color: var(--ink-soft);
}

.study-summary-text-list li {
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.free-text-summary-count {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
}

.free-text-summary-more {
  margin-top: 0.55rem;
  font-size: 0.9rem;
  color: var(--faint);
}

.study-summary-chart--free-text {
  grid-column: 1 / -1;
}

.study-summary-chart--bar {
  grid-column: 1 / -1;
}

.bar-chart-list {
  display: grid;
  gap: 0.55rem;
}

.bar-chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr auto;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.bar-chart-label {
  overflow-wrap: break-word;
}

.bar-chart-track {
  background: var(--surface-2);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.bar-chart-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.bar-chart-count {
  min-width: 1.6em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

@media (max-width: 760px) {
  .study-summary-charts {
    grid-template-columns: 1fr;
  }

  .pie-legend {
    max-height: none;
  }

  .bar-chart-row {
    grid-template-columns: minmax(100px, 160px) 1fr auto;
  }
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #6c757d;
  border-color: #6c757d;
}
/* ---- explainability package (user-study follow-up) ---- */
.scope-note { font-size: .78rem; color: var(--muted, #8a8a8a); margin: .45rem 0 0; line-height: 1.45; }
.rel-badge { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem;
  padding: .35rem .7rem; border-radius: 8px; margin: .5rem 0 0; line-height: 1.35; }
.rel-badge .rel-ic { font-weight: 700; }
.rel-in_domain { background: rgba(12,163,12,.10); color: #0a7a0a; }
.rel-out_of_domain, .rel-uncertain { background: rgba(236,131,90,.14); color: #b45309; }
.rel-deferred { background: rgba(42,120,214,.12); color: #1c5cab; }
.why-neutral { font-size: .85rem; color: var(--muted, #8a8a8a); margin: .5rem 0 0; }
.explain-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .8rem; }
.btn-ghost { font-size: .8rem; padding: .35rem .8rem; border: 1px solid rgba(128,128,128,.35);
  background: transparent; border-radius: 8px; cursor: pointer; color: inherit; }
.btn-ghost:hover { border-color: rgba(128,128,128,.7); }
.btn-ghost:disabled { opacity: .5; cursor: default; }
#prove-out { font-size: .82rem; }
.prove-strong { color: #0a7a0a; }
.prove-caution { color: #b45309; }
.fb-box { display: flex; gap: .5rem; align-items: flex-start; margin-top: .5rem; }
.fb-box textarea { flex: 1; font: inherit; font-size: .82rem; padding: .4rem .6rem;
  border-radius: 8px; border: 1px solid rgba(128,128,128,.35); background: transparent; color: inherit; }
#fb-out { font-size: .8rem; color: #0a7a0a; align-self: center; }
.occl-head { color: var(--muted, #8a8a8a); font-size: .78rem; }
.occl-chip { display: inline-flex; gap: .3rem; align-items: baseline; padding: .12rem .5rem;
  border-radius: 6px; background: rgba(42,120,214,.10); font-size: .82rem; }
.occl-chip i { font-style: normal; font-size: .7rem; color: #1c5cab; }
.prove-out { margin: .6rem 0 0; font-size: .82rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.prove-out:empty { display: none; }

/* ---- semantic map (3D lens) ---- */
.lens-overlay { position: fixed; inset: 0; z-index: 9999; background: #0d0d0f; color: #eee;
  display: flex; flex-direction: column; font-size: 13px; }
.lens-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px;
  border-bottom: 1px solid #26262a; }
.lens-head b { font-size: 14px; }
.lens-sub { color: #8a8a90; margin-left: 10px; font-size: 11px; }
.lens-close { background: none; border: 1px solid #3a3a40; color: #ccc; border-radius: 6px;
  width: 30px; height: 30px; cursor: pointer; font-size: 14px; }
.lens-close:hover { border-color: #666; }
.lens-canvas { flex: 1; position: relative; min-height: 0; }
.lens-canvas canvas { display: block; }
.lens-legend { display: flex; flex-wrap: wrap; gap: 9px; padding: 13px 22px; border-top: 1px solid #26262a; }
.lens-chip { display: inline-flex; align-items: center; gap: 7px; background: #17171a; color: #ddd;
  border: 1px solid #2c2c30; border-radius: 20px; padding: 6px 14px; font-size: 11.5px; cursor: pointer; }
.lens-chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lens-chip.off { opacity: 0.4; text-decoration: line-through; }
/* a category that has not landed yet during the staged reveal */
.lens-chip.pending { opacity: .28; transition: opacity .45s; }
.lens-tip { position: fixed; pointer-events: none; z-index: 10000; background: #17171acc; backdrop-filter: blur(4px);
  border: 1px solid #333; border-radius: 8px; padding: 8px 10px; max-width: 320px; font-size: 12px; }
.lens-detail { position: absolute; left: 16px; bottom: 16px; z-index: 10000; background: #16161acc;
  backdrop-filter: blur(6px); border: 1px solid #33333a; border-radius: 10px; padding: 12px 14px;
  max-width: 380px; }
.lens-detail-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: #888;
  cursor: pointer; font-size: 13px; }
.tip-lab { font-weight: 600; margin-bottom: 3px; }
.tip-int { color: #b7b7bd; font-size: 11px; margin-bottom: 5px; }
.tip-txt { color: #ddd; line-height: 1.4; }
.detail-txt { color: #e8e8ea; line-height: 1.45; margin: 4px 0 6px; }
.tip-meta { color: #7a7a80; font-size: 10.5px; margin-top: 5px; }

/* ---- semantic map: region labels + toggle ---- */
.lens-actions { display: flex; align-items: center; gap: 8px; }
.lens-tog { background: #17171a; border: 1px solid #33333a; color: #999; border-radius: 6px;
  padding: 5px 12px; font-size: 11.5px; cursor: pointer; }
.lens-tog.on { color: #eee; border-color: #55555f; }
.lens-region { position: absolute; transform: translate(-50%, -50%); pointer-events: none;
  font-size: 11px; font-weight: 600; letter-spacing: .2px; white-space: nowrap;
  text-shadow: 0 0 6px #000, 0 0 6px #000, 0 1px 2px #000; z-index: 5; opacity: .92; }

.lens-anchor { font-size: 12.5px !important; font-weight: 800 !important; letter-spacing: .3px;
  padding: 2px 8px; background: #000000aa; border-radius: 6px; border: 1px solid currentColor; }

/* ===== semantic map — CN1C light theme (overrides the dark defaults above) ===== */
.lens-overlay { background: var(--bg); color: var(--ink); }
.lens-head { border-bottom: 1px solid var(--line); }
.lens-head b { color: var(--ink); }
.lens-sub { color: var(--muted); }
.lens-close, .lens-tog { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-soft); }
.lens-close:hover, .lens-tog:hover { border-color: var(--muted); }
.lens-tog.on { color: var(--ink); border-color: var(--muted); background: var(--surface); }
.lens-legend { border-top: 1px solid var(--line); background: var(--bg); }
.lens-chip { background: var(--surface); color: var(--ink-soft); border: 1px solid var(--line-strong); }
.lens-chip.off { opacity: .45; }
.lens-tip, .lens-detail { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  box-shadow: var(--shadow-lg); backdrop-filter: none; }
.tip-txt { color: var(--ink-soft); }
.detail-txt { color: var(--ink); }
.tip-meta { color: var(--muted); }
.lens-detail-x { color: var(--muted); }
.lens-region { text-shadow: 0 0 4px var(--bg), 0 0 4px var(--bg), 0 0 9px var(--bg); }
.lens-anchor { background: #ffffffcc !important; border: 1px solid currentColor; }

/* ===== semantic map — "What am I looking at?" explainer =======================
   One light theme, no dark base to override. Editorial rather than dashboard:
   a single card, sectioned by rules, with the animation as the centrepiece. */
.lens-intro { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center;
  justify-content: center; padding: 20px; background: rgba(28, 27, 25, .28);
  backdrop-filter: blur(3px); animation: licFade .18s ease-out; }
@keyframes licFade { from { opacity: 0; } }

.lens-intro-card { width: min(600px, 100%); max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: var(--shadow-lg); font-family: var(--sans); color: var(--ink);
  animation: licRise .22s cubic-bezier(.2, .7, .3, 1); }
@keyframes licRise { from { opacity: 0; transform: translateY(8px); } }

.lic-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 24px 14px; }
.lic-eyebrow { display: block; font: 600 10.5px/1 var(--mono); letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.lic-head h3 { margin: 0; font: 600 20px/1.25 var(--serif); color: var(--ink); }
.lic-x { flex: none; width: 30px; height: 30px; border-radius: 7px; cursor: pointer;
  background: none; border: 1px solid transparent; color: var(--muted); font-size: 13px; line-height: 1; }
.lic-x:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }

.lic-body { padding: 0 24px 4px; }
.lic-lede { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.lic-lede b, .lic-key b, .lic-note b { color: var(--ink); font-weight: 600; }

/* ---- the pipeline animation: one beat at a time, so it stays legible on a phone ---- */
.lic-anim { margin: 0 0 18px; padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.lic-stage { position: relative; height: 132px; }
.lic-beat { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 14px; opacity: 0; transform: scale(.97); transition: opacity .4s, transform .4s;
  pointer-events: none; }
.lic-anim[data-step="0"] .lic-beat[data-b="0"], .lic-anim[data-step="1"] .lic-beat[data-b="1"],
.lic-anim[data-step="2"] .lic-beat[data-b="2"], .lic-anim[data-step="3"] .lic-beat[data-b="3"],
.lic-anim[data-step="4"] .lic-beat[data-b="4"], .lic-anim[data-step="5"] .lic-beat[data-b="5"] {
  opacity: 1; transform: scale(1); }

.lic-quote { font: 400 15px/1.45 var(--serif); color: var(--ink); text-align: center; quotes: "\201C" "\201D"; }
.lic-toks { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.lic-tok { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 5px;
  padding: 5px 8px; font: 500 11.5px/1 var(--mono); color: var(--ink-soft); animation: licPop .3s backwards; }
.lic-tok:nth-child(2) { animation-delay: .05s } .lic-tok:nth-child(3) { animation-delay: .1s }
.lic-tok:nth-child(4) { animation-delay: .15s } .lic-tok:nth-child(5) { animation-delay: .2s }
.lic-tok:nth-child(6) { animation-delay: .25s }
@keyframes licPop { from { opacity: 0; transform: translateY(6px); } }

.lic-model { display: inline-flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 12px 20px; font: 600 13px/1 var(--mono); color: var(--ink); }
.lic-att { display: flex; align-items: flex-end; gap: 3px; height: 12px; }
.lic-att i { width: 3px; height: 4px; border-radius: 1px; background: var(--muted);
  animation: licAtt .9s infinite ease-in-out; }
.lic-att i:nth-child(2) { animation-delay: .12s } .lic-att i:nth-child(3) { animation-delay: .24s }
.lic-att i:nth-child(4) { animation-delay: .36s } .lic-att i:nth-child(5) { animation-delay: .48s }
@keyframes licAtt { 50% { height: 12px; background: var(--ink-soft); } }

.lic-vec { display: flex; align-items: flex-end; gap: 2px; height: 46px; }
.lic-vec i { width: 3px; height: 6px; border-radius: 1px; background: var(--c-consent);
  transition: height .45s cubic-bezier(.2, .7, .3, 1); }

.lic-dot { width: 15px; height: 15px; border-radius: 50%; background: var(--ink);
  animation: licPulse 1.4s infinite; }
@keyframes licPulse {
  0%   { box-shadow: 0 0 0 0 rgba(28, 27, 25, .40); }
  70%  { box-shadow: 0 0 0 14px rgba(28, 27, 25, 0); }
  100% { box-shadow: 0 0 0 0 rgba(28, 27, 25, 0); } }

.lic-mini { width: 100%; height: 104px; display: block; }

.lic-cap { display: flex; align-items: center; gap: 9px; padding: 0 14px 10px; min-height: 20px; }
.lic-step { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ink);
  color: var(--surface); font: 600 10.5px/18px var(--mono); text-align: center; }
.lic-captxt { font-size: 12.5px; color: var(--ink-soft); }

.lic-rail { display: flex; gap: 4px; padding: 0 14px 12px; }
.lic-pip { flex: 1; height: 3px; padding: 0; border: 0; border-radius: 2px; cursor: pointer;
  background: var(--line-strong); transition: background .3s; }
.lic-pip:hover { background: var(--faint); }
.lic-pip.on { background: var(--ink); }

/* ---- the key: the one distinction the map lives or dies on ---- */
.lic-key { margin: 0 0 16px; display: grid; gap: 10px; }
.lic-key > div { display: flex; align-items: flex-start; gap: 12px; }
.lic-key dt { flex: none; width: 22px; display: flex; justify-content: center; padding-top: 3px; }
.lic-key dd { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.lic-sw { display: block; border-radius: 50%; }
.lic-sw-cloud { width: 9px; height: 9px; background: var(--c-distort);
  box-shadow: 10px 4px 0 -1.5px var(--c-delegit), -9px 5px 0 -2px var(--c-consent); }
.lic-sw-you { width: 15px; height: 15px; background: var(--ink); box-shadow: 0 0 0 3px rgba(28, 27, 25, .12); }

.lic-note { margin: 0 0 20px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.lic-note em { font-style: italic; }

.lic-foot { display: flex; justify-content: flex-end; padding: 14px 24px 18px;
  border-top: 1px solid var(--line); background: var(--surface-2);
  border-radius: 0 0 13px 13px; }
.lic-ok { background: var(--ink); color: #fff; border: 0; border-radius: 8px; cursor: pointer;
  padding: 10px 22px; font: 500 13px/1 var(--sans); }
.lic-ok:hover { background: #000; }
.lic-ok:focus-visible, .lic-pip:focus-visible, .lic-x:focus-visible { outline: 2px solid var(--c-consent);
  outline-offset: 2px; }

@media (max-width: 560px) {
  .lens-intro { padding: 10px; }
  .lic-head { padding: 16px 16px 12px; } .lic-body { padding: 0 16px 4px; } .lic-foot { padding: 12px 16px 14px; }
  .lic-head h3 { font-size: 18px; }
  .lic-stage { height: 118px; }
  .lic-ok { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .lens-intro, .lens-intro-card, .lic-beat, .lic-tok { animation: none; transition: none; }
  .lic-dot, .lic-att i { animation: none; }
}

/* ---- (A) framing cast-list ---- */
.framing { margin: 10px 0 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); }
.framing-h { font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.cast-line { display: block; font-size: 13.5px; color: var(--ink); line-height: 1.7; }
.cast-role { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px;
  margin-right: 7px; color: #fff; }
.cast-role.eb-antagonist { background: var(--e-antagonist); }
.cast-role.eb-protagonist { background: var(--e-protagonist); }
.cast-role.eb-innocent { background: var(--e-innocent); }
.cast-fine { color: var(--muted); font-size: 12px; }

/* ---- semantic map: mode toggle (Sentences | Entities) ---- */
.lens-modes { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; }
.lens-mode { background: var(--surface); border: 0; color: var(--muted); font: 500 11.5px/1 inherit; padding: 6px 12px; cursor: pointer; }
.lens-mode + .lens-mode { border-left: 1px solid var(--line-strong); }
.lens-mode.on { background: var(--ink); color: #fff; }

/* ---- what-if editor: tap words out, watch the score react (BERT route) ---- */
.occl-row { width: 100%; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
button.occl-chip { border: 0; cursor: pointer; font: inherit; color: inherit; }
button.occl-chip.on { background: rgba(196,67,43,.16); text-decoration: line-through; }
button.occl-chip.on i { color: #c4432b; }
.wi-hint { width: 100%; margin-top: .55rem; font-size: .78rem; color: var(--ink-soft); }
.wi-text { width: 100%; margin-top: .35rem; padding: .6rem .7rem; border-radius: 8px;
  background: rgba(0,0,0,.035); line-height: 1.85; font-size: .92rem; }
.wi-tok { cursor: pointer; padding: .06rem .14rem; border-radius: 4px; transition: background .12s; }
.wi-tok:hover { background: rgba(42,120,214,.14); }
.wi-tok.cue { box-shadow: inset 0 -2px 0 rgba(42,120,214,.45); }
.wi-tok.gone { text-decoration: line-through; color: #b3aca2; background: rgba(196,67,43,.10); }
.wi-meter { width: 100%; margin-top: .55rem; display: flex; gap: .5rem; align-items: baseline; font-size: .86rem; }
.wi-lab { color: var(--ink-soft); font-size: .78rem; }
.wi-from { font-weight: 700; }
.wi-to { font-weight: 700; }
.wi-to.down { color: #1d7a3e; }
.wi-to.up { color: #c4432b; }
.wi-n { color: var(--ink-soft); font-size: .78rem; }
.wi-reset { margin-left: auto; border: 0; background: none; cursor: pointer; font-size: .78rem;
  color: var(--ink-soft); text-decoration: underline; }
.wi-bar { width: 100%; height: 7px; margin-top: .35rem; border-radius: 4px;
  background: rgba(0,0,0,.07); position: relative; overflow: hidden; }
.wi-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; transition: width .35s; }
.wi-bar .wi-base { background: rgba(0,0,0,.12); }
.wi-bar .wi-now { background: #c4432b; }
.wi-bar .wi-now.down { background: #1d7a3e; }

/* ---- the LLM's own explanation (deferred / cross-check routes) ---- */
.llm-explain .llm-expl-text { margin: 0; padding: .15rem 0 .15rem .8rem;
  border-left: 3px solid rgba(42,120,214,.55); font-size: .95rem; line-height: 1.6; }
.llm-explain .llm-expl-note { margin: .55rem 0 0; font-size: .76rem; color: var(--ink-soft); }

/* ---- deferral-gate HUD inside the semantic map ---- */
.lens-gate { position: absolute; left: 14px; top: 62px; z-index: 4; max-width: 330px;
  padding: .65rem .8rem; border-radius: 10px; background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.14); box-shadow: 0 4px 18px rgba(0,0,0,.28);
  backdrop-filter: blur(3px); font-size: 12px; color: #2a2a2c; }
.lens-gate .lg-top { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; }
.lens-gate .lg-badge { font-weight: 700; }
.lens-gate.near .lg-badge { color: #128069; }
.lens-gate.mid .lg-badge { color: #a8761d; }
.lens-gate.far .lg-badge { color: #c4432b; }
.lens-gate .lg-num { color: #777; white-space: nowrap; }
.lens-gate .lg-num b { color: #1c1b19; }
.lens-gate .lg-track { position: relative; height: 8px; margin-top: .5rem; border-radius: 4px;
  overflow: visible; background: rgba(0,0,0,.06); }
.lens-gate .lg-zone-ok { position: absolute; inset: 0 auto 0 0; border-radius: 4px 0 0 4px;
  background: rgba(31,158,143,.45); }
.lens-gate .lg-zone-far { position: absolute; top: 0; bottom: 0; border-radius: 0 4px 4px 0;
  background: rgba(196,67,43,.35); }
.lens-gate .lg-theta { position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: #1c1b19; opacity: .7; }
.lens-gate .lg-marker { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%;
  transform: translate(-50%, -50%); background: #1c1b19; border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.lens-gate.far .lg-marker { animation: lg-pulse 2.2s ease-out infinite; }
@keyframes lg-pulse {
  0% { box-shadow: 0 0 0 1px rgba(196,67,43,.55); }
  70% { box-shadow: 0 0 0 6px rgba(196,67,43,0); }
  100% { box-shadow: 0 0 0 1px rgba(196,67,43,0); }
}
.lens-gate .lg-cap { margin-top: .45rem; color: #777; }
.lens-gate .lg-mixrow { margin-top: .35rem; display: flex; flex-wrap: wrap; gap: .3rem .6rem;
  color: #777; align-items: center; }
.lens-gate .lg-mix { display: inline-flex; align-items: center; gap: .28rem; color: #333; }
.lens-gate .lg-mix i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
@media (max-width: 640px) { .lens-gate { left: 8px; right: 8px; top: 58px; max-width: none; } }

/* ---- framing cast-list v2: quiet entity chips (the solid pills read too loud) ---- */
.framing { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.framing .framing-h { margin-bottom: 0; }
.cast-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.cast-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px 3px 8px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--surface-2);
  font-size: 12.5px; color: var(--ink); }
.cast-chip i { width: 8px; height: 8px; border-radius: 50%; align-self: center; flex: none; }
.cast-chip.eb-antagonist i { background: var(--e-antagonist); }
.cast-chip.eb-protagonist i { background: var(--e-protagonist); }
.cast-chip.eb-innocent i { background: var(--e-innocent); }
.cast-chip b { font-weight: 600; }
.cast-chip .cast-fine { font-size: 11px; color: var(--muted); }

/* ---- reliability badge is now a button that opens the semantic map ---- */
button.rel-badge { border: 0; font: inherit; cursor: pointer; }
button.rel-badge:hover { filter: brightness(0.97); }
.rel-badge .rel-more { margin-left: 4px; opacity: .45; font-size: 10px; }
button.rel-badge:hover .rel-more { opacity: .9; }

/* ---- what-if meter: pending (a re-score is in flight) ---- */
.wi-meter.pending .wi-to, .wi-meter.pending + .wi-bar .wi-now { opacity: .45; }
.wi-meter.pending .wi-to::after { content: "…"; }

/* ---- "decided by" model chip in the result header ---- */
.model-chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 9px;
  border-radius: 20px; font-size: 11.5px; border: 1px solid var(--line); }
.model-chip.enc { background: rgba(59,111,182,.08); }
.model-chip.llm { background: rgba(196,67,43,.09); border-color: rgba(196,67,43,.25); }
.model-chip b { font-weight: 600; }

/* ---- async second-opinion pill (LLM answer swaps in when ready) ---- */
.defer-pill { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 2px;
  padding: 6px 12px; border-radius: 20px; font-size: 12px; width: fit-content;
  background: rgba(224,160,48,.14); color: #7a5410; border: 1px solid rgba(224,160,48,.35); }
.defer-pill .proc-spin { width: 12px; height: 12px; border-width: 2px; }
