/* Copilot++: a dark calibration bench. Code is the hero; lime is the signal. */

:root {
  --bg: #0f1218;
  --bg-1: #151a21;
  --bg-2: #1b212a;
  --bg-3: #232a35;
  --code-bg: #0d1117;
  --line: #252c37;
  --line-2: #323a47;
  --text: #ecebe6;
  --text-2: #b3b8c2;
  --text-3: #7c8392;
  --accent: #c8f53c;
  --accent-2: #dcff6e;
  --accent-ink: #141a00;
  --accent-soft: rgba(200, 245, 60, 0.09);
  --accent-line: rgba(200, 245, 60, 0.6);
  --amber: #f5b83c;
  --amber-soft: rgba(245, 184, 60, 0.12);
  --coral: #ff7b6b;
  --coral-soft: rgba(255, 123, 107, 0.12);
  --mint: #7ee0c3;
  --violet: #a58bff;
  --violet-soft: rgba(165, 139, 255, 0.12);
  --violet-line: rgba(165, 139, 255, 0.55);
  --green: #3fb950;
  --red: #f85149;
  --radius: 16px;
  --radius-2: 11px;
  --radius-3: 7px;
  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-ui: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --width: 1180px;
}

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

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.035) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-color: rgba(200, 245, 60, 0.35);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--accent);
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  font-variant-ligatures: none;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(200, 245, 60, 0.28);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.muted {
  color: var(--text-3);
}

.small {
  font-size: 13px;
}

.boot {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 24px;
  color: var(--text-3);
  font-family: var(--font-display);
  font-size: 18px;
  text-align: center;
  animation: breathe 1.6s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.5;
  }
}

/* ------------------------------------------------------------------------------------------ */
/* Keycaps */

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.kbd + .kbd {
  margin-left: 3px;
}

.kbd-on-accent {
  border-color: rgba(20, 26, 0, 0.25);
  background: rgba(20, 26, 0, 0.12);
  color: var(--accent-ink);
}

/* ------------------------------------------------------------------------------------------ */
/* Buttons */

.btn-primary,
.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms var(--ease), background 120ms var(--ease), box-shadow 160ms var(--ease);
}

.btn-primary {
  height: 40px;
  padding: 0 10px 0 16px;
  font-size: 14.5px;
}

.btn-primary:hover,
.btn-start:hover {
  background: var(--accent-2);
}

.btn-primary:active,
.btn-start:active {
  transform: translateY(1px) scale(0.99);
}

.btn-primary.is-waiting {
  background: var(--bg-3);
  color: var(--text-3);
}

.btn-primary.is-waiting .kbd-on-accent {
  border-color: var(--line-2);
  background: var(--bg-2);
  color: var(--text-3);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: progress;
}

.btn-start {
  height: 56px;
  padding: 0 14px 0 24px;
  font-family: var(--font-display);
  font-size: 19px;
  box-shadow: 0 10px 40px -12px rgba(200, 245, 60, 0.55);
}

.btn-quiet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px 0 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease), border-color 120ms var(--ease);
}

.btn-quiet:hover:not(:disabled) {
  border-color: var(--line-2);
  background: var(--bg-2);
  color: var(--text);
}

.btn-quiet:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn-quiet.is-flagged {
  border-color: rgba(245, 184, 60, 0.45);
  background: var(--amber-soft);
  color: var(--amber);
}

.btn-small {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
}

.icon-btn:hover:not(:disabled) {
  background: var(--bg-3);
  color: var(--text);
}

.icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text-3);
  font-size: 13.5px;
  cursor: pointer;
}

