/* ========================================================================
   CKA Practice Lab — Utilitarian design system
   Warm off-white parchment · hairline rules · IBM Plex Sans + JetBrains Mono
   One steel-blue accent. No gradients, minimal shadows, square edges.
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  /* surfaces */
  --bg:           #f4f3ed;         /* warm parchment */
  --surface:      #ffffff;
  --surface-2:    #fafaf5;
  --surface-3:    #efeee7;
  --tint:         #e9e7dd;

  /* line */
  --line:         #d9d6cb;
  --line-2:       #c2bfb2;
  --line-strong:  #1a1a17;

  /* ink */
  --ink:          #18181a;
  --ink-2:        #36352f;
  --ink-3:        #5a5851;
  --muted:        #7e7c72;
  --muted-2:      #9b998f;

  /* accent — steel blue, single-hue family */
  --accent:       oklch(0.46 0.12 248);
  --accent-ink:   oklch(0.32 0.10 248);
  --accent-soft:  oklch(0.96 0.025 248);
  --accent-line:  oklch(0.85 0.05 248);

  /* status (chroma matched, hue varied) */
  --ok:           oklch(0.50 0.11 148);
  --ok-soft:      oklch(0.96 0.03 148);
  --warn:         oklch(0.62 0.13 75);
  --warn-soft:    oklch(0.96 0.04 80);
  --danger:       oklch(0.52 0.18 28);
  --danger-soft:  oklch(0.96 0.03 28);

  /* type */
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius:       2px;
  --radius-lg:    3px;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Layout primitives ─────────────────────────────────────────────────── */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px 1fr; }
.app-main { padding: 0; overflow: auto; }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 16px 16px;
  display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px 16px;
  border-bottom: 1px dashed var(--line);
}
.side-brand .mark {
  width: 28px; height: 28px;
  background: var(--ink); color: var(--bg);
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
  border-radius: 6px;
  letter-spacing: -0.02em;
}
.side-brand .name {
  font-weight: 600; font-size: 16px;
  letter-spacing: -0.005em;
}
.side-brand .sub {
  font-family: var(--mono); font-size: 12px;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 1px;
}
.ws-nav {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  margin: -12px 4px -2px;
}
.ws-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
}
.ws-back:hover { color: var(--ink); text-decoration: none; }
.ws-current {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid var(--accent-line);
}
.ws-current::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.side-section {
  display: flex; flex-direction: column; gap: 2px;
}
.side-section h3 {
  margin: 0 8px 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
}
.nav-btn {
  border: 0; background: transparent;
  color: var(--ink-2); text-align: left;
  padding: 8px 10px;
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  cursor: pointer; border-radius: var(--radius);
  display: flex; align-items: center; gap: 9px;
  position: relative;
}
.nav-btn::before {
  content: ''; width: 4px; height: 4px;
  background: var(--line-2); border-radius: 50%;
  flex-shrink: 0;
}
.nav-btn:hover { background: var(--surface-3); color: var(--ink); }
.nav-btn.active {
  background: var(--ink); color: #fff;
}
.nav-btn.active::before { background: var(--accent); }

.discord-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.discord-mark {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--accent-ink);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.discord-mark svg {
  width: 13px;
  height: 13px;
  display: block;
  fill: currentColor;
}
.discord-link:hover .discord-mark {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.side-meta {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  color: var(--muted);
}
.side-meta .row { display: flex; justify-content: space-between; }
.side-meta .row .v { color: var(--ink-2); }

/* ── Topline ───────────────────────────────────────────────────────────── */
.topline {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.topline .crumb {
  font-family: var(--mono); font-size: 13px;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.topline h1 {
  margin: 0; font-size: 25px; font-weight: 600;
  letter-spacing: -0.015em;
}
.topline .sub {
  margin-top: 4px; color: var(--muted); font-size: 15px;
}
.topline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  border: 1px solid var(--line-strong);
  background: var(--ink); color: #fff;
  padding: 8px 14px;
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  display: inline-flex; align-items: center; gap: 7px;
  letter-spacing: -0.005em;
  transition: background .12s;
}
.btn:hover { background: var(--ink-2); }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn-ghost:hover { background: var(--surface-3); border-color: var(--line-strong); }

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-soft); }

