/* ============================================================
   DECISION ENGINE — style.css
   Mobile-first, terminal aesthetic
   ============================================================ */

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

:root {
  --bg:         #0a0b0e;
  --surface:    #0f1117;
  --surface-2:  #141720;
  --surface-3:  #1a1e2a;
  --line:       #1e2330;
  --line-2:     #252c3a;

  --t1: #edf0f5;
  --t2: #8a95a8;
  --t3: #4e5a6e;
  --t4: #2e3848;

  --green:  #22d87a;
  --red:    #f0455a;
  --amber:  #f5a623;
  --blue:   #4f9cf9;

  --grade-a: #22d87a;
  --grade-b: #4f9cf9;
  --grade-c: #f5a623;
  --grade-d: #f0455a;

  --sans: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', monospace;

  --nav-h: 64px;
  --header-h: 56px;

  --r1: 4px;
  --r2: 10px;
  --r3: 16px;

  --ease: 0.15s ease;
  --ease-out: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ── Auth ──────────────────────────────────────────── */

.auth-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r3);
  padding: 28px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.auth-logo {
  color: var(--green);
  margin-bottom: 20px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--t1);
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13px;
  color: var(--t3);
  margin-bottom: 20px;
  line-height: 1.5;
  text-align: center;
}

.auth-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: 3px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--t3);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 7px;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--ease);
}

.auth-tab.active {
  background: var(--surface-3);
  color: var(--t1);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form[hidden] { display: none; }

.auth-error {
  font-size: 12px;
  padding: 10px 12px;
  border-radius: var(--r1);
  background: rgba(240,69,90,0.1);
  border: 1px solid rgba(240,69,90,0.3);
  color: var(--red);
  line-height: 1.5;
}

/* ── App Shell ─────────────────────────────────────── */

#appShell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

#appShell[hidden] { display: none; }

/* ── Screens ───────────────────────────────────────── */

.screens {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen.active { z-index: 1; }
.screen[hidden] { display: none; }

.screen-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
}

.screen-header h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.header-date {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t3);
  letter-spacing: 0.05em;
}

.screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: calc(var(--nav-h) + 20px);
  padding-bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 24px;
}

/* Scroll focused input into view above keyboard */
.screen-body:focus-within {
  scroll-padding-bottom: 24px;
}

/* ── Bottom Nav ────────────────────────────────────── */

.bottom-nav {
  height: var(--nav-h);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  border-top: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
  position: relative;
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--t4);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.nav-btn.active { color: var(--green); }
.nav-btn:hover  { color: var(--t2); }

/* ── Fields & Inputs ───────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label, .form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.text-input {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r1);
  color: var(--t1);
  font-family: var(--mono);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  width: 100%;
  -webkit-appearance: none;
  transition: border-color var(--ease);
}

.text-input:-webkit-autofill,
.text-input:-webkit-autofill:hover,
.text-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--surface-2) inset !important;
  -webkit-text-fill-color: var(--t1) !important;
  border-color: var(--line-2);
}

.text-input:focus { border-color: var(--green); }
.text-input::placeholder { color: var(--t4); }

/* ── Form Blocks ───────────────────────────────────── */

.form-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

/* ── Toggle Groups ─────────────────────────────────── */

.toggle-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.toggle-btn {
  flex: 1;
  min-width: 60px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--t3);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 11px 8px;
  border-radius: var(--r1);
  cursor: pointer;
  transition: all var(--ease);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.toggle-btn:hover { color: var(--t1); border-color: var(--line-2); }

.toggle-btn.selected {
  background: rgba(34,216,122,0.1);
  border-color: var(--green);
  color: var(--green);
}

.toggle-btn.selected-short {
  background: rgba(240,69,90,0.1);
  border-color: var(--red);
  color: var(--red);
}

.toggle-btn.selected-neutral {
  background: rgba(79,156,249,0.1);
  border-color: var(--blue);
  color: var(--blue);
}

.toggle-btn.selected-warn {
  background: rgba(245,166,35,0.1);
  border-color: var(--amber);
  color: var(--amber);
}

.toggle-btn.selected-bad {
  background: rgba(240,69,90,0.1);
  border-color: var(--red);
  color: var(--red);
}

.outcome-win.selected { background: rgba(34,216,122,0.1); border-color: var(--green); color: var(--green); }
.outcome-loss.selected { background: rgba(240,69,90,0.1); border-color: var(--red); color: var(--red); }

/* ── Notes ─────────────────────────────────────────── */

.notes-toggle {
  background: none;
  border: none;
  color: var(--t3);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color var(--ease);
}

.notes-toggle:hover { color: var(--t1); }

.notes-input {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r1);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 14px;
  padding: 12px 14px;
  outline: none;
  width: 100%;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  -webkit-appearance: none;
}