.toggle.is-on {
  border-color: rgba(245, 184, 60, 0.4);
  background: var(--amber-soft);
  color: var(--amber);
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px 0 7px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.is-on {
  background: var(--bg-3);
  color: var(--text);
}

.seg-count {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ------------------------------------------------------------------------------------------ */
/* Top bar */

.app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(37, 44, 55, 0.7);
  background: rgba(15, 18, 24, 0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.brand {
  justify-self: start;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-plus {
  margin-left: 1px;
  color: var(--accent);
}

.brand-dot {
  color: var(--accent);
}

.brand-hosted {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

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

.tab {
  padding: 7px 14px;
  border-radius: 10px;
  color: var(--text-3);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: color 120ms var(--ease), background 120ms var(--ease);
}

.tab:hover {
  color: var(--text);
}

.tab.is-on {
  background: var(--bg-2);
  color: var(--text);
}

.topbar-right {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 16px;
  color: var(--text-3);
  font-size: 13.5px;
}

.topbar-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-streak {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 13px;
}

.streak-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-2);
}

.streak-dot.is-lit {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(200, 245, 60, 0.7);
}

.help-btn {
  font-family: var(--font-mono);
  font-weight: 600;
}

.pips {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pip {
  width: 34px;
  height: 6px;
  border-radius: 6px;
  background: var(--line);
  transition: background 300ms var(--ease), transform 300ms var(--ease);
}

.pip.is-done {
  background: var(--accent);
  animation: pip-pop 420ms var(--ease);
}

.pip.is-current {
  background: var(--text-3);
}

.pips-label {
  margin-left: 8px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

@keyframes pip-pop {
  40% {
    transform: scaleY(2);
  }
}

/* Knows-you meter */

.meter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.meter svg {
  display: block;
}

.meter-track {
  fill: none;
  stroke: var(--line);
}

.meter-fill {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 1100ms var(--ease);
}

.meter-text {
  color: var(--text-3);
  font-size: 13px;
}

.meter-text b {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 600;
}

.meter-big {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.meter-big small {
  color: var(--text-3);
  font-size: 18px;
}

/* ------------------------------------------------------------------------------------------ */
/* Layout */

.main {
  max-width: var(--width);
  margin: 0 auto;
  padding: 36px 28px 72px;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title {
  max-width: 17ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-num {
  color: var(--accent);
}

.hero-sub {
  max-width: 52ch;
  margin: 18px 0 28px;
  color: var(--text-2);
  font-size: 18px;
  text-wrap: pretty;
}

.page-head {
  margin-bottom: 28px;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-sub {
  margin: 6px 0 0;
  color: var(--text-2);
}

.empty {
  padding: 48px 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--text-3);
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.pill code {
  font-size: 11.5px;
}

.pill-topic {
  border-color: transparent;
  background: var(--bg-3);
  color: var(--text);
}

.pill-guess {
  border-color: var(--violet-line);
  color: var(--violet);
}

.pill-amber {
  border-color: rgba(245, 184, 60, 0.35);
  background: var(--amber-soft);
  color: var(--amber);
}

.pill-strong {
  border-color: rgba(200, 245, 60, 0.35);
  color: var(--accent);
}

.pill-mild {
  color: var(--text-2);
}

.pill-indifferent {
  color: var(--text-3);
  border-style: dashed;
}

/* ------------------------------------------------------------------------------------------ */
/* Lobby */

.lobby {
  display: grid;
  gap: 40px;
  animation: rise 360ms var(--ease);
}

.lobby-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 40px;
}

.lobby-top.has-digest {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr);
}

.lobby-hero {
  padding-top: 24px;
}

/* Since last time */

.digest {
  position: relative;
  align-self: center;
  padding: 18px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(165, 139, 255, 0.07), transparent 55%), var(--bg-1);
  animation: rise 420ms 80ms var(--ease) backwards;
}

.digest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.digest-head .eyebrow {
  margin: 0;
  color: var(--violet);
}

.digest-date {
  margin-left: 6px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.digest-dismiss {
  margin: -4px -8px 0 0;
  border-color: transparent;
  font-size: 18px;
}

.digest-title {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.digest-body {
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.55;
}

.digest-body ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding-left: 18px;
}

.digest-body li::marker {
  color: var(--violet);
}

.digest-body strong {
  color: var(--text);
}

.digest-body code {
  white-space: nowrap;
}

.md a code {
  border-color: rgba(200, 245, 60, 0.3);
  color: var(--accent);
}

.digest-more {
  display: inline-block;
  margin-top: 12px;
  color: var(--text-3);
  font-size: 13px;
}

.setlist ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setlist li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-2);
  background: var(--bg-1);
}

.setlist-num {
  width: 18px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 13px;
}

.setlist-title {
  flex: 1;
  font-weight: 600;
}

.tiles {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 12px;
}

.tile {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}

.tile-meter {
  display: flex;
  align-items: center;
  gap: 18px;
}

.tile-meter .meter {
  flex-direction: column;
  position: relative;
}

.tile-meter .meter-big {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 17px;
  white-space: nowrap;
}

.tile-meter .meter-big small {
  font-size: 11px;
}

.tile-label {
  margin: 0;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
}

.tile-value {
  margin: 4px 0 8px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tile-note {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 13px;
}

.tile-note a {
  color: var(--text-2);
}

.bar {
  height: 6px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--line);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--accent);
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13.5px;
}

.topic-chip b {
  margin-left: 4px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.warnings {
  border: 1px solid rgba(245, 184, 60, 0.25);
  border-radius: var(--radius-2);
  background: rgba(245, 184, 60, 0.05);
}

.warnings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: var(--amber);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.warn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.warnings-list {
  margin: 0;
  padding: 0 16px 4px 34px;
  color: var(--text-2);
  font-size: 13.5px;
}

.warnings-list ul {
  margin: 4px 0 10px;
  padding-left: 18px;
  color: var(--text-3);
}

.warnings .muted {
  margin: 0;
  padding: 0 16px 14px 34px;
}

.chev {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms var(--ease);
}

[aria-expanded="true"] > .chev {
  transform: rotate(-135deg) translate(-2px, 0);
}

/* ------------------------------------------------------------------------------------------ */
/* Question card */

.card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  animation: rise 280ms var(--ease);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.card-head {
  display: grid;
  gap: 10px;
  max-width: 900px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.meta-dim {
  color: var(--text-3);
  font-size: 12.5px;
}

.card-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.card-prompt {
  max-width: 72ch;
  color: var(--text-2);
  font-size: 17px;
  text-wrap: pretty;
}

.card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.card-nudge {
  margin: -8px 0 0;
  color: var(--amber);
  font-size: 14px;
}

.card-error {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: var(--radius-2);
  background: rgba(248, 81, 73, 0.08);
  color: #ffb3ad;
  font-size: 14px;
}

.hint {
  margin: 0;
  color: var(--text-3);
  font-size: 13px;
}

.hint .kbd {
  height: 20px;
  min-width: 20px;
  font-size: 11px;
}

.input-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

/* Why I'm asking */

.why {
  margin-top: 4px;
}

.why-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
}

.why-toggle:hover {
  background: var(--bg-2);
  color: var(--text);
}

.why-toggle .chev {
  margin-left: 4px;
}

.why-count {
  color: var(--text-3);
}

.why-body {
  max-width: 80ch;
  margin-top: 10px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: var(--bg-1);
  color: var(--text-2);
  font-size: 14.5px;
  animation: rise 200ms var(--ease);
}

.why-body .md > :first-child {
  margin-top: 0;
}

.why-body .md > :last-child {
  margin-bottom: 0;
}

.evidence {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.evidence li {
  display: grid;
  gap: 2px;
}

.evidence-quote {
  color: var(--text);
}

.evidence-meta {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* Markdown */

.md p {
  margin: 0 0 0.7em;
}

.md > :last-child {
  margin-bottom: 0;
}

.md code,
.md-inline code {
  padding: 0.12em 0.32em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--code-bg);
  color: #e6edf3;
  font-size: 0.86em;
}

.md .code code,
.md pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
}

.md pre {
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: var(--code-bg);
}

.md .code {
  margin: 0.8em 0;
}

/* ------------------------------------------------------------------------------------------ */
/* Code */

.code {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.68;
  font-variant-ligatures: none;
}

.code pre {
  margin: 0;
  padding: 14px 0;
  overflow-x: auto;
  background: var(--code-bg) !important;
  color: #e6edf3;
  font: inherit;
  tab-size: 2;
}

.code code {
  display: block;
  width: max-content;
  min-width: 100%;
  font: inherit;
  counter-reset: line var(--line-start, 0);
}

.code .line {
  display: inline-block;
  width: 100%;
  min-height: 1.68em;
  padding-right: 20px;
}

.code .line::before {
  content: counter(line);
  counter-increment: line;
  display: inline-block;
  width: 2.6em;
  margin-right: 18px;
  color: #3e4653;
  text-align: right;
  user-select: none;
}

.code .line.is-marked {
  background: rgba(245, 184, 60, 0.085);
  box-shadow: inset 2px 0 0 var(--amber);
}

.code .line.is-marked::before {
  color: var(--amber);
}

.code pre::-webkit-scrollbar {
  height: 12px;
}

.code pre::-webkit-scrollbar-thumb {
  border: 3px solid var(--code-bg);
  border-radius: 12px;
  background: var(--line-2);
}

.code pre::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

.code-compact {
  font-size: 12.5px;
}

.code-compact pre {
  padding: 9px 0;
}

/* ------------------------------------------------------------------------------------------ */
/* Options */

.opts {
  display: grid;
  gap: 8px;
  max-width: 900px;
}

.opts-code {
  max-width: none;
}

.opts-after-ab {
  max-width: none;
}

.opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: var(--bg-1);
  cursor: pointer;
  transition: border-color 120ms var(--ease), background 120ms var(--ease), transform 120ms var(--ease);
}

.opt:hover {
  border-color: var(--line-2);
  background: var(--bg-2);
}

.opt.is-selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.opt-key {
  flex: none;
  margin-top: 1px;
}

.opt.is-selected .opt-key,
.ab-card.is-selected .ab-keys .kbd:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  animation: key-pop 260ms var(--ease);
}

@keyframes key-pop {
  40% {
    transform: scale(1.18);
  }
}

.opt-body {
  display: grid;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.opt-label {
  font-size: 16px;
  font-weight: 600;
}

.opt-detail {
  color: var(--text-2);
  font-size: 14px;
}

.opt-other .opt-label {
  color: var(--text-2);
  font-weight: 500;
}

.other-input {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.other-input::placeholder {
  color: var(--text-3);
}

.check {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--line-2);
  border-radius: 6px;
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
}

.opt.is-selected .check {
  border-color: var(--accent);
  background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23141a00' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center / 18px no-repeat;
}

/* A/B */

.ab-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

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

.ab.is-stacked {
  grid-template-columns: minmax(0, 1fr);
}

.ab.is-small .code {
  font-size: 12.5px;
}

.ab-card {
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
  cursor: pointer;
  transition: border-color 140ms var(--ease), opacity 200ms var(--ease), transform 140ms var(--ease), box-shadow 200ms var(--ease);
}

.ab-card:hover {
  border-color: var(--line-2);
}

.ab-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 18px 50px -24px rgba(200, 245, 60, 0.45);
}

.ab-card.is-dimmed {
  opacity: 0.55;
}

.ab-card.is-dimmed:hover {
  opacity: 0.85;
}

.ab-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
}

.ab-letter {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--bg-3);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}

.ab-card.is-selected .ab-letter {
  background: var(--accent);
  color: var(--accent-ink);
}

.ab-label {
  flex: 1;
  font-size: 15.5px;
  font-weight: 600;
}

.ab-keys {
  display: inline-flex;
}

.ab-card .code {
  border-width: 1px 0 0;
  border-radius: 0;
}

.ab-card .code pre {
  padding: 16px 0 18px;
}

.ab-card .opt-detail {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

/* Rank */

.rank {
  display: grid;
  gap: 14px;
  max-width: 900px;
}

.rank-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-2);
  background: var(--accent-soft);
  cursor: grab;
  animation: rise 200ms var(--ease);
}