.btn-sm { padding: 5px 10px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Surface / Panel ───────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel-pad { padding: 18px 20px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.panel-head h2 {
  margin: 0; font-size: 14px; font-weight: 600;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-2);
}
.panel-head .meta {
  font-family: var(--mono); font-size: 13px; color: var(--muted);
}
.panel-body { padding: 18px 20px; }
.panel-body.flush { padding: 0; }

/* ── Section grid ──────────────────────────────────────────────────────── */
.section { padding: 22px 28px; }
.grid { display: grid; gap: 16px; }
.grid-stats { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: minmax(280px, 380px) 1fr; align-items: start; }
.profile-panel { max-width: 760px; }

/* ── Stat card ─────────────────────────────────────────────────────────── */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
}
.stat-label {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em;
}
.stat-value {
  margin-top: 14px;
  font-family: var(--mono); font-size: 34px; font-weight: 500;
  color: var(--ink); letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
  line-height: 1;
}
.stat-value .unit { color: var(--muted); font-size: 21px; margin-left: 2px; }
.stat-note {
  margin-top: 8px;
  font-size: 13px; color: var(--muted);
  font-family: var(--mono);
}
.stat .marker {
  position: absolute; top: 0; left: 18px;
  width: 24px; height: 2px; background: var(--ink);
}
.stat.readiness-low {
  border-color: color-mix(in oklch, var(--danger) 55%, var(--line));
  background: color-mix(in oklch, var(--danger-soft) 62%, var(--surface));
}
.stat.readiness-mid {
  border-color: color-mix(in oklch, var(--warn) 55%, var(--line));
  background: color-mix(in oklch, var(--warn-soft) 62%, var(--surface));
}
.stat.readiness-ready {
  border-color: color-mix(in oklch, var(--ok) 55%, var(--line));
  background: color-mix(in oklch, var(--ok-soft) 62%, var(--surface));
}
.stat.readiness-low .marker { background: var(--danger); }
.stat.readiness-mid .marker { background: var(--warn); }
.stat.readiness-ready .marker { background: var(--ok); }
.stat.readiness-low .stat-value { color: var(--danger); }
.stat.readiness-mid .stat-value { color: var(--warn); }
.stat.readiness-ready .stat-value { color: var(--ok); }
.stat:nth-child(2) .marker { background: var(--accent); }
.stat:nth-child(3) .marker { background: var(--ok); width: 16px; }
.stat:nth-child(4) .marker { background: var(--line-2); width: 8px; }

/* ── Definition rows ───────────────────────────────────────────────────── */
.def-row {
  display: grid; grid-template-columns: 120px 1fr;
  gap: 12px; padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
  align-items: baseline;
}
.def-row:last-child { border-bottom: 0; }
.def-label {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
}
.def-value { color: var(--ink); font-weight: 500; }

/* ── Attempt / table rows ──────────────────────────────────────────────── */
.row-table { display: flex; flex-direction: column; }
.row-head, .attempt-row {
  display: grid;
  grid-template-columns: 60px 1fr 90px 80px 90px;
  gap: 14px; align-items: center;
  padding: 10px 18px;
}
.row-head {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em;
}
.attempt-row {
  border-bottom: 1px solid var(--line);
  font-size: 15px; cursor: pointer;
  transition: background .1s;
}
.attempt-row:last-child { border-bottom: 0; }
.attempt-row:hover { background: var(--surface-2); }
.attempt-row .idx {
  font-family: var(--mono); font-size: 14px; color: var(--muted);
}
.attempt-row .meta {
  font-family: var(--mono); font-size: 14px; color: var(--ink-2);
  min-width: 0;
}
.attempt-row .meta .sub {
  display: block; font-size: 13px; color: var(--muted); margin-top: 2px;
}
.attempt-row > div { min-width: 0; }
.score-cell {
  font-family: var(--mono); font-weight: 500; font-size: 16px;
  font-feature-settings: 'tnum';
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.score-cell::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-2);
}
.score-cell.pass::before { background: var(--ok); }
.score-cell.fail::before { background: var(--danger); }