.notes-input:focus { border-color: var(--green); }
.notes-input::placeholder { color: var(--t4); }
.notes-input[hidden] { display: none; }

/* ── Buttons ───────────────────────────────────────── */

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green);
  color: #000;
  border: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--r2);
  cursor: pointer;
  transition: opacity var(--ease);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.01em;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-full { width: 100%; }

.btn-submit {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 14px;
  border-radius: var(--r2);
  cursor: pointer;
  transition: all var(--ease);
  letter-spacing: -0.01em;
  margin-top: 8px;
}

.btn-submit:hover { border-color: var(--green); color: var(--green); }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-back {
  background: none;
  border: none;
  color: var(--t3);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  transition: color var(--ease);
}

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

.form-error {
  font-size: 12px;
  color: var(--red);
  padding: 10px 12px;
  background: rgba(240,69,90,0.08);
  border: 1px solid rgba(240,69,90,0.2);
  border-radius: var(--r1);
}

/* ── Verdict Screen ────────────────────────────────── */

.verdict-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 28px;
}

.verdict-card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r3);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.verdict-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.verdict-grade-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.verdict-grade {
  font-family: var(--mono);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.grade-a { color: var(--grade-a); }
.grade-b { color: var(--grade-b); }
.grade-c { color: var(--grade-c); }
.grade-d { color: var(--grade-d); }

.verdict-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--r1);
  border: 1px solid currentColor;
}

.tag-a { color: var(--grade-a); background: rgba(34,216,122,0.08); }
.tag-b { color: var(--grade-b); background: rgba(79,156,249,0.08); }
.tag-c { color: var(--grade-c); background: rgba(245,166,35,0.08); }
.tag-d { color: var(--grade-d); background: rgba(240,69,90,0.08); }

.verdict-headline {
  font-size: 17px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.verdict-message {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.6;
}

.result-classification {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t3);
}

/* ── Trades List ───────────────────────────────────── */

.trades-filter {
  display: flex;
  gap: 6px;
}

.filter-pill {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--t3);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--ease);
}

.filter-pill.active {
  background: var(--surface-3);
  border-color: var(--line-2);
  color: var(--t1);
}

.trade-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.trade-card:hover { border-color: var(--line-2); background: var(--surface-2); }

.trade-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.trade-pair {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
}

.trade-grade {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
}

.trade-card-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trade-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid currentColor;
  text-transform: uppercase;
}

.badge-long  { color: var(--green); background: rgba(34,216,122,0.08); }
.badge-short { color: var(--red);   background: rgba(240,69,90,0.08); }
.badge-active { color: var(--blue);  background: rgba(79,156,249,0.08); }
.badge-completed { color: var(--t3); background: rgba(255,255,255,0.04); }
.badge-win   { color: var(--green); background: rgba(34,216,122,0.08); }
.badge-loss  { color: var(--red);   background: rgba(240,69,90,0.08); }

.trade-date {
  font-size: 11px;
  color: var(--t4);
  font-family: var(--mono);
  margin-left: auto;
}

.trade-action {
  width: 100%;
  margin-top: 12px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--t2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 9px;
  border-radius: var(--r1);
  cursor: pointer;
  transition: all var(--ease);
  text-align: center;
}

.trade-action:hover { border-color: var(--green); color: var(--green); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--t4);
}

.empty-state p { font-size: 14px; margin-top: 8px; }

/* ── Complete Screen ───────────────────────────────── */

.complete-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 16px;
  margin-bottom: 24px;
}

.complete-summary-pair {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 6px;
}

.complete-summary-grade {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--t3);
}

/* ── Insights ──────────────────────────────────────── */

.insights-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--t4);
  font-size: 14px;
  line-height: 1.6;
}

.insight-headline {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r2);
  padding: 20px;
  margin-bottom: 16px;
}

.insight-headline-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 8px;
}

.insight-headline-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.02em;
  line-height: 1.4;
}

.insight-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.insight-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 16px;
}

.insight-stat-value {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.insight-stat-label {
  font-size: 11px;
  color: var(--t3);
  letter-spacing: 0.02em;
}

.insight-patterns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insight-pattern {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 16px;
  font-size: 14px;
  color: var(--t2);
  line-height: 1.5;
  border-left: 3px solid var(--amber);
}

/* ── Insight sections ──────────────────────────────── */

.insight-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 16px;
  margin-bottom: 16px;
  min-width: 0;
  box-sizing: border-box;
}

.insight-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 14px;
}

.insight-quadrant {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.insight-quad {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: 14px 12px;
}

.insight-quad-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.insight-quad-label {
  font-size: 11px;
  color: var(--t3);
  line-height: 1.4;
}

/* ── Sign out ──────────────────────────────────────── */

.signout-btn {
  display: block;
  width: 100%;
  margin-top: 24px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--t4);
  font-family: var(--sans);
  font-size: 13px;
  padding: 12px;
  border-radius: var(--r1);
  cursor: pointer;
  transition: all var(--ease);
  text-align: center;
}

