:root {
  --bg: #050505;
  --card: #121212;
  --field: #0c0c0c;
  --line: rgba(243, 240, 232, 0.1);
  --text: #f3f0e8;
  --muted: #a39b90;
  --faint: #6f675e;
  --green: #00ff88;
  --green-ink: #062114;
  --red: #ff3355;
  --accent: #c4a36a;
  --accent-ink: #16130e;
  --silver: #f3f0e8;
  --gold: #c4a36a;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Outfit, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1000px 420px at 8% -10%, rgba(196, 163, 106, 0.08), transparent 55%),
    radial-gradient(800px 380px at 100% 0%, rgba(243, 240, 232, 0.04), transparent 46%),
    var(--bg);
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
::selection { background: rgba(196, 163, 106, 0.45); color: #16130e; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: #2a3140 transparent; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 80;
  font-weight: 700;
}
.skip:focus { top: 12px; }

.app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(8, 9, 12, 0.94);
}

.brand {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 12px;
}
.brand-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 622 / 486;
  overflow: hidden;
  background: #000;
}
.brand-logo {
  position: absolute;
  left: 0;
  top: 0;
  width: 187.78%;
  max-width: none;
  height: auto;
  transform: translate(-23.97%, -19.39%);
}
.hub-banner {
  position: relative;
  width: min(100%, 760px);
  aspect-ratio: 1094 / 222;
  overflow: hidden;
  margin: 0 0 16px;
  background: #000;
}
.hub-banner img {
  position: absolute;
  left: 0;
  top: 0;
  width: 117%;
  max-width: none;
  height: auto;
  transform: translate(-11.25%, -24.41%);
}

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav-btn.is-active { background: rgba(196, 163, 106, 0.16); color: #f6ead2; }

.side-foot { margin-top: auto; padding: 8px 8px 4px; }
.side-foot p { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
#side-stats { font-family: var(--mono); line-height: 1.4; }

.main { padding: 22px 24px 56px; min-width: 0; }

.trader-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 16px;
  padding-bottom: 2px;
  min-width: 0;
  max-width: 100%;
}
.trader-tab {
  border: 1px solid var(--line);
  background: #121418;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  white-space: nowrap;
}
.trader-tab:hover { border-color: rgba(255, 255, 255, 0.16); color: var(--text); }
.trader-tab.is-active {
  background: rgba(196, 163, 106, 0.16);
  color: #f6ead2;
  border-color: rgba(196, 163, 106, 0.55);
}
.leaderboard-card { margin-bottom: 14px; }
.leaderboard-card .best-mark { color: var(--silver); font-size: 12px; letter-spacing: 0.04em; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.topbar h1 { margin: 0; font-size: 28px; letter-spacing: -0.04em; font-weight: 600; }
.topbar p { margin: 4px 0 0; color: var(--muted); max-width: 52ch; }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }

.mode-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; max-width: 78ch; }
.live-status { margin: 6px 0 0; color: var(--gold); font-family: var(--mono); font-size: 12px; }
.auth-gate { z-index: 60; }
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.auth-form .btn { width: 100%; }
.claim-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.claim-list .btn { justify-content: flex-start; border-radius: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  background: #171c24;
  color: var(--text);
  font-weight: 600;
  line-height: 1;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.16); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: #d4b57c; }
.btn.danger { background: rgba(255, 51, 85, 0.12); color: #ffd0d8; border-color: rgba(255, 51, 85, 0.35); }
.btn.tiny { padding: 7px 11px; font-size: 13px; }
.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #12161c;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #0c0f14;
  border: 1px solid var(--line);
  gap: 2px;
}
.seg label { position: relative; }
.seg input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.seg span {
  display: block;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.seg label:has(input:checked) span { background: #2a2418; color: #f6ead2; }
.seg.dir label:has(input[value="LONG"]:checked) span {
  color: var(--green);
  background: rgba(0, 255, 136, 0.12);
}
.seg.dir label:has(input[value="SHORT"]:checked) span {
  color: #ff8b9a;
  background: rgba(255, 51, 85, 0.14);
}
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.menu { position: relative; }
.menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 6px;
  background: #161b22;
  border: 1px solid var(--line);
  border-radius: 12px;
  z-index: 30;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4);
}
.menu-pop button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}
.menu-pop button:hover { background: rgba(255, 255, 255, 0.05); }

