
:root {
  --bg:        #0e0f11;
  --surface:   #14151a;
  --surface2:  #1a1b22;
  --border:    #252630;
  --accent:    #8b9fc4;
  --accent-soft: rgba(139,159,196,0.1);
  --text:      #dde0ea;
  --text-dim:  #7a7f92;
  --text-muted:#3f4254;
  --success:   #6a9e7f;
  --danger:    #9e6a6a;
  --font-display: 'EB Garamond', Georgia, serif;
  --font-body:    'Source Sans 3', system-ui, sans-serif;
  --radius:    12px;
  --radius-sm: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
header {
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
}

.logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.header-right { margin-left: auto; display: flex; align-items: center; gap: 7px; }

#auth-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); transition: background 0.3s; }
#auth-dot.online { background: var(--success); }
#auth-label { font-size: 12px; color: var(--text-dim); }

/* SCREENS */
.screen { display: none; flex: 1; overflow: hidden; }
.screen.active { display: flex; }

/* AUTH SCREEN */
#auth-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 58px);
  padding: 40px 24px;
  overflow-y: auto;
  position: relative;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 52px 48px;
  max-width: 440px;
  width: 100%;
  animation: fadeUp 0.4s ease forwards;
  text-align: center;
}

.auth-logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.auth-logo em { font-style: italic; color: var(--accent); }

.auth-tagline {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 36px;
}

.auth-divider {
  height: 1px;
  background: var(--border);
  margin: 28px 0;
}

.auth-heading {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.auth-sub {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 32px;
}

.auth-benefit {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
  text-align: left;
}

.auth-benefit-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.auth-benefits { margin-bottom: 32px; }

.auth-btn-primary {
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: opacity 0.18s, transform 0.15s;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.auth-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.auth-btn-secondary {
  width: 100%;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.auth-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 20px;
  line-height: 1.6;
}

.auth-note a { color: var(--text-dim); }

.auth-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0;
}

.auth-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.auth-loading p { font-size: 13px; color: var(--text-dim); }

/* LANDING */
#landing-screen {
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Hero ── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: calc(100vh - 58px);
  border-bottom: 1px solid var(--border);
}

.hero-left {
  padding: 72px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
}

.landing-kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.landing-kicker::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.landing-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.landing-title em {
  font-style: italic;
  color: var(--accent);
}

.landing-tagline {
  font-size: 16px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 440px;
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.landing-cta {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 36px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: opacity 0.18s, transform 0.18s;
  display: inline-block;
}

.landing-cta:hover { opacity: 0.85; transform: translateY(-1px); }

.landing-cta-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 36px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.18s;
  display: inline-block;
}

.landing-cta-secondary:hover { 
  background: var(--accent); 
  color: var(--bg); 
  transform: translateY(-1px); 
}

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

/* Hero right - mock UI preview */
.hero-right {
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.hero-right::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(139,159,196,0.04);
  pointer-events: none;
}

.mock-header {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

.mock-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mock-dot.g { background: var(--success); }
.mock-dot.a { background: var(--accent); }

.mock-msg {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
  animation: fadeUp 0.4s ease forwards;
}

.mock-msg.ai {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-top-left-radius: 3px;
  align-self: flex-start;
  max-width: 88%;
}

.mock-msg.user {
  background: var(--accent-soft);
  border: 1px solid rgba(139,159,196,0.2);
  border-top-right-radius: 3px;
  align-self: flex-end;
  max-width: 80%;
  text-align: right;
}

.mock-who {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.mock-score-bar {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-top: 4px;
}

.mock-score-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.mock-score-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 10px;
}

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

.mock-bar-fill {
  height: 100%;
  width: 74%;
  background: var(--accent);
  border-radius: 99px;
}

/* ── Features row ── */
.features-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
}

.feature-card {
  padding: 44px 44px;
  border-right: 1px solid var(--border);
  animation: fadeUp 0.5s ease forwards;
}

.feature-card:last-child { border-right: none; }

.feature-icon {
  font-size: 22px;
  margin-bottom: 16px;
  display: block;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.2;
}

.feature-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.75;
}

/* ── Ticker ── */
.ticker-wrap {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  position: relative;
}

.ticker-wrap::before,
.ticker-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}

.ticker-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}