.signout-btn:hover { color: var(--red); border-color: rgba(240,69,90,0.4); }

/* ── Scrollbar ─────────────────────────────────────── */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 2px; }

/* ── Desktop ───────────────────────────────────────── */

@media (min-width: 481px) {
  #appShell {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }

  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--bg);
    background-image:
      linear-gradient(var(--line) 1px, transparent 1px),
      linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 32px 32px;
    z-index: -1;
  }
}

#authScreen[hidden] { display: none !important; }
#appShell[hidden]   { display: none !important; }

/* ── Trade action row ──────────────────────────────── */
.trade-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.trade-action--complete {
  flex: 2;
}

.trade-action--edit {
  flex: 1;
  color: var(--t3);
}

.trade-action--edit:hover {
  color: var(--blue);
  border-color: rgba(79,156,249,0.4);
}

.trade-action--delete {
  flex: 1;
  color: var(--t3);
}

.trade-action--delete:hover {
  color: var(--red);
  border-color: rgba(240,69,90,0.4);
}

/* ── Delete Modal ──────────────────────────────────── */
.delete-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,8,11,0.8);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 24px 0;
  animation: fade-in 0.15s ease;
}

.delete-modal-overlay[hidden] { display: none; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.delete-modal {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r3);
  padding: 28px 24px;
  width: calc(100% - 32px);
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  animation: slide-up 0.2s cubic-bezier(0.16,1,0.3,1);
}

@keyframes slide-up {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.delete-modal-icon {
  color: var(--red);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(240,69,90,0.1);
  border: 1px solid rgba(240,69,90,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.delete-modal-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.delete-modal-sub {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.55;
}

.delete-modal-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.delete-modal-actions .btn-ghost {
  flex: 1;
  padding: 12px;
  text-align: center;
  justify-content: center;
}

.btn-danger {
  flex: 1;
  background: var(--red);
  color: #fff;
  border: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--r1);
  cursor: pointer;
  transition: opacity var(--ease);
  letter-spacing: -0.01em;
}

.btn-danger:hover { opacity: 0.85; }

/* ── Evidence anchoring ────────────────────────────── */
.anchor-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  animation: anchor-in 0.2s ease;
}

@keyframes anchor-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.anchor-wrap[hidden] { display: none; }

.anchor-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--amber);
  letter-spacing: 0.03em;
  font-family: var(--sans);
  text-transform: none;
}

.anchor-input {
  background: var(--surface-2);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: var(--r1);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  width: 100%;
  resize: none;
  line-height: 1.55;
  -webkit-appearance: none;
  transition: border-color var(--ease);
}

.anchor-input:focus { border-color: var(--amber); }
.anchor-input::placeholder { color: var(--t4); font-style: italic; }

/* ── Comparison screen ─────────────────────────────── */
.comparison-card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r2);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.comparison-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0;
}

.comparison-block:first-child { padding-top: 0; }
.comparison-block:last-child  { padding-bottom: 0; }

.comparison-divider {
  height: 1px;
  background: var(--line);
}

.comparison-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t3);
}

.comparison-text {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.6;
  font-style: italic;
}

/* ── Trade Detail Screen ───────────────────────────── */
.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t4);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t4);
  font-family: var(--sans);
}

.detail-field-value {
  font-size: 14px;
  color: var(--t1);
  font-family: var(--sans);
  line-height: 1.4;
}

.detail-field-value.prose {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.6;
  font-style: italic;
}

.detail-field.full {
  grid-column: 1 / -1;
}

.detail-grade-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r2);
}

.detail-grade-big {
  font-family: var(--mono);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.detail-grade-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-outcome-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r1);
  margin-bottom: 12px;
}

.detail-thesis-reality {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r2);
  overflow: hidden;
}

.detail-tr-block {
  padding: 14px 16px;
}

.detail-tr-block:first-child {
  border-bottom: 1px solid var(--line);
}

.detail-tr-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 6px;
}

.detail-tr-text {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.6;
  font-style: italic;
}

.detail-variables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-var {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.detail-var-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t4);
  font-family: var(--sans);
}

.detail-var-value {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--sans);
}

.var-good  { color: var(--green); }
.var-bad   { color: var(--red); }
.var-neutral { color: var(--t2); }

.trade-action--view {
  flex: 2;
  color: var(--t2);
}

.trade-action--view:hover {
  color: var(--blue);
  border-color: rgba(79,156,249,0.4);
}

/* ── Forgot password ───────────────────────────────── */
.forgot-password-link {
  background: none;
  border: none;
  color: var(--t3);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-align: center;
  width: 100%;
  margin-top: 4px;
  transition: color var(--ease);
}

.forgot-password-link:hover { color: var(--t1); }