.status-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: var(--radius);
  border: 1px solid currentColor;
  background: transparent;
}
.status-tag.ok    { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.status-tag.warn  { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.status-tag.danger{ color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.status-tag.muted { color: var(--muted); border-color: var(--line); }

.status-pass { color: var(--ok); font-family: var(--mono); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.status-review { color: var(--warn); font-family: var(--mono); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

.score-pill {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 500; font-size: 15px;
  font-feature-settings: 'tnum';
  padding: 3px 8px;
  background: var(--ink); color: #fff;
  border-radius: var(--radius);
  letter-spacing: -0.01em;
}

/* expanded attempt detail */
.attempt-detail {
  display: none;
  padding: 0 18px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.attempt-detail.open { display: block; }
.q-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; align-items: start;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left-width: 3px;
  margin-top: 10px;
  border-radius: var(--radius);
  font-size: 15px;
}
.q-row.correct { border-left-color: var(--ok); }
.q-row.partial { border-left-color: var(--warn); }
.q-row.wrong   { border-left-color: var(--danger); }
.q-title { font-weight: 600; color: var(--ink); }
.q-status {
  font-family: var(--mono); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap;
}
.q-status.correct { color: var(--ok); }
.q-status.partial { color: var(--warn); }
.q-status.wrong   { color: var(--danger); }
.q-body {
  display: none;
  padding: 0 14px 14px;
}
.q-body.open { display: block; }
.q-chevron {
  font-size: 13px; color: var(--muted); margin-left: 6px;
  display: inline-block; transition: transform 0.15s;
}
.review-block {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.review-block.solution {
  background: var(--surface);
  border-left: 3px solid var(--accent);
}
.review-label {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.review-md {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.65;
}
.review-md p { margin: 8px 0; }
.review-md p:first-child { margin-top: 0; }
.review-md p:last-child { margin-bottom: 0; }
.review-md ul { margin: 8px 0; padding-left: 20px; }
.review-md li { margin: 4px 0; }
.review-md strong { color: var(--ink); font-weight: 600; }
.review-md code {
  background: var(--surface-3); color: var(--accent-ink);
  padding: 2px 5px; border-radius: var(--radius);
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: 14px;
}
.review-md pre {
  margin: 10px 0;
  padding: 11px 12px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  color: var(--ink-2);
  font-family: var(--mono); font-size: 14px; line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
  border-radius: var(--radius);
}
.review-md pre code {
  background: none; border: 0; padding: 0; color: inherit;
}
.code-wrap { position: relative; }
.copy-btn {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,.06); color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 2px 10px; font-family: var(--mono); font-size: 12px;
  cursor: pointer; z-index: 1; transition: background .15s, color .15s;
}
.copy-btn:hover { background: rgba(0,0,0,.12); color: var(--ink); }

/* ── Empty state ───────────────────────────────────────────────────────── */
.empty {
  border: 1px dashed var(--line-2);
  padding: 28px;
  background: var(--surface-2);
  text-align: center;
  color: var(--muted); font-size: 15px;
  border-radius: var(--radius);
}
.empty::before {
  content: '∅';
  display: block;
  font-family: var(--mono);
  font-size: 25px; color: var(--line-2);
  margin-bottom: 8px;
}

/* ── Lab callout ───────────────────────────────────────────────────────── */
.lab-grid {
  display: grid; grid-template-columns: minmax(280px, 1fr) 320px;
  gap: 16px;
}
.lab-callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.lab-callout::before {
  content: ''; position: absolute; top: 0; left: 0; height: 3px;
  width: 80px; background: var(--ink);
}
.lab-callout h2 {
  margin: 0 0 6px; font-size: 21px; font-weight: 600;
  letter-spacing: -0.01em;
}
.steps { margin-top: 22px; display: grid; gap: 14px; }
.step {
  display: grid; grid-template-columns: 32px 1fr;
  gap: 14px; align-items: start;
  font-size: 15px; color: var(--ink-2);
}
.step-num {
  width: 24px; height: 24px;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  border-radius: var(--radius);
}

/* ── Auth pages ────────────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 40px 20px;
  gap: 28px;
}

.auth-brand {
  display: flex; align-items: center; gap: 12px;
}
.auth-brand .mark {
  width: 36px; height: 36px;
  background: var(--ink); color: var(--bg);
  font-family: var(--mono); font-weight: 700; font-size: 16px;
  display: grid; place-items: center;
  border-radius: 8px;
  letter-spacing: -0.02em;
}
.auth-brand .name {
  font-weight: 600; font-size: 18px;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.auth-brand .sub {
  font-family: var(--mono); font-size: 12px;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 1px;
}

.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent); margin-bottom: 6px;
}

.auth-card {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 100%; max-width: 440px;
}

.auth-meta-strip {
  display: flex; gap: 24px; flex-wrap: wrap; justify-content: center;
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.02em;
}
.auth-meta-strip .cell {
  display: flex; gap: 6px;
}
.auth-meta-strip .k {
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em;
}
.auth-meta-strip .v {
  color: var(--ink-2);
}

.auth-legal {
  font-family: var(--mono); font-size: 11px;
  color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.1em;
  text-align: center;
}
.auth-form {
  width: 100%; max-width: 360px;
}
.auth-form h1 {
  margin: 0 0 4px;
  font-size: 25px; font-weight: 600; letter-spacing: -0.015em;
}
.auth-form .sub {
  color: var(--muted); font-size: 15px; margin-bottom: 24px;
}
label {
  display: block;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin: 14px 0 6px;
}
.input, input[type="text"], input[type="email"], input[type="password"], input[type="search"], select {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-family: var(--sans); font-size: 15px;
  color: var(--ink);
  outline: 0;
  transition: border .12s, background .12s;
}
.input:focus, input:focus, select:focus {
  border-color: var(--ink);
  background: var(--surface);
}
.hint {
  margin-top: 6px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  letter-spacing: 0.02em;
}
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0;
  font-family: var(--mono); font-size: 12px;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
.btn-google {
  width: 100%; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); padding: 9px 12px; border-radius: var(--radius);
  font-family: var(--sans); font-weight: 500; cursor: pointer;
  font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-google:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn-google svg { width: 16px; height: 16px; flex-shrink: 0; }
.error {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
  font-family: var(--mono); font-size: 14px;
  border-radius: var(--radius);
  display: none;
}
.auth-footer {
  text-align: center; margin-top: 18px;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
}

/* ── Misc ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.subtle { color: var(--muted); }
.mono { font-family: var(--mono); }
.notice {
  padding: 10px 12px;
  background: var(--surface-2);
  border-left: 2px solid var(--line-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}
.kbd {
  font-family: var(--mono); font-size: 13px;
  padding: 1px 6px; background: var(--surface-3);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  color: var(--ink-2);
}

/* ── Plan strip (overview top) ─────────────────────────────────────────── */
.plan-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr 1fr;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}
.plan-strip .strip-meter + .strip-meter { border-left: 1px solid var(--line); }
.plan-strip::before {
  content: ''; position: absolute; top: 0; left: 0; height: 3px;
  width: 80px; background: var(--ink);
}
.plan-strip[data-state="trial"]::before { background: var(--warn); }
.plan-strip[data-state="full"]::before { background: var(--ok); }
.plan-strip[data-state="granted"]::before { background: var(--accent); }
.plan-strip[data-state="expired"]::before { background: var(--danger); }

.plan-strip .strip-id {
  padding: 18px 22px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface-2);
}
.plan-strip .strip-eyebrow {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em;
  display: flex; align-items: center; gap: 8px;
}
.plan-strip .strip-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
}
.plan-strip[data-state="trial"] .strip-eyebrow .dot { background: var(--warn); }
.plan-strip[data-state="expired"] .strip-eyebrow .dot { background: var(--danger); }

.plan-strip .strip-name {
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--ink);
}
.plan-strip .strip-sub {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}

.plan-strip .strip-meter {
  padding: 18px 24px;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 8px;
  align-content: center;
}
.plan-strip .meter-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.plan-strip .meter-head .big {
  font-size: 22px; font-weight: 500; color: var(--ink);
  text-transform: none; letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}
.plan-strip .meter-head .big .unit { color: var(--muted); font-size: 13px; margin-left: 4px; }
.plan-strip .meter-bar {
  height: 4px; background: var(--surface-3);
  border-radius: 2px; overflow: hidden;
  border: 1px solid var(--line);
}
.plan-strip .meter-bar i {
  display: block; height: 100%;
  background: var(--ink);
  transition: width .25s ease;
}
.plan-strip[data-state="trial"] .meter-bar i { background: var(--warn); }
.plan-strip[data-state="granted"] .meter-bar i { background: var(--accent); }
.plan-strip[data-state="expired"] .meter-bar i { background: var(--danger); width: 100% !important; }
.plan-strip .meter-ticks {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; color: var(--muted-2);
  letter-spacing: 0.04em;
}
.plan-strip .strip-meter.attempts .meter-bar i { background: var(--accent-ink); }
.plan-strip[data-state="trial"] .strip-meter.attempts .meter-bar i { background: var(--warn); }
.plan-strip[data-state="expired"] .strip-meter.attempts .meter-bar i { background: var(--danger); }

.attempt-dots {
  display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap;
}
.attempt-dots .ad {
  width: 14px; height: 6px; border-radius: 1px;
  background: var(--surface-3);
  border: 1px solid var(--line);
}
.attempt-dots .ad.used { background: var(--ink); border-color: var(--ink); }
.plan-strip[data-state="trial"] .attempt-dots .ad.used { background: var(--warn); border-color: var(--warn); }
.plan-strip[data-state="granted"] .attempt-dots .ad.used { background: var(--accent); border-color: var(--accent); }
.plan-strip[data-state="expired"] .attempt-dots .ad.used { background: var(--danger); border-color: var(--danger); }

@media (max-width: 1280px) {
  .plan-strip { grid-template-columns: minmax(200px, 240px) 1fr 1fr; }
}
@media (max-width: 900px) {
  .plan-strip { grid-template-columns: 1fr; }
  .plan-strip .strip-id { border-right: 0; border-bottom: 1px solid var(--line); }
  .plan-strip .strip-meter + .strip-meter { border-left: 0; border-top: 1px solid var(--line); }
}

/* ── Track toggle ─────────────────────────────────────────────────────── */
.track-toggle {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
}
.track-btn {
  background: var(--surface);
  border: none;
  padding: 5px 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  color: var(--ink-2);
  transition: background .12s, color .12s;
}
.track-btn:hover { background: var(--surface-3); }
.track-btn.active {
  background: var(--ink);
  color: #fff;
}
.track-btn + .track-btn {
  border-left: 1px solid var(--line-2);
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .side-section { flex: 1; }
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .lab-grid { grid-template-columns: 1fr; }
  .auth-card { margin: 0 16px; }
  .row-head, .attempt-row { grid-template-columns: 50px minmax(0, 1fr) 70px 70px; }
  .row-head .col-status, .attempt-row .col-status { display: none; }
}