.rank-item.is-dragging {
  opacity: 0.4;
}

.rank-pos {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
}

.rank-actions {
  display: flex;
  gap: 4px;
}

.rank-key {
  margin-top: 4px;
}

.rank-slot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-2);
  color: var(--text-3);
  font-size: 14px;
}

.rank-slot .rank-pos {
  border: 1px dashed var(--line-2);
  background: transparent;
  color: var(--text-3);
}

.rank-pool {
  display: grid;
  gap: 8px;
}

/* Refactor */

.refactor {
  display: grid;
  gap: 10px;
}

.refactor-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.change-count {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.change-count .plus {
  color: var(--green);
}

.change-count .minus {
  color: var(--red);
}

.spacer {
  flex: 1;
}

.hint-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.editor-shell {
  position: relative;
}

/* Not .editor: Monaco uses that class for its own diff panes. */
.editor-host {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  box-shadow: 0 24px 60px -36px rgba(0, 0, 0, 0.9);
}

.editor-host.is-loading {
  height: 0;
  border: 0;
}

.editor-host:focus-within {
  border-color: var(--line-2);
  box-shadow: 0 0 0 1px rgba(200, 245, 60, 0.25), 0 24px 60px -36px rgba(0, 0, 0, 0.9);
}

.editor-loading {
  position: relative;
}

.editor-loading .code {
  border-radius: var(--radius);
  opacity: 0.6;
}

.editor-loading-note {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--text-3);
  font-size: 12.5px;
  animation: breathe 1.4s ease-in-out infinite;
}