.auth-form-desc {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.55;
  margin-bottom: 4px;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r1);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 14px;
  padding: 12px 14px;
  outline: none;
  width: 100%;
  -webkit-appearance: none;
  transition: border-color var(--ease);
  box-sizing: border-box;
}

.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus {
  border-color: var(--green);
}

.auth-card input[type="email"]:-webkit-autofill,
.auth-card input[type="email"]:-webkit-autofill:hover,
.auth-card input[type="email"]:-webkit-autofill:focus,
.auth-card input[type="password"]:-webkit-autofill,
.auth-card input[type="password"]:-webkit-autofill:hover,
.auth-card input[type="password"]:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--surface-2) inset !important;
  -webkit-text-fill-color: var(--t1) !important;
  border-color: var(--line-2);
}

.auth-card input::placeholder {
  color: var(--t4);
}

/* ── Loading state ─────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
  color: var(--t4);
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line-2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p {
  font-size: 13px;
  color: var(--t4);
}

/* ── Empty state improved ──────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--t4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-icon {
  font-size: 28px;
  color: var(--t4);
  margin-bottom: 4px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
  color: var(--t3);
  margin: 0;
}

.empty-sub {
  font-size: 12px !important;
  color: var(--t4) !important;
  max-width: 240px;
  line-height: 1.5;
}

/* ── Auth logo image ───────────────────────────────── */
.auth-logo-img {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}

.auth-logo-png {
  width: 200px;
  height: auto;
  display: block;
}

/* ── Verdict breakdown ─────────────────────────────── */
.verdict-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.verdict-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--r1);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.breakdown-item.pass {
  border-color: rgba(34,216,122,0.25);
  background: rgba(34,216,122,0.05);
}

.breakdown-item.neutral {
  border-color: rgba(79,156,249,0.2);
  background: rgba(79,156,249,0.04);
}

.breakdown-item.fail {
  border-color: rgba(240,69,90,0.25);
  background: rgba(240,69,90,0.05);
}

.breakdown-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t4);
  font-family: var(--sans);
}

.breakdown-value {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--sans);
}

.breakdown-item.pass .breakdown-value  { color: var(--green); }
.breakdown-item.neutral .breakdown-value { color: var(--blue); }
.breakdown-item.fail .breakdown-value  { color: var(--red); }

.breakdown-score {
  font-family: var(--mono);
  font-size: 10px;
  margin-left: auto;
}

.breakdown-item.pass .breakdown-score  { color: var(--green); }
.breakdown-item.neutral .breakdown-score { color: var(--blue); }
.breakdown-item.fail .breakdown-score  { color: var(--red); }
/* ── Side Menu ─────────────────────────────────────── */

#appShell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

.side-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(2px);
}
.side-menu-overlay.visible { opacity: 1; }
.side-menu-overlay[hidden] { display: none; }

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--line-2);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--ease-out);
  padding-bottom: env(safe-area-inset-bottom);
}
.side-menu.open { transform: translateX(0); }

.side-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.side-menu-logo {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.side-menu-close {
  background: none;
  border: none;
  color: var(--t3);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r1);
  transition: color var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.side-menu-close:hover { color: var(--t1); }

.side-menu-items {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.side-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: none;
  border-radius: var(--r2);
  color: var(--t3);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.side-nav-btn:hover { background: var(--surface-2); color: var(--t2); }
.side-nav-btn.active {
  background: rgba(34,216,122,0.08);
  color: var(--green);
  border: 1px solid rgba(34,216,122,0.15);
}

.side-menu-footer {
  padding: 12px 12px 16px;
  border-top: 1px solid var(--line);
}

.side-nav-signout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  border-radius: var(--r2);
  color: var(--t4);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.side-nav-signout:hover { color: var(--red); background: rgba(240,69,90,0.06); }

/* ── Hamburger ─────────────────────────────────────── */

.hamburger-btn {
  background: none;
  border: none;
  color: var(--t2);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r1);
  transition: color var(--ease);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.hamburger-btn:hover { color: var(--t1); }

/* ── Screen body — no bottom nav padding needed ─────── */
.screen-body {
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* ── Home Screen ───────────────────────────────────── */

.home-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

.home-greeting {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 6px;
}

.home-oneliner {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--t1);
  margin-bottom: 24px;
}
.home-oneliner span { color: var(--green); }
.home-oneliner span.amber { color: var(--amber); }
.home-oneliner span.red   { color: var(--red); }

.home-cta {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.home-cta-primary {
  flex: 1;
  padding: 13px 18px;
  background: var(--green);
  color: #0a0b0e;
  border: none;
  border-radius: var(--r2);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity var(--ease);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: -0.01em;
}
.home-cta-primary:hover { opacity: 0.88; }

.home-cta-secondary {
  padding: 13px 18px;
  background: var(--surface-2);
  color: var(--t2);
  border: 1px solid var(--line-2);
  border-radius: var(--r2);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.home-cta-secondary:hover { color: var(--t1); border-color: var(--t4); }

.home-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.home-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 16px;
}

.home-stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t4);
  margin-bottom: 8px;
}

.home-stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--t1);
}
.home-stat-value.green { color: var(--green); }
.home-stat-value.amber { color: var(--amber); }
.home-stat-value.red   { color: var(--red); }
.home-stat-value.blue  { color: var(--blue); }