.ticker-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 40s linear infinite;
  align-items: center;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-set { display: flex; align-items: center; white-space: nowrap; }

.ticker-item {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 0 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: color 0.2s;
}

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

.ticker-sep { color: var(--text-muted); font-size: 14px; flex-shrink: 0; user-select: none; }

/* ── Footer ── */
.landing-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  font-size: 12px;
  color: var(--text-muted);
}

.landing-footer-bar .creator { color: var(--text-dim); }

/* Feedback form in footer */
.footer-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-feedback input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text);
  outline: none;
  width: 220px;
  transition: border-color 0.18s;
}

.footer-feedback input:focus { border-color: var(--accent); }
.footer-feedback input::placeholder { color: var(--text-muted); }

.footer-feedback button {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.footer-feedback button:hover { border-color: var(--accent); color: var(--accent); }

.feedback-sent {
  font-size: 12px;
  color: var(--success);
  display: none;
}

/* ──────────────────────────────────────────────────────────────────── */
/* STUDY PLAN STYLES */
/* ──────────────────────────────────────────────────────────────────── */

/* Study Plan Intro */
#studyplan-intro-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  overflow-y: auto;
}

.studyplan-intro-inner {
  max-width: 700px;
  width: 100%;
  position: relative;
}

.sp-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  text-align: center;
}

.sp-subtitle {
  font-size: 15px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 50px;
}

.sp-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sp-step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.sp-step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.sp-step-content h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.sp-step-content p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Study Plan Dashboard */
#studyplan-dashboard-screen {
  flex-direction: column;
  padding: 40px 24px;
  overflow-y: auto;
}

.sp-dashboard {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.sp-dash-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.sp-dash-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.sp-focus-areas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 40px;
}

.sp-focus-areas h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

#sp-weak-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weak-area-tag {
  background: var(--accent-soft);
  border: 1px solid rgba(139,159,196,0.3);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-dim);
}

.sp-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.sp-day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.sp-day-card:hover { border-color: var(--accent); }
.sp-day-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.sp-day-num {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sp-day-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.sp-day-progress {
  font-size: 13px;
  color: var(--text-dim);
}

.sp-day-lock {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 20px;
  opacity: 0.4;
}

/* Daily Practice Screen */
.daily-practice-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

.dp-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
}

.dp-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.dp-progress {
  font-size: 13px;
  color: var(--text-dim);
}

/* SETUP */
#setup-screen {
  flex-direction: column;
  overflow-y: auto;
}

.setup-top-bar {
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.back-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.back-btn:hover { border-color: var(--accent); color: var(--accent); }

.setup-top-bar h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.setup-top-bar p { font-size: 13px; color: var(--text-dim); margin-left: 4px; }

.setup-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.setup-col {
  padding: 48px 52px;
  border-right: 1px solid var(--border);
}

.setup-col:last-child { border-right: none; }

.setup-col-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.setup-col-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 28px;
  line-height: 1.6;
}

.divider { height: 1px; background: var(--border); margin: 22px 0; }

.field-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 9px;
}

.opt-grid { display: grid; gap: 9px; }
.opt-grid.c1 { grid-template-columns: 1fr; }
.opt-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.opt-grid.c2 { grid-template-columns: repeat(2, 1fr); }

.opt-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: border-color 0.15s, background 0.15s;
}

.opt-btn:hover { border-color: var(--accent); }
.opt-btn.selected { border-color: var(--accent); background: rgba(139,159,196,0.07); }

.opt-name { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.opt-desc { font-size: 12px; color: var(--text-muted); }
.opt-btn.selected .opt-name { color: var(--accent); }

.setup-footer {
  padding: 24px 52px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.start-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 36px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: opacity 0.18s, transform 0.15s;
}

.start-btn:hover:not(:disabled) { opacity: 0.85; transform: translateY(-1px); }
.start-btn:disabled { opacity: 0.28; cursor: not-allowed; }

.setup-hint { font-size: 13px; color: var(--text-muted); }

/* INTERVIEW */
#interview-screen {
  flex-direction: row;
  height: calc(100vh - 58px);
  min-height: 0;
}

.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 16px;
  overflow-y: auto;
  min-height: 0;
}

.sb-label { font-size: 9px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 4px; }
.sb-value { font-family: var(--font-display); font-size: 13px; color: var(--text); }

