:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --panel: #141415;
  --panel-2: #1a1a1c;
  --panel-3: #202023;
  --text: #f5f2ea;
  --muted: #9b988f;
  --gold: #c9ad72;
  --gold-2: #ead7ab;
  --line: rgba(234, 215, 171, 0.14);
  --green: #44d49b;
  --green-deep: #123f31;
  --red: #ff7272;
  --red-deep: #4a2023;
  --white-tile: #eeeae0;
  --flat: #d5b65f;
  --radius: 24px;
  --cell-size: 38px;
  --cell-gap: 5px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 50% -20%, rgba(201, 173, 114, 0.12), transparent 35%), var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, label.file-button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
[hidden] { display: none !important; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.05rem, 2vw, 1.35rem); font-weight: 650; }
h2 { margin-bottom: 0.4rem; font-size: clamp(1.35rem, 4vw, 2rem); letter-spacing: -0.035em; }
h3 { margin-bottom: 0; }
.muted { color: var(--muted); line-height: 1.65; }
.eyebrow { margin-bottom: 0.4rem; color: var(--gold); font-size: 0.67rem; font-weight: 800; letter-spacing: 0.18em; }

.setup-shell { min-height: 100vh; padding: 32px 18px; display: grid; place-items: center; }
.setup-card { width: min(860px, 100%); padding: clamp(24px, 5vw, 56px); background: linear-gradient(145deg, rgba(26, 26, 28, 0.98), rgba(15, 15, 16, 0.98)); border: 1px solid var(--line); border-radius: 32px; box-shadow: var(--shadow); }
.brand-mark { width: 58px; height: 58px; margin-bottom: 26px; display: grid; place-items: center; border: 1px solid rgba(234, 215, 171, 0.4); border-radius: 18px; color: var(--gold-2); background: linear-gradient(145deg, rgba(201, 173, 114, 0.17), rgba(201, 173, 114, 0.04)); font-family: Georgia, serif; font-weight: 700; letter-spacing: 0.08em; }
.brand-mark-sm { width: 42px; height: 42px; margin: 0; border-radius: 13px; font-size: 0.82rem; flex: 0 0 auto; }
.stack-lg { display: grid; gap: 22px; }
.form-section { padding: 22px; display: grid; gap: 20px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,0.018); }
.section-heading { display: flex; gap: 14px; align-items: flex-start; }
.section-heading > span { color: var(--gold); font: 700 0.78rem/1 Georgia, serif; }
.section-heading h2 { margin: 0; font-size: 1.05rem; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 0.86rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-wide { grid-column: 1 / -1; }
.field, .switch-field { display: grid; gap: 8px; color: #d7d3ca; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.02em; }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 11px 13px; color: var(--text); background: #0e0e0f; border: 1px solid rgba(255,255,255,0.1); border-radius: 13px; transition: border-color 160ms ease, background 160ms ease; }
.field textarea { resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(234, 215, 171, 0.25); }
.field-label { margin: 0 0 10px; color: #d7d3ca; font-size: 0.76rem; font-weight: 700; }
.switch-field { min-height: 60px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; }
.switch-field span { display: grid; gap: 4px; }
.switch-field small { color: var(--muted); font-weight: 500; line-height: 1.4; }
.switch-field input { appearance: none; width: 46px; height: 26px; margin: 0; flex: 0 0 auto; border-radius: 99px; background: #39393d; position: relative; cursor: pointer; transition: 180ms ease; }
.switch-field input::after { content: ""; position: absolute; width: 20px; height: 20px; top: 3px; left: 3px; border-radius: 50%; background: white; transition: 180ms ease; }
.switch-field input:checked { background: var(--gold); }
.switch-field input:checked::after { transform: translateX(20px); }
.caps-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cap-field { display: grid; gap: 6px; color: var(--muted); font-size: 0.7rem; }
.cap-field input { width: 100%; min-width: 0; min-height: 42px; padding: 9px 10px; color: var(--text); background: #0e0e0f; border: 1px solid rgba(255,255,255,0.09); border-radius: 12px; }

.primary-btn, .ghost-btn, .danger-btn, .text-btn, .icon-btn, .nav-item { border: 0; cursor: pointer; }
.primary-btn, .ghost-btn, .danger-btn, label.file-button { min-height: 44px; padding: 10px 16px; border-radius: 13px; font-weight: 750; transition: transform 150ms ease, filter 150ms ease, background 150ms ease; }
.primary-btn { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #15110a; }
.ghost-btn, label.file-button { display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--text); }
.danger-btn { background: rgba(255,114,114,0.09); border: 1px solid rgba(255,114,114,0.24); color: #ffaaaa; }
.primary-btn:hover, .ghost-btn:hover, .danger-btn:hover, label.file-button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.full-width { width: 100%; }
.text-btn { padding: 8px 0; color: var(--gold-2); background: transparent; font-weight: 700; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--text); background: rgba(255,255,255,0.055); border: 1px solid rgba(255,255,255,0.08); font-size: 1.2rem; }
.button-row { display: flex; gap: 10px; align-items: center; }
.button-row.wrap { flex-wrap: wrap; }

.app-shell { min-height: 100vh; padding-bottom: 92px; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 76px; padding: 14px clamp(16px, 4vw, 46px); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(11,11,12,0.84); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255,255,255,0.055); }
.brand-row, .header-actions { display: flex; align-items: center; gap: 12px; }
.brand-row .eyebrow { margin-bottom: 3px; }
.header-actions { flex-wrap: nowrap; }
main { width: min(1280px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: panel-in 220ms ease; }
@keyframes panel-in { from { opacity: 0; transform: translateY(4px); } }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr); gap: 16px; }
.hero-card, .mindset-card, .content-card, .metric-card { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(24,24,26,0.97), rgba(15,15,16,0.98)); box-shadow: 0 12px 42px rgba(0,0,0,0.18); }
.hero-card, .mindset-card { min-height: 230px; padding: clamp(22px, 4vw, 36px); border-radius: var(--radius); }
.hero-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hero-copy h2 { margin: 0 0 10px; font: 600 clamp(2.4rem, 8vw, 5.2rem)/0.95 Georgia, serif; color: var(--gold-2); letter-spacing: -0.045em; }
.progress-orbit { width: 160px; aspect-ratio: 1; flex: 0 0 auto; display: grid; place-items: center; position: relative; }
.progress-orbit svg { width: 100%; transform: rotate(-90deg); }
.orbit-track, .orbit-progress { fill: none; stroke-width: 8; }
.orbit-track { stroke: rgba(255,255,255,0.06); }
.orbit-progress { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 314.159; stroke-dashoffset: 314.159; transition: stroke-dashoffset 500ms ease; }
.progress-orbit > div { position: absolute; display: grid; text-align: center; }
.progress-orbit strong { font-size: 1.4rem; }
.progress-orbit span { max-width: 70px; color: var(--muted); font-size: 0.66rem; line-height: 1.2; }
.mindset-card { display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(circle at 100% 0%, rgba(201,173,114,0.14), transparent 45%), linear-gradient(145deg, #171719, #111112); }
.mindset-card blockquote { margin: 18px 0; font: 500 clamp(1.35rem, 3vw, 2.15rem)/1.2 Georgia, serif; letter-spacing: -0.02em; }
.horizon-stats { display: flex; gap: 20px; color: var(--muted); font-size: 0.76rem; }
.horizon-stats strong { display: block; color: var(--text); font-size: 1.2rem; }
.metric-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { padding: 20px; display: grid; gap: 5px; border-radius: 18px; }
.metric-card span, .metric-card small { color: var(--muted); }
.metric-card span { font-size: 0.74rem; }
.metric-card strong { font-size: 1.45rem; letter-spacing: -0.03em; }
.metric-card small { font-size: 0.68rem; }
.content-card { margin-top: 16px; padding: clamp(18px, 3vw, 28px); border-radius: var(--radius); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.month-summary-list { margin-top: 20px; display: grid; gap: 9px; }
.month-row { min-height: 76px; padding: 14px 16px; display: grid; grid-template-columns: 56px minmax(120px, 1fr) repeat(4, minmax(82px, 0.65fr)); align-items: center; gap: 12px; background: rgba(255,255,255,0.022); border: 1px solid rgba(255,255,255,0.055); border-radius: 15px; }
.month-number { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--gold-2); background: rgba(201,173,114,0.09); font: 700 0.95rem Georgia, serif; }
.month-primary strong, .month-stat strong { display: block; }
.month-primary span, .month-stat span { color: var(--muted); font-size: 0.67rem; }
.month-progress { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,0.06); }
.month-progress i { display: block; height: 100%; max-width: 100%; border-radius: inherit; background: var(--gold); }
.value-positive { color: var(--green) !important; }
.value-negative { color: var(--red) !important; }

.board-header { margin-top: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.zoom-controls { display: flex; align-items: center; gap: 8px; }
.zoom-controls input { width: min(220px, 28vw); accent-color: var(--gold); }
.legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 0.72rem; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; display: inline-block; border-radius: 3px; }
.legend-dot.positive { background: var(--green); }
.legend-dot.negative { background: var(--red); }
.legend-dot.flat { background: var(--flat); }
.legend-dot.empty { background: var(--white-tile); }
.board-viewport { margin-top: 16px; padding: 12px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--radius); background: #0f0f10; box-shadow: inset 0 0 50px rgba(0,0,0,0.35); }
.six-month-board { width: max-content; min-width: 100%; padding: 8px; display: grid; grid-template-columns: repeat(3, max-content); gap: calc(var(--cell-gap) * 3); align-items: start; }
.month-board { min-width: calc(var(--cell-size) * 6 + var(--cell-gap) * 5 + 24px); padding: 12px; border: 1px solid rgba(255,255,255,0.055); border-radius: 15px; background: rgba(255,255,255,0.018); }
.month-board-header { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.month-board-header strong { font-size: 0.8rem; }
.month-board-header span { color: var(--muted); font-size: 0.64rem; }
.day-grid { display: grid; grid-template-columns: repeat(6, var(--cell-size)); gap: var(--cell-gap); }
.day-cell { width: var(--cell-size); height: var(--cell-size); padding: 0; display: grid; place-items: center; position: relative; border: 1px solid rgba(0,0,0,0.24); border-radius: max(5px, calc(var(--cell-size) * 0.16)); color: #171719; background: var(--white-tile); font-weight: 800; font-size: clamp(0.55rem, calc(var(--cell-size) * 0.23), 0.78rem); cursor: pointer; transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease; }
.day-cell:hover { z-index: 2; transform: translateY(-2px) scale(1.04); filter: brightness(1.06); box-shadow: 0 8px 18px rgba(0,0,0,0.28); }
.day-cell.positive { color: #051e14; background: var(--green); }
.day-cell.negative { color: #2b0709; background: var(--red); }
.day-cell.flat { color: #2b2106; background: var(--flat); }
.day-cell.future { opacity: 0.52; }
.day-cell.today { box-shadow: 0 0 0 2px #0f0f10, 0 0 0 4px var(--gold-2); }
.day-cell.has-note::after { content: ""; width: 4px; height: 4px; position: absolute; right: 4px; bottom: 4px; border-radius: 50%; background: currentColor; opacity: 0.65; }
.day-cell .trade-dot { min-width: 13px; height: 13px; padding: 0 3px; position: absolute; right: -3px; top: -4px; display: grid; place-items: center; border-radius: 99px; color: var(--text); background: #111; font-size: 0.5rem; border: 1px solid rgba(255,255,255,0.28); }

.settings-card { margin-top: 0; }
.utility-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(460px, calc(100% - 24px)); padding: 7px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; background: rgba(22,22,24,0.9); backdrop-filter: blur(22px); box-shadow: var(--shadow); }
.nav-item { min-height: 54px; padding: 8px; display: grid; place-items: center; gap: 2px; border-radius: 14px; color: var(--muted); background: transparent; font-size: 0.66rem; font-weight: 700; }
.nav-item span { font-size: 1.05rem; }
.nav-item.active { color: #16110a; background: linear-gradient(135deg, var(--gold-2), var(--gold)); }

.day-dialog { width: min(760px, calc(100% - 20px)); max-height: min(92vh, 920px); padding: 0; color: var(--text); background: #101011; border: 1px solid rgba(234,215,171,0.19); border-radius: 26px; box-shadow: 0 40px 100px rgba(0,0,0,0.62); overflow: hidden; }
.day-dialog::backdrop { background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); }
.dialog-topbar { position: sticky; top: 0; z-index: 2; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(16,16,17,0.94); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255,255,255,0.07); }
.dialog-topbar h2 { margin: 0; font-size: 1.25rem; }
.day-dialog-body { padding: 16px; overflow-y: auto; max-height: calc(min(92vh, 920px) - 78px); }
.day-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.day-summary-grid article { padding: 14px; display: grid; gap: 5px; border: 1px solid rgba(255,255,255,0.07); border-radius: 14px; background: rgba(255,255,255,0.025); }
.day-summary-grid span { color: var(--muted); font-size: 0.66rem; }
.day-summary-grid strong { font-size: 1.1rem; }
.compact-card { margin-top: 12px; padding: 18px; border-radius: 18px; }
.trade-list { margin-top: 14px; display: grid; gap: 8px; }
.empty-state { padding: 24px; color: var(--muted); text-align: center; border: 1px dashed rgba(255,255,255,0.1); border-radius: 14px; font-size: 0.82rem; }
.trade-item { padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; border: 1px solid rgba(255,255,255,0.07); border-radius: 14px; background: rgba(255,255,255,0.025); }
.trade-main { min-width: 0; }
.trade-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-main small, .trade-meta small { color: var(--muted); }
.trade-meta { text-align: right; }
.trade-meta strong { display: block; }
.delete-trade { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; color: #ffaaaa; background: rgba(255,114,114,0.08); cursor: pointer; }
.trade-form { margin-top: 14px; display: grid; gap: 14px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 94px; transform: translate(-50%, 20px); max-width: calc(100% - 28px); padding: 11px 15px; opacity: 0; pointer-events: none; color: #17110a; background: var(--gold-2); border-radius: 12px; box-shadow: var(--shadow); font-weight: 750; font-size: 0.78rem; transition: 180ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .six-month-board { grid-template-columns: repeat(2, max-content); }
  .month-row { grid-template-columns: 48px minmax(120px, 1fr) repeat(2, minmax(80px, 0.7fr)); }
  .month-row .month-stat:nth-last-child(-n+2) { display: none; }
}

@media (max-width: 600px) {
  :root { --radius: 20px; }
  .setup-shell { padding: 0; }
  .setup-card { min-height: 100vh; padding: 24px 16px 40px; border-radius: 0; border-left: 0; border-right: 0; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .caps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { padding: 11px 14px; }
  .brand-row h1 { max-width: 145px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 0.94rem; }
  .brand-row .eyebrow { font-size: 0.55rem; }
  .header-actions .ghost-btn { display: none; }
  .header-actions .primary-btn { min-height: 40px; padding: 8px 11px; font-size: 0.73rem; }
  main { width: min(100% - 20px, 1280px); padding-top: 18px; }
  .hero-card { min-height: 250px; flex-direction: column; align-items: flex-start; }
  .progress-orbit { width: 126px; align-self: flex-end; margin-top: -84px; }
  .hero-copy h2 { font-size: 3.4rem; }
  .mindset-card { min-height: 220px; }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 15px; }
  .metric-card strong { font-size: 1.18rem; }
  .card-header { align-items: flex-start; }
  .month-row { grid-template-columns: 42px minmax(0, 1fr) 82px; padding: 12px; }
  .month-row .month-stat:nth-last-child(-n+3) { display: none; }
  .board-header { grid-template-columns: 1fr; }
  .zoom-controls { width: 100%; }
  .zoom-controls input { flex: 1; width: auto; }
  .six-month-board { grid-template-columns: max-content; }
  .utility-card { align-items: flex-start; flex-direction: column; }
  .day-dialog { width: 100%; max-width: none; max-height: 96vh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .day-dialog-body { max-height: calc(96vh - 78px); }
  .day-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .trade-item { grid-template-columns: minmax(0, 1fr) auto; }
  .delete-trade { grid-column: 2; grid-row: 1 / span 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Trader Horizon — White Minimal Theme v0.1.1 */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --panel-3: #f1f5f9;
  --text: #111827;
  --muted: #6b7280;
  --gold: #2563eb;
  --gold-2: #1d4ed8;
  --line: #e5e7eb;
  --green: #16a34a;
  --green-deep: #dcfce7;
  --red: #dc2626;
  --red-deep: #fee2e2;
  --white-tile: #ffffff;
  --flat: #d97706;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

html { background: var(--bg); }
body {
  background: linear-gradient(180deg, #ffffff 0, #f6f7f9 320px, #f6f7f9 100%);
  color: var(--text);
}
button { color: var(--text); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline-color: rgba(37, 99, 235, 0.55);
}
.eyebrow { color: #2563eb; }
.setup-card,
.hero-card, .mindset-card, .content-card, .metric-card {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: var(--shadow);
}
.setup-card { box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10); }
.brand-mark {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.form-section {
  background: #f8fafc;
  border-color: #e5e7eb;
}
.field, .switch-field, .field-label { color: #374151; }
.field input, .field select, .field textarea,
.cap-field input {
  color: var(--text);
  background: #ffffff;
  border-color: #d1d5db;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.field input:hover, .field select:hover, .field textarea:hover,
.cap-field input:hover { border-color: #93c5fd; }
.switch-field { background: #ffffff; border-color: #e5e7eb; }
.switch-field input { background: #d1d5db; }
.switch-field input:checked { background: #2563eb; }
.primary-btn {
  color: #ffffff;
  background: #2563eb;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}
.primary-btn:hover { background: #1d4ed8; }
.ghost-btn, label.file-button, .icon-btn {
  color: #374151;
  background: #ffffff;
  border-color: #d1d5db;
}
.ghost-btn:hover, label.file-button:hover, .icon-btn:hover { background: #f8fafc; }
.danger-btn {
  color: #b91c1c;
  background: #fff1f2;
  border-color: #fecdd3;
}
.text-btn { color: #2563eb; }
.topbar {
  background: rgba(255, 255, 255, 0.90);
  border-bottom-color: #e5e7eb;
  box-shadow: 0 1px 12px rgba(15, 23, 42, 0.04);
}
.hero-card, .mindset-card { background: #ffffff; }
.hero-copy h2 { color: #111827; font-family: Inter, ui-sans-serif, sans-serif; font-weight: 720; }
.orbit-track { stroke: #e5e7eb; }
.orbit-progress { stroke: #2563eb; }
.mindset-card {
  background: linear-gradient(145deg, #ffffff, #f8fafc);
}
.mindset-card blockquote { font-family: Inter, ui-sans-serif, sans-serif; color: #1f2937; }
.metric-card, .content-card { box-shadow: 0 10px 30px rgba(15, 23, 42, 0.055); }
.month-row,
.utility-card,
.trade-item,
.day-summary-card {
  background: #f8fafc;
  border-color: #e5e7eb;
}
.month-number {
  color: #1d4ed8;
  background: #eff6ff;
  font-family: Inter, ui-sans-serif, sans-serif;
}

/* Board and day cells */
.board-shell, .month-board, .calendar-wrap, .board-viewport {
  background: #ffffff;
  border-color: #e5e7eb;
}
.day-cell {
  color: #6b7280;
  background: #ffffff;
  border-color: #d1d5db;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.day-cell:hover { border-color: #93c5fd; box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08); }
.day-cell.profit, .day-cell.positive, .day-cell.win {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}
.day-cell.loss, .day-cell.negative {
  color: #991b1b;
  background: #fee2e2;
  border-color: #fca5a5;
}
.day-cell.flat, .day-cell.breakeven {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}
.day-cell.today { outline-color: #2563eb; }
.legend-swatch.empty { background: #ffffff; border-color: #d1d5db; }

/* Navigation and dialogs */
.bottom-nav {
  background: rgba(255, 255, 255, 0.94);
  border-top-color: #e5e7eb;
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.06);
}
.nav-item { color: #6b7280; background: transparent; }
.nav-item.active { color: #2563eb; background: #eff6ff; }
.dialog-backdrop, dialog::backdrop { background: rgba(15, 23, 42, 0.32); }
.day-dialog, dialog {
  color: var(--text);
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
}
.day-dialog-header { background: #ffffff; border-bottom-color: #e5e7eb; }
.day-dialog-body { background: #ffffff; }
.delete-trade { color: #b91c1c; background: #fff1f2; }
.toast { color: #ffffff; background: #111827; box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18); }

/* Scrollbars */
* { scrollbar-color: #cbd5e1 transparent; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

.field-hint {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}

.month-primary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .72rem;
}

.forecast-card {
  margin-top: 18px;
}

.forecast-waiting {
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: #fafcff;
}

.forecast-waiting p {
  margin: 7px 0 0;
  max-width: 760px;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.forecast-grid article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #f8fafc;
}

.forecast-grid span,
.forecast-grid small {
  display: block;
  color: var(--muted);
}

.forecast-grid span {
  margin-bottom: 8px;
  font-size: .78rem;
}

.forecast-grid strong {
  display: block;
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  letter-spacing: -.04em;
}

.forecast-grid small {
  margin-top: 6px;
  font-size: .7rem;
  line-height: 1.4;
}

.forecast-basis {
  margin: 14px 2px 0;
  font-size: .78rem;
}

@media (max-width: 900px) {
  .forecast-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .forecast-grid { grid-template-columns: 1fr; }
}

/* Trade image journal — v0.1.3 */
.trade-photo-field { display: grid; gap: 8px; }
.trade-photo-field > small { color: var(--muted); font-size: 0.72rem; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-picker { display: inline-flex !important; align-items: center; justify-content: center; min-height: 42px; cursor: pointer; }
.pending-photo-grid, .trade-image-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.pending-photo-grid:empty { display: none; }
.pending-photo, .trade-image-thumb { position: relative; margin: 0; aspect-ratio: 1; overflow: hidden; border: 1px solid #dbe2ea; border-radius: 14px; background: #f1f5f9; }
.pending-photo img, .trade-image-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pending-photo > button, .image-delete { position: absolute; z-index: 2; top: 6px; right: 6px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 999px; color: #fff; background: rgba(17,24,39,.82); cursor: pointer; }
.trade-item { grid-template-columns: minmax(0, 1fr) auto auto; }
.trade-main p { margin: 7px 0 0; color: #4b5563; font-size: .75rem; line-height: 1.55; white-space: pre-wrap; }
.trade-meta { display: grid; gap: 2px; }
.trade-image-gallery { grid-column: 1 / -1; padding-top: 4px; }
.image-open { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.image-viewer { width: min(1100px, calc(100% - 20px)); max-height: 94vh; padding: 0; border: 0; border-radius: 20px; background: #0b0c0f; overflow: hidden; box-shadow: 0 35px 100px rgba(0,0,0,.45); }
.image-viewer::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(7px); }
.image-viewer-bar { min-height: 58px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fff; background: #111318; }
.image-viewer-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-viewer-bar .icon-btn { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); }
.image-viewer > img { width: 100%; max-height: calc(94vh - 58px); display: block; object-fit: contain; background: #050505; }
@media (max-width: 600px) {
  .pending-photo-grid, .trade-image-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .trade-item { grid-template-columns: minmax(0, 1fr) auto; }
  .trade-image-gallery { grid-column: 1 / -1; }
  .image-viewer { width: 100%; max-height: 100vh; border-radius: 0; }
  .image-viewer > img { max-height: calc(100vh - 58px); }
}


/* Independent trade/setup outcomes — v0.1.4 */
.inline-field-hint {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 500;
  line-height: 1.45;
}
.metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.day-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.result-badges { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.result-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #dbe2ea;
  border-radius: 999px;
  color: #475569;
  background: #f8fafc;
  font-size: .66rem;
  font-weight: 750;
  line-height: 1;
}
.result-badge.win { color: #166534; background: #dcfce7; border-color: #86efac; }
.result-badge.loss { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }
.result-badge.breakeven { color: #92400e; background: #fef3c7; border-color: #fcd34d; }
.result-badge.mismatch { color: #6d28d9; background: #f3e8ff; border-color: #d8b4fe; }
.trade-item.execution-mismatch { border-color: #d8b4fe; box-shadow: inset 3px 0 0 #8b5cf6; }
@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .day-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Cloud account and multi-device sync — v0.2.0 */
.auth-shell {
  min-height: 100vh;
  padding: 28px 18px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 10%, rgba(37, 99, 235, .09), transparent 28%),
    radial-gradient(circle at 90% 85%, rgba(14, 165, 233, .07), transparent 30%),
    #f7f9fc;
}
.auth-card {
  width: min(520px, 100%);
  padding: clamp(24px, 6vw, 44px);
  border: 1px solid #e5e7eb;
  border-radius: 30px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 28px 80px rgba(15,23,42,.11);
}
.auth-brand { display: grid; gap: 4px; }
.auth-brand .brand-mark { margin-bottom: 18px; }
.auth-brand h1 { font-size: clamp(1.8rem, 7vw, 2.65rem); line-height: 1.05; letter-spacing: -.055em; }
.auth-tabs {
  margin: 26px 0 18px;
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
}
.auth-tab {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  color: #64748b;
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}
.auth-tab.active { color: #1d4ed8; background: #fff; box-shadow: 0 2px 8px rgba(15,23,42,.07); }
.auth-form { display: grid; gap: 14px; }
.optional-label { color: #94a3b8; font-weight: 500; }
.form-error {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #991b1b;
  background: #fef2f2;
  font-size: .8rem;
  line-height: 1.45;
}
.auth-offline { width: 100%; margin-top: 16px; text-align: center; }
.auth-note { margin: 14px 0 0; color: #94a3b8; font-size: .7rem; line-height: 1.55; text-align: center; }

.sync-pill {
  min-height: 38px;
  max-width: 260px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  color: #475569;
  background: #fff;
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
}
.sync-pill i { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #94a3b8; }
.sync-pill[data-status="synced"] i { background: #16a34a; box-shadow: 0 0 0 4px #dcfce7; }
.sync-pill[data-status="syncing"] i { background: #2563eb; box-shadow: 0 0 0 4px #dbeafe; animation: sync-pulse 1s ease-in-out infinite; }
.sync-pill[data-status="offline"] i { background: #d97706; box-shadow: 0 0 0 4px #fef3c7; }
.sync-pill[data-status="error"] i, .sync-pill[data-status="signed-out"] i { background: #dc2626; box-shadow: 0 0 0 4px #fee2e2; }
.sync-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes sync-pulse { 50% { opacity: .45; transform: scale(.82); } }
.sync-detail { margin: 8px 0 0; color: #475569; font-size: .78rem; line-height: 1.5; }
.cloud-account-card { align-items: flex-start; }
.cloud-account-card .button-row { justify-content: flex-end; }

button[disabled], .primary-btn[disabled], .ghost-btn[disabled], .danger-btn[disabled] {
  cursor: wait;
  opacity: .58;
  transform: none;
}

@media (max-width: 760px) {
  .sync-pill { max-width: 42px; width: 42px; justify-content: center; padding: 0; }
  .sync-pill span { display: none; }
  .cloud-account-card { align-items: stretch; }
  .cloud-account-card .button-row { justify-content: flex-start; }
}


.image-loading,
.image-unavailable {
  min-height: 116px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  color: #64748b;
  background: #f8fafc;
  font-size: .75rem;
  text-align: center;
}

.photo-compression-status {
  min-height: 34px;
  padding: 8px 11px;
  border: 1px solid #dbe2ea;
  border-radius: 11px;
  color: #475569;
  background: #f8fafc;
  font-size: .72rem;
  line-height: 1.45;
}
.photo-compression-status[data-tone="working"] { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.photo-compression-status[data-tone="success"] { color: #166534; border-color: #bbf7d0; background: #f0fdf4; }
.photo-compression-status[data-tone="warning"] { color: #92400e; border-color: #fde68a; background: #fffbeb; }
.photo-compression-status[data-tone="error"] { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.pending-photo figcaption {
  position: absolute;
  right: 5px;
  bottom: 5px;
  left: 5px;
  padding: 4px 6px;
  overflow: hidden;
  border-radius: 7px;
  color: #fff;
  background: rgba(15, 23, 42, .76);
  font-size: .58rem;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.photo-picker:has(input:disabled) { opacity: .55; cursor: wait; }

/* Journal upgrade v3.2.0 — editable entries, observation outcomes, month-end outlook */
.hero-value-label {
  display: block;
  margin-top: -4px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.result-badge.no_trade { color: #334155; background: #f1f5f9; border-color: #cbd5e1; }
.result-badge.guide { color: #075985; background: #e0f2fe; border-color: #7dd3fc; }
.trade-item.journal-only { border-style: dashed; background: #f8fafc; }
.trade-actions { display: grid; gap: 6px; justify-items: end; }
.edit-trade {
  min-width: 52px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #1e3a8a;
  background: #eff6ff;
  font: inherit;
  font-size: .7rem;
  font-weight: 800;
  cursor: pointer;
}
.trade-form-actions { justify-content: flex-start; }
.trade-form-actions .primary-btn { flex: 1 1 220px; }
.trade-form-actions .ghost-btn { flex: 0 0 auto; }
@media (max-width: 600px) {
  .trade-actions { grid-column: 2; grid-row: 1 / span 2; }
  .trade-form-actions { display: grid; grid-template-columns: 1fr; }
  .trade-form-actions .primary-btn, .trade-form-actions .ghost-btn { width: 100%; }
}