.home-stat-sub {
  font-size: 11px;
  color: var(--t3);
  margin-top: 4px;
  font-family: var(--mono);
}

.home-section-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t4);
  margin-bottom: 10px;
}

.home-last-trade {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 14px 16px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: border-color var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.home-last-trade:hover { border-color: var(--line-2); }

.home-last-trade-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.home-last-pair {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.home-last-meta {
  font-size: 11px;
  color: var(--t3);
  font-family: var(--mono);
}

.home-improve-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--r2);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.home-improve-title {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}

.home-improve-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--t2);
  line-height: 1.5;
  margin-bottom: 6px;
}
.home-improve-item:last-child { margin-bottom: 0; }
.home-improve-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--amber);
  margin-top: 6px;
  flex-shrink: 0;
}

.home-streak-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-streak-left {}
.home-streak-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t4);
  margin-bottom: 4px;
}
.home-streak-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--green);
}
.home-streak-sub {
  font-size: 11px;
  color: var(--t3);
  font-family: var(--mono);
  margin-top: 2px;
}

.home-streak-dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 140px;
}
.home-streak-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-2);
}
.home-streak-dot.good  { background: var(--green); }
.home-streak-dot.bad   { background: var(--red); }
.home-streak-dot.mid   { background: var(--amber); }

.home-grade-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.home-grade-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.home-grade-row:last-child { margin-bottom: 0; }

.home-grade-lbl {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  width: 16px;
  flex-shrink: 0;
}
.home-grade-track {
  flex: 1;
  height: 5px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.home-grade-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.16,1,0.3,1);
}
.home-grade-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--t4);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Cookie Banner ─────────────────────────────────── */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-2);
  border-top: 1px solid var(--line-2);
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 500;
  animation: slideUp 0.3s ease;
}
.cookie-banner[hidden] { display: none; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.cookie-text {
  font-size: 12px;
  color: var(--t3);
  line-height: 1.5;
}
.cookie-link {
  color: var(--green);
  text-decoration: none;
}
.cookie-link:hover { text-decoration: underline; }

.cookie-accept {
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--t2);
  border-radius: var(--r1);
  padding: 6px 14px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.cookie-accept:hover { color: var(--t1); border-color: var(--t3); }

/* ── Side menu legal links ─────────────────────────── */

.side-menu-legal {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 10px;
}

.side-menu-legal-link {
  font-size: 11px;
  color: var(--t4);
  text-decoration: none;
  transition: color var(--ease);
}
.side-menu-legal-link:hover { color: var(--t2); }

.side-menu-legal-sep {
  font-size: 11px;
  color: var(--t4);
}

/* ── Trade card clickable ──────────────────────────── */

.trade-card {
  cursor: pointer;
}
.trade-card:active {
  opacity: 0.85;
}

/* ── Edit action bar ───────────────────────────────── */

.edit-action-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
}
.edit-action-bar[hidden] { display: none; }

.edit-action-complete {
  flex: 1;
  padding: 10px 14px;
  background: rgba(34,216,122,0.08);
  border: 1px solid rgba(34,216,122,0.2);
  border-radius: var(--r1);
  color: var(--green);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.edit-action-complete:hover {
  background: rgba(34,216,122,0.14);
}

.edit-action-delete {
  padding: 10px 14px;
  background: transparent;
  border: 1px solid rgba(240,69,90,0.2);
  border-radius: var(--r1);
  color: var(--red);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.edit-action-delete:hover {
  background: rgba(240,69,90,0.06);
}

/* ── Settings Screen ───────────────────────────────── */

.settings-section {
  margin-bottom: 24px;
}

.settings-section-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t4);
  margin-bottom: 8px;
  padding: 0 2px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  overflow: hidden;
}

.settings-card--danger {
  border-color: rgba(240,69,90,0.2);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.settings-row-left {
  min-width: 0;
  flex: 1;
}

.settings-row-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  margin-bottom: 2px;
}

