/* ═══════════════════════════════════════════════════
   NexoChart — Verdict-First Design System
   ═══════════════════════════════════════════════════ */

:root {
  --bg0:    oklch(0.155 0.014 256);
  --bg1:    oklch(0.198 0.017 256);
  --bg2:    oklch(0.235 0.02  256);
  --line:   oklch(0.32  0.018 256);
  --t1:     oklch(0.97  0.004 250);
  --t2:     oklch(0.74  0.012 250);
  --t3:     oklch(0.55  0.016 252);
  --accent: oklch(0.74  0.155 226);
  --buy:    oklch(0.80  0.15  158);
  --sell:   oklch(0.67  0.20   23);
  --hold:   oklch(0.82  0.12   88);

  --font-ui:   'Manrope', system-ui, sans-serif;
  --font-brand:'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
  height: 100%;
  background: var(--bg0);
  color: var(--t1);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }


/* ═══════════════════════════════════════════════════
   Root layout
   ═══════════════════════════════════════════════════ */

.app-root {
  display: flex;
  height: 100vh;
  min-height: 700px;
  overflow: hidden;
}


/* ═══════════════════════════════════════════════════
   Sidebar
   ═══════════════════════════════════════════════════ */

.sidebar {
  width: 266px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--bg1);
  display: flex;
  flex-direction: column;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 18px 14px;
}

.brand-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: oklch(0.16 0.03 256);
  font-weight: 700;
  font-family: var(--font-brand);
  font-size: 15px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 16px;
  color: var(--t1);
  letter-spacing: -0.01em;
}

.sidebar-logo {
  height: 36px;
  width: auto;
  display: block;
}

/* Sidebar nav links */
.sidebar-nav-section {
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--t2);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.sidebar-nav-item:hover { background: oklch(0.24 0.018 256 / 0.6); color: var(--t1); }
.sidebar-nav-item.active { background: oklch(0.74 0.155 226 / 0.12); color: var(--accent); }
.sidebar-nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

/* New analysis button */
.sidebar-new {
  padding: 4px 14px 12px;
}

.btn-new-analysis {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: 10px;
  background: var(--accent);
  border: none;
  color: oklch(0.16 0.03 256);
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-new-analysis:hover { opacity: 0.88; }

.btn-new-plus {
  font-size: 16px;
  line-height: 1;
}

/* Search */
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 14px 10px;
  padding: 9px 12px;
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.search-icon {
  color: var(--t3);
  font-size: 13px;
}

.sidebar-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--t3);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: not-allowed;
}
.sidebar-search input::placeholder { color: var(--t3); }

/* Recent reads label */
.sidebar-reads-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 22px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  color: var(--t3);
  text-transform: uppercase;
}

.reads-count {
  font-family: var(--font-mono);
  font-size: 11px;
}

/* History list */
.sidebar-history {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 10px;
}

.history-row {
  display: block;
  width: 100%;
  padding: 11px 18px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.history-row:hover { background: oklch(0.24 0.018 256 / 0.6); }

.history-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-pair {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--t1);
}

.history-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.chip-buy  { background: oklch(0.80 0.15 158 / 0.18); color: var(--buy);  border: 1px solid oklch(0.80 0.15 158 / 0.35); }
.chip-sell { background: oklch(0.67 0.20  23 / 0.18); color: var(--sell); border: 1px solid oklch(0.67 0.20 23  / 0.35); }
.chip-hold { background: oklch(0.82 0.12  88 / 0.18); color: var(--hold); border: 1px solid oklch(0.82 0.12 88  / 0.35); }

.history-row-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--t3);
}

.history-empty {
  padding: 24px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--t3);
}

.history-placeholder { padding: 10px 18px; display: flex; flex-direction: column; gap: 10px; }
.history-placeholder-row {
  height: 40px; border-radius: 8px;
  background: oklch(0.25 0.018 256);
  animation: nx-pulse 1.5s ease-in-out infinite;
  width: 100%;
}
.history-placeholder-row.w80 { width: 80%; }
.history-placeholder-row.w90 { width: 90%; }