.kpis {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.kpi { grid-column: span 3; }
.kpi.wide { grid-column: span 4; }
.streak-note { margin: 2px 0 8px; }
.streaks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.mind-card { margin-bottom: 14px; }
.mind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.mind-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #0d1117;
  min-width: 0;
}
.mind-stat strong {
  display: block;
  margin: 6px 0 2px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line);
  background: #12161c;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 13px;
  font-weight: 600;
}
.chip.is-on {
  border-color: rgba(196, 163, 106, 0.6);
  background: rgba(196, 163, 106, 0.16);
  color: #f6ead2;
}
.chip[data-mood="calm"].is-on {
  border-color: rgba(0, 255, 136, 0.55);
  background: rgba(0, 255, 136, 0.12);
  color: var(--green);
}
.chip[data-mood="tilted"].is-on {
  border-color: rgba(255, 51, 85, 0.55);
  background: rgba(255, 51, 85, 0.12);
  color: #ffd0d8;
}
.chip[data-mood="fomo"].is-on {
  border-color: rgba(255, 176, 32, 0.55);
  background: rgba(255, 176, 32, 0.12);
  color: #ffe1a8;
}
.mood-add { margin-top: 8px; }
.mind-text { color: var(--muted); font-size: 13px; }
.kpi {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 42%), var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 12px 14px;
  min-width: 0;
}
.kpi-label {
  margin: 0;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
.kpi-value {
  margin: 8px 0 4px;
  font-family: var(--mono);
  font-size: clamp(16px, 1.35vw, 22px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.kpi-sub { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.kpi-value.win { color: var(--green); text-shadow: 0 0 18px rgba(0, 255, 136, 0.22); }
.kpi-value.loss { color: var(--red); text-shadow: 0 0 18px rgba(255, 51, 85, 0.2); }
.kpi-value.flat { color: var(--muted); text-shadow: none; }

.wl {
  display: flex;
  height: 4px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  margin-top: 10px;
}
.wl span { display: block; height: 100%; }
.wl-win { background: var(--green); }
.wl-loss { background: var(--red); }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 28%), var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  min-width: 0;
}
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  min-width: 0;
  max-width: 100%;
}
.card-head > * { min-width: 0; }
.card-head h2, .card h2 { margin: 0; font-size: 16px; font-weight: 600; }
.quiet { color: var(--muted); margin: 0; font-size: 13px; }
.card-head .quiet { margin-top: 3px; }

.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
  min-width: 0;
}
.cal-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cal-step-name {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin-right: 2px;
}
.cal-label-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 148px;
  text-align: center;
  gap: 1px;
}
.cal-label-block strong { font-weight: 600; font-size: 15px; }
.cal-week-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.cal-scroll { overflow-x: auto; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(76px, 0.75fr);
  gap: 6px;
  min-width: 680px;
}
.dow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 0 4px 2px;
  font-weight: 600;
}
.day {
  min-height: 72px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #0d1117;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  color: var(--muted);
}
.day-out { visibility: hidden; min-height: 72px; }
.day-num { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.day-pnl { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.day.win {
  background: rgba(0, 255, 136, calc(0.1 + var(--i) * 0.42));
  color: #e7fff3;
}
.day.loss {
  background: rgba(255, 51, 85, calc(0.1 + var(--i) * 0.42));
  color: #ffe4e8;
}
.day.flat { background: #10151c; }
.day.is-today .day-num { color: var(--gold); font-weight: 700; }
.day.is-week { box-shadow: inset 0 0 0 2px rgba(196, 163, 106, 0.72); }
.day.is-selected { box-shadow: inset 0 0 0 2px var(--silver); }
.day.is-future { opacity: 0.72; }
.week-total {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #0d1117;
  font-family: var(--mono);
  font-size: 12px;
  min-height: 72px;
  padding: 4px;
  text-align: center;
}
.week-total.win { color: var(--green); }
.week-total.loss { color: var(--red); }
.week-total.flat { color: var(--faint); }
.week-total.is-week { box-shadow: inset 0 0 0 2px rgba(196, 163, 106, 0.72); }

.cal-foot {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.cal-foot strong { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.win { color: var(--green); }
.loss { color: var(--red); }
.flat { color: var(--muted); }

#cal-detail { margin-top: 12px; }
#cal-detail h3 { margin: 0 0 4px; font-size: 15px; }
.detail-list { display: flex; flex-direction: column; margin-top: 4px; }
.detail-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.detail-row div:first-child { display: flex; align-items: center; gap: 8px; }

.chart-wrap { position: relative; height: 320px; }
.chart-wrap.short { height: 240px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  padding: 16px;
  margin: 0;
}
.chart-end { font-family: var(--mono); font-size: 18px; font-weight: 500; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: middle;
}
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table .num, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.table th.num { text-align: right; }
.actions { text-align: right; white-space: nowrap; }
.ticker { font-family: var(--mono); font-weight: 600; letter-spacing: 0.02em; }
.ticker-line { display: flex; align-items: center; gap: 8px; }
.note-dot {
  font-size: 11px;
  color: var(--faint);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
  cursor: help;
}
.result { font-family: var(--mono); font-weight: 500; }
.result-sub { color: var(--faint); font-family: var(--mono); font-size: 11px; margin-top: 2px; }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}
.pill.long { color: var(--green); background: rgba(0, 255, 136, 0.12); }
.pill.short { color: #ff8b9a; background: rgba(255, 51, 85, 0.14); }
.pill.open { color: var(--gold); background: rgba(231, 194, 122, 0.12); }
.linkish {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 8px;
  font-weight: 600;
}
.linkish:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.linkish.danger:hover { color: var(--red); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 8px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.field.grow { flex: 1 1 220px; }
.field > span, .field-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
input, select, textarea {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(196, 163, 106, 0.7); outline: none; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }

#journal-summary { margin: 0 0 10px; }
.empty { padding: 28px 10px; text-align: center; }
.empty p { margin: 0 0 6px; }
.stack { display: grid; gap: 14px; }
.report-block .chart-wrap { margin-bottom: 8px; }

.card-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(320px, 1.14fr);
  gap: 14px;
  align-items: start;
}
.card-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.seg.wrap { flex-wrap: wrap; }
.poster-frame {
  display: flex;
  justify-content: center;
  background: #050608;
  border-radius: 12px;
  padding: 12px;
}
#poster-canvas {
  width: min(100%, 460px);
  height: auto;
  display: block;
  border-radius: 10px;
}
.style-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.discord-shell {
  background: #1e1f22;
  border-radius: 12px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.discord-shell[data-style="minimal"] {
  background: #1a1c21;
  padding: 22px 22px 16px;
}
.discord-shell[data-style="neon"] {
  background:
    radial-gradient(460px 200px at 50% -10%, rgba(0, 255, 136, 0.2), transparent 68%),
    #101513;
  box-shadow: inset 0 0 0 1px rgba(0, 255, 136, 0.5), 0 0 36px rgba(0, 255, 136, 0.08);
}
.discord-shell[data-style="neon"][data-direction="SHORT"] {
  background:
    radial-gradient(460px 200px at 50% -10%, rgba(255, 51, 85, 0.22), transparent 68%),
    #160f12;
  box-shadow: inset 0 0 0 1px rgba(255, 51, 85, 0.55), 0 0 36px rgba(255, 51, 85, 0.1);
}
.discord-shell[data-style="classic"] {
  background: #2b2d31;
  box-shadow: inset 3px 0 0 #e7c27a;
}
.discord-kicker {
  margin: 0 0 10px;
  color: #b5bac1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.discord-preview {
  margin: 0;
  color: #f2f3f5;
  font-size: 15px;
  line-height: 1.4;
}
.md-spacer { height: 8px; }
.discord-shell[data-style="minimal"] .md-spacer { height: 12px; }
.discord-shell[data-style="neon"] .md-spacer { height: 6px; }
.md-line { margin: 0; }
.md-ticker {
  font-family: var(--mono);
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin: 2px 0 4px;
}
.md-ticker strong { font-weight: 700; }
.md-border {
  margin: 2px 0;
  letter-spacing: 1px;
  line-height: 1.2;
  font-size: 15px;
}
.md-line.tone-stop,
.md-line.tone-stop strong { color: #ffb4c0; }
.md-line.tone-gold,
.md-line.tone-gold strong { color: #f6d78a; }
.md-line code {
  font-family: var(--mono);
  background: rgba(0, 0, 0, 0.38);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.92em;
}
.md-codeblock {
  margin: 8px 0;
  padding: 12px 14px;
  background: #111318;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 136, 0.35);
  color: #e9fff4;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  white-space: pre-wrap;
  overflow-x: auto;
}
.discord-shell[data-direction="SHORT"] .md-codeblock {
  border-color: rgba(255, 51, 85, 0.5);
  color: #ffe4e9;
}
.discord-shell[data-style="classic"] .md-codeblock {
  border-color: rgba(231, 194, 122, 0.45);
  color: #fff6e4;
}
.md-view em { color: #c5cad3; font-style: italic; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.markdown-fold { margin-top: 14px; }
.markdown-fold summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.markdown-fold pre {
  white-space: pre-wrap;
  background: #0b0e13;
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: #d5deea;
  line-height: 1.5;
}
.inline-row { display: flex; gap: 8px; align-items: center; }
.inline-row input { flex: 1; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.hint.warn { color: #ffc1cb; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.exit-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.exit-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) 4.8rem auto;
  gap: 8px;
  align-items: center;
}
.exit-r { font-family: var(--mono); font-size: 13px; text-align: right; }
.exit-remove { width: 32px; height: 32px; }
#add-exit { margin-top: 8px; }
.check-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text);
  font-size: 14px;
}
.check-line input { margin-top: 3px; accent-color: var(--accent); }
.calc-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  background: #0c1016;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin: 4px 0 8px;
}
.calc-strip span {
  display: block;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.calc-value { font-family: var(--mono); font-size: 16px; }
.form-error {
  color: #ffd0d8;
  background: rgba(255, 51, 85, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 10px;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.dialog-actions .left { margin-right: auto; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.66);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 40;
}
.dialog {
  width: min(740px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  background: #12161c;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.dialog.narrow { width: min(440px, 100%); }
.dialog h2, .dialog h3 { margin: 0 0 6px; }
.dialog > p, #confirm-body { color: var(--muted); margin: 0 0 8px; }

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #14110c;
  color: #f6ead2;
  border: 1px solid rgba(196, 163, 106, 0.45);
  padding: 10px 14px;
  border-radius: 999px;
  z-index: 70;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .kpi, .kpi.wide { grid-column: span 6; }
}
@media (max-width: 980px) {
  .card-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .side-nav { min-width: 0; max-width: 100%; }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 20;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    padding: 12px;
    gap: 10px;
  }
  .side-nav { flex-direction: row; overflow-x: auto; }
  .nav-btn { white-space: nowrap; }
  .brand { width: 132px; flex: none; }
  .hub-banner { display: none; }
  .side-foot { display: none; }
  .main { padding: 16px 14px 48px; }
  .topbar { flex-direction: column; }
  .top-actions { justify-content: flex-start; }
  .topbar h1 { font-size: 24px; }
}
@media (max-width: 720px) {
  .kpi, .kpi.wide { grid-column: span 12; }
  .kpis, .streaks { grid-template-columns: 1fr 1fr; }
  .streaks .kpi:first-child { grid-column: 1 / -1; }
  .kpi, .kpi.wide { grid-column: auto; }
  .form-grid, .targets, .calc-strip { grid-template-columns: 1fr; }
  .exit-row { grid-template-columns: minmax(0, 1fr) 5.2rem auto; }
  .exit-r { grid-column: 1 / -1; text-align: left; }
  .card-head { flex-direction: column; align-items: stretch; }
  .cal-nav { width: 100%; justify-content: flex-start; }
  .cal-label-block { order: -1; flex: 1 0 100%; align-items: flex-start; text-align: left; min-width: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 6px 0;
    background: #0e131a;
  }
  .table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 6px 12px;
    border: 0;
    text-align: right;
  }
  .table td::before {
    content: attr(data-label);
    color: var(--faint);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
  }
  .table td.actions { justify-content: flex-end; }
  .table td.actions::before { margin-right: auto; }
  .result-sub { text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