.settings-row-value {
  font-size: 12px;
  color: var(--t3);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-row-action {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r1);
  color: var(--t2);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.settings-row-action:hover { color: var(--t1); border-color: var(--t3); }

.settings-row-action--danger {
  color: var(--red);
  border-color: rgba(240,69,90,0.2);
  background: transparent;
}
.settings-row-action--danger:hover {
  background: rgba(240,69,90,0.06);
  border-color: rgba(240,69,90,0.4);
}

.settings-divider {
  height: 1px;
  background: var(--line);
  margin: 0 16px;
}

/* ── Settings Modals ───────────────────────────────── */

.settings-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.settings-modal-overlay[hidden] { display: none; }

.settings-modal {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r3) var(--r3) 0 0;
  padding: 24px 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  animation: slideUpModal 0.25s cubic-bezier(0.16,1,0.3,1);
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes slideUpModal {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.settings-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.settings-modal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.settings-modal-close {
  background: none;
  border: none;
  color: var(--t3);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r1);
  transition: color var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.settings-modal-close:hover { color: var(--t1); }

/* ── Zero State Home ───────────────────────────────── */

.zero-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
}

.zero-headline {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--t1);
  margin-bottom: 12px;
}

.zero-headline-green {
  color: var(--green);
}

.zero-sub {
  font-size: 14px;
  color: var(--t3);
  line-height: 1.6;
  margin-bottom: 24px;
  font-family: var(--mono);
}

.zero-grades {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 32px;
}

.zero-grade-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 14px;
}

.zero-grade-letter {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 6px;
}

.zero-grade-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.zero-grade-desc {
  font-size: 11px;
  color: var(--t4);
  line-height: 1.5;
  font-family: var(--mono);
}

.zero-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  overflow: hidden;
}

.zero-step {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.zero-step:last-child { border-bottom: none; }

.zero-step-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  flex-shrink: 0;
  width: 20px;
  padding-top: 2px;
}

.zero-step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.zero-step-desc {
  font-size: 12px;
  color: var(--t3);
  line-height: 1.55;
  font-family: var(--mono);
}

.zero-honest {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--r2);
  padding: 16px;
  margin-bottom: 20px;
}

.zero-honest-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}

.zero-honest-text {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.65;
}

/* ── Header logo ───────────────────────────────────── */
/* Logo — home screen header only */
.header-logo-home {
  height: 24px;
  width: auto;
  opacity: 0.9;
  pointer-events: none;
  display: block;
  margin: 0 auto;
  flex: 1;
  object-fit: contain;
  object-position: center;
}

/* ── Side menu brand mark ──────────────────────────── */

.side-menu-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-menu-ae-mark {
  width: 36px;
  height: 36px;
  background: #0a0b0e;
  border: 1px solid #252c3a;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px 0;
}
.side-menu-ae-a, .side-menu-ae-e {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--t1);
  line-height: 1;
  letter-spacing: -0.02em;
}
.side-menu-ae-line {
  width: 22px;
  height: 1.5px;
  background: var(--green);
  margin: 2px 0;
  flex-shrink: 0;
}
.side-menu-wordmark {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-menu-wordmark-main {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.01em;
  line-height: 1;
}
.side-menu-wordmark-sub {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--t4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}
/* ── Insights locked state ─────────────────────────── */

.insights-locked {
  padding: 48px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.insights-locked-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 14px;
}

.insights-locked-headline {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--t1);
  line-height: 1.15;
  margin-bottom: 16px;
}

.insights-locked-sub {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 340px;
}

.insights-locked-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.insights-locked-pip {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
}

.insights-locked-pip.filled {
  background: var(--green);
}

.insights-locked-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--t4);
  letter-spacing: 0.06em;
}

/* ── Profile Screen ────────────────────────────────── */

.profile-hero { padding: 32px 20px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; border-bottom: 1px solid var(--line); }
.profile-badge { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; border: 1.5px solid; border-radius: 8px; padding: 6px 20px; margin-bottom: 14px; }
.profile-desc { font-size: 13px; color: var(--t2); line-height: 1.6; max-width: 280px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.profile-stat { background: var(--bg); padding: 20px 12px; text-align: center; }
.profile-stat-val { font-size: 24px; font-weight: 700; color: var(--t1); letter-spacing: -0.02em; line-height: 1; margin-bottom: 4px; font-family: var(--mono); }
.profile-stat-label { font-size: 11px; color: var(--t3); font-family: var(--mono); letter-spacing: 0.04em; }
.profile-next { padding: 20px; border-bottom: 1px solid var(--line); }
.profile-next-label { font-size: 11px; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--t3); margin-bottom: 12px; }
.profile-progress-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.profile-progress-label { font-size: 11px; color: var(--t3); font-family: var(--mono); width: 44px; flex-shrink: 0; }
.profile-progress-track { flex: 1; height: 4px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.profile-progress-fill { height: 100%; border-radius: 2px; transition: width 0.4s ease; }
.profile-progress-val { font-size: 11px; color: var(--t3); font-family: var(--mono); width: 72px; text-align: right; flex-shrink: 0; }
.profile-section-label { font-size: 10px; font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--t4); margin-bottom: 12px; }
.profile-rewards { padding: 20px; border-bottom: 1px solid var(--line); }
.profile-empty-rewards { font-size: 13px; color: var(--t3); line-height: 1.6; }
.profile-reward { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.profile-reward:last-child { margin-bottom: 0; }
.profile-reward-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.profile-reward-title { font-size: 13px; font-weight: 600; color: var(--t1); margin-bottom: 2px; }
.profile-reward-desc { font-size: 12px; color: var(--t2); line-height: 1.5; }
.profile-levels { padding: 20px; }
.profile-level-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.profile-level-row:last-child { border-bottom: none; }
.profile-level-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.profile-level-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.profile-level-name { font-size: 13px; font-weight: 500; }
.profile-level-req { font-size: 11px; color: var(--t3); font-family: var(--mono); }
.profile-level-current { font-size: 10px; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--t3); background: var(--surface); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 7px; }