.editor-fallback {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.code-textarea {
  display: block;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: var(--code-bg);
  color: #e6edf3;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  tab-size: 2;
}

.editor-plain {
  overflow: visible;
  border: 0;
  background: none;
  box-shadow: none;
}

.editor-plain:focus-within {
  box-shadow: none;
}

/* 16px keeps iOS from zooming in on focus; lines never wrap, the area scrolls sideways. */
.editor-plain .code-textarea {
  overflow-x: auto;
  font-size: 16px;
  line-height: 1.55;
  white-space: pre;
  overflow-wrap: normal;
}

.editor-note {
  margin: 8px 0 0;
  color: var(--text-3);
  font-size: 13px;
}

/* Rule and scale statements */

.statement {
  max-width: 900px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.statement code {
  font-size: 0.8em;
}

.word-diff {
  margin: 0;
}

.word-diff del {
  border-radius: 4px;
  background: rgba(248, 81, 73, 0.16);
  color: #ffaba5;
  text-decoration-color: rgba(255, 171, 165, 0.7);
}

.word-diff ins {
  border-radius: 4px;
  background: rgba(63, 185, 80, 0.2);
  color: #a6f0b2;
  text-decoration: none;
}

.tweak-input,
.text-answer {
  display: block;
  width: 100%;
  max-width: 900px;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-2);
  outline: 0;
  background: var(--bg-1);
  color: var(--text);
  font: inherit;
  font-size: 16.5px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 120ms var(--ease);
}

.tweak-input:focus,
.text-answer:focus {
  border-color: var(--accent-line);
}

.text-answer::placeholder {
  color: var(--text-3);
}

.verdicts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 900px;
}

.verdict {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: var(--bg-1);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms var(--ease), background 120ms var(--ease);
}

.verdict .kbd {
  grid-row: span 2;
}

.verdict:hover {
  border-color: var(--line-2);
  background: var(--bg-2);
}

.verdict-label {
  font-size: 16px;
  font-weight: 700;
}

.verdict-note {
  color: var(--text-3);
  font-size: 13px;
}

.verdict.is-selected .kbd {
  border-color: currentColor;
  background: currentColor;
}

.verdict-agree.is-selected {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.verdict-tweak.is-selected {
  border-color: rgba(245, 184, 60, 0.5);
  background: var(--amber-soft);
  color: var(--amber);
}

.verdict-disagree.is-selected {
  border-color: rgba(255, 123, 107, 0.5);
  background: var(--coral-soft);
  color: var(--coral);
}

.verdict.is-selected .verdict-note {
  color: inherit;
  opacity: 0.75;
}

.verdict.is-selected .kbd {
  color: var(--bg);
}

.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 900px;
}

.scale-step {
  --tone: var(--text-2);
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: var(--bg-1);
  cursor: pointer;
  transition: border-color 120ms var(--ease), background 120ms var(--ease);
}

.scale-0 {
  --tone: var(--coral);
}

.scale-1 {
  --tone: #e8a090;
}

.scale-2 {
  --tone: var(--text-2);
}

.scale-3 {
  --tone: #b6dd62;
}

.scale-4 {
  --tone: var(--accent);
}

.scale-step:hover {
  border-color: var(--line-2);
  background: var(--bg-2);
}

.scale-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--tone);
  border-radius: 50%;
  transition: transform 160ms var(--ease), background 160ms var(--ease);
}

.scale-0 .scale-dot,
.scale-4 .scale-dot {
  width: 20px;
  height: 20px;
}

.scale-label {
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}

.scale-step.is-selected {
  border-color: var(--tone);
  background: color-mix(in srgb, var(--tone) 10%, var(--bg-1));
}

.scale-step.is-selected .scale-dot {
  background: var(--tone);
  transform: scale(1.15);
}

.scale-step.is-selected .scale-label {
  color: var(--tone);
}

/* ------------------------------------------------------------------------------------------ */
/* Dock: confidence, note, flag, skip, submit. Always within reach. */

.dock {
  position: sticky;
  bottom: 16px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: rgba(21, 26, 33, 0.88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8);
}

.seg-confidence .conf-strong.is-on {
  background: var(--accent);
  color: var(--accent-ink);
}

.seg-confidence .conf-strong.is-on .kbd {
  border-color: rgba(20, 26, 0, 0.25);
  background: rgba(20, 26, 0, 0.12);
  color: var(--accent-ink);
}

.seg-confidence .conf-mild.is-on {
  background: rgba(200, 245, 60, 0.18);
  color: var(--accent);
}

.seg-confidence .conf-indifferent.is-on {
  background: var(--bg-3);
  color: var(--text);
}

.dock-note {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 180px;
}

.dock-note textarea {
  width: 100%;
  min-height: 40px;
  max-height: 140px;
  padding: 9px 40px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.45;
  resize: none;
}

.dock-note textarea:focus {
  border-color: var(--line-2);
}

.dock-note textarea::placeholder {
  color: var(--text-3);
}

.dock-note-key {
  position: absolute;
  top: 9px;
  right: 9px;
  pointer-events: none;
}

.dock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.flag-wrap {
  position: relative;
}

.flag-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  gap: 2px;
  width: 260px;
  padding: 8px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--bg-2);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
  animation: rise 160ms var(--ease);
}

.flag-menu-title {
  margin: 4px 8px 6px;
  color: var(--text-3);
  font-size: 12.5px;
}

.flag-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.flag-item:hover,
.flag-item.is-on {
  background: var(--amber-soft);
  color: var(--amber);
}

/* ------------------------------------------------------------------------------------------ */
/* Copilot's guess, revealed after submitting */

.reveal {
  flex-wrap: nowrap;
  gap: 16px;
  padding: 12px 12px 12px 14px;
  border-color: var(--violet-line);
  animation: reveal-in 360ms var(--ease);
}

.reveal-exact,
.reveal-close,
.reveal-same,
.reveal-merged {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 1px rgba(200, 245, 60, 0.12), 0 20px 60px -24px rgba(200, 245, 60, 0.35);
}

.reveal-differ {
  border-color: var(--violet-line);
}

@keyframes reveal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

.reveal-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--violet-soft);
  color: var(--violet);
  animation: badge-pop 520ms 60ms var(--ease) backwards;
}

.reveal-badge svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reveal-shown .reveal-badge svg {
  fill: currentColor;
  stroke-width: 1.5;
}

