/* =========================================================
   PracticeMe — premium EdTech design system
   Deep indigo + teal, calm and confident.
   ========================================================= */

:root {
  /* core palette */
  --ink: #0e1430;          /* near-black indigo */
  --ink-2: #161e44;
  --indigo: #4656e6;
  --indigo-bright: #4656e6;
  --indigo-soft: #eef0ff;
  --teal: #087f75;
  --teal-bright: #14d3c1;
  --teal-soft: #e6fbf8;
  --amber: #945500;
  --pink: #bd1f65;
  --violet: #8b5cf6;

  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #fbfcff;
  --line: #e7e9f4;
  --line-strong: #d6d9ee;

  --text: #11173a;
  --text-2: #5a6285;
  --text-3: #646d92;
  --text-muted: #646d92;

  --ring-track: #e9ebf7;

  --radius: 18px;
  --radius-lg: 26px;
  --radius-sm: 12px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 64, .05), 0 1px 3px rgba(16, 24, 64, .06);
  --shadow: 0 4px 14px -4px rgba(20, 28, 80, .12), 0 12px 40px -12px rgba(20, 28, 80, .14);
  --shadow-lg: 0 18px 50px -16px rgba(20, 28, 80, .28);

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Figtree', system-ui, sans-serif;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

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

:focus-visible { outline: 3px solid #2436c7; outline-offset: 3px; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  /* atmospheric background */
  background-image:
    radial-gradient(900px 500px at 12% -6%, rgba(91, 108, 255, .10), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, rgba(20, 211, 193, .10), transparent 55%);
  background-attachment: fixed;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; margin: 0; color: var(--text); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ===================== top bar ===================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 248, 252, .78);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 28px;
  height: 70px;
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.03em; color: var(--ink); }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, var(--indigo-bright), var(--teal));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px -4px rgba(70, 86, 230, .55);
  position: relative; overflow: hidden;
}
.brand .mark svg { width: 19px; height: 19px; }
.brand b { color: var(--indigo); }

.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  font-weight: 600; font-size: 14.5px; color: var(--text-2);
  padding: 8px 14px; border-radius: 10px; transition: .16s;
}
.nav a:hover { color: var(--text); background: rgba(70, 86, 230, .07); }
.nav a.active { color: var(--indigo); background: var(--indigo-soft); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.streak-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px 7px 11px; font-weight: 700; font-size: 14px; color: var(--text);
  box-shadow: var(--shadow-sm);
}
.streak-pill svg { width: 16px; height: 16px; color: var(--amber); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(140deg, #2a3470, #4656e6);
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  box-shadow: var(--shadow-sm);
}

/* ===================== buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  border-radius: 13px; padding: 12px 20px; border: 1px solid transparent;
  cursor: pointer; transition: transform .14s, box-shadow .18s, background .18s, border-color .18s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--indigo-bright), var(--indigo));
  color: #fff; box-shadow: 0 10px 24px -10px rgba(70, 86, 230, .7);
}
.btn-primary:hover { box-shadow: 0 14px 30px -10px rgba(70, 86, 230, .85); transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: rgba(70,86,230,.07); color: var(--indigo); }
.btn-teal { background: linear-gradient(135deg, var(--teal-bright), var(--teal)); color: #04302c; box-shadow: 0 10px 24px -10px rgba(15,181,166,.6); }
.btn-teal:hover { transform: translateY(-1px); }
.btn-lg { padding: 15px 26px; font-size: 16px; border-radius: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.feature-notice, .ai-disclaimer {
  margin-top: 12px; color: var(--text-2); font-size: 13.5px; line-height: 1.55;
  background: #f3f5ff; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px;
}
.ai-disclaimer { max-width: 660px; }

/* ===================== cards ===================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ===================== page header ===================== */
.page-head { padding: 40px 0 8px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--indigo); margin-bottom: 14px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(20,211,193,.18); }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.05; }
.page-head .sub { color: var(--text-2); font-size: 17px; margin-top: 12px; max-width: 620px; }