.diff-pill { font-family: var(--font-display); display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.diff-pill.beginner     { background: rgba(106,158,127,0.12); color: var(--success); }
.diff-pill.intermediate { background: rgba(139,159,196,0.12); color: var(--accent); }
.diff-pill.advanced     { background: rgba(158,106,106,0.12); color: var(--danger); }

.tracker { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px; }
.tracker-label { font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 9px; }
.dot-row { display: flex; flex-wrap: wrap; gap: 5px; }

.xdot { width: 11px; height: 11px; border-radius: 2px; background: var(--border); transition: background 0.25s; }
.xdot.done    { background: var(--accent); }
.xdot.current { background: var(--accent); opacity: 0.4; animation: xp 1.2s infinite; }
@keyframes xp { 0%,100%{opacity:0.4} 50%{opacity:0.9} }

.tips-panel { background: var(--surface2); border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: var(--radius-sm); padding: 11px; flex: 1; }
.tips-panel .tip-hd { font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.tips-panel p { font-size: 12px; color: var(--text-dim); line-height: 1.7; }

.restart-side { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-family: var(--font-body); font-size: 12px; padding: 9px; cursor: pointer; transition: all 0.15s; text-align: center; }
.restart-side:hover { border-color: var(--danger); color: var(--danger); }

.chat-col { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

.messages { flex: 1; overflow-y: auto; padding: 30px 34px; display: flex; flex-direction: column; gap: 22px; min-height: 0; }
.messages::-webkit-scrollbar { width: 3px; }
.messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.msg-row { display: flex; gap: 11px; animation: fadeUp 0.25s ease forwards; }
.msg-row.user { flex-direction: row-reverse; }

.msg-av { width: 31px; height: 31px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; font-family: var(--font-body); }
.msg-row.ai   .msg-av { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(139,159,196,0.15); }
.msg-row.user .msg-av { background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border); font-size: 9px; }

.msg-body { max-width: 590px; }
.msg-who { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.msg-row.user .msg-who { text-align: right; }

.msg-bubble { padding: 13px 17px; border-radius: var(--radius); font-size: 14px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.msg-row.ai   .msg-bubble { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 3px; color: var(--text); }
.msg-row.user .msg-bubble { background: var(--surface2); border: 1px solid var(--border); border-top-right-radius: 3px; color: var(--text); }

.typing-row { display: flex; gap: 11px; animation: fadeUp 0.25s ease forwards; }
.typing-bubble { padding: 13px 17px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); border-top-left-radius: 3px; display: flex; gap: 5px; align-items: center; }
.typing-bubble span { width: 6px; height: 6px; background: var(--text-muted); border-radius: 50%; animation: tb 1.1s infinite; }
.typing-bubble span:nth-child(2) { animation-delay: 0.18s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.36s; }
@keyframes tb { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

.input-zone { padding: 14px 34px 20px; border-top: 1px solid var(--border); }
.input-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 13px; display: flex; align-items: flex-end; gap: 9px; transition: border-color 0.2s; }
.input-wrap:focus-within { border-color: var(--accent); }

#chat-input { flex: 1; background: transparent; border: none; outline: none; font-family: var(--font-body); font-size: 14px; color: var(--text); resize: none; max-height: 130px; line-height: 1.6; }
#chat-input::placeholder { color: var(--text-muted); }

#diag-input,
#dp-input {
  flex: 1; background: transparent; border: none; outline: none; font-family: var(--font-body); font-size: 14px; color: var(--text); resize: none; max-height: 130px; line-height: 1.6;
}
#diag-input::placeholder,
#dp-input::placeholder { color: var(--text-muted); }

#send-btn { width: 33px; height: 33px; background: var(--accent); border: none; border-radius: 8px; color: var(--bg); font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: opacity 0.15s, transform 0.15s; }
#send-btn:hover:not(:disabled) { opacity: 0.8; transform: scale(1.06); }
#send-btn:disabled { opacity: 0.22; cursor: not-allowed; }

#diag-send-btn,
#dp-send-btn {
  width: 33px; height: 33px; background: var(--accent); border: none; border-radius: 8px; color: var(--bg); font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: opacity 0.15s, transform 0.15s;
}
#diag-send-btn:hover:not(:disabled),
#dp-send-btn:hover:not(:disabled) { opacity: 0.8; transform: scale(1.06); }
#diag-send-btn:disabled,
#dp-send-btn:disabled { opacity: 0.22; cursor: not-allowed; }

.input-hint { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 7px; }
.err-bubble { color: var(--danger) !important; border-color: rgba(158,106,106,0.3) !important; }

/* RESULTS SCREEN */
#results-screen {
  flex-direction: row;
  overflow: hidden;
}