.reveal-exact .reveal-badge,
.reveal-close .reveal-badge,
.reveal-same .reveal-badge,
.reveal-merged .reveal-badge {
  background: var(--accent);
  color: var(--accent-ink);
}

.reveal-differ .reveal-badge {
  background: var(--violet-soft);
  color: var(--violet);
}

@keyframes badge-pop {
  from {
    opacity: 0;
    transform: scale(0.3) rotate(-30deg);
  }
  60% {
    transform: scale(1.18) rotate(6deg);
  }
}

.reveal-main {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.reveal-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 10px;
  margin: 0;
}

.reveal-verdict {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.reveal-exact .reveal-verdict,
.reveal-close .reveal-verdict,
.reveal-same .reveal-verdict,
.reveal-merged .reveal-verdict {
  color: var(--accent);
}

.reveal-differ .reveal-verdict {
  color: var(--violet);
}

.reveal-shown .reveal-verdict {
  color: var(--violet);
}

.reveal-guess {
  color: var(--text-2);
  font-size: 15px;
}

.reveal-pick strong {
  color: var(--text);
}

.reveal-conf {
  margin-left: 4px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 13px;
}

.reveal-why {
  margin: 0;
  color: var(--text-3);
  font-size: 14px;
  text-wrap: pretty;
}

.reveal-note {
  margin-left: 6px;
  color: var(--text-2);
}

.reveal-next {
  flex: none;
}

.guess-tag {
  display: inline-flex;
  flex: none;
  align-items: center;
  align-self: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px 0 7px;
  border: 1px solid var(--violet-line);
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  animation: badge-pop 420ms 120ms var(--ease) backwards;
}

.guess-spark {
  width: 10px;
  height: 10px;
  background: currentColor;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.verdict,
.scale-step {
  position: relative;
}

.verdict .guess-tag,
.scale-step .guess-tag {
  position: absolute;
  top: -11px;
  right: 10px;
  background: var(--bg-1);
}

.scale-step .guess-tag {
  right: 50%;
  transform: translateX(50%);
}

.card.is-revealed :is(.opt, .ab-card, .verdict, .scale-step, .rank-item) {
  cursor: default;
}

.card.is-revealed :is(.hint, .input-tools, .rank-actions, .rank-key) {
  display: none;
}

.card.is-revealed .opt:hover {
  border-color: var(--line);
  background: var(--bg-1);
}

.card.is-revealed .opt.is-selected:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.card.is-revealed :is(.opt, .ab-card, .verdict, .scale-step):has(.guess-tag):not(.is-selected) {
  border-style: dashed;
  border-color: var(--violet-line);
}

.card.is-revealed .ab-card.is-dimmed,
.card.is-revealed .ab-card.is-dimmed:hover {
  opacity: 0.5;
}

.card.is-revealed .ab-card.is-dimmed:has(.guess-tag) {
  opacity: 0.8;
}

.guess-diff-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  min-height: 32px;
}

.guess-diff-bar.is-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.diff-key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}

.diff-key::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.diff-key-guess::before {
  background: var(--violet);
}

.diff-key-yours::before {
  background: var(--accent);
}

.diff-key .change-count {
  margin-left: auto;
  font-weight: 400;
}

.editor-host.is-readonly {
  box-shadow: none;
}

.editor-host.is-readonly .monaco-editor .cursors-layer {
  display: none;
}

/* ------------------------------------------------------------------------------------------ */
/* Round complete */

.done {
  display: grid;
  gap: 32px;
  padding-top: 24px;
  animation: rise 420ms var(--ease);
}

.done-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
}

.done-stat {
  display: grid;
  gap: 2px;
  min-width: 130px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}

.done-stat b {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.done-stat span {
  color: var(--text-3);
  font-size: 13px;
}

.done-sub {
  margin: -14px 0 0;
}

.done-guessed {
  border-color: var(--accent-line);
  background: linear-gradient(160deg, rgba(200, 245, 60, 0.08), transparent 60%), var(--bg-1);
}

.done-guessed b small {
  color: var(--text-3);
  font-size: 20px;
  letter-spacing: -0.01em;
}

.done-dots {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}

.done-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  animation: badge-pop 360ms var(--ease) backwards;
}

.done-dots i:nth-child(2) {
  animation-delay: 80ms;
}

.done-dots i:nth-child(3) {
  animation-delay: 160ms;
}

.done-dots i:nth-child(4) {
  animation-delay: 240ms;
}

.done-dots i:nth-child(5) {
  animation-delay: 320ms;
}

.done-dots .is-hit {
  background: var(--accent);
}

.done-dots .is-miss {
  border: 1.5px solid var(--coral);
}

.guess-mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.guess-mark.is-hit {
  background: var(--accent);
}

.guess-mark.is-miss {
  background: var(--coral-soft);
}

.guess-mark.is-hit::before,
.guess-mark.is-miss::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--accent-ink);
  -webkit-mask: var(--glyph) center / contain no-repeat;
  mask: var(--glyph) center / contain no-repeat;
}

.guess-mark.is-hit::before {
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.guess-mark.is-miss::before {
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7l10 10M17 7L7 17' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background: var(--coral);
}

.done-meter {
  display: flex;
  align-items: center;
  gap: 16px;
}

.done-meter .meter {
  gap: 14px;
}

.recap {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recap-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-2);
  background: var(--bg-1);
  color: var(--text);
  text-decoration: none;
}

.recap-row:hover {
  background: var(--bg-2);
}

.recap-title {
  font-weight: 600;
}

.recap-answer {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.done-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.done-actions .btn-quiet {
  height: 56px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 16px;
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

/* ------------------------------------------------------------------------------------------ */
/* History */

.page {
  animation: rise 300ms var(--ease);
}

.history-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search input {
  width: 260px;
  height: 40px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--bg-1);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
}

.search input:focus {
  border-color: var(--line-2);
}

.search .kbd {
  position: absolute;
  right: 9px;
  pointer-events: none;
}

.history {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-2);
  background: var(--bg-1);
  color: var(--text);
  text-decoration: none;
  transition: background 120ms var(--ease), border-color 120ms var(--ease);
}