/* ── Home level badge ──────────────────────────────── */

.home-level-badge { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid; border-radius: 6px; padding: 3px 10px; background: transparent; cursor: pointer; transition: opacity 0.15s ease; }
.home-level-badge:hover { opacity: 0.7; }
/* ── Home leaderboard card ─────────────────────────────────── */

.home-lb-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r2);
  padding: 14px 16px;
  margin-top: 20px;
  cursor: pointer;
  transition: opacity var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.home-lb-card:hover { opacity: 0.8; }
.home-lb-card-left { display: flex; flex-direction: column; gap: 2px; }
.home-lb-card-label { font-size: 13px; font-weight: 600; color: var(--t1); letter-spacing: -0.01em; }
.home-lb-card-sub { font-size: 12px; color: var(--t3); font-family: var(--mono); }

/* ── Leaderboard screen ────────────────────────────────────── */

.lb-join { padding: 32px 0 48px; }
.lb-join-eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green); margin-bottom: 12px; }
.lb-join-headline { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; color: var(--t1); line-height: 1.2; margin-bottom: 10px; }
.lb-join-sub { font-size: 14px; color: var(--t2); line-height: 1.6; margin-bottom: 28px; }
.lb-join-form { margin-bottom: 28px; }

.lb-visibility-opts { display: flex; flex-direction: column; gap: 8px; }
.lb-vis-btn { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r2); padding: 14px; cursor: pointer; text-align: left; transition: border-color var(--ease); -webkit-tap-highlight-color: transparent; width: 100%; }
.lb-vis-btn.active { border-color: var(--green); background: rgba(34,216,122,0.04); }
.lb-vis-icon { font-size: 16px; color: var(--t3); flex-shrink: 0; margin-top: 1px; line-height: 1; }
.lb-vis-btn.active .lb-vis-icon { color: var(--green); }
.lb-vis-title { font-size: 13px; font-weight: 600; color: var(--t1); margin-bottom: 2px; }
.lb-vis-desc { font-size: 12px; color: var(--t3); font-family: var(--mono); line-height: 1.5; }

.lb-join-info { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); }
.lb-join-info-row { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; color: var(--t3); font-family: var(--mono); line-height: 1.5; }
.lb-join-info-icon { color: var(--green); flex-shrink: 0; font-size: 11px; margin-top: 1px; }

.lb-timeframe-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r1); padding: 3px; }
.lb-tab { flex: 1; background: transparent; border: none; color: var(--t3); font-family: var(--mono); font-size: 12px; font-weight: 500; padding: 7px; border-radius: 3px; cursor: pointer; transition: all var(--ease); letter-spacing: 0.03em; }
.lb-tab.active { background: var(--surface-3); color: var(--t1); }

.lb-my-rank { display: flex; align-items: center; gap: 10px; background: rgba(34,216,122,0.05); border: 1px solid rgba(34,216,122,0.2); border-radius: var(--r2); padding: 12px 14px; margin-bottom: 16px; }
.lb-my-rank--pending { background: var(--surface); border-color: var(--line); }
.lb-my-rank-label { font-size: 11px; font-family: var(--mono); color: var(--t3); letter-spacing: 0.04em; flex-shrink: 0; }
.lb-my-rank-val { font-size: 16px; font-weight: 700; color: var(--green); font-family: var(--mono); flex-shrink: 0; }
.lb-my-rank-score { font-size: 12px; color: var(--t3); font-family: var(--mono); margin-left: auto; }

.lb-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; margin-bottom: 12px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: none; }
.lb-row--me { background: rgba(34,216,122,0.03); }
.lb-rank { font-family: var(--mono); font-size: 13px; font-weight: 600; width: 24px; flex-shrink: 0; text-align: center; }
.lb-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--t1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.lb-you { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); background: rgba(34,216,122,0.1); border: 1px solid rgba(34,216,122,0.2); border-radius: 4px; padding: 1px 6px; flex-shrink: 0; }
.lb-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.lb-score { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--t1); }
.lb-trades { font-family: var(--mono); font-size: 10px; color: var(--t3); }

