/* ============================================================================
   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);
}

.input-lang {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-lang label {
  font-size: 12px;
  color: var(--muted);
}

.input-lang select {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
}

.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;
}

.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);
}

.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;
}

/* ================================================================ 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;
  }

  .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;
}

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

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #6c757d;
  border-color: #6c757d;
}