.history-row:hover {
  border-color: var(--line-2);
  background: var(--bg-2);
}

.history-main {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.history-title {
  font-weight: 650;
}

.history-answer {
  overflow: hidden;
  color: var(--text-2);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-side {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.history-when {
  width: 76px;
  color: var(--text-3);
  font-size: 12.5px;
  text-align: right;
}

/* ------------------------------------------------------------------------------------------ */
/* Learned */

.learned {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: start;
  gap: 28px;
}

.learned-nav {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 4px;
}

.learned-link {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--radius-2);
  color: var(--text-2);
  text-decoration: none;
}

.learned-link:hover {
  background: var(--bg-1);
  color: var(--text);
}

.learned-link.is-on {
  background: var(--bg-2);
  color: var(--text);
}

.learned-link-title {
  font-weight: 650;
}

.learned-link-news .learned-link-title::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 8px 2px 0;
  border-radius: 50%;
  background: var(--violet);
}

.digest-entry {
  padding: 22px 0 4px;
  border-top: 1px solid var(--line);
}

.digest-entry .eyebrow {
  margin: 0;
  color: var(--violet);
}

.digest-entry .digest-title {
  margin-top: 4px;
}

.learned-link-meta {
  color: var(--text-3);
  font-size: 12.5px;
}

.learned-doc {
  min-width: 0;
  padding: 28px 34px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}

.learned-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.learned-file {
  color: var(--text-3);
  font-size: 12.5px;
}

.learned-title {
  margin: 14px 0 6px;
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.learned-description {
  max-width: 70ch;
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 16.5px;
  text-wrap: pretty;
}

.prose {
  max-width: 78ch;
  font-size: 16px;
  line-height: 1.65;
}

.prose h1 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -0.03em;
}

.prose h2 {
  margin: 34px 0 10px;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.02em;
}

.prose h3 {
  margin: 24px 0 8px;
  font-size: 17px;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li {
  margin: 4px 0;
}

.prose li::marker {
  color: var(--accent);
}

.basis {
  margin: 10px 0 0;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
}

.basis code {
  padding: 0 0.25em;
  font-size: inherit;
}

.basis-label {
  margin-right: 6px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------------------------------ */
/* Help overlay */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 7, 10, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 160ms ease-out;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.overlay-panel {
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px 30px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: var(--bg-1);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
  animation: rise 220ms var(--ease);
}

.overlay-title {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.02em;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 36px;
}

.help-grid h3 {
  margin: 0 0 8px;
  color: var(--text-3);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.help-grid dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.help-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 12px;
}

.help-row dt {
  display: flex;
}

.help-row dd {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

.overlay-foot {
  margin: 22px 0 0;
  color: var(--text-3);
  font-size: 13px;
}

/* ------------------------------------------------------------------------------------------ */
/* Small screens */

/* ------------------------------------------------------------------------------------------ */
/* Hosted mode: team questions, the account, the admin's Team view, and the sign-in pages.     */
/* Mint marks the team, next to lime (you) and violet (Copilot's guess).                       */

:root {
  --mint-soft: rgba(126, 224, 195, 0.1);
  --mint-line: rgba(126, 224, 195, 0.55);
  --danger: #ff7b6b;
}

.pill-team {
  border-color: var(--mint-line);
  background: var(--mint-soft);
  color: var(--mint);
  font-weight: 650;
}

.pill-personal {
  border-style: dashed;
  color: var(--text-3);
}

.team-note {
  margin: 10px 0 0;
  color: var(--mint);
  font-size: 14px;
}

.reveal-team {
  align-items: flex-start;
  border-color: var(--mint-line);
  box-shadow: 0 0 0 1px rgba(126, 224, 195, 0.1), 0 20px 60px -24px rgba(126, 224, 195, 0.3);
}

.reveal-team .reveal-badge {
  background: var(--mint-soft);
  color: var(--mint);
}

.reveal-team .reveal-badge svg {
  stroke-width: 2;
}

.reveal-team .reveal-verdict {
  color: var(--mint);
}

.reveal-team .reveal-next {
  align-self: center;
}

.spread {
  display: grid;
  gap: 5px;
  margin: 8px 0 6px;
  padding: 0;
  list-style: none;
}

.spread-row {
  display: grid;
  grid-template-columns: minmax(120px, 15rem) minmax(80px, 1fr) 2.5ch;
  align-items: center;
  gap: 12px;
  color: var(--text-2);
  font-size: 14px;
}

.spread-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.spread-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
}

.spread-bar i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--text-3);
  transform-origin: left;
  animation: grow 520ms 80ms var(--ease) backwards;
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

.spread-count {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
}

.spread-row.is-mine {
  color: var(--text);
}

.spread-row.is-mine .spread-bar i {
  background: var(--mint);
}

.spread-you {
  flex: none;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 11.5px;
  font-weight: 650;
}

/* Top bar: who's signed in */

.me-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 120ms var(--ease), color 120ms var(--ease);
}

.me-chip:hover,
.me-chip.is-on {
  border-color: var(--line-2);
  color: var(--text);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-3);
  object-fit: cover;
}

.avatar-blank {
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.avatar-big {
  width: 56px;
  height: 56px;
  font-size: 24px;
}

/* Account */

.account {
  display: grid;
  gap: 28px;
  max-width: 760px;
}

.account .page-head {
  margin-bottom: 0;
}

.account-who {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}

.account-who p {
  margin: 0;
}

.account-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.account-signout {
  margin-left: auto;
}

.account-section .section-label {
  margin-bottom: 8px;
}

.account-copy {
  max-width: 64ch;
  margin: 0 0 14px;
  color: var(--text-2);
}

.account-empty {
  padding: 24px;
  text-align: left;
}

.account-notice {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--mint-line);
  border-radius: var(--radius-2);
  background: var(--mint-soft);
  color: var(--mint);
}

