/* Synapse clinical-chart tokens.
   Light palette from lib/app/theme/app_theme.dart.
   One set, shared by every phone frame. */

:root {
  --background: hsl(180, 14%, 96%);
  --foreground: hsl(202, 38%, 12%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(202, 38%, 12%);
  --primary: hsl(182, 62%, 27%);
  --primary-hover: hsl(182, 62%, 23%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(182, 22%, 92%);
  --secondary-foreground: hsl(182, 62%, 27%);
  --muted: hsl(190, 16%, 93%);
  --muted-foreground: hsl(202, 14%, 42%);
  --destructive: hsl(9, 78%, 56%);
  --destructive-text: hsl(9, 68%, 34%);
  --destructive-foreground: hsl(0, 0%, 100%);
  --border: hsl(186, 18%, 87%);
  --ring: hsl(182, 62%, 27%);
  --streak: hsl(38, 80%, 54%);
  --streak-foreground: hsl(38, 80%, 14%);
  --success: hsl(152, 48%, 38%);
  --success-foreground: hsl(0, 0%, 100%);
  --hero-start: hsl(206, 46%, 15%);
  --hero-end: hsl(202, 56%, 8%);
  --hero-trace: hsl(174, 68%, 56%);
  --hero-foreground: hsl(0, 0%, 100%);
  --hero-muted: hsl(180 18% 92% / 0.72);
  --hero-line: hsl(180 20% 100% / 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-xl: 16px;
  --radius-pill: 28px;
  --shadow-hero: inset 0 1px 0 hsl(180 20% 100% / 0.16), 0 12px 28px hsl(202 56% 8% / 0.16);
  --shadow-phone: 0 0 0 1px hsl(186 18% 80%), 0 16px 32px hsl(202 46% 15% / 0.1);
  --font-ui: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, monospace;
  --space-screen: 20px;
  --z-skip: 4;
  --z-phone: 1;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--muted);
  background-image: radial-gradient(hsl(202 38% 12% / 0.035) 0.55px, transparent 0.55px);
  background-size: 3px 3px;
  color: var(--foreground);
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
ul,
figure {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus {
  outline: none;
}

button:focus-visible,
summary:focus-visible,
.skip:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

::selection {
  background: hsl(182 62% 27% / 0.18);
  color: var(--foreground);
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: var(--z-skip);
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.board {
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px 32px 72px;
}

.intro {
  max-width: 68ch;
  margin-bottom: 40px;
  padding: 20px 22px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.intro h1 {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-wrap: balance;
}

.note {
  max-width: 65ch;
  font-size: 15px;
  line-height: 1.6;
  text-wrap: pretty;
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, 390px);
  gap: 48px 36px;
  justify-content: start;
}

.shot {
  width: 390px;
}

.shot-label {
  margin: 0 0 10px 4px;
  font-size: 13px;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.01em;
}

.phone {
  position: relative;
  z-index: var(--z-phone);
  width: 390px;
  height: 844px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 32px;
  padding-top: 14px;
  background-color: var(--background);
  background-image: radial-gradient(hsl(202 38% 12% / 0.04) 0.55px, transparent 0.55px);
  background-size: 3px 3px;
  box-shadow: var(--shadow-phone);
  color: var(--foreground);
}

.clock {
  flex: none;
  margin: 0;
  padding: 2px var(--space-screen) 0;
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--muted-foreground);
}

.phone-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px var(--space-screen) 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.phone-foot {
  flex: none;
  padding: 0 var(--space-screen) 8px;
}

.phone-foot.has-actions {
  border-top: 1px solid var(--border);
  padding: 12px var(--space-screen) 6px;
}

.home-indicator {
  width: 128px;
  height: 4px;
  margin: 8px auto;
  border-radius: var(--radius-pill);
  background: hsl(202 18% 28% / 0.16);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

.screen-head {
  margin-bottom: 14px;
}

.screen-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
}

.screen-sub {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted-foreground);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 32px;
  margin: 0 0 6px -4px;
  padding: 0 4px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

.back svg {
  transform: translateY(0.5px);
}

.back:hover {
  color: var(--primary-hover);
}

.back:active {
  transform: scale(0.98);
}

.icon {
  width: 16px;
  height: 16px;
  display: block;
  flex: none;
}

.data {
  font-family: var(--font-data);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 500;
}

.data-lg {
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px 13px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: background-color 200ms ease, transform 200ms ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-block {
  width: 100%;
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  transition: color 200ms ease, transform 200ms ease;
}

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

.btn-text:active {
  transform: scale(0.98);
}

.btn-text.quiet {
  color: var(--muted-foreground);
  font-weight: 500;
}

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

.section {
  margin-top: 18px;
}

.appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 14px;
}

.mark {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--primary);
}

.streak-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px 6px;
  border-radius: var(--radius-pill);
  background: var(--streak);
  color: var(--streak-foreground);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.streak-pill .kicker {
  font-weight: 500;
}

.streak-pill .data {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.streak-pill.lg {
  padding: 6px 11px 7px;
}

.streak-pill.lg .data {
  font-size: 14px;
}

.hero {
  padding: 16px 16px 14px;
  border-radius: var(--radius);
  background:
    radial-gradient(90% 80% at 100% -8%, hsl(182 42% 30% / 0.5), transparent 58%),
    linear-gradient(168deg, var(--hero-start) 0%, var(--hero-end) 74%);
  box-shadow: var(--shadow-hero);
  color: var(--hero-foreground);
}

.greeting {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
}

.trace {
  display: block;
  width: 100%;
  height: 28px;
  margin: 12px 0 10px;
  color: var(--hero-trace);
}

.hero-rule {
  height: 1px;
  margin-bottom: 12px;
  background: var(--hero-line);
}

.vitals {
  display: grid;
  grid-template-columns: 0.82fr 1.25fr 0.68fr;
}

.vital {
  min-width: 0;
}

.vital + .vital {
  padding-left: 12px;
  box-shadow: inset 1px 0 0 var(--hero-line);
}

.vital-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--hero-foreground);
}

.vital-value .data {
  font-size: 22px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.vital-sub {
  font-size: 12px;
  color: var(--hero-muted);
}

.vital.is-flagged .vital-value .data {
  color: var(--destructive);
}

.vital-label {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.25;
  color: var(--hero-muted);
}

.list {
  overflow: hidden;
}

.list li + li {
  border-top: 1px solid var(--border);
}

.row {
  display: flex;
  width: 100%;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  text-align: left;
  transition: background-color 200ms ease, transform 200ms ease;
}

.row:hover {
  background: var(--muted);
}

.row:active {
  transform: scale(0.98);
}

.row-lead {
  background: var(--secondary);
}

.row-lead:hover {
  background: hsl(182, 22%, 88%);
}

.row-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.focus {
  padding: 12px 14px 13px;
}

.focus-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
}

.focus .data {
  font-size: 13px;
}

.meter {
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--muted);
}

.meter .fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.meter-strong {
  height: 8px;
  margin-top: 12px;
}

.meter-quiet {
  height: 3px;
  margin-top: 8px;
}

.fill-35 { width: 35%; }
.fill-42 { width: 42%; }
.fill-51 { width: 51%; }
.fill-58 { width: 58%; }
.fill-64 { width: 64%; }
.fill-68 { width: 68%; }
.fill-71 { width: 71%; }

.is-teal { background: var(--primary); }
.is-coral { background: var(--destructive); }
.is-amber { background: var(--streak); }
.is-success { background: var(--success); }

.block + .block,
.findings .block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.pad {
  padding: 14px 14px 16px;
}

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

.chip {
  min-height: 36px;
  padding: 7px 12px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--background);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.chip:hover {
  background: var(--muted);
}

.chip:active {
  transform: scale(0.98);
}

.chip[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

.chip[aria-pressed="true"]:hover {
  background: var(--primary-hover);
}

.segment {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--background);
}

.segment button {
  min-height: 36px;
  border-radius: var(--radius-pill);
  padding: 8px 4px 9px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.segment button:hover {
  color: var(--foreground);
}

.segment button:active {
  transform: scale(0.98);
}

.segment button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-foreground);
}

