/* ── Orator — throat-chakra light blue on deep midnight navy ─────────
   Palette: sky blue primary (#6ec6e8, the throat chakra / vishuddha),
   analogous dark navy backgrounds, ivory text, complementary muted
   coral for flagged words, seafoam green for success. */
:root {
  --bg: #0d1420;
  --bg-raised: #131e2d;
  --bg-card: #152233;
  --border: #26394e;
  --primary: #6ec6e8;
  --primary-soft: #a5dcf2;
  --ink: #eef6fb;
  --muted: #8da5b8;
  --coral: #e08573;
  --green: #7fc8a0;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
}

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 18px 12px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  font-size: 34px; color: var(--primary); line-height: 1;
  text-shadow: 0 0 24px rgba(110, 198, 232, .4);
}
.topbar h1 { font-size: 22px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.tagline { font-size: 11.5px; color: var(--muted); font-style: italic; }
.streak {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; font-size: 14px;
}

/* Layout */
main { flex: 1; overflow-y: auto; padding: 16px 16px 90px; }
.view { display: none; animation: fadeIn .25s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.card-label {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 8px; font-family: system-ui, sans-serif;
}
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.center { text-align: center; }
.hidden { display: none !important; }
.chip {
  display: inline-block; vertical-align: 1px;
  background: rgba(110, 198, 232, .16); color: var(--primary-soft);
  border: 1px solid rgba(110, 198, 232, .45); border-radius: 999px;
  font-size: 9.5px; padding: 2px 8px; letter-spacing: .1em; margin-left: 6px;
}
.coached-note { margin: 2px 6px 14px; font-style: italic; }
.tip-body { font-size: 14.5px; color: var(--ink); opacity: .85; line-height: 1.55; }

.tip-card { border-color: rgba(110, 198, 232, .5); }
.tip-card h2 { font-size: 19px; margin-bottom: 6px; }
.tip-card p { color: var(--ink); opacity: .85; line-height: 1.55; }

/* Buttons */
.cta {
  display: block; width: 100%;
  background: linear-gradient(180deg, var(--primary-soft), var(--primary));
  color: #0a2433; border: none; border-radius: var(--radius);
  font-family: inherit; font-size: 17px; font-weight: 700;
  padding: 15px; margin: 14px 0; cursor: pointer;
  box-shadow: 0 4px 18px rgba(110, 198, 232, .28);
}
.cta:active { transform: scale(.98); }
.cta:disabled {
  filter: grayscale(.6); opacity: .55; cursor: not-allowed;
  transform: none; box-shadow: none;
}
.cta.stop { background: linear-gradient(180deg, #eda292, var(--coral)); color: #3a1710; box-shadow: 0 4px 18px rgba(224, 133, 115, .3); }
.btn {
  font-family: inherit; font-size: 14px; cursor: pointer;
  border-radius: 10px; padding: 10px 14px;
}
.btn.secondary { background: var(--bg-raised); color: var(--ink); border: 1px solid var(--border); }
.btn.ghost { background: none; color: var(--primary); border: none; text-decoration: underline; text-underline-offset: 3px; }
.center-block { display: block; margin: 0 auto; }

/* Stats */
.stats-row { display: flex; justify-content: space-around; text-align: center; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 24px; color: var(--primary-soft); font-weight: 700; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-family: system-ui, sans-serif; }

/* Practice */
.topic-card h2 { font-size: 21px; line-height: 1.35; margin-bottom: 10px; }
.duration-guide { list-style: none; margin: 4px 0 10px; }
.duration-guide li {
  font-size: 14px; line-height: 1.5; color: var(--ink); opacity: .85;
  padding: 6px 0 6px 2px; border-bottom: 1px solid var(--border);
}
.duration-guide li:last-child { border-bottom: none; }
.duration-guide strong { color: var(--primary-soft); }
textarea {
  width: 100%; background: var(--bg-raised); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 15px; padding: 12px; margin-top: 12px;
  resize: vertical;
}
.live-header {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; margin: 6px 2px 12px; color: var(--ink);
}
.rec-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--coral);
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.timer { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--primary-soft); font-size: 18px; }
.transcript-card { min-height: 180px; max-height: 45dvh; overflow-y: auto; }
.transcript { line-height: 1.65; font-size: 16px; }

/* Report */
.score-ring-wrap { position: relative; width: 170px; margin: 10px auto; }
.score-ring { width: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-raised); stroke-width: 10; }
.ring-fg {
  fill: none; stroke: var(--primary); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.2s ease;
}
.score-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-num { font-size: 42px; font-weight: 700; color: var(--primary-soft); }
.score-verdict { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-family: system-ui, sans-serif; }

.pointer {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
}
.pointer .icon { font-size: 22px; line-height: 1.2; }
.pointer h3 { font-size: 15.5px; margin-bottom: 4px; color: var(--primary-soft); }
.pointer p { font-size: 14px; color: var(--ink); opacity: .85; line-height: 1.5; }
details.card summary { cursor: pointer; color: var(--primary); font-size: 14px; }
details.card .transcript { margin-top: 10px; color: var(--muted); }

/* Lexicon */
#lexSearch {
  width: 100%; background: var(--bg-raised); color: var(--ink);
  border: 1px solid var(--border); border-radius: 999px;
  font-family: inherit; font-size: 15px; padding: 12px 18px; margin-bottom: 14px;
}
.lex-nav {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.lex-nav::-webkit-scrollbar { display: none; }
.lex-chip {
  flex-shrink: 0; background: var(--bg-raised); color: var(--primary-soft);
  border: 1px solid var(--border); border-radius: 999px;
  font-family: system-ui, sans-serif; font-size: 12px; letter-spacing: .04em;
  padding: 7px 14px; cursor: pointer;
}
.lex-chip:active { background: var(--bg-card); }
.lex-header {
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--primary); font-family: system-ui, sans-serif;
  margin: 18px 4px 4px;
}
.lex-header:first-child { margin-top: 4px; }
.lex-sub { margin: 0 4px 10px; font-style: italic; font-size: 13px; }
.lex-entry { padding: 14px 16px; }
.lex-entry .slang-word { font-size: 17px; color: var(--coral); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.lex-entry .arrow { color: var(--muted); margin: 0 8px; }
.lex-entry .upgrade { font-size: 17px; color: var(--primary-soft); font-style: italic; }
.lex-entry .example { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.5; }

.pattern-entry { padding: 14px 16px; }
.pattern-name {
  font-size: 16px; color: var(--primary); font-weight: 700;
  letter-spacing: .02em; margin-bottom: 4px;
}
.pattern-use { font-size: 13px; color: var(--muted); font-style: italic; margin-bottom: 8px; line-height: 1.45; }
.pattern-weak { font-size: 14px; color: var(--coral); line-height: 1.5; margin-bottom: 4px; }
.pattern-strong { font-size: 14px; color: var(--primary-soft); line-height: 1.5; }

/* Tab bar */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px;
  display: flex; background: rgba(13, 20, 32, .96);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  backdrop-filter: blur(10px);
}
.tab {
  flex: 1; background: none; border: none; color: var(--muted);
  font-family: system-ui, sans-serif; font-size: 20px; padding: 10px 0 8px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tab span { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.tab.active { color: var(--primary); }

/* Daily challenge & drills */
.challenge-card, .drill-card { border-color: rgba(110, 198, 232, .5); }
.challenge-card h2, .drill-card h2 { font-size: 19px; margin-bottom: 6px; }
#drillResult { border-width: 2px; }
#drillResult.pass { border-color: var(--green); }
#drillResult.fail { border-color: var(--coral); }
#drillResult h3 { font-size: 16px; margin-bottom: 4px; }
#drillResult.pass h3 { color: var(--green); }
#drillResult.fail h3 { color: var(--coral); }

/* Audio */
audio { width: 100%; margin-top: 10px; }

/* Transcript highlights */
mark.hl {
  background: none; color: inherit; cursor: pointer;
  border-bottom: 2px solid; border-radius: 2px; padding: 0 1px;
}
.hl-slang  { border-color: var(--coral);  background: rgba(224, 133, 115, .14); }
.hl-hedge  { border-color: #e3b34c;       background: rgba(227, 179, 76, .14); }
.hl-phrase { border-color: var(--coral);  background: rgba(224, 133, 115, .10); }
.hl-weak   { border-color: #e3b34c;       background: rgba(227, 179, 76, .10); }
.hl-filler { border-bottom-style: dotted; border-color: var(--muted); }
.hl-tipbar {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px;
  font-size: 13.5px; color: var(--primary-soft); line-height: 1.5;
}

/* AI coaching */
.ai-card { border-color: rgba(110, 198, 232, .5); }
.ai-rewrite {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; margin-top: 10px;
}
.ai-orig { font-size: 14px; color: var(--coral); margin-bottom: 6px; line-height: 1.5; }
.ai-impr { font-size: 14px; color: var(--primary-soft); margin-bottom: 6px; line-height: 1.5; }
.ai-rewrite .muted { font-size: 13px; }
.ai-note { margin-top: 10px; font-style: italic; }

/* Progress */
.chart { width: 100%; display: block; }
.trend-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 2px; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.trend-row:last-child { border-bottom: none; }
.trend-up { color: var(--coral); }
.trend-down { color: var(--green); }
.trend-flat { color: var(--muted); }
.hist-head { display: flex; align-items: center; gap: 12px; }
.hist-score {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%;
  background: var(--bg-raised); border: 2px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-soft); font-weight: 700; font-size: 15px;
}
.hist-title { flex: 1; min-width: 0; }
.hist-title strong { font-size: 14.5px; }
.small { font-size: 12px; }
.hist-item details { margin-top: 8px; }
.hist-item summary { cursor: pointer; color: var(--primary); font-size: 13px; }
.hist-item .transcript { margin-top: 8px; color: var(--muted); font-size: 14px; }
.hist-play { flex-shrink: 0; }

/* Playbooks */
.pb-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px;
}
.pb-chip {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 12px; cursor: pointer;
  color: var(--ink); font-family: inherit; text-align: left;
  display: flex; flex-direction: column; gap: 6px;
}
.pb-chip .pb-icon { font-size: 22px; }
.pb-chip .pb-name { font-size: 14.5px; font-weight: 700; color: var(--primary-soft); }
.pb-title { font-size: 22px; margin: 10px 0 6px; }

/* Flashcards */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 10, 16, .88); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal-box { width: 100%; max-width: 420px; }
.flash-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.flash-card {
  background: var(--bg-card); border: 1px solid rgba(110, 198, 232, .5);
  border-radius: var(--radius); padding: 26px 20px; min-height: 220px;
  display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.flash-card h2 { font-size: 24px; margin: 10px 0; color: var(--coral); }
.flash-upgrades { font-size: 19px; color: var(--primary-soft); font-style: italic; line-height: 1.5; margin-bottom: 10px; }
.flash-grade { display: flex; gap: 10px; }
.flash-grade .btn { flex: 1; padding: 14px; font-size: 16px; }
.flash-again { border-color: var(--coral); color: var(--coral); }
.flash-good { border-color: var(--green); color: var(--green); }

/* Account & auth */
input[type="email"], input[type="password"] {
  width: 100%; background: var(--bg-raised); color: var(--ink);
  border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 15px; padding: 12px; margin-bottom: 10px;
}
.acct-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.auth-error { color: var(--coral); min-height: 16px; margin-bottom: 6px; }