.tokens {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.token {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 12px 14px 12px 18px;
  border-radius: var(--radius-2);
  background: var(--bg-1);
}

.token-label {
  font-weight: 600;
}

.token .btn-quiet {
  margin-left: auto;
}

.account-privacy {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
}

.account-privacy b {
  color: var(--text);
  font-weight: 650;
}

.account-danger {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.btn-danger {
  border-color: rgba(255, 123, 107, 0.35);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  border-color: rgba(255, 123, 107, 0.6);
  background: var(--coral-soft);
  color: var(--danger);
}

.btn-primary.btn-danger-solid {
  background: var(--danger);
  color: #2a0905;
}

.btn-primary.btn-danger-solid.is-waiting {
  background: var(--bg-3);
  color: var(--text-3);
}

.confirm-delete {
  display: grid;
  gap: 12px;
  max-width: 480px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 123, 107, 0.45);
  border-radius: var(--radius);
  background: var(--coral-soft);
  animation: rise 200ms var(--ease);
}

.confirm-delete label {
  display: grid;
  gap: 8px;
  color: var(--text-2);
}

.confirm-delete input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
}

.confirm-delete input:focus {
  border-color: var(--danger);
}

.confirm-actions {
  display: flex;
  gap: 8px;
}

/* The admin's Team view */

.conventions {
  display: grid;
  gap: 12px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}

.convention {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
  cursor: pointer;
  transition: border-color 120ms var(--ease), box-shadow 160ms var(--ease);
}

.convention.is-selected {
  border-color: var(--mint-line);
  box-shadow: 0 0 0 1px rgba(126, 224, 195, 0.12), 0 18px 50px -28px rgba(126, 224, 195, 0.35);
  cursor: default;
}

.convention-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.convention-key {
  color: var(--text-3);
  font-size: 12.5px;
}

.pill-materiality-high {
  border-color: rgba(255, 123, 107, 0.4);
  color: var(--coral);
}

.pill-materiality-medium {
  border-color: rgba(245, 184, 60, 0.35);
  color: var(--amber);
}

.pill-recommend {
  margin-left: auto;
  font-weight: 650;
}

.pill-recommend-adopt {
  border-color: var(--mint-line);
  background: var(--mint-soft);
  color: var(--mint);
}

.pill-recommend-personal-only {
  border-style: dashed;
  color: var(--text-2);
}

.pill-recommend-discuss {
  border-color: rgba(245, 184, 60, 0.35);
  background: var(--amber-soft);
  color: var(--amber);
}

.convention-rule {
  font-size: 15.5px;
}

.convention-rule > :first-child {
  margin-top: 0;
}

.convention-rule > :last-child {
  margin-bottom: 0;
}

.convention-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.convention-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-3);
  font-size: 13px;
}