/* User footer */
.sidebar-user {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12.5px; color: var(--t1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta { font-size: 10.5px; color: var(--t3); font-family: var(--font-mono); }

.user-signout {
  font-size: 15px;
  color: var(--t3);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
  padding: 4px;
}
.user-signout:hover { color: var(--t1); }


/* ═══════════════════════════════════════════════════
   Main area
   ═══════════════════════════════════════════════════ */

.main-area {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.state-panel {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}
.state-panel.active {
  display: flex;
}

.disclaimer-label {
  font-size: 11px;
  color: var(--t3);
  font-family: var(--font-mono);
}


/* ═══════════════════════════════════════════════════
   PRE state (empty / upload)
   ═══════════════════════════════════════════════════ */

.pre-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.pre-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  overflow-y: auto;
}

.pre-heading {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 30px;
  color: var(--t1);
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: 8px;
}

.pre-subtext {
  font-size: 15px;
  color: var(--t2);
  text-align: center;
  max-width: 480px;
  margin-bottom: 30px;
}

/* Drop zone */
.drop-zone {
  width: 100%;
  max-width: 540px;
  border: 1.5px dashed oklch(0.42 0.03 256);
  border-radius: 16px;
  padding: 46px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: oklch(0.20 0.02 256 / 0.5);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: oklch(0.20 0.02 256 / 0.8);
}
.drop-zone.has-preview {
  padding: 0;
  border-style: solid;
  border-color: var(--line);
  min-height: 200px;
}

.drop-zone-icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: oklch(0.74 0.155 226 / 0.14);
  border: 1px solid oklch(0.74 0.155 226 / 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 24px;
}

.drop-zone-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.drop-main-text {
  font-size: 16px;
  color: var(--t1);
  font-weight: 600;
}

.drop-sub-text {
  font-size: 13px;
  color: var(--t3);
}

.drop-browse {
  color: var(--accent);
  border-bottom: 1px dotted var(--accent);
  cursor: pointer;
}

.drop-zone-preview {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 14px;
}

/* Inline controls */
.inline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  max-width: 600px;
}

.ctrl-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ctrl-pill:hover { border-color: oklch(0.45 0.02 256); }

.ctrl-label {
  font-size: 10.5px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.ctrl-input {
  background: none;
  border: none;
  outline: none;
  color: var(--t1);
  font-family: var(--font-mono);
  font-size: 13px;
  width: 72px;
  padding: 0;
}

.ctrl-select {
  background: none;
  border: none;
  outline: none;
  color: var(--t1);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
}
.ctrl-select option { background: var(--bg2); color: var(--t1); }

.ctrl-arrow {
  font-size: 10px;
  color: var(--t3);
  pointer-events: none;
  flex-shrink: 0;
}

/* Analyze button */
.btn-analyze {
  margin-top: 22px;
  padding: 13px 36px;
  border-radius: 11px;
  background: var(--accent);
  border: none;
  color: oklch(0.16 0.03 256);
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-analyze:hover:not(:disabled) { opacity: 0.88; }
.btn-analyze:disabled { opacity: 0.4; cursor: not-allowed; }


/* ═══════════════════════════════════════════════════
   LOAD state (analyzing)
   ═══════════════════════════════════════════════════ */

#state-load.active {
  align-items: center;
  justify-content: center;
}

.load-content {
  width: 560px;
  max-width: 100%;
  padding: 48px 32px;
}

.load-chart-preview {
  position: relative;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, oklch(0.24 0.03 256), oklch(0.17 0.02 256));
  border: 1px solid var(--line);
  margin-bottom: 30px;
}

.load-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 42px, oklch(0.6 0.03 256 / 0.06) 42px 43px),
    repeating-linear-gradient(0deg,  transparent 0 34px, oklch(0.6 0.03 256 / 0.06) 34px 35px);
}

.load-pair-label {
  position: absolute;
  left: 14px;
  top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--t3);
}

.load-scanner {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 16px 3px var(--accent);
  animation: nx-scan 1.9s ease-in-out infinite;
}

.load-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-family: var(--font-brand);
  font-size: 18px;
  font-weight: 600;
  color: var(--t1);
}

.load-dots { display: flex; gap: 4px; }
.load-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: nx-dots 1.2s infinite;
}
.load-dots span:nth-child(2) { animation-delay: 0.2s; }
.load-dots span:nth-child(3) { animation-delay: 0.4s; }

.load-skeleton-lines { display: flex; flex-direction: column; gap: 11px; }
.skeleton-line {
  height: 13px;
  border-radius: 7px;
  background: oklch(0.30 0.02 256);
  animation: nx-pulse 1.5s ease-in-out infinite;
}
.skeleton-line.tall { height: 46px; border-radius: 9px; }
.skeleton-line.w55  { width: 55%; }
.skeleton-line.w88  { width: 88%; }
.skeleton-line.w100 { width: 100%; }

.load-steps {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--t3);
}
.load-step.done    { color: var(--buy); }
.load-step.pending { color: var(--t3); }


/* ═══════════════════════════════════════════════════
   POST state (result)
   ═══════════════════════════════════════════════════ */