.segment button[aria-pressed="true"]:hover {
  background: var(--primary-hover);
  color: var(--primary-foreground);
}

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

.countline .eyebrow {
  margin: 0;
}

.count {
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.value {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.action-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.q-label {
  font-size: 13px;
  font-weight: 600;
}

.timer {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

.stem {
  margin: 16px 0 18px;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.55;
  text-wrap: pretty;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 12px 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  text-align: left;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  transition: background-color 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.choice:hover {
  background: var(--muted);
}

.choice:active {
  transform: scale(0.98);
}

.choice[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--secondary);
}

.choice[aria-pressed="true"]:hover {
  background: hsl(182, 22%, 88%);
}

.key {
  padding-top: 1px;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.choice[aria-pressed="true"] .key {
  color: var(--primary);
  font-weight: 600;
}

.action-inline {
  display: flex;
  align-items: center;
  gap: 2px;
}

.action-inline .btn-primary {
  margin-left: auto;
  min-width: 104px;
}

.flag-btn .icon {
  color: var(--muted-foreground);
  transition: color 200ms ease;
}

.flag-btn:hover .icon {
  color: var(--destructive);
}

.stack-gap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mastery-card,
.findings,
.split {
  padding: 14px 14px 16px;
}

.split {
  display: grid;
  grid-template-columns: 0.92fr 1.15fr;
  gap: 14px;
}

.split > div + div {
  padding-left: 14px;
  box-shadow: inset 1px 0 0 var(--border);
}

.split-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 14px;
  line-height: 1.45;
}

.meter-follow {
  margin-top: 10px;
}

.split-value .data.attempts {
  font-size: 22px;
  letter-spacing: -0.03em;
  line-height: 1;
}

.best {
  color: var(--muted-foreground);
}

.meter-caption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.meter-caption .data {
  color: var(--foreground);
  font-size: 12px;
  font-weight: 600;
}

.risk-line {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

.risk-high {
  color: var(--destructive-text);
  font-weight: 600;
}

.risk-rule {
  height: 4px;
  margin-top: 10px;
  border-radius: var(--radius-pill);
  background: var(--destructive);
}

.ready-label {
  position: relative;
  height: 16px;
  margin-top: 10px;
  font-family: var(--font-data);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
}

.ready-label span {
  position: absolute;
  left: 75%;
  transform: translateX(-50%);
}

.meter-ready {
  position: relative;
  height: 8px;
  overflow: visible;
}

.tick {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  border-radius: 1px;
  background: var(--foreground);
}

.tick-75 {
  left: 75%;
}

.disclosure {
  margin-top: 12px;
}

.disclosure summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.disclosure summary::-webkit-details-marker {
  display: none;
}

.disclosure summary .chev {
  transition: transform 200ms ease;
}

.disclosure[open] summary .chev {
  transform: rotate(180deg);
}

.disclosure p {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-wrap: pretty;
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