.convention-stat b {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.convention-reason {
  flex: 1 1 260px;
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

.convention .spread {
  max-width: 640px;
  margin: 0;
}

.convention-why {
  color: var(--text-2);
  font-size: 14px;
}

.convention-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.convention-actions .muted {
  margin-right: auto;
}

.team-files,
.team-questions {
  margin-bottom: 32px;
}

.team-files ul,
.team-questions ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.team-file,
.team-question {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 12px 10px 16px;
  border-radius: var(--radius-2);
  background: var(--bg-1);
}

.team-file .btn-quiet {
  margin-left: auto;
}

.team-question-title {
  font-weight: 600;
}

.team-question .pill-recommend {
  margin-left: auto;
}

.learned-nav-label {
  margin: 14px 12px 6px;
}

/* Sign-in pages (server-rendered) */

.gate {
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: calc(100vh - 64px);
  padding-top: 0;
  padding-bottom: 12vh;
  animation: rise 360ms var(--ease);
}

.gate .hero-sub {
  max-width: 56ch;
}

.gate-title {
  max-width: 14ch;
}

.gate-wordmark {
  display: flex;
  align-items: center;
  gap: 0.22em;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.04em;
}

.gate-wordmark .brand-mark {
  width: 0.9em;
  height: 0.9em;
  border-radius: 0.22em;
}

.gate-note {
  max-width: 56ch;
  margin: 22px 0 0;
  color: var(--text-3);
  font-size: 14px;
}

.gate .btn-start,
.gate .btn-quiet {
  text-decoration: none;
}

@media (max-width: 980px) {
  .tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .lobby-top.has-digest {
    grid-template-columns: minmax(0, 1fr);
  }

  .learned {
    grid-template-columns: 1fr;
  }

  .learned-nav {
    position: static;
  }

  .topbar-hint,
  .meter-compact .meter-text {
    display: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 16px;
  }

  .main {
    padding: 24px 16px 64px;
  }

  .tiles,
  .verdicts,
  .help-grid {
    grid-template-columns: 1fr;
  }

  .scale {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .scale-label {
    font-size: 11.5px;
  }

  .history-side .pill-topic,
  .hint-inline {
    display: none;
  }

  .dock {
    bottom: 8px;
  }

  .dock-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .reveal {
    flex-wrap: wrap;
  }

  .spread-row {
    grid-template-columns: minmax(90px, 9rem) minmax(60px, 1fr) 2.5ch;
  }

  .me-chip > span:not(.avatar) {
    display: none;
  }

  .guess-diff-bar.is-split {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

/* A shared question's author-only why, and the spread under the author's guess reveal. */
.why-author {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--line-2);
}

.why-author-label {
  display: block;
  margin-bottom: 2px;
  color: var(--text-3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reveal-spread {
  margin-top: 8px;
}

/* ------------------------------------------------------------------------------------------ */
/* Refactor focus, as-is, and the inline diff */

.focus-note {
  display: grid;
  gap: 4px;
  max-width: 900px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: var(--bg-1);
  font-size: 14.5px;
}

.focus-row {
  display: flex;
  gap: 10px;
  margin: 0;
  color: var(--text-2);
}

.focus-row b {
  flex: none;
  min-width: 5.5em;
  font-weight: 650;
}

.focus-in b {
  color: var(--accent);
}

.focus-out b {
  color: var(--text-3);
}

.as-is {
  border-color: var(--accent-line);
  color: var(--accent);
}

.diff-block .line::before {
  content: attr(data-sign);
  counter-increment: none;
  width: 1.4em;
  margin-right: 10px;
  text-align: center;
}

.diff-block .line.diff-del {
  background: rgba(255, 123, 107, 0.1);
}

.diff-block .line.diff-del::before {
  color: var(--coral);
}

.diff-block .line.diff-add {
  background: rgba(126, 231, 135, 0.1);
}

.diff-block .line.diff-add::before {
  color: var(--green);
}

.diff-takes .line.diff-del {
  background: var(--violet-soft);
  box-shadow: inset 3px 0 0 var(--violet);
}

.diff-takes .line.diff-add {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ------------------------------------------------------------------------------------------ */
/* Two takes: comparing a refactor with Copilot's, change by change */

.reconcile {
  display: grid;
  gap: 14px;
  scroll-margin-top: 80px;
  animation: reveal-in 320ms var(--ease);
}

.reconcile-head {
  display: grid;
  gap: 4px;
}

.reconcile-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0;
  color: var(--violet);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
}

.reconcile-count {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
}

.reconcile-dots {
  display: inline-flex;
  gap: 5px;
}

.reconcile-dots i {
  width: 16px;
  height: 5px;
  border-radius: 5px;
  background: var(--line);
}

.reconcile-dots i.is-done {
  background: var(--violet);
}

.reconcile-dots i.is-current {
  background: var(--text-3);
}

.reconcile-sub,
.reconcile-foot {
  margin: 0;
  color: var(--text-3);
  font-size: 14.5px;
  text-wrap: pretty;
}

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

.takes.is-stacked {
  grid-template-columns: minmax(0, 1fr);
}

.take {
  display: grid;
  align-content: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
  cursor: pointer;
  transition: border-color 140ms var(--ease), box-shadow 200ms var(--ease);
}

.take:hover {
  border-color: var(--line-2);
}

.take-static {
  cursor: default;
}

.take-copilot {
  border-style: dashed;
  border-color: var(--violet-line);
}

.take.is-selected {
  border-style: solid;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.take-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-weight: 650;
}

.take-copilot .take-label {
  color: var(--violet);
}

.take-empty {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
}

.take .code {
  border-width: 1px 0 0;
  border-radius: 0;
}

.take-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.take-choice-yours:hover:not(:disabled) {
  border-color: var(--accent-line);
  color: var(--accent);
}

.take-choice-copilot:hover:not(:disabled) {
  border-color: var(--violet-line);
  color: var(--violet);
}

.take-back {
  margin-left: auto;
}

.final-take {
  display: grid;
  gap: 10px;
  animation: reveal-in 320ms var(--ease);
}

.final-take-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
}

.final-take-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-3);
  font-family: var(--font-body, inherit);
  font-size: 13.5px;
  font-weight: 500;
}

.final-take-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--amber);
}

/* ------------------------------------------------------------------------------------------ */
/* Phones (iPhone-sized, 390px and up): compact header, nothing overlays code, big tap targets. */

@media (max-width: 680px) {
  .topbar {
    gap: 10px;
    height: 56px;
  }

  /* Outside a round, the tabs get their own row so every one fits and none is cut off. */
  .topbar:has(.tabs) {
    grid-template-columns: 1fr auto;
    grid-template-rows: 52px auto;
    height: auto;
    row-gap: 0;
  }

  .topbar:has(.tabs) .tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0 -6px;
    padding-bottom: 8px;
  }

  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .history-tools .seg {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .tab {
    padding: 7px 10px;
    white-space: nowrap;
  }

  .pips {
    gap: 4px;
    justify-self: center;
    min-width: 0;
  }

  .pip {
    width: 14px;
    height: 5px;
  }

  .pips-label {
    margin-left: 6px;
    font-size: 12px;
    white-space: nowrap;
  }

  .topbar-right {
    gap: 10px;
  }

  .topbar-streak,
  .help-btn,
  .topbar-hint {
    display: none;
  }

  .card {
    gap: 18px;
  }

  .card-title {
    font-size: 26px;
  }

  .card-prompt {
    font-size: 16px;
  }

  .code {
    font-size: 12.5px;
  }

  /* Nothing floats over code on a phone: the dock and reveals sit below it, in the flow. */
  .dock,
  .reveal {
    position: static;
    gap: 10px 12px;
    padding: 12px;
  }

  .reveal-badge {
    display: none;
  }

  .reveal-main {
    flex-basis: 100%;
  }

  .reveal-next {
    width: 100%;
    justify-content: center;
  }

  .dock .seg-confidence {
    width: 100%;
  }

  .dock .seg-confidence .seg-btn {
    flex: 1;
    justify-content: center;
  }

  .btn-quiet,
  .btn-primary,
  .seg-btn {
    min-height: 44px;
  }

  .btn-small {
    min-height: 36px;
  }

  .opt,
  .verdict {
    min-height: 48px;
  }

  .other-input {
    font-size: 16px;
  }

  .dock-note textarea {
    font-size: 16px;
  }

  .refactor-bar {
    gap: 8px 10px;
  }

  .takes {
    grid-template-columns: minmax(0, 1fr);
  }

  .take-actions .take-choice {
    flex: 1 1 30%;
    justify-content: center;
  }

  .take-back {
    margin-left: 0;
  }

  .focus-row {
    flex-direction: column;
    gap: 0;
  }
}

/* Touch screens have no keyboard shortcuts to show. */
@media (pointer: coarse) {
  .kbd:not(.opt-key, .rank-key),
  .key-hints,
  .hint {
    display: none;
  }
}