.post-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.post-topbar-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--t2);
  flex-wrap: wrap;
}

.post-pair  { color: var(--t1); }
.post-dot   { color: var(--t3); }

.post-edit-btn {
  margin-left: 6px;
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px dotted var(--accent);
  padding: 0;
}

.post-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.post-time { font-family: var(--font-mono); font-size: 11px; color: var(--t3); }

.post-content {
  flex: 1;
  overflow-y: auto;
  padding: 40px 32px 60px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* Log trade button (in post topbar) */
.btn-log-trade-result {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: oklch(0.74 0.155 226 / 0.12);
  border: 1px solid oklch(0.74 0.155 226 / 0.35);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-log-trade-result:hover { background: oklch(0.74 0.155 226 / 0.2); }

/* Chart thumbnail on result page */
.result-chart-wrap {
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 28px;
  background: var(--bg1);
}
.result-chart-img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
}
.result-chart-toggle {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: oklch(0.15 0.014 256 / 0.8);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--t3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 4px 10px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: color 0.12s;
}
.result-chart-toggle:hover { color: var(--t1); }
.result-chart-wrap.collapsed .result-chart-img { display: none; }
.result-chart-wrap.collapsed .result-chart-toggle { position: static; margin: 8px 12px; }

/* Verdict hero */
.verdict-hero {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 14px;
}

.verdict-word {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 88px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.verdict-word.buy  { color: var(--buy); }
.verdict-word.sell { color: var(--sell); }
.verdict-word.hold { color: var(--hold); }

.verdict-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 10px;
}

.verdict-conf {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--t2);
}

.verdict-rr {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--t2);
  font-size: 12px;
  font-family: var(--font-mono);
}

/* Headline & summary */
.verdict-headline {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 17px;
  color: var(--t1);
  margin-bottom: 4px;
}

.verdict-summary {
  font-size: 16px;
  line-height: 1.7;
  color: var(--t2);
  margin-top: 18px;
}

/* Levels grid */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: 13px;
  width: 100%;
}

.level-cell {
  padding: 20px 18px 22px;
  border-right: 1px solid var(--line);
}
.level-cell:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.level-cell:last-child  { border-right: none; border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

.level-cell-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 8px;
}

.level-cell-value {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 500;
}
.level-cell-value.neutral { color: var(--t1); }
.level-cell-value.buy     { color: var(--buy); }
.level-cell-value.sell    { color: var(--sell); }

/* Hold zone */
.hold-zone {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  width: 100%;
  align-items: stretch;
}

.hold-message {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.hold-icon  { font-size: 24px; }
.hold-title { font-size: 14px; color: var(--t1); font-weight: 600; font-family: var(--font-brand); }
.hold-sub   { font-size: 13px; color: var(--t3); margin-top: 2px; }

.hold-levels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}

.hold-level-cell {
  background: var(--bg0);
  padding: 16px 22px;
}

/* Tech toggle */
.tech-toggle-btn {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent);
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 600;
  padding: 0;
  transition: opacity 0.15s;
}
.tech-toggle-btn:hover { opacity: 0.8; }

.tech-toggle-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.tech-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  width: 100%;
}

.tech-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.tech-row:first-child { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.tech-row:last-child  { border-bottom: none; padding-bottom: 20px; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }

.tech-row-label { font-size: 13px; color: var(--t3); flex-shrink: 0; }
.tech-row-val   { font-size: 13px; color: var(--t1); text-align: right; }
.tech-row-val.mono { font-family: var(--font-mono); }

.post-disclaimer {
  margin-top: 32px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--t3);
}


/* ═══════════════════════════════════════════════════
   Auth pages (login, register, select_tier, checkout)
   ═══════════════════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: var(--bg0);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 28px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 36px 32px;
}

.auth-heading {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 22px;
  color: var(--t1);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.auth-subtext {
  font-size: 13.5px;
  color: var(--t2);
  line-height: 1.5;
  margin-bottom: 28px;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 12px;
  color: var(--t3);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--t1);
  font-family: var(--font-ui);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--t3); }

.auth-btn {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  border-radius: 10px;
  background: var(--accent);
  border: none;
  color: oklch(0.16 0.03 256);
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.auth-btn:hover { opacity: 0.88; }

.auth-alert {
  padding: 11px 14px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.auth-alert.error   { background: oklch(0.67 0.20 23 / 0.12); border: 1px solid oklch(0.67 0.20 23 / 0.4); color: var(--sell); }
.auth-alert.success { background: oklch(0.80 0.15 158 / 0.12); border: 1px solid oklch(0.80 0.15 158 / 0.4); color: var(--buy); }

.auth-footer-link {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--t3);
}
.auth-footer-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* Pricing page */
.pricing-page {
  min-height: 100vh;
  background: var(--bg0);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px 80px;
}