.results-left {
  width: 340px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  gap: 0;
}

.results-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.results-score-big {
  font-family: var(--font-display);
  font-size: 110px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -2px;
}

.results-score-denom {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.bar-track { height: 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; width: 100%; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 99px; width: 0%; transition: width 1.8s cubic-bezier(0.25, 1, 0.5, 1); }
.bar-sublabel { font-size: 12px; color: var(--text-muted); margin-top: 8px; font-style: italic; text-align: center; }

.results-meta { font-size: 12px; color: var(--text-muted); margin-top: 20px; letter-spacing: 0.06em; }

.results-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 32px; }

.btn-new { background: var(--accent); color: var(--bg); border: none; border-radius: var(--radius-sm); padding: 12px; font-family: var(--font-body); font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity 0.18s; text-align: center; }
.btn-new:hover { opacity: 0.82; }
.btn-next { background: transparent; border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 12px; font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; transition: all 0.18s; text-align: center; }
.btn-next:hover { background: var(--accent-soft); }
.btn-back-chat { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px; font-family: var(--font-body); font-size: 13px; color: var(--text-dim); cursor: pointer; transition: border-color 0.15s; text-align: center; }
.btn-back-chat:hover { border-color: var(--accent); }

/* Results right panel */
.results-right {
  flex: 1;
  overflow-y: auto;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.results-right::-webkit-scrollbar { width: 3px; }
.results-right::-webkit-scrollbar-thumb { background: var(--border); }

.results-section h3 {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.results-list { display: flex; flex-direction: column; gap: 10px; }

.results-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-dim);
}

.ri-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 9px;
}

.ri-dot.g { background: var(--success); }
.ri-dot.r { background: var(--danger); }

.reflection-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-style: italic;
}

/* Feedback */
.feedback-wrap { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; }
.fb-q { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; font-weight: 500; }
.fb-opts { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.fb-btn { padding: 6px 13px; border: 1px solid var(--border); border-radius: 20px; background: transparent; font-family: var(--font-body); font-size: 12px; color: var(--text-dim); cursor: pointer; transition: all 0.15s; }
.fb-btn:hover { border-color: var(--accent); color: var(--accent); }
.fb-btn.sel   { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.fb-ta { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; font-family: var(--font-body); font-size: 13px; color: var(--text); resize: none; outline: none; min-height: 68px; transition: border-color 0.18s; }
.fb-ta:focus { border-color: var(--accent); }
.fb-ta::placeholder { color: var(--text-muted); }

/* Spinner for loading state */
.spinner-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 56px 0; }
.spinner { width: 32px; height: 32px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }
.spinner-wrap p { font-size: 13px; color: var(--text-dim); }

/* HISTORY SCREEN */
#history-screen {
  flex-direction: column;
  overflow-y: auto;
}

.history-top {
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.history-top h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}

.history-body {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.history-left {
  border-right: 1px solid var(--border);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.stat-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.stat-box-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-box-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-box-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.history-right {
  padding: 32px 40px;
  overflow-y: auto;
}

.history-right h3 {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Chart */
.chart-wrap {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.chart-wrap::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 0; bottom: 32px;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(25% - 1px),
    var(--border) calc(25% - 1px),
    var(--border) 25%
  );
  pointer-events: none;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.chart-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  opacity: 0.85;
  transition: opacity 0.15s;
  min-height: 4px;
  position: relative;
}

.chart-bar:hover { opacity: 1; }

.chart-bar-score {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Session list */
.session-list { display: flex; flex-direction: column; gap: 8px; }

.session-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.session-score {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  width: 36px;
  flex-shrink: 0;
}

.session-info { flex: 1; }
.session-field { color: var(--text-dim); }
.session-diff  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.session-date  { font-size: 11px; color: var(--text-muted); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.clear-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: auto;
}

.clear-btn:hover { border-color: var(--danger); color: var(--danger); }
