/* DropHoldClimb — dark trading UI (mockup-aligned) */
:root {
  --bg: #0b0f14;
  --panel: #121821;
  --panel2: #18212c;
  --border: #243041;
  --text: #e8eef6;
  --muted: #8b9bb0;
  --accent: #3dd6c6;
  --drop: #ff5c7a;
  --hold: #f0c14a;
  --climb: #3ecf8e;
  --day: #5b8cff;
  --holdscore: #c084fc;
  --danger: #ff5c7a;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 64px;
  --bottom-nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
button { cursor: pointer; border: none; background: none; }
img { max-width: 100%; }

.app-shell {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #10161f 0%, #0b0f14 100%);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--drop), var(--hold), var(--climb));
  display: grid; place-items: center;
  font-weight: 900; font-size: 13px; color: #0b0f14;
}
.brand-text h1 {
  font-size: 18px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
}
.brand-text h1 span { color: var(--accent); }
.brand-text .tagline {
  font-size: 10px; color: var(--muted); font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.demo-badge, .pill {
  background: #2a1f0a; color: var(--hold);
  border: 1px solid #5a4518; padding: 5px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.05em;
  white-space: nowrap;
}
.paper-pill {
  background: var(--panel2); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 10px; font-size: 12px; font-weight: 700;
}
.paper-pill em { color: var(--accent); font-style: normal; }

/* Banners */
.disclaimer-banner, .data-banner {
  margin: 10px 16px 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12px; font-weight: 600; line-height: 1.4;
}
.disclaimer-banner {
  background: rgba(255,92,122,0.08);
  border: 1px solid rgba(255,92,122,0.35);
  color: #ffc0cb;
}
.data-banner {
  background: #2a1f0a;
  border: 1px solid #5a4518;
  color: var(--hold);
}
.disclaimer-banner strong, .data-banner strong { font-weight: 800; }

/* Main */
.app-main {
  padding: 14px 16px calc(var(--bottom-nav-h) + 20px + var(--safe-bottom));
}
.view { display: none; animation: fadeIn 0.18s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.panel-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }

/* Indices strip */
.indices {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px;
}
.idx {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px;
}
.idx .name { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: 0.04em; }
.idx .val { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.idx .chg { font-size: 12px; font-weight: 800; margin-top: 2px; }
.up { color: var(--climb); }
.down { color: var(--drop); }
.flat { color: var(--muted); }

/* Toggle */
.toggle {
  display: inline-flex; background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px;
}
.toggle button {
  color: var(--muted); font-weight: 800; font-size: 12px; padding: 7px 12px;
  border-radius: 999px;
}
.toggle button.on { background: var(--day); color: #fff; }
.toggle button.on.hold-mode { background: var(--holdscore); }

/* Cards / picks */
.picks, .list-stack { display: flex; flex-direction: column; gap: 10px; }
.pick, .card-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: left; width: 100%;
}
.pick:hover, .card-row:hover { border-color: #35506a; background: #1b2533; }
.pick:focus-visible, .card-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sym { font-size: 17px; font-weight: 900; letter-spacing: -0.02em; }
.sym small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.pick-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.pick-right { text-align: right; }
.price { font-size: 16px; font-weight: 800; }
.chg { font-size: 12px; font-weight: 800; }

.pattern {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.02em; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.d { background: var(--drop); }
.dot.h { background: var(--hold); }
.dot.c { background: var(--climb); }
.arrow { font-size: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 900; letter-spacing: 0.04em;
}
.badge.drop { background: rgba(255,92,122,0.15); color: var(--drop); border: 1px solid rgba(255,92,122,0.4); }
.badge.hold { background: rgba(240,193,74,0.15); color: var(--hold); border: 1px solid rgba(240,193,74,0.4); }
.badge.climb { background: rgba(62,207,142,0.15); color: var(--climb); border: 1px solid rgba(62,207,142,0.4); }
.badge.watch { background: rgba(91,140,255,0.12); color: var(--day); border: 1px solid rgba(91,140,255,0.35); }

.grade {
  text-align: center; border-radius: 10px; padding: 6px 8px; min-width: 56px;
}
.grade .lbl { font-size: 9px; font-weight: 800; color: var(--muted); letter-spacing: 0.05em; }
.grade .val { font-size: 16px; font-weight: 900; margin-top: 1px; }
.grade.day { background: rgba(91,140,255,0.12); border: 1px solid rgba(91,140,255,0.35); }
.grade.day .val { color: var(--day); }
.grade.holdg { background: rgba(192,132,252,0.12); border: 1px solid rgba(192,132,252,0.35); }
.grade.holdg .val { color: var(--holdscore); }

.grades-inline { display: flex; gap: 6px; justify-content: flex-end; }

/* Bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 8px 6px calc(8px + var(--safe-bottom));
  background: rgba(16,22,31,0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
  max-width: 1200px; margin: 0 auto;
}
.bottom-nav button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-size: 10px; font-weight: 800;
  padding: 6px 2px; border-radius: 10px;
}
.bottom-nav button .ico { font-size: 16px; line-height: 1; }
.bottom-nav button.active { color: var(--accent); background: rgba(61,214,198,0.08); }

/* Forms */
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-grid.two { grid-template-columns: 1fr; } }
.label { display: block; font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 6px; letter-spacing: 0.03em; }
.field, .select, .textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; color: var(--text);
}
.field:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61,214,198,0.15);
}
.help { font-size: 11px; color: var(--muted); margin-top: 5px; font-weight: 600; }
.row-check { display: flex; align-items: flex-start; gap: 10px; }
.row-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: 12px; font-weight: 800; font-size: 14px;
  border: 1px solid transparent; transition: transform 0.08s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #06201d; }
.btn-climb { background: var(--climb); color: #062016; }
.btn-drop { background: var(--drop); color: #2a0610; }
.btn-ghost {
  background: var(--panel2); color: var(--text); border-color: var(--border);
}
.btn-day { background: var(--day); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 11px; font-size: 12px; border-radius: 9px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Symbol detail */
.ticker-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.ticker-head h2 { font-size: 26px; font-weight: 900; letter-spacing: -0.03em; }
.ticker-head h2 small {
  display: block; font-size: 13px; color: var(--muted); font-weight: 700;
  margin-top: 4px; letter-spacing: 0;
}
.price-block { text-align: right; }
.price-block .px { font-size: 26px; font-weight: 900; }
.chart-wrap {
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; position: relative; margin-bottom: 12px;
}
.chart-label {
  font-size: 11px; font-weight: 800; color: var(--muted);
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px;
}
svg.chart { width: 100%; height: 220px; display: block; }
.phase-bar { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr; gap: 8px; }
.phase {
  text-align: center; font-size: 12px; font-weight: 900;
  padding: 8px; border-radius: 8px; letter-spacing: 0.04em;
}
.phase.d { background: rgba(255,92,122,0.15); color: var(--drop); border: 1px solid rgba(255,92,122,0.4); }
.phase.h { background: rgba(240,193,74,0.15); color: var(--hold); border: 1px solid rgba(240,193,74,0.4); }
.phase.c { background: rgba(62,207,142,0.15); color: var(--climb); border: 1px solid rgba(62,207,142,0.4); }
.phase.dim { opacity: 0.4; }

.grades { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.grade-card {
  background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.grade-card .lbl { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: 0.06em; }
.grade-card .big { font-size: 32px; font-weight: 900; margin: 4px 0; }
.grade-card.day .big { color: var(--day); }
.grade-card.holdg .big { color: var(--holdscore); }
.grade-card p { font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.35; }

.buy-window {
  background: linear-gradient(160deg, #0f2a28, #121821);
  border: 1px solid rgba(61,214,198,0.35);
  border-radius: 14px; padding: 18px; text-align: center; margin-bottom: 12px;
}
.buy-window .lbl {
  font-size: 11px; font-weight: 800; color: var(--accent);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.buy-window .clock { font-size: 40px; font-weight: 900; margin: 4px 0; }
.buy-window .sub { font-size: 12px; color: var(--muted); font-weight: 600; }

.kv { display: grid; gap: 8px; }
.kv-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row span:first-child { color: var(--muted); }
.score-breakdown { display: grid; gap: 8px; }
.score-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.score-item .top { display: flex; justify-content: space-between; font-weight: 800; font-size: 13px; }
.bar {
  height: 6px; background: #1a2330; border-radius: 999px; margin-top: 8px; overflow: hidden;
}
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

/* Scanner */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 800;
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
}
.chip.on { background: rgba(61,214,198,0.12); border-color: rgba(61,214,198,0.45); color: var(--accent); }

/* Paper */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat {
  background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center;
}
.stat .n { font-size: 18px; font-weight: 900; }
.stat .l { font-size: 10px; font-weight: 800; color: var(--muted); letter-spacing: 0.05em; margin-top: 2px; }
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 13px; font-weight: 700;
}
table.data th {
  text-align: left; color: var(--muted); font-size: 10px; letter-spacing: 0.05em;
  padding: 8px 6px; border-bottom: 1px solid var(--border);
}
table.data td { padding: 10px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.empty {
  text-align: center; padding: 28px 12px; color: var(--muted); font-weight: 700; font-size: 14px;
}

/* Education */
.edu-step {
  display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start;
  padding: 14px; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 10px;
}
.edu-step .num {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 900; font-size: 14px; color: #0b0f14;
}
.edu-step.drop .num { background: var(--drop); }
.edu-step.hold .num { background: var(--hold); }
.edu-step.climb .num { background: var(--climb); }
.edu-step.buy .num { background: var(--accent); }
.edu-step h3 { font-size: 15px; font-weight: 900; margin-bottom: 4px; }
.edu-step p { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Modal / toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom-nav-h) + 16px + var(--safe-bottom));
  transform: translateX(-50%);
  background: #1c2a22; color: var(--climb); border: 1px solid rgba(62,207,142,0.45);
  padding: 10px 16px; border-radius: 999px; font-weight: 800; font-size: 13px;
  z-index: 80; opacity: 0; pointer-events: none; transition: opacity 0.2s;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; }
.toast.err { background: #2a1218; color: var(--drop); border-color: rgba(255,92,122,0.45); }

.gate {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5,8,12,0.92); display: grid; place-items: center; padding: 20px;
}
.gate-card {
  width: min(460px, 100%); background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; padding: 22px;
}
.gate-card h2 { font-size: 20px; font-weight: 900; margin-bottom: 10px; }
.gate-card p { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.hidden { display: none !important; }

@media (min-width: 900px) {
  .app-main { padding-bottom: 28px; }
  .bottom-nav {
    position: sticky; bottom: auto; grid-template-columns: repeat(6, auto);
    justify-content: center; gap: 8px; border-radius: 16px;
    margin: 0 16px 16px; border: 1px solid var(--border);
  }
  .bottom-nav button { padding: 10px 16px; flex-direction: row; font-size: 13px; }
  .bottom-nav button .ico { font-size: 14px; }
  .detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }
  .indices .val { font-size: 22px; }
  svg.chart { height: 280px; }
}
@media (max-width: 480px) {
  .indices { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .bottom-nav button .lbl-hide-xs { display: none; }
}
