/* Spermbook — chrome on white.
   Layout, spacing and type scale follow the reference app shell:
   40px top strip, 56px sticky header, 260px rail, 768px reading column. */

:root {
  --bg: #fbfbfc;
  --surface: #ffffff;
  --surface-2: #f1f2f5;
  --surface-3: #e9ebef;
  --line: #e4e6ea;
  --line-2: #d4d8de;
  --text: #16181d;
  --text-2: #3f444d;
  --muted: #767b85;
  --muted-2: #9aa0aa;
  --steel: #8c94a1;
  --steel-deep: #5a626e;
  --chrome: linear-gradient(180deg, #ffffff 0%, #eceef2 30%, #b9bfc9 50%, #e7eaee 62%, #fdfdfe 100%);
  --chrome-soft: linear-gradient(180deg, #ffffff 0%, #f3f4f7 45%, #e3e6eb 100%);
  --chrome-line: linear-gradient(90deg, transparent, #c8ccd4 20%, #eef0f3 50%, #c8ccd4 80%, transparent);
  --ok: #2f7d5f;
  --warn: #9a6b1f;
  --bad: #a2402f;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 31, 0.05), 0 8px 24px -16px rgba(20, 24, 31, 0.28);
  --strip-h: 40px;
  --head-h: 56px;
  --rail-w: 260px;
  --col: 768px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding-left: 20px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--steel-deep);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ------------------------------------------------------------ top strip */

.strip {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--strip-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--chrome-soft);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}

.strip-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--steel);
  box-shadow: 0 0 0 3px rgba(140, 148, 161, 0.18);
  flex: none;
}

.strip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip-link {
  flex: none;
  font-weight: 600;
  color: var(--steel-deep);
  border-bottom: 1px solid var(--line-2);
}

.strip-link:hover { color: var(--text); border-color: var(--steel); }

/* ------------------------------------------------------------ app shell */

.shell {
  position: fixed;
  inset: var(--strip-h) 0 0 0;
  display: flex;
}