.pricing-wrap { width: 100%; max-width: 860px; }

.pricing-heading {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 28px;
  color: var(--t1);
  letter-spacing: -0.01em;
  text-align: center;
  margin-bottom: 8px;
}

.pricing-subtext {
  font-size: 14px;
  color: var(--t2);
  text-align: center;
  max-width: 440px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 640px) { .pricing-grid { grid-template-columns: 1fr; } }

.pricing-card {
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
}
.pricing-card.featured { border-color: var(--accent); }

.pricing-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
  width: fit-content;
}
.pricing-badge.blue   { background: oklch(0.74 0.155 226 / 0.15); color: var(--accent);   border: 1px solid oklch(0.74 0.155 226 / 0.35); }
.pricing-badge.green  { background: oklch(0.80 0.15  158 / 0.15); color: var(--buy);      border: 1px solid oklch(0.80 0.15 158  / 0.35); }

.pricing-name {
  font-family: var(--font-brand);
  font-size: 18px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 6px;
}

.pricing-desc {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.5;
  margin-bottom: 20px;
}

.pricing-price {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 4px;
}
.pricing-price span {
  font-size: 14px;
  color: var(--t3);
  font-weight: 400;
}

.pricing-cycle {
  font-size: 12px;
  color: var(--t3);
  margin-bottom: 20px;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  flex: 1;
}

.pricing-features li {
  font-size: 13.5px;
  color: var(--t2);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pricing-features li::before {
  content: '✓';
  color: var(--buy);
  font-size: 12px;
  margin-top: 1px;
  flex-shrink: 0;
}

.pricing-btn {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: none;
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.pricing-btn.primary { background: var(--accent); color: oklch(0.16 0.03 256); }
.pricing-btn.secondary { background: var(--bg2); border: 1px solid var(--line); color: var(--t1); }
.pricing-btn:hover { opacity: 0.85; }

/* Google sign-in button */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--bg0);
  border: 1px solid var(--line);
  color: var(--t1);
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.btn-google:hover { border-color: oklch(0.45 0.02 256); background: oklch(0.20 0.016 256); }
.btn-google svg { flex-shrink: 0; }

/* Auth divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-divider-text {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t3);
  white-space: nowrap;
}

/* Terms checkboxes */
.auth-terms {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-terms-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 2px;
  display: block;
}
.auth-terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.auth-terms-row input[type="checkbox"] {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.auth-terms-row label {
  font-size: 12.5px;
  color: var(--t2);
  line-height: 1.5;
  cursor: pointer;
}
.auth-terms-row label a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}
.auth-terms-row label a:hover { opacity: 0.8; }

/* Checkout page */
.checkout-page {
  min-height: 100vh;
  background: var(--bg0);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px 80px;
}

.checkout-back {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--t3);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
.checkout-back:hover { color: var(--t1); }

.checkout-wrap {
  width: 100%;
  max-width: 900px;
}

.checkout-card {
  background: var(--bg1);
  border: 1px solid var(--line);
  border-radius: 16px;
}

/* ═══════════════════════════════════════════════════
   Animations
   ═══════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════
   Mobile nav overlay
   ═══════════════════════════════════════════════════ */

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg1);
  flex-shrink: 0;
}

.mobile-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--t2);
  font-size: 20px;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
}

.mobile-brand {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: 15px;
  color: var(--t1);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.55);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-backdrop.open { display: block; }