.lb-empty { padding: 40px 0; text-align: center; }
.lb-empty-text { font-size: 13px; color: var(--t3); font-family: var(--mono); }
.lb-footnote { font-size: 11px; color: var(--t4); font-family: var(--mono); line-height: 1.6; margin-top: 8px; }

.lb-settings-btn { background: none; border: 1px solid var(--line-2); border-radius: 6px; color: var(--t3); font-family: var(--mono); font-size: 11px; padding: 4px 10px; cursor: pointer; transition: color var(--ease), border-color var(--ease); -webkit-tap-highlight-color: transparent; }
.lb-settings-btn:hover { color: var(--t1); border-color: var(--t3); }
/* ── Field info button ─────────────────────────────────────── */

.field-info-btn {
  background: none;
  border: none;
  color: var(--t4);
  font-size: 13px;
  cursor: pointer;
  padding: 0 0 0 4px;
  line-height: 1;
  vertical-align: middle;
  transition: color var(--ease);
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
}
.field-info-btn:hover { color: var(--t2); }

/* ── Form label row ────────────────────────────────────────── */
.form-label-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Field info modal — centered with green accent ─────────── */

#fieldInfoModal {
  align-items: center;
  padding: 24px;
}

#fieldInfoModal .settings-modal {
  border-radius: var(--r3);
  border-color: var(--green);
  border-width: 1px;
  max-width: 420px;
  animation: fadeScaleIn 0.2s cubic-bezier(0.16,1,0.3,1);
}

@keyframes fadeScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

#fieldInfoModal .settings-modal-title {
  color: var(--green);
}

#fieldInfoModal #fieldInfoBody {
  border-left: 2px solid var(--green);
  padding-left: 12px;
  margin-top: 4px;
}

/* ── Streak card personal best ─────────────────────────────── */
.home-streak-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.home-streak-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.home-streak-pb-label { font-size: 10px; font-family: var(--mono); color: var(--t3); letter-spacing: 0.06em; text-transform: uppercase; }
.home-streak-pb-val { font-size: 20px; font-weight: 700; color: var(--t2); font-family: var(--mono); line-height: 1; }

/* ── Checklist modal ───────────────────────────────────────── */
.checklist-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r2); cursor: pointer; transition: border-color var(--ease); -webkit-tap-highlight-color: transparent; }
.checklist-item:hover { border-color: var(--line-2); opacity: 0.85; }
.checklist-item.checked { border-color: rgba(34,216,122,0.3); background: rgba(34,216,122,0.04); }
.checklist-check { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--line-2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all var(--ease); }
.checklist-text { font-size: 13px; color: var(--t2); line-height: 1.55; padding-top: 2px; }
.checklist-item.checked .checklist-text { color: var(--t1); }

/* ── Session journal modal ─────────────────────────────────── */
#sessionJournalModal .settings-modal-title { color: var(--t1); }

/* ── Profile journal history ───────────────────────────────── */
.profile-journal { padding: 20px; border-top: 1px solid var(--line); }
.profile-journal-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.profile-journal-row:last-child { border-bottom: none; }
.profile-journal-date { font-size: 10px; font-family: var(--mono); color: var(--t3); letter-spacing: 0.06em; margin-bottom: 4px; }
.profile-journal-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.profile-journal-focus { font-size: 12px; color: var(--t2); font-family: var(--mono); }
.profile-journal-mood { font-size: 12px; font-weight: 500; font-family: var(--mono); }
.profile-journal-notes { font-size: 12px; color: var(--t3); line-height: 1.55; margin-top: 4px; }

/* ── Verdict journal prompt ────────────────────────────────── */
.verdict-journal-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r2);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--ease), opacity var(--ease);
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}
.verdict-journal-btn:hover { opacity: 0.85; }
.verdict-journal-btn-left { display: flex; flex-direction: column; gap: 2px; }
.verdict-journal-btn-title { font-size: 13px; font-weight: 600; color: var(--t1); }
.verdict-journal-btn-sub { font-size: 12px; color: var(--t3); font-family: var(--mono); }

/* ── Home tools card ───────────────────────────────────────── */
.home-tools-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  overflow: hidden;
  margin-bottom: 20px;
}
.home-tool-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.home-tool-row:hover { background: var(--surface-2); }
.home-tool-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t3);
  flex-shrink: 0;
}
.home-tool-body { flex: 1; min-width: 0; }
.home-tool-title { font-size: 13px; font-weight: 600; color: var(--t1); letter-spacing: -0.01em; margin-bottom: 1px; }
.home-tool-sub { font-size: 11px; color: var(--t3); font-family: var(--mono); }
.home-tool-divider { height: 1px; background: var(--line); margin: 0 16px; }