.rail {
  width: var(--rail-w);
  flex: none;
  height: 100%;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.rail-head {
  height: var(--head-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.mark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.mark-badge {
  width: 26px; height: 26px;
  border-radius: 9px;
  background: var(--chrome);
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 #fff;
  flex: none;
}

.mark-badge svg { width: 16px; height: 16px; }

.wordmark {
  background: linear-gradient(180deg, #4a515c 0%, #9aa2ad 38%, #5f6772 52%, #b4bac3 72%, #6d747f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.35px;
}

.rail-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 20px;
  scrollbar-width: thin;
}

.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }

.nav-label {
  padding: 8px 10px 4px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.nav-item, .nav-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-item:hover, .nav-channel:hover { background: var(--surface-2); color: var(--text); }

.nav-item.is-on {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
}

.nav-primary {
  background: var(--chrome);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 1px 0 #fff;
  margin-bottom: 6px;
}

.nav-primary:hover { filter: brightness(1.02); }

.ico { width: 17px; height: 17px; flex: none; color: var(--muted); }
.nav-item.is-on .ico, .nav-primary .ico { color: var(--steel-deep); }

.nav-channel { justify-content: space-between; font-size: 13px; color: var(--muted); }
.nav-channel em { font-style: normal; font-size: 11px; color: var(--muted-2); }

.nav-foot {
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 16px;
  color: var(--muted-2);
}

.nav-foot p { margin-bottom: 6px; }

/* ------------------------------------------------------------ header */

.topbar {
  position: fixed;
  top: var(--strip-h);
  left: var(--rail-w);
  right: 0;
  z-index: 30;
  height: var(--head-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  background: rgba(251, 251, 252, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-mark { display: none; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  color: var(--muted);
}

.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
#burger { display: none; }

.topbar-title {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------ main column */

.scroller {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}

.column {
  width: 100%;
  max-width: var(--col);
  margin: 0 auto;
  padding: calc(var(--head-h) + 16px) 16px 96px;
}

/* ------------------------------------------------------------ hero */

.hero { padding: 24px 0 18px; text-align: center; }

.hero h1, .page-head h1, .entry-title, .profile h1 {
  font-size: 30px;
  line-height: 36px;
  font-weight: 600;
  letter-spacing: -0.75px;
}

.hero-sub {
  margin: 10px auto 0;
  max-width: 560px;
  font-size: 15px;
  line-height: 23px;
  color: var(--muted);
}

.page-head { padding: 12px 0 20px; }
.page-head .hero-sub { margin-left: 0; max-width: 620px; }
.page-head .btn { margin-top: 16px; }

h2 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 12px;
}

.section-action { font-size: 13px; color: var(--muted); }
.section-action:hover { color: var(--text); }

/* ------------------------------------------------------------ ask box */

.askbox { margin: 8px 0 24px; }

.askbox form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 10px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.askbox form:focus-within {
  border-color: var(--line-2);
  box-shadow: 0 1px 2px rgba(20, 24, 31, 0.06), 0 14px 30px -18px rgba(20, 24, 31, 0.4);
}

.askbox textarea {
  width: 100%;
  border: 0;
  outline: none;
  resize: vertical;
  min-height: 52px;
  background: none;
  font: inherit;
  color: var(--text);
  line-height: 24px;
}

.askbox textarea::placeholder { color: var(--muted-2); }

.askbox-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}

.askbox-note { font-size: 11px; line-height: 16px; color: var(--muted-2); }

.chip-scroll {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chip-scroll::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.chip:hover { background: var(--surface-3); color: var(--text); }
.chip.is-on { background: var(--chrome); color: var(--text); border-color: var(--line-2); font-weight: 600; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip-row .chip { cursor: default; white-space: normal; max-width: none; }

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.btn-primary {
  background: var(--chrome);
  color: var(--text);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(20, 24, 31, 0.08);
}

.btn-primary:hover { filter: brightness(1.03) contrast(1.02); }
.btn-primary:active { filter: brightness(0.98); }

.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ------------------------------------------------------------ faces + stats */

.faces {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
}

.faces::-webkit-scrollbar { display: none; }

.face {
  flex: none;
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
  text-align: center;
}

.face:hover { color: var(--text); }
.face:hover .avatar { transform: translateY(-2px); }

.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--chrome);
  border: 1px solid var(--line-2);
  color: var(--steel-deep);
  font-weight: 700;
  letter-spacing: -0.2px;
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(20, 24, 31, 0.08);
  transition: transform 0.16s ease;
  flex: none;
}

.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-md { width: 38px; height: 38px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 16px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 8px 0 20px;
  padding: 18px 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat { text-align: center; }

.stat-n {
  display: block;
  font-size: 26px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.6px;
}

.stat-n em { font-style: normal; font-size: 14px; color: var(--muted); margin-left: 2px; }

.stat-l {
  display: block;
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
}

.promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--chrome-soft);
  margin-bottom: 8px;
}

.promo strong { display: block; font-size: 14px; font-weight: 600; }
.promo span { display: block; font-size: 13px; line-height: 20px; color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------------------ cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card-link { display: block; transition: border-color 0.15s ease, transform 0.15s ease; }
.card-link:hover { border-color: var(--line-2); transform: translateY(-1px); }

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-text { display: flex; flex-direction: column; min-width: 0; }

.who-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.who-meta {
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-when { margin-left: auto; font-size: 11px; color: var(--muted-2); flex: none; }

.pill {
  margin-left: auto;
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
}

.card-title {
  font-size: 16px;
  line-height: 23px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 6px;
}

.card-title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.card-body { font-size: 15px; line-height: 24px; color: var(--text-2); }

.card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.tag {
  flex: none;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11px;
  line-height: 16px;
  color: var(--muted);
}

.tag:hover { background: var(--surface-3); color: var(--text); }

.react-row { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }

.react {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.react:hover { background: var(--surface-2); color: var(--text-2); }
.react.is-on { background: var(--chrome); border-color: var(--line-2); color: var(--text); }
.react-ico { width: 13px; height: 13px; flex: none; }
.react-n { font-variant-numeric: tabular-nums; }

.react-replies { font-size: 11px; color: var(--muted); }
.react-replies:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

.cites { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.cites-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
}

.cites ul, .plain { list-style: none; padding: 0; margin: 0; }
.cites li, .plain li { font-size: 12.5px; line-height: 20px; color: var(--muted); padding-left: 14px; position: relative; }
.cites li::before, .plain li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 1px;
  background: var(--line-2);
}

.plain li { font-size: 14px; line-height: 24px; color: var(--text-2); margin-bottom: 2px; }
.plain { margin-bottom: 12px; }

.fineprint { font-size: 11px; line-height: 16px; color: var(--muted-2); margin-top: 12px; }

.empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ------------------------------------------------------------ feed controls */

.feed-controls {
  position: sticky;
  top: var(--head-h);
  z-index: 5;
  margin: 0 -4px;
  padding: 10px 4px 8px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg) 88%, rgba(251, 251, 252, 0) 100%);
}

.tabs { display: flex; gap: 4px; }

.tab {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.is-on { background: var(--chrome); border-color: var(--line-2); color: var(--text); }

/* ------------------------------------------------------------ threads */

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

.reply { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.reply:first-child { border-top: 0; padding-top: 0; }
.reply-main { min-width: 0; }
.reply-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.reply p { font-size: 14px; line-height: 22px; color: var(--text-2); }

.thread { margin-top: 20px; }
.thread h2 { margin-bottom: 10px; }
.thread .reply:first-child { border-top: 1px solid var(--line); padding-top: 12px; }

.back {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

.back::before { content: '\2190'; margin-right: 6px; }
.back:hover { color: var(--text); }

.profile { padding: 8px 0 20px; }
.profile-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-bio { font-size: 15px; line-height: 24px; color: var(--text-2); max-width: 620px; }

.opener {
  margin: 14px 0 0;
  padding: 12px 16px;
  border-left: 2px solid var(--line-2);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px;
  line-height: 24px;
  color: var(--text-2);
}

.profile .btn { margin-top: 16px; }

.steps { margin: 12px 0 0; padding-left: 18px; }
.steps li { font-size: 14px; line-height: 23px; color: var(--text-2); margin-bottom: 8px; }
.steps li::marker { color: var(--muted-2); font-variant-numeric: tabular-nums; }

.turns { margin-top: 14px; }
.round .card-head { gap: 8px; }
.round .pill { margin-left: 0; }

.takeaway {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--chrome-soft);
  border: 1px solid var(--line);
}

.takeaway p { font-size: 14px; line-height: 22px; color: var(--text-2); }

/* ------------------------------------------------------------ decoder */

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-grid-2 { margin-top: 12px; }

.field { display: flex; flex-direction: column; gap: 5px; }

.field-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field-label em { font-style: normal; color: var(--muted-2); font-weight: 500; }

.field input[type='number'] {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
}

.field input[type='number']:focus { border-color: var(--steel); }
.field-hint { font-size: 11px; line-height: 16px; color: var(--muted-2); }

.field-check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  align-self: end;
  padding-bottom: 10px;
}

.field-check input { width: 16px; height: 16px; accent-color: var(--steel-deep); }

.form-foot { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

.meters { display: flex; flex-direction: column; gap: 14px; margin: 16px 0 4px; }

.meter-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.meter-head strong { font-weight: 600; font-variant-numeric: tabular-nums; }

.meter-track {
  position: relative;
  height: 6px;
  margin: 6px 0 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.meter-track span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--chrome);
  border-right: 1px solid var(--line-2);
}

.meter-limit {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 12px;
  background: var(--steel-deep);
  opacity: 0.55;
}

.meter-foot { font-size: 11px; color: var(--muted-2); }

.meter[data-status='within'] .meter-track span { background: linear-gradient(180deg, #d6ece0, #9cc9b3); }
.meter[data-status='below'] .meter-track span { background: linear-gradient(180deg, #f6e6c8, #dcb978); }
.meter[data-status='well-below'] .meter-track span { background: linear-gradient(180deg, #f3cec6, #d89286); }
.meter[data-status='below'] .meter-head strong { color: var(--warn); }
.meter[data-status='well-below'] .meter-head strong { color: var(--bad); }
.meter[data-status='within'] .meter-head strong { color: var(--ok); }
.meter[data-status='missing'] { opacity: 0.55; }

.derived {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.derived .stat-n { font-size: 22px; line-height: 28px; }

.notes { list-style: none; padding: 0; margin: 12px 0 0; }
.notes li {
  font-size: 13px;
  line-height: 20px;
  color: var(--text-2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.next { margin-top: 16px; }
.next ol { padding-left: 18px; }
.next li { font-size: 14px; line-height: 23px; color: var(--text-2); margin-bottom: 6px; }

.speakers { margin-top: 16px; }
.speaker-row { display: flex; flex-wrap: wrap; gap: 14px; }

.result[data-severity='high'] { border-color: #e3c4bd; }
.result[data-severity='mid'] { border-color: #e6d5b4; }
.result[data-severity='ok'] { border-color: #c4ddd0; }

/* ------------------------------------------------------------ answers */

.ask-answer { margin-top: 16px; }

.thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.dots { display: inline-flex; gap: 4px; }
.dots i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--steel);
  animation: pulse 1s infinite ease-in-out;
}
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.answer-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid #e0bdb4;
  background: #fdf3f1;
  color: #7c3626;
  font-size: 14px;
  line-height: 22px;
  margin-bottom: 12px;
}

.note-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 22px;
  color: var(--text-2);
}

.related { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.related .cites-label { width: 100%; margin-bottom: 0; }

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 16px;
  margin-bottom: 8px;
}

.faq summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted-2); font-weight: 400; }
.faq details[open] summary::after { content: '\2013'; }
.faq p { margin-top: 10px; font-size: 14px; line-height: 23px; color: var(--text-2); }

/* ------------------------------------------------------------ motion */

.fade-up {
  animation: fadeUp 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fade-up, .avatar, .card-link { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .rail {
    position: fixed;
    inset: var(--strip-h) auto 0 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(20, 24, 31, 0.12);
  }
  .drawer-open .rail { transform: none; }
  .drawer-open::after {
    content: '';
    position: fixed;
    inset: var(--strip-h) 0 0 0;
    background: rgba(20, 24, 31, 0.28);
    z-index: 45;
  }
  .topbar { left: 0; }
  .topbar-mark { display: flex; }
  #burger { display: grid; }
  .topbar-title { display: none; }
  .column { padding-top: calc(var(--head-h) + 12px); }
  .hero h1, .page-head h1, .entry-title, .profile h1 { font-size: 26px; line-height: 32px; }
}

@media (max-width: 560px) {
  .strip { font-size: 11px; gap: 8px; }
  .strip-text { max-width: 58vw; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .derived { grid-template-columns: minmax(0, 1fr); }
  .promo { flex-direction: column; align-items: flex-start; }
  .promo .btn { width: 100%; }
  .stats { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .stat { display: flex; align-items: baseline; justify-content: center; gap: 8px; text-align: left; }
  .card-foot { gap: 8px; }
  .react-row { margin-left: 0; width: 100%; }
  .askbox-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .askbox-foot .btn { width: 100%; }
}

/* Brand mark and X link */
.mark-svg { width: 26px; height: 26px; flex: none; filter: drop-shadow(0 1px 1px rgba(20, 24, 31, 0.12)); }
.topbar-mark .mark-svg { width: 24px; height: 24px; }
.btn-ico { width: 14px; height: 14px; flex: none; }
.promo-actions { display: flex; gap: 8px; flex: none; }
.link { color: var(--steel-deep); border-bottom: 1px solid var(--line-2); }
.link:hover { color: var(--text); border-color: var(--steel); }
.nav-item .ico[fill='currentColor'] { width: 15px; height: 15px; }
@media (max-width: 560px) {
  .promo-actions { width: 100%; flex-direction: column; }
  .promo-actions .btn { width: 100%; }
}

/* Phones: the rail already carries the decoder link, so the header keeps the icons */
@media (max-width: 620px) {
  .topbar-actions .btn-ghost { display: none; }
}

/* Contract address pill */
.ca-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 26px;
  padding: 0 4px 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--chrome);
  box-shadow: inset 0 1px 0 #fff;
  cursor: pointer;
  font-size: 11px;
  max-width: 100%;
  min-width: 0;
  transition: filter 0.14s ease;
}
.ca-pill:hover { filter: brightness(1.03) contrast(1.02); }
.ca-sym { font-weight: 800; letter-spacing: -0.2px; color: var(--text); flex: none; }
.ca-pill code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ca-pill em {
  font-style: normal;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  flex: none;
}
.ca-pill.is-copied em { color: var(--ok); border-color: #bfdccd; }
.ca-full { height: 32px; }
.strip-ca:empty { display: none; }
.strip.has-ca { justify-content: flex-start; gap: 12px; }
.strip.has-ca .strip-text { flex: 1; text-align: right; }
.token-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

@media (max-width: 860px) {
  .strip.has-ca .strip-text,
  .strip.has-ca .strip-dot { display: none; }
  .strip.has-ca { justify-content: space-between; }
}