/* ===================== dashboard hero ===================== */
.hero {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 22px; margin: 26px 0 38px;
}
.hero-main {
  position: relative; overflow: hidden;
  background:
    radial-gradient(700px 320px at 88% -30%, rgba(20,211,193,.30), transparent 60%),
    linear-gradient(135deg, #1a2256, #0e1430);
  color: #fff; border-radius: var(--radius-lg);
  padding: 34px 36px; border: 1px solid rgba(255,255,255,.06);
  box-shadow: var(--shadow-lg);
}
.hero-main::after {
  content: ''; position: absolute; right: -60px; bottom: -90px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(91,108,255,.45), transparent 70%);
  pointer-events: none;
}
.hero-main .tag { color: var(--teal-bright); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.hero-main h2 { color: #fff; font-size: 30px; margin: 14px 0 8px; line-height: 1.12; }
.hero-main p { color: rgba(255,255,255,.72); font-size: 16px; max-width: 460px; }
.hero-meta { display: flex; gap: 26px; margin: 26px 0 28px; }
.hero-meta .m .k { font-family: var(--font-display); font-weight: 700; font-size: 26px; color: #fff; }
.hero-meta .m .l { color: rgba(255,255,255,.6); font-size: 13px; margin-top: 2px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 2; }

.hero-side { display: flex; flex-direction: column; gap: 22px; }
.stat-card { padding: 22px 24px; display: flex; align-items: center; gap: 18px; }
.stat-card .ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.stat-card .ico svg { width: 22px; height: 22px; }
.stat-card .k { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; }
.stat-card .l { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }

/* ===================== progress ring ===================== */
.ring { position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-bg { stroke: var(--ring-track); }
.ring .ring-fg { stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.22,1,.36,1); }
.ring .ring-label { position: absolute; text-align: center; }
.ring .ring-label .pct { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.ring .ring-label .cap { font-size: 10px; color: var(--text-2); letter-spacing: .04em; }

/* ===================== section heading ===================== */
.sec-head { display: flex; align-items: end; justify-content: space-between; margin: 6px 0 18px; gap: 16px; }
.sec-head h3 { font-size: 22px; }
.sec-head .hint { color: var(--text-2); font-size: 14.5px; }

/* ===================== track grid ===================== */
.track-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.track-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s, border-color .2s;
  display: flex; flex-direction: column; gap: 16px;
}
.track-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.track-card .accent-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--acc); }
.track-card .tc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.track-card .tc-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.track-card .tc-icon svg { width: 24px; height: 24px; }
.track-card h4 { font-size: 18.5px; }
.track-card .tc-blurb { color: var(--text-2); font-size: 14px; min-height: 40px; }
.track-card .tc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.track-card .tc-meta { display: flex; gap: 8px; align-items: center; color: var(--text-2); font-size: 13px; font-weight: 600; }
.chip {
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--indigo-soft); color: var(--indigo); letter-spacing: .02em;
}
.chip.teal { background: var(--teal-soft); color: var(--teal); }
.go-arrow { color: var(--acc); transition: transform .18s; display: inline-flex; }
.track-card:hover .go-arrow { transform: translateX(4px); }

/* ===================== session page ===================== */
.session-shell { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; margin: 26px 0 60px; }
.qcard { padding: 0; overflow: hidden; }
.qcard-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 28px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.q-counter { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-2); }
.q-counter b { color: var(--text); }
.qcard-body { padding: 30px 32px 28px; }
.q-prompt { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 2.6vw, 28px); line-height: 1.28; letter-spacing: -.02em; }
.q-tip { margin-top: 16px; display: flex; gap: 10px; align-items: flex-start; background: var(--teal-soft); border: 1px solid rgba(15,181,166,.22); color: #0a6c63; padding: 12px 15px; border-radius: 13px; font-size: 14px; }
.q-tip svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }

.answer-area { position: relative; margin-top: 22px; }
.answer-area textarea {
  width: 100%; min-height: 200px; resize: vertical;
  font-family: var(--font-body); font-size: 16px; line-height: 1.6; color: var(--text);
  border: 1.5px solid var(--line-strong); border-radius: 16px; padding: 18px 18px 46px;
  background: var(--surface-2); transition: border-color .16s, box-shadow .16s;
}
.answer-area textarea:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; border-color: var(--indigo-bright); background: #fff; }
.answer-area .wc { position: absolute; right: 16px; bottom: 14px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }

.session-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 28px; border-top: 1px solid var(--line); background: var(--surface-2); }
.foot-left { display: flex; gap: 10px; }

/* timer sidebar */
.side-panel { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 20px; }
.timer-card { padding: 24px; text-align: center; }
.timer-ring { margin: 0 auto 4px; }
.timer-time { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: .02em; }
.timer-time.warn { color: var(--amber); }
.timer-time.danger { color: #ef4444; }
.timer-cap { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.timer-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: center; }

.progress-dots { display: flex; flex-wrap: wrap; gap: 8px; padding: 22px 24px; }
.dot-q {
  width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line-strong);
  background: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  color: var(--text-2); cursor: pointer; transition: .16s; font-family: var(--font-display);
}
.dot-q:hover { border-color: var(--indigo); color: var(--indigo); }
.dot-q.current { border-color: var(--indigo); background: var(--indigo); color: #fff; }
.dot-q.answered { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.dot-q.answered.current { background: var(--indigo); color: #fff; border-color: var(--indigo); }

/* ===================== feedback ===================== */
.thinking { text-align: center; padding: 60px 20px; }
.thinking .orb {
  width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--indigo-bright), var(--teal-bright), var(--indigo-bright));
  animation: spin 1.1s linear infinite; position: relative;
}
.thinking .orb::after { content:''; position:absolute; inset:7px; border-radius:50%; background: var(--surface); }
@keyframes spin { to { transform: rotate(360deg); } }
.thinking h3 { font-size: 20px; }
.thinking p { color: var(--text-2); margin-top: 8px; }
.thinking .steps { margin-top: 18px; color: var(--text-muted); font-size: 14px; min-height: 20px; }

.fb-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.fb-score-card { padding: 28px 24px; text-align: center; }
.fb-tier { font-family: var(--font-display); font-weight: 700; font-size: 19px; margin-top: 14px; }
.fb-summary { color: var(--text-2); font-size: 14px; margin-top: 8px; }
.fb-panels { display: flex; flex-direction: column; gap: 18px; }
.fb-panel { padding: 22px 24px; }
.fb-panel h4 { display: flex; align-items: center; gap: 9px; font-size: 16px; margin-bottom: 14px; }
.fb-panel h4 svg { width: 18px; height: 18px; }
.fb-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.fb-list li { display: flex; gap: 11px; align-items: flex-start; font-size: 15px; color: var(--text); line-height: 1.5; }
.fb-list li .bullet { flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; margin-top: 1px; }
.fb-list li .bullet svg { width: 13px; height: 13px; }
.b-good { background: var(--teal-soft); color: var(--teal); }
.b-improve { background: #fff4e3; color: #c2790a; }
.model-answer { background: var(--ink); color: #e6e9ff; border-radius: 18px; padding: 22px 24px; }
.model-answer h4 { color: #fff; display: flex; align-items: center; gap: 9px; font-size: 16px; margin-bottom: 4px; }
.model-answer h4 svg { width: 18px; height: 18px; flex-shrink: 0; }
.model-answer .ma-text { color: rgba(230,233,255,.82); font-size: 15px; line-height: 1.65; margin-top: 10px; }

/* ===================== history ===================== */
.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 26px 0 30px; }
.metric { padding: 22px 24px; }
.metric .mt { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.metric .mt svg { width: 16px; height: 16px; }
.metric .mv { font-family: var(--font-display); font-weight: 700; font-size: 32px; margin-top: 8px; line-height: 1; }
.metric .md { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

.chart-card { padding: 26px 28px; margin-bottom: 30px; }
#scoreChart { width: 100%; display: block; }

.session-list { display: flex; flex-direction: column; gap: 12px; }
.session-row {
  display: flex; align-items: center; gap: 18px; padding: 18px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-sm); transition: .16s;
}
.session-row:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.session-row .sr-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.session-row .sr-icon svg { width: 21px; height: 21px; }
.session-row .sr-main { flex: 1; min-width: 0; }
.session-row .sr-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.session-row .sr-sub { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.score-badge {
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
  width: 56px; height: 48px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0;
}
.score-badge small { font-size: 11px; opacity: .7; font-weight: 600; }

/* ===================== library ===================== */
.lib-controls { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 24px 0 22px; }
.search-box { position: relative; flex: 1; min-width: 240px; }
.search-box svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); }
.search-box input {
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--text);
  padding: 13px 16px 13px 44px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: #fff;
  transition: .16s;
}
.search-box input:focus { outline: none; border-color: var(--indigo-bright); box-shadow: 0 0 0 4px rgba(91,108,255,.13); }
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line-strong); color: var(--text-2); transition: .15s;
}
.filter-pill:hover { border-color: var(--indigo); color: var(--indigo); }
.filter-pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.lib-count { color: var(--text-2); font-size: 14px; margin-bottom: 14px; font-weight: 600; }
.lib-list { display: flex; flex-direction: column; gap: 12px; }
.lib-item {
  display: flex; align-items: center; gap: 18px; padding: 18px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-sm); transition: .16s;
}
.lib-item:hover { box-shadow: var(--shadow); }
.lib-item.is-mastered { background: linear-gradient(90deg, var(--teal-soft), #fff 40%); border-color: rgba(15,181,166,.3); }
.lib-item .li-main { flex: 1; min-width: 0; }
.lib-item .li-q { font-weight: 600; font-size: 15.5px; line-height: 1.4; }
.lib-item .li-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.diff {
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em;
}
.diff-Easy { background: var(--teal-soft); color: var(--teal); }
.diff-Medium { background: #fff4e3; color: #c2790a; }
.diff-Hard { background: #ffe9ef; color: #d93a6a; }
.track-tag { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo); }

.master-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 13.5px; padding: 9px 14px; border-radius: 11px;
  border: 1.5px solid var(--line-strong); background: #fff; color: var(--text-2); cursor: pointer; transition: .15s;
}
.master-btn svg { width: 15px; height: 15px; }
.master-btn:hover { border-color: var(--teal); color: var(--teal); }
.master-btn.on { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ===================== misc ===================== */
.empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty svg { width: 46px; height: 46px; color: var(--line-strong); margin-bottom: 14px; }
.empty h3 { font-size: 19px; margin-bottom: 6px; }

.toast-wrap { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 11px; background: var(--ink); color: #fff;
  padding: 13px 20px; border-radius: 14px; font-weight: 600; font-size: 14.5px;
  box-shadow: var(--shadow-lg); animation: toastin .3s cubic-bezier(.22,1,.36,1);
}
.toast svg { width: 18px; height: 18px; color: var(--teal-bright); }
@keyframes toastin { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.fade-up { animation: fadeUp .55s cubic-bezier(.22,1,.36,1) backwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.footer { text-align: center; color: var(--text-muted); font-size: 13.5px; padding: 40px 0 50px; }
.footer b { color: var(--indigo); }

/* ===================== account menu (topbar) ===================== */
.acct { position: relative; }
.acct .avatar { border: none; cursor: pointer; padding: 0; }
.acct .avatar.sm { width: 40px; height: 40px; font-size: 16px; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 260px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 8px; animation: fadeUp .18s ease;
}
.acct-menu[hidden] { display: none; }
.acct-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acct-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.acct-sub { color: var(--text-muted); font-size: 12.5px; }
.acct-menu a, .acct-menu button {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  font-family: var(--font-body); font-weight: 600; font-size: 14.5px; color: var(--text);
  padding: 10px 12px; border-radius: 11px; border: none; background: none; cursor: pointer; transition: .14s;
}
.acct-menu a svg, .acct-menu button svg { width: 17px; height: 17px; color: var(--text-2); }
.acct-menu a:hover, .acct-menu button:hover { background: rgba(70,86,230,.07); color: var(--indigo); }
.acct-menu a:hover svg, .acct-menu button:hover svg { color: var(--indigo); }
.acct-div { height: 1px; background: var(--line); margin: 6px 4px; }
.acct-admin { color: var(--indigo) !important; }
.acct-admin svg { color: var(--indigo) !important; }

/* ===================== home personalized strip ===================== */
.home-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 22px 0 4px; }
.pstat { display: flex; align-items: center; gap: 16px; padding: 18px 22px; }
.pstat-ring { flex-shrink: 0; }
.pstat-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.pstat-ico svg { width: 22px; height: 22px; }
.pstat-k { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; }
.pstat-k span { font-size: 15px; color: var(--text-2); font-weight: 600; }
.pstat-l { color: var(--text-2); font-size: 13.5px; margin-top: 5px; }

/* ===================== onboarding ===================== */
.onb-body {
  min-height: 100vh; display: flex; flex-direction: column;
  background-image:
    radial-gradient(900px 520px at 15% -8%, rgba(91,108,255,.16), transparent 60%),
    radial-gradient(820px 520px at 100% 0%, rgba(20,211,193,.14), transparent 55%);
}
.onb-shell { flex: 1; display: flex; flex-direction: column; max-width: 760px; width: 100%; margin: 0 auto; padding: 0 22px; }
.onb-top { display: flex; align-items: center; justify-content: space-between; padding: 26px 0 8px; }
.onb-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 0 48px; gap: 22px; }
.onb-progress { display: flex; gap: 8px; justify-content: center; }
.onb-pip { width: 38px; height: 6px; border-radius: 999px; background: var(--line-strong); transition: .25s; }
.onb-pip.current { background: var(--indigo); width: 52px; }
.onb-pip.done { background: var(--teal); }
.onb-card { padding: 40px 44px; border-radius: var(--radius-lg); }

.onb-hero { text-align: center; }
.onb-orb {
  width: 68px; height: 68px; margin: 0 auto 20px; border-radius: 20px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--indigo-bright), var(--teal)); box-shadow: var(--shadow-lg);
}
.onb-orb svg { width: 30px; height: 30px; }
.onb-hero .eyebrow { justify-content: center; }
.onb-hero h1 { font-size: clamp(28px, 4vw, 38px); }
.onb-lead { color: var(--text-2); font-size: 17px; margin: 14px auto 0; max-width: 520px; }
.onb-bullets { display: flex; flex-direction: column; gap: 12px; margin: 28px auto 4px; max-width: 420px; text-align: left; }
.onb-b { display: flex; align-items: center; gap: 13px; font-weight: 600; color: var(--text); font-size: 15px; }
.onb-b svg { width: 20px; height: 20px; color: var(--indigo); flex-shrink: 0; }

.onb-step h2 { font-size: clamp(24px, 3vw, 30px); }
.onb-kicker { color: var(--indigo); font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
.onb-sub { color: var(--text-2); font-size: 16px; margin-top: 10px; }
.onb-field { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.onb-field > span { font-weight: 600; font-size: 14px; color: var(--text); }
.onb-field > span em { color: var(--text-muted); font-style: normal; font-weight: 500; }
.onb-field input, .onb-field textarea, .admin-select {
  width: 100%; font-family: var(--font-body); font-size: 16px; color: var(--text);
  padding: 13px 16px; border: 1.5px solid var(--line-strong); border-radius: 13px; background: var(--surface-2); transition: .16s;
}
.onb-field textarea { resize: vertical; line-height: 1.5; }
.onb-field input:focus-visible, .onb-field textarea:focus-visible, .admin-select:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; border-color: var(--indigo-bright); background: #fff; }

.onb-choices { display: flex; flex-direction: column; gap: 11px; margin-top: 22px; }
.onb-choice {
  display: flex; align-items: center; gap: 15px; text-align: left; cursor: pointer; width: 100%;
  background: var(--surface-2); border: 1.5px solid var(--line-strong); border-radius: 16px; padding: 15px 17px; transition: .16s;
}
.onb-choice:hover { border-color: var(--acc); }
.onb-choice.sel { border-color: var(--acc); background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 16%, transparent); }
.onb-choice-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.onb-choice-ico svg { width: 22px; height: 22px; }
.onb-choice-body { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.onb-choice-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.onb-choice-sub { color: var(--text-2); font-size: 13.5px; }
.onb-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; color: #fff; flex-shrink: 0; transition: .16s; }
.onb-check svg { width: 15px; height: 15px; opacity: 0; }
.onb-choice.sel .onb-check { background: var(--acc); border-color: var(--acc); }
.onb-choice.sel .onb-check svg { opacity: 1; }

.onb-goal { display: flex; align-items: center; gap: 30px; margin-top: 26px; flex-wrap: wrap; }
.onb-goal-ring { flex-shrink: 0; }
.onb-goal-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-width: 240px; }
.onb-goal-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 26px; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 16px; transition: .16s;
}
.onb-goal-opt small { font-family: var(--font-body); font-weight: 600; font-size: 12px; color: var(--text-2); }
.onb-goal-opt:hover { border-color: var(--teal); }
.onb-goal-opt.sel { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.onb-goal-opt.sel small { color: var(--teal); }

.onb-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 32px; }
.onb-done { text-align: center; padding: 14px 0; }
.onb-done-orb { width: 76px; height: 76px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--teal-bright), var(--teal)); box-shadow: 0 14px 34px -10px rgba(15,181,166,.6); animation: pop .4s cubic-bezier(.22,1.6,.4,1); }
.onb-done-orb svg { width: 36px; height: 36px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.onb-done h1 { font-size: clamp(26px, 3.5vw, 34px); }
.onb-done .btn { margin-top: 26px; }

/* ===================== admin: login ===================== */
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 30px 20px;
  background-image: radial-gradient(900px 520px at 18% -10%, rgba(91,108,255,.18), transparent 60%), radial-gradient(820px 520px at 100% 0%, rgba(20,211,193,.14), transparent 55%); }