/* ═══════════════════════════════════════════════════
   Responsive — tablet / mobile (≤ 768px)
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Root layout */
  .app-root {
    flex-direction: column;
    height: 100dvh;
    min-height: unset;
    overflow: hidden;
  }

  /* Mobile topbar visible */
  .mobile-topbar { display: flex; }

  /* Sidebar becomes an off-canvas drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    bottom: 0;
    width: 280px;
    z-index: 100;
    transition: left 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 32px oklch(0 0 0 / 0.5);
  }

  /* Main area fills remaining height below mobile topbar */
  .main-area {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  /* ── PRE state ── */
  .pre-topbar {
    padding: 12px 16px;
  }

  .pre-content {
    padding: 24px 16px 40px;
    align-items: stretch;
  }

  .pre-heading {
    font-size: 22px;
    margin-bottom: 6px;
  }

  .pre-subtext {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .drop-zone {
    max-width: 100%;
    padding: 36px 20px;
    border-radius: 12px;
  }

  .inline-controls {
    gap: 8px;
    margin-top: 18px;
  }

  .ctrl-pill {
    padding: 9px 10px;
  }

  .ctrl-input {
    width: 56px;
  }

  .btn-analyze {
    width: 100%;
    max-width: 100%;
    padding: 14px;
    margin-top: 16px;
    font-size: 15px;
  }

  /* ── LOAD state ── */
  .load-content {
    width: 100%;
    padding: 28px 20px;
  }

  .load-chart-preview {
    height: 160px;
  }

  /* ── POST state ── */
  .post-topbar {
    padding: 12px 16px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .post-topbar-right {
    gap: 10px;
  }

  .post-content {
    padding: 24px 16px 48px;
  }

  .verdict-hero {
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
  }

  .verdict-word {
    font-size: 64px;
  }

  .verdict-badges {
    gap: 6px;
    padding-bottom: 6px;
  }

  .verdict-summary {
    font-size: 15px;
    margin-top: 14px;
  }

  /* 4-col grid → 2×2 */
  .levels-grid {
    grid-template-columns: 1fr 1fr;
    margin-top: 24px;
  }

  /* Fix radius for 2×2 layout */
  .level-cell:first-child { border-radius: 0; border-top-left-radius: 12px; }
  .level-cell:nth-child(2) { border-right: none; border-top-right-radius: 12px; border-bottom-right-radius: 0; }
  .level-cell:nth-child(3) { border-right: 1px solid var(--line); border-bottom-left-radius: 12px; }
  .level-cell:last-child  { border-bottom-right-radius: 12px; border-top-right-radius: 0; }

  /* Hold zone stacks vertically */
  .hold-zone {
    flex-direction: column;
    margin-top: 24px;
  }

  .tech-panel { margin-top: 14px; }

  .post-disclaimer { margin-top: 24px; }

}


/* ═══════════════════════════════════════════════════
   Extra small phones (≤ 390px)
   ═══════════════════════════════════════════════════ */

@media (max-width: 390px) {

  .verdict-word { font-size: 52px; }

  .inline-controls { flex-direction: column; align-items: stretch; }
  .ctrl-pill { justify-content: space-between; }
  .ctrl-input { width: 100%; }

  .post-topbar-meta { font-size: 11.5px; }

  /* Auth card tighter on small phones */
  .auth-card { padding: 28px 20px 24px; }
  .pricing-page { padding: 40px 16px 60px; }

}


/* ═══════════════════════════════════════════════════
   Touch / tap-target fixes (all mobile)
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Sign-out button — minimum 44px touch area */
  .user-signout {
    padding: 12px 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* History rows — ensure 44px height */
  .history-row {
    min-height: 44px;
  }

  /* Sidebar nav items — comfortable tap height */
  .sidebar-nav-item {
    padding: 12px 10px;
    min-height: 44px;
  }

  /* ctrl-pill — full tap height */
  .ctrl-pill {
    min-height: 44px;
    padding: 10px 13px;
  }

  /* Bottom: raise minimum readable font sizes */
  .sidebar-section-label,
  .reads-count,
  .user-meta,
  .sidebar-meta,
  .history-chip {
    font-size: 12px;
  }
}

@keyframes nx-scan {
  0%   { top: -2%; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 103%; opacity: 0; }
}

@keyframes nx-pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.6; }
}

@keyframes nx-dots {
  0%, 80%, 100% { opacity: 0.2; }
  40%           { opacity: 1; }
}

/* ═══════════════════════════════════════════════════
   PWA / safe-area insets (iPhone notch + home bar)
   ═══════════════════════════════════════════════════ */

@supports (padding: env(safe-area-inset-bottom)) {
  .app-root {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-topbar {
    padding-top: calc(14px + env(safe-area-inset-top));
  }
  .sidebar {
    padding-top: env(safe-area-inset-top);
  }
}

/* ═══════════════════════════════════════════════════
   Mobile camera upload button
   ═══════════════════════════════════════════════════ */

.slot-camera-btn {
  display: none;
}

@media (max-width: 768px) {
  /* JS swaps .slot-drop-label text on mobile */
  /* Show camera shortcut button below the drop zone */
  .slot-camera-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: oklch(0.18 0.016 256);
    color: var(--t2);
    font-size: 13px;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
  }
  .slot-camera-btn:hover,
  .slot-camera-btn:active {
    border-color: var(--accent);
    color: var(--accent);
  }
  .slot-camera-btn.hidden {
    display: none;
  }
}