.admin-login-card { width: 100%; max-width: 420px; padding: 36px 36px 28px; text-align: center; }
.al-tag { color: var(--indigo); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin: 8px 0 6px; }
.admin-login-card h1 { font-size: 28px; }
.al-sub { color: var(--text-2); margin-top: 8px; }
.al-demo { display: flex; align-items: flex-start; gap: 11px; text-align: left; background: var(--teal-soft); border: 1px solid rgba(15,181,166,.25); color: #0a6c63; border-radius: 13px; padding: 13px 15px; margin: 20px 0; font-size: 13.5px; line-height: 1.5; }
.al-demo svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.al-demo b { color: var(--ink); }
.admin-login-card form { text-align: left; }
.al-error { color: #d93a6a; font-size: 13.5px; font-weight: 600; margin-top: 12px; }
.al-back { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-weight: 600; font-size: 14px; margin-top: 20px; }
.al-back svg { width: 16px; height: 16px; }
.al-back:hover { color: var(--indigo); }

/* ===================== admin: shell ===================== */
.admin-wrap { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.admin-side {
  background: var(--ink); color: #cdd3f5; padding: 24px 18px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.admin-brand { color: #fff; font-size: 19px; }
.admin-brand .mark { box-shadow: none; }
.admin-brand b { color: var(--teal-bright); }
.admin-side-tag { color: rgba(205,211,245,.5); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; margin: 16px 0 18px; padding-left: 4px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 14.5px; color: #aab2e0;
  background: none; border: none; padding: 11px 13px; border-radius: 12px; transition: .15s;
}
.admin-nav button svg { width: 18px; height: 18px; }
.admin-nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav button.active { background: linear-gradient(135deg, var(--indigo-bright), var(--indigo)); color: #fff; box-shadow: 0 8px 20px -8px rgba(70,86,230,.7); }
.admin-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.admin-side-foot .btn-quiet { color: #aab2e0; }
.admin-side-foot .btn-quiet:hover { background: rgba(255,255,255,.06); color: #fff; }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 16px 30px; background: rgba(247,248,252,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.admin-burger { display: none; background: none; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px; cursor: pointer; color: var(--text); }
.admin-burger svg { width: 18px; height: 18px; display: block; }
.admin-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.admin-top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.admin-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--teal); background: var(--teal-soft); border: 1px solid rgba(15,181,166,.25); padding: 6px 12px; border-radius: 999px; }
.admin-badge svg { width: 14px; height: 14px; }
.admin-body { padding: 26px 30px 48px; }

/* ===================== admin: KPIs ===================== */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 22px; }
.kpi { padding: 20px 22px; }
.kpi-top { display: flex; align-items: center; gap: 11px; }
.kpi-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-ico svg { width: 19px; height: 19px; }
.kpi-t { color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.kpi-v { font-family: var(--font-display); font-weight: 700; font-size: 30px; margin-top: 14px; line-height: 1; }
.kpi-d { color: var(--text-muted); font-size: 12.5px; margin-top: 7px; }

.admin-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 18px; }
.admin-panel { padding: 22px 24px; }
.admin-svg { width: 100%; display: block; height: auto; }
.admin-link { cursor: pointer; color: var(--indigo); }

.signup-list { display: flex; flex-direction: column; }
.signup-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.signup-row:last-child { border-bottom: none; }
.su-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(140deg,#2a3470,#4656e6); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.su-avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.su-main { flex: 1; min-width: 0; }
.su-name { font-weight: 700; font-size: 14.5px; }
.su-email { color: var(--text-muted); font-size: 12.5px; }
.su-when { color: var(--text-muted); font-size: 12.5px; white-space: nowrap; }

/* ===================== admin: users table ===================== */
.users-controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.admin-search { flex: 1; min-width: 220px; }
.users-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-select { width: auto; padding: 11px 14px; font-size: 14px; cursor: pointer; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; color: var(--text-2); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding: 10px 14px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface-2); }
.admin-table .num, .admin-table th.num { text-align: right; }
.admin-table .ta-r, .admin-table th.ta-r { text-align: right; }
.admin-table .muted { color: var(--text-muted); white-space: nowrap; }
.ut-user { display: flex; align-items: center; gap: 12px; }
.ut-name { font-weight: 700; }
.ut-email { color: var(--text-muted); font-size: 12.5px; }
.score-chip { display: inline-block; min-width: 38px; text-align: center; font-weight: 700; padding: 3px 8px; border-radius: 8px; font-size: 13px; }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--text-2); cursor: pointer; display: grid; place-items: center; transition: .14s; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { border-color: var(--indigo); color: var(--indigo); }
.icon-btn.danger:hover { border-color: #ef4444; color: #ef4444; }
.icon-btn.good:hover { border-color: var(--teal); color: var(--teal); }

/* ===================== admin: question bank ===================== */
.bank-tracks { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.bank-track-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 8px 7px 13px; font-size: 13.5px; }
.bank-track-chip .btc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--acc); }
.bank-track-chip b { font-weight: 700; }
.bank-track-chip .btc-n { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-weight: 700; font-size: 12px; color: var(--text-2); }
.btc-x { width: 24px; height: 24px; border-radius: 50%; border: none; background: none; color: var(--text-muted); cursor: pointer; display: grid; place-items: center; }
.btc-x svg { width: 14px; height: 14px; }
.btc-x:hover { color: #ef4444; background: #ffe9ef; }
.bank-count { color: var(--text-2); font-size: 13.5px; font-weight: 600; margin-bottom: 12px; }
.bank-item { display: flex; align-items: center; gap: 16px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; background: #fff; transition: .14s; }
.bank-item:hover { box-shadow: var(--shadow-sm); }
.bi-main { flex: 1; min-width: 0; }
.bi-q { font-weight: 600; font-size: 15px; line-height: 1.4; }
.bi-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

/* ===================== admin: modal ===================== */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(14,20,48,.5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .18s; }
.modal-overlay.show { opacity: 1; }
.modal { width: 100%; max-width: 460px; background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); transition: transform .2s cubic-bezier(.22,1,.36,1); max-height: 90vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 600px; }
.modal-overlay.show .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 24px 0; }
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.modal-sub { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.modal-head .icon-btn { transform: rotate(45deg); }
.modal-body { padding: 18px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; }
.btn-danger { background: linear-gradient(135deg,#f43f5e,#ef4444); color: #fff; box-shadow: 0 10px 24px -10px rgba(239,68,68,.6); }
.confirm-msg { color: var(--text-2); font-size: 15px; line-height: 1.55; }

.qf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.qf-row .onb-field { margin-top: 0; }
.q-form .onb-field { margin-top: 16px; }
.q-form .onb-field:first-child, .qf-row .onb-field { margin-top: 4px; }
.qf-err, .al-error { color: #d93a6a; font-weight: 600; font-size: 13.5px; margin-top: 12px; }

.color-pick { display: flex; gap: 10px; }
.color-opt { width: 36px; height: 36px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; transition: .14s; }
.color-opt:hover { transform: scale(1.08); }
.color-opt.sel { box-shadow: 0 0 0 3px #fff, 0 0 0 5px currentColor; }

.user-detail .ud-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.ud-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; }
.ud-k { font-family: var(--font-display); font-weight: 700; font-size: 26px; }
.ud-l { color: var(--text-2); font-size: 12.5px; margin-top: 4px; }
.ud-list { display: flex; flex-direction: column; gap: 0; margin: 0; }
.ud-list > div { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ud-list > div:last-child { border-bottom: none; }
.ud-list dt { color: var(--text-2); font-size: 14px; }
.ud-list dd { margin: 0; font-weight: 600; }

/* ===================== responsive ===================== */
@media (max-width: 1080px) {
  .admin-cols { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .track-grid { grid-template-columns: repeat(2, 1fr); }
  .home-strip { grid-template-columns: repeat(3, 1fr); }
  .session-shell { grid-template-columns: 1fr; }
  .side-panel { position: static; flex-direction: row; flex-wrap: wrap; }
  .timer-card { flex: 1; }
  .progress-dots { flex: 1; }
  .fb-grid { grid-template-columns: 1fr; }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  /* admin sidebar becomes a slide-in drawer */
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-side {
    position: fixed; left: 0; top: 0; bottom: 0; width: 256px; z-index: 80;
    transform: translateX(-100%); transition: transform .24s cubic-bezier(.22,1,.36,1);
    box-shadow: var(--shadow-lg); height: 100vh;
  }
  .admin-side.open { transform: translateX(0); }
  .admin-burger { display: grid; place-items: center; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 18px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: flex; justify-content: center; gap: 2px; margin: 0; padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(14,20,48,.08);
  }
  .nav a { flex: 1; max-width: 150px; padding: 9px 6px; text-align: center; font-size: 12px; }
  .topbar ~ main { padding-bottom: 82px; }
  .track-grid { grid-template-columns: 1fr; }
  .home-strip { grid-template-columns: 1fr; }
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .hero-main { padding: 26px 24px; }
  .qcard-body { padding: 24px 20px; }
  .topbar-inner { gap: 14px; }
  .streak-pill span.lbl { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .admin-body { padding: 20px 16px 40px; }
  .admin-topbar { padding: 14px 16px; }
  .onb-card { padding: 28px 22px; }
  .onb-goal { justify-content: center; }
  .qf-row { grid-template-columns: 1fr; }
  .user-detail .ud-grid { grid-template-columns: 1fr 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .ring .ring-fg { transition: none !important; }
}
