/* Trading Journal — gold edition. Chart data colors stay from the validated palette;
   gold is UI chrome + the single-series equity/radar accent. */
:root {
  color-scheme: light dark;
  --page:        #faf9f6;
  --page-glow:   rgba(184, 134, 11, 0.05);
  --surface:     #ffffff;
  --surface-2:   #f6f4ee;
  --ink:         #1a1917;
  --ink-2:       #52514e;
  --muted:       #8b897f;
  --grid:        #eae8df;
  --baseline:    #c9c7bc;
  --border:      rgba(26, 25, 23, 0.08);
  --shadow:      0 1px 2px rgba(26,25,23,.04), 0 10px 30px -18px rgba(26,25,23,.18);
  --gold:        #b8860b;
  --gold-hi:     #d4a017;
  --gold-grad:   linear-gradient(135deg, #e6b83f, #b8860b);
  --gold-ink:    #241a00;
  --series-1:    #2a78d6;
  --good:        #0ca30c;
  --critical:    #d03b3b;
  --good-text:   #006300;
  --crit-text:   #b32222;
}
:root[data-theme="dark"] {
  --page:      #0b0c10;
  --page-glow: rgba(240, 193, 75, 0.06);
  --surface:   #14161c;
  --surface-2: #1a1d25;
  --ink:       #f2f1ec;
  --ink-2:     #bab8ae;
  --muted:     #85837a;
  --grid:      #232630;
  --baseline:  #3a3e4a;
  --border:    rgba(255, 255, 255, 0.07);
  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 12px 34px -18px rgba(0,0,0,.6);
  --gold:      #f0c14b;
  --gold-hi:   #ffd66b;
  --gold-grad: linear-gradient(135deg, #ffd66b, #d4a017);
  --gold-ink:  #241a00;
  --series-1:  #3987e5;
  --good-text: #2fbf4f;
  --crit-text: #e66767;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(1100px 420px at 50% -140px, var(--page-glow), transparent 70%), var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
main { max-width: 1180px; margin: 0 auto; padding: 0 20px 64px; }
h1 {
  font-size: 19px; margin: 0; letter-spacing: -0.01em; font-weight: 700;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
h2 { font-size: 14px; font-weight: 650; margin: 0; letter-spacing: -0.005em; }
.muted { color: var(--muted); }
.k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.spacer { flex: 1; }

/* --- top bar --- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px; margin: 0 auto 14px; max-width: 1180px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.tabs {
  display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 11px; padding: 3px; box-shadow: var(--shadow);
}
.tabs button {
  font: inherit; border: none; background: none; color: var(--ink-2);
  padding: 7px 15px; border-radius: 8px; cursor: pointer; font-weight: 550;
  transition: color .15s, background .15s;
}
.tabs button:hover { color: var(--ink); background: var(--surface-2); }
.tabs button.active { background: var(--gold-grad); color: var(--gold-ink); font-weight: 700; }

/* --- buttons / inputs --- */
.btn {
  font: inherit; padding: 8px 15px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  transition: border-color .15s, transform .1s, background .15s;
}
.btn:hover { border-color: var(--baseline); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--gold-grad); border-color: transparent; color: var(--gold-ink);
  font-weight: 700; box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--gold) 60%, transparent);
}
.btn-primary:hover { filter: brightness(1.06); background: var(--gold-grad); }
.btn-danger { color: var(--crit-text); }
.btn-icon {
  font: inherit; font-size: 20px; line-height: 1; padding: 4px 10px;
  background: none; border: none; color: var(--muted); cursor: pointer;
}
.btn-icon:hover { color: var(--ink); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px; padding: 8px 11px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent);
}

/* --- stat tiles --- */
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 15px 17px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.tile::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--gold-grad); opacity: 0.55;
}
.tile .label { font-size: 12px; color: var(--ink-2); font-weight: 550; }
.tile .value { font-size: 27px; font-weight: 700; margin-top: 3px; letter-spacing: -0.02em; }
.tile .delta { font-size: 12px; margin-top: 3px; color: var(--ink-2); }
.tile .delta.up, .up-text { color: var(--good-text); }
.tile .delta.down, .down-text { color: var(--crit-text); }

/* --- cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
/* A sentence beside a card's title saying what its numbers are counted from.
   Pushed to the right so it reads as a footnote, not a subtitle. */
.card-note { font-size: 11.5px; margin-left: auto; text-align: right; }
.card-head h2 { padding-left: 11px; position: relative; }
.card-head h2::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 14px; border-radius: 2px; background: var(--gold-grad);
}
.dash-row { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.dash-row .card { margin-bottom: 16px; }

/* dashboard: quote of the day */
.quote-banner {
  position: relative; overflow: hidden;
  background:
    radial-gradient(480px 140px at 18% -60%, var(--page-glow), transparent 70%),
    var(--surface);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 28px 20px 56px; margin-bottom: 16px; box-shadow: var(--shadow);
  text-align: center;
  animation: quote-in .5s ease-out;
}
.quote-banner::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gold-grad);
}
.quote-banner::after {
  content: "“"; position: absolute; left: 14px; top: 8px;
  font-family: Georgia, "Times New Roman", serif; font-size: 52px; line-height: 1;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text;
  color: transparent; opacity: .5; pointer-events: none;
}
.quote-banner .quote-text {
  display: block; color: var(--ink); font-style: italic;
  font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.5;
}
.quote-banner .quote-author {
  display: block; margin-top: 8px; color: var(--gold); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.quote-banner .quote-author::before { content: "— "; }
@keyframes quote-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .quote-banner { animation: none; }
}

/* account switcher (topbar) */
.brand { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.acct-switch {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 2px; box-shadow: var(--shadow);
}
.acct-switch select {
  width: auto; border: none; background: none; box-shadow: none;
  padding: 6px 8px 6px 10px; font-weight: 650; color: var(--ink); max-width: 60vw;
}
.acct-switch select:focus { box-shadow: none; }
.acct-cog { font-size: 15px; padding: 5px 9px; border-radius: 8px; }
.acct-cog:hover { background: var(--surface-2); }

/* account progress header (dashboard) */
.acct-header { display: flex; flex-direction: column; gap: 16px; }
/* The hidden attribute has to beat any class that sets `display`, or an
   element stays on screen with hidden="" set on it. That has caught this
   codebase three times now — the account header, the accounts list, and the
   recording timer, which sat beside a finished video reading 0:03. */
[hidden] { display: none !important; }

.acct-header[hidden] { display: none; }
.acct-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.acct-id h2 { font-size: 19px; }
.acct-meta { display: flex; align-items: center; gap: 7px; margin-top: 6px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.acct-balance { text-align: right; }
.acct-balance .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.acct-balance .value { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; }
.badge.phase-funded::before { background: var(--gold); box-shadow: 0 0 6px color-mix(in srgb, var(--gold) 60%, transparent); }
.badge.phase-eval::before { background: var(--muted); }
.badge.st-active::before { background: var(--good); box-shadow: 0 0 6px color-mix(in srgb, var(--good) 55%, transparent); }
.badge.st-passed::before { background: var(--gold); }
.badge.st-failed::before { background: var(--critical); }
.badge.st-archived::before { background: var(--muted); }

.acct-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
@media (max-width: 620px) { .acct-bars { grid-template-columns: 1fr; } }
.acct-prog-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.acct-prog-head span:first-child { color: var(--ink-2); font-weight: 600; }
.acct-prog-head span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.acct-prog-head .muted { font-weight: 400; }
.prog-track { height: 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 999px; transition: width .3s ease; }
.prog-fill.gold { background: var(--gold-grad); }
.prog-fill.good { background: linear-gradient(135deg, color-mix(in srgb, var(--good) 70%, #fff), var(--good)); }
.prog-fill.ok { background: linear-gradient(135deg, color-mix(in srgb, var(--good) 55%, transparent), var(--good)); }
.prog-fill.warn { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); }
.prog-fill.crit { background: linear-gradient(135deg, color-mix(in srgb, var(--critical) 75%, #fff), var(--critical)); }

.acct-quick { display: flex; flex-wrap: wrap; gap: 8px 26px; padding-top: 2px; border-top: 1px solid var(--border); }
.acct-quick > div { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; }
.acct-quick .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.acct-quick .v { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.acct-quick .v .muted { font-size: 12px; font-weight: 400; }

.acct-flags { display: flex; flex-direction: column; gap: 8px; }
.acct-flag { font-size: 13px; line-height: 1.45; padding: 9px 12px; border-radius: 10px; border: 1px solid transparent; }
.acct-flag.ok { color: var(--good-text); background: color-mix(in srgb, var(--good) 12%, transparent); border-color: color-mix(in srgb, var(--good) 28%, transparent); }
.acct-flag.warn { color: color-mix(in srgb, var(--gold) 72%, var(--ink)); background: color-mix(in srgb, var(--gold) 15%, transparent); border-color: color-mix(in srgb, var(--gold) 34%, transparent); }
.acct-flag.crit { color: var(--crit-text); background: color-mix(in srgb, var(--critical) 12%, transparent); border-color: color-mix(in srgb, var(--critical) 30%, transparent); }

/* preset picker note in the account form — mirrors the .acct-flag palette */
.preset-note { font-size: 13px; line-height: 1.45; margin: 0; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--muted); }
.preset-note.ok { color: var(--good-text); background: color-mix(in srgb, var(--good) 12%, transparent); border-color: color-mix(in srgb, var(--good) 28%, transparent); }
.preset-note.warn { color: color-mix(in srgb, var(--gold) 72%, var(--ink)); background: color-mix(in srgb, var(--gold) 15%, transparent); border-color: color-mix(in srgb, var(--gold) 34%, transparent); }
.preset-note a { color: inherit; }

/* accounts manager modal */
#accounts-list { display: flex; flex-direction: column; gap: 8px; }
#accounts-list[hidden] { display: none; }
.acct-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.acct-item.active { border-color: color-mix(in srgb, var(--gold) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent) inset; }
.acct-item-name { font-weight: 650; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.acct-item-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.acct-add { margin-top: 6px; align-self: flex-start; }
.dash-row .grow { flex: 1 1 480px; min-width: 0; }
.score-card { flex: 0 0 350px; }
@media (max-width: 800px) { .score-card { flex: 1 1 100%; } }

.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-tooltip {
  position: absolute; pointer-events: none; background: var(--surface);
  border: 1px solid var(--border); border-radius: 9px; padding: 7px 11px;
  font-size: 12px; box-shadow: var(--shadow);
  white-space: nowrap; display: none; z-index: 5;
}
.chart-tooltip .tt-val { font-weight: 700; }

/* --- edge score --- */
.score-body { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.score-num { font-size: 42px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.score-num small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.score-radar svg { width: 300px; height: 210px; display: block; }
.score-comps { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; font-size: 12px; }
.score-comps .row { display: flex; justify-content: space-between; gap: 8px; }
.score-comps .row b { font-variant-numeric: tabular-nums; }

/* --- filters --- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters select, .filters input { width: auto; }
.filters-toggle { display: none; }          /* desktop shows the bar outright */

@media (max-width: 760px) {
  /* Four rows of filters above the table buried the trades. Collapse them. */
  .filters-toggle { display: inline-flex; align-items: center; margin-bottom: 12px; }
  .filters-toggle.has-active { border-color: var(--gold); color: var(--ink); }
  .filters-count { font-weight: 700; color: var(--gold); }
  .filters { display: none; }
  .filters.open {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    padding: 12px; margin-bottom: 16px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2);
  }
  .filters.open select { width: 100%; min-width: 0; }
  /* the date range reads as one thing, so it spans the row */
  .filters.open .filter-date { grid-column: 1 / -1; }
  .filters.open #f-clear { grid-column: 1 / -1; }
}

/* --- trade table --- */
.trades { width: 100%; border-collapse: collapse; }
.trades th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 650; padding: 6px 9px; border-bottom: 1px solid var(--grid);
}
.trades td { padding: 9px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.trades tbody tr { cursor: pointer; transition: background .12s; }
.trades tbody tr:last-child td { border-bottom: none; }
.trades tbody tr:hover { background: color-mix(in srgb, var(--gold) 7%, transparent); }
.trades .num, .trades td.num { text-align: right; font-variant-numeric: tabular-nums; }
.thumb {
  width: 58px; height: 38px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); display: block; background: var(--surface-2);
}
.thumb-empty {
  width: 58px; height: 38px; border-radius: 8px; border: 1px dashed var(--grid);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 10px;
}
.pnl-pos { color: var(--good-text); font-weight: 650; }
.pnl-neg { color: var(--crit-text); font-weight: 650; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 650; padding: 2.5px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.badge.win::before { background: var(--good); box-shadow: 0 0 6px color-mix(in srgb, var(--good) 60%, transparent); }
.badge.loss::before { background: var(--critical); box-shadow: 0 0 6px color-mix(in srgb, var(--critical) 60%, transparent); }
.chip {
  display: inline-block; font-size: 11px; padding: 1.5px 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); margin: 1px 2px 1px 0;
}
.dir { font-weight: 650; font-size: 12px; }
.empty { text-align: center; padding: 30px 0; }

/* --- calendar --- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cal-head h2 { min-width: 150px; text-align: center; }
.cal-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr) 96px; gap: 7px; }
.cal-dow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); text-align: center; padding: 2px 0; font-weight: 650; }
.cal-cell {
  min-height: 76px; border: 1px solid var(--grid); border-radius: 12px; padding: 7px 9px;
  font-size: 12px; position: relative; background: var(--surface-2);
  transition: outline-color .12s, transform .12s;
}
.cal-cell.out { opacity: 0.3; background: transparent; }
.cal-cell .d { color: var(--muted); font-size: 11px; }
.cal-cell.win { background: color-mix(in srgb, var(--good) 13%, var(--surface-2)); border-color: color-mix(in srgb, var(--good) 32%, var(--grid)); }
.cal-cell.loss { background: color-mix(in srgb, var(--critical) 13%, var(--surface-2)); border-color: color-mix(in srgb, var(--critical) 32%, var(--grid)); }
.cal-cell.tradeday { cursor: pointer; }
.cal-cell.tradeday:hover { outline: 2px solid var(--gold); outline-offset: -1px; transform: translateY(-1px); }
.cal-cell .pnl { font-weight: 750; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cal-cell .n { color: var(--ink-2); font-size: 11px; }
.cal-cell .note-dot { position: absolute; top: 8px; right: 9px; color: var(--gold); font-size: 11px; }
.cal-week {
  min-height: 76px; border: 1px solid var(--border); border-radius: 12px; padding: 7px 9px;
  font-size: 12px; background: var(--surface); box-shadow: var(--shadow);
}
.cal-week .pnl { font-weight: 750; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* --- day modal --- */
.day-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px 14px; margin-bottom: 14px; }
.day-stats .v { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.day-note textarea { margin-top: 4px; }
.day-note .saved { font-size: 12px; color: var(--good-text); margin-left: 8px; }
.day-note-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
#day-save { padding: 6px 16px; font-size: 13px; }
#day-save:disabled { opacity: .55; cursor: default; }
#day-save:disabled:hover { transform: none; }

/* --- journal --- */
.jr-date { font-weight: 400; font-size: 13px; }
.jr-today .card-head { justify-content: space-between; }
.jr-today .saved { font-size: 12px; color: var(--good-text); }
.jr-moods { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.jr-mood {
  font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  transition: border-color .15s, background .15s, color .15s;
}
.jr-mood:hover { border-color: var(--baseline); background: var(--surface-2); }
.jr-mood .e { font-size: 15px; line-height: 1; }
.jr-mood.on { border-color: transparent; background: var(--gold-grad); color: var(--gold-ink); font-weight: 600; }
#jr-today-text { width: 100%; resize: vertical; min-height: 140px; }
.jr-today-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-top: 8px; font-size: 13px;
}
.jr-hint { font-size: 12px; }
.jr-save-row { display: flex; align-items: center; gap: 12px; }
#jr-save { padding: 7px 18px; }
#jr-save:disabled { opacity: .55; cursor: default; }
#jr-save:disabled:hover { transform: none; }
.jr-today .saved.failed, .day-note .saved.failed { color: var(--crit-text); }
.jr-list { display: flex; flex-direction: column; gap: 10px; }
.jr-entry { border: 1px solid var(--border); border-radius: 11px; padding: 13px 15px; background: var(--surface-2); }
.jr-entry-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.jr-entry-head h3 { font-size: 14px; font-weight: 650; }
.jr-entry-today { border-color: color-mix(in srgb, var(--accent, #c9a227) 40%, var(--border)); }
.jr-today-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--gold-grad); color: var(--gold-ink); margin-left: 6px; vertical-align: middle; }
.jr-entry-meta { font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.jr-tag {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
}
.jr-tag .e { font-size: 14px; line-height: 1; }
.jr-entry-text { white-space: pre-wrap; margin: 9px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.jr-entry-text.muted { color: var(--muted); font-style: italic; }
.jr-entry-actions { display: flex; gap: 8px; align-items: center; margin-top: 11px; }
.jr-entry-actions .btn { padding: 5px 12px; font-size: 12px; }
.jr-del { color: var(--muted); }
.jr-del:hover { color: var(--crit-text); border-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.jr-del.armed {
  color: var(--crit-text); font-weight: 600;
  border-color: color-mix(in srgb, var(--critical) 55%, transparent);
  background: color-mix(in srgb, var(--critical) 12%, transparent);
}
.jr-del:disabled { opacity: .6; cursor: default; }
@media (max-width: 560px) {
  .jr-entry-head { flex-direction: column; gap: 3px; }
  .jr-entry-meta { white-space: normal; }
  .jr-today-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .jr-save-row { justify-content: space-between; }
  .jr-mood { flex: 1 1 auto; justify-content: center; }
}

/* --- reports --- */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.bar-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.bar-row { display: grid; grid-template-columns: 88px 1fr 118px; align-items: center; gap: 8px; font-size: 12px; }
.bar-row .lbl { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.bar-track { position: relative; height: 16px; }
.bar-track .zero { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--baseline); }
.bar-track .bar { position: absolute; top: 0; height: 16px; border-radius: 0 5px 5px 0; background: var(--series-1); }
.bar-track .bar.neg { border-radius: 5px 0 0 5px; background: var(--critical); }
.bar-row .sub { color: var(--muted); font-weight: 400; }

/* --- rules --- */
.rules-wrap { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }
@media (max-width: 700px) { .rules-wrap { grid-template-columns: 1fr; } }
.mantras { color: var(--ink-2); font-style: italic; font-size: 13px; display: flex; flex-direction: column; gap: 9px; }
.mantras p { margin: 0; padding-left: 11px; border-left: 2px solid var(--gold); }
.rules-list { display: flex; flex-direction: column; gap: 7px; }
.rule-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.rule-row .pct { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.rule-row .pct.good { color: var(--good-text); }
.rule-row .pct.bad { color: var(--crit-text); }
.rules-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; padding: 0 14px 12px; }
@media (max-width: 640px) { .rules-checks { grid-template-columns: 1fr; } }
.rules-checks label { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.rules-checks input[type="checkbox"] { width: auto; accent-color: var(--gold); }

/* --- modals --- */
dialog {
  border: 1px solid var(--border); border-radius: 18px; padding: 0;
  background: var(--surface); color: var(--ink);
  width: min(780px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  box-shadow: 0 24px 80px -24px rgba(0,0,0,.45);
}
dialog::backdrop { background: rgba(8, 8, 10, 0.55); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 22px 20px; }
#trade-form .grid, #detail-body, #day-body { padding: 4px 22px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px 12px; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.grid label.full, .grid .full { grid-column: 1 / -1; }
/* The preset picker is its own block at the top of the account form, so the
   three choices that seed every other field read as one step rather than as
   more fields to fill in. */
.preset-box { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px 14px;
  background: color-mix(in srgb, var(--ink) 3%, transparent); display: flex; flex-direction: column; gap: 11px; }
.preset-box-head { display: flex; flex-direction: column; gap: 2px; }
.preset-box-head strong { font-size: 13px; color: var(--ink); }
.preset-box-head span { font-size: 12px; color: var(--muted); }
.preset-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.preset-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.preset-fields .preset-plan-field { grid-column: 1 / -1; }
@media (max-width: 560px) { .preset-fields { grid-template-columns: 1fr; } }
/* Divider between the preset step and the fields it fills in. */
.form-section { margin: 4px 0 -2px; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }

/* --- collapsible sections in the trade form --- */
.form-more { border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--surface-2); }
.form-more summary {
  cursor: pointer; padding: 11px 15px; color: var(--ink-2); font-size: 13px; font-weight: 550;
  list-style-position: inside; user-select: none;
}
.form-more summary:hover { color: var(--ink); }
.form-more[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.form-more > .grid { padding: 0 15px 13px; }

/* --- dropzone --- */
.dropzone {
  margin: 12px 22px 0; border: 1.5px dashed var(--baseline); border-radius: 12px;
  padding: 13px; text-align: center; color: var(--ink-2); font-size: 13px;
  transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.dropzone p { margin: 4px 0; }
.dropzone .link { color: var(--gold); cursor: pointer; text-decoration: underline; }
.previews { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.previews .pv { position: relative; }
.previews img { width: 96px; height: 64px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); }
.pv { position: relative; display: inline-block; }
.pv .rm {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  border-radius: 50%; border: none; background: var(--critical); color: #fff;
  font-size: 12px; line-height: 1; cursor: pointer;
}

/* --- detail view --- */
.detail-shots { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 14px; }
.detail-shots img {
  max-width: 220px; max-height: 150px; border-radius: 12px;
  border: 1px solid var(--border); cursor: zoom-in; display: block; box-shadow: var(--shadow);
}
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 11px 16px; margin-bottom: 12px; }
.detail-grid .v { font-weight: 650; font-variant-numeric: tabular-nums; }
.notes-block { margin-bottom: 13px; }
.notes-block h3 { font-size: 12px; color: var(--muted); margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.notes-block p { margin: 0; white-space: pre-wrap; }

/* --- lightbox --- */
#lightbox { width: auto; max-width: calc(100vw - 40px); background: transparent; border: none; box-shadow: none; }
#lightbox img { max-width: 100%; max-height: calc(100vh - 80px); border-radius: 12px; cursor: zoom-out; display: block; }

/* ============ multi-user additions ============ */
.user-menu { display: flex; align-items: center; gap: .6rem; margin-left: .25rem; }
.user-email {
  font-size: .82rem; color: var(--muted); max-width: 16ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 720px) { .user-email { display: none; } }

/* login / signup page */
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--page-glow), transparent 60%),
    var(--page);
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  padding: 2rem 1.75rem 1.5rem;
}
.auth-brand { display: flex; align-items: center; gap: .6rem; justify-content: center; }
.auth-brand h1 { font-size: 1.35rem; margin: 0; }
.auth-logo { font-size: 1.6rem; }
.auth-tag { text-align: center; color: var(--muted); font-size: .88rem; margin: .5rem 0 1.4rem; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: .25rem;
  background: var(--surface-2); border-radius: 10px; padding: .25rem; margin-bottom: 1.25rem;
}
.auth-tabs button {
  border: 0; background: transparent; padding: .5rem; border-radius: 8px;
  font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
}
.auth-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
#auth-form { display: flex; flex-direction: column; gap: .9rem; }
#auth-form label { display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; color: var(--ink-2); font-weight: 600; }
#auth-form input {
  font: inherit; padding: .6rem .7rem; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink);
}
#auth-form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.hint { color: var(--muted); font-weight: 400; }
.btn-block { width: 100%; justify-content: center; padding: .65rem; font-weight: 700; margin-top: .3rem; }
.auth-error {
  background: color-mix(in srgb, var(--critical) 12%, transparent);
  color: var(--crit-text); border-radius: 8px; padding: .55rem .7rem; font-size: .84rem; margin: 0;
}
.auth-switch { text-align: center; color: var(--muted); font-size: .85rem; margin: 1.1rem 0 0; }

/* subscribe page */
.price-box { text-align: center; margin: .25rem 0 1rem; }
.price-amount {
  font-size: 2.1rem; font-weight: 700;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.price-period { color: var(--muted); font-size: .9rem; margin-left: .2rem; }
.price-features { list-style: none; margin: 0 0 1.3rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.price-features li {
  font-size: .85rem; color: var(--ink-2); padding-left: 1.3rem; position: relative;
}
.price-features li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-weight: 700; }
.auth-switch a { color: var(--gold); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* rules editor */
#rules-modal { max-width: 520px; width: 100%; }
.rules-help { font-size: .85rem; margin: 0 0 1rem; }
.rules-section { font-size: .9rem; margin: 1.2rem 0 .6rem; }
.rules-section:first-of-type { margin-top: 0; }
.checkbox-row {
  display: flex; align-items: center; gap: .55rem; font-size: .85rem;
  color: var(--ink-2); cursor: pointer; margin-bottom: 1rem;
}
.checkbox-row input { width: auto; margin: 0; }
.edit-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.edit-row input {
  flex: 1; font: inherit; padding: .5rem .6rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink);
}
.edit-row input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.edit-row .rm { color: var(--crit-text); font-size: 1.2rem; line-height: 1; }
#rules-card .card-head .spacer { flex: 1; }

/* dark-mode toggle */
#btn-theme {
  font-size: 1rem; line-height: 1; width: 2.1rem; height: 2.1rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); color: var(--ink); cursor: pointer;
}
#btn-theme:hover { border-color: var(--gold); color: var(--gold); }
.theme-fab {
  position: fixed; top: 1rem; right: 1rem; z-index: 10;
  width: 2.4rem; height: 2.4rem; background: var(--surface);
  box-shadow: var(--shadow);
}

/* success + forgot-password on auth pages */
.auth-ok {
  background: color-mix(in srgb, var(--good) 14%, transparent);
  color: var(--good-text); border-radius: 8px; padding: .55rem .7rem; font-size: .84rem; margin: 0;
}
.auth-forgot { text-align: center; font-size: .85rem; margin: .9rem 0 0; }
.auth-forgot a { color: var(--gold); text-decoration: none; }
.auth-forgot a:hover { text-decoration: underline; }

/* CSV import */
#import-modal, #account-modal-user { max-width: 620px; width: 100%; }
#import-modal label.full { display: block; margin-bottom: .8rem; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.import-summary { margin: 1rem 0 .5rem; font-size: .95rem; }
.import-warn {
  display: block; background: color-mix(in srgb, var(--critical) 12%, transparent);
  color: var(--crit-text); border-radius: 8px; padding: .5rem .7rem; font-size: .82rem; margin: .5rem 0;
}
.import-preview-table { width: 100%; font-size: .82rem; }
.import-preview-table th { text-align: left; color: var(--muted); font-weight: 600; padding: .3rem .5rem; }
.import-preview-table td { padding: .35rem .5rem; border-top: 1px solid var(--border); }
#import-text { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; margin-top: .5rem; }

/* --- responsive: comfortable on laptops and down to phones --- */
dialog { max-height: 92vh; overflow: auto; }
@media (max-width: 1024px) {
  main { padding: 0 14px 48px; }
  .dash-row { flex-direction: column; }
  .dash-row .card.grow, .dash-row .score-card { width: 100%; }
}
@media (max-width: 820px) {
  .topbar { gap: 8px; padding: 10px 14px; }
  .topbar .btn { padding: 7px 11px; font-size: 13px; }
  .topbar .btn-icon { width: 32px; height: 32px; }
  .brand h1 { font-size: 17px; }
  .user-menu { gap: 6px; }
  #btn-import { display: none; }      /* CSV import is a desktop job */
  .tabs { order: 3; width: 100%; justify-content: space-between; }
  .tabs button { flex: 1; text-align: center; padding: 7px 6px; }
  .user-email { display: none; }
  /* let wide trade tables scroll instead of squashing */
  .card { overflow-x: auto; }
  table.trades { min-width: 560px; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .btn { padding: 8px 12px; }
  #btn-import { display: none; } /* import lives inside a fuller screen; keep phone bar clean */
}

/* --- appearance modal --- */
#appearance-modal { max-width: 560px; }
.appearance-body { display: flex; flex-direction: column; gap: 18px; padding: 2px 0 4px; }
.appearance-row { display: flex; flex-direction: column; gap: 8px; }
.appearance-label { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.appearance-hint { margin: -2px 0 2px; font-size: 12px; color: var(--muted); }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; }
.theme-chip { display: flex; flex-direction: column; gap: 6px; align-items: stretch; padding: 7px;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); cursor: pointer;
  font: inherit; color: var(--ink-2); transition: border-color .12s, transform .12s; }
.theme-chip:hover { transform: translateY(-1px); }
.theme-chip.on { border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 1px var(--gold) inset; }
/* A miniature of the theme: page behind, with surface, accent and ink on top. */
.theme-swatch { display: flex; gap: 3px; align-items: center; justify-content: center;
  height: 34px; border-radius: 7px; border: 1px solid var(--border); }
.theme-swatch i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.theme-name { font-size: 12px; font-weight: 600; text-align: center; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; align-self: flex-start; }
.seg button { font: inherit; font-size: 12.5px; padding: 6px 14px; border: 0; cursor: pointer;
  background: var(--surface-2); color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--gold-grad); color: var(--gold-ink); font-weight: 650; }

.colour-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.colour-field { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.colour-field.changed { border-color: var(--gold); }
.colour-label { font-size: 12px; font-weight: 650; color: var(--ink); }
.colour-field .colour-hint { font-size: 11px; color: var(--muted); line-height: 1.3; min-height: 28px; }
.colour-field input[type="color"] { width: 100%; height: 30px; padding: 0; border: 1px solid var(--border);
  border-radius: 7px; background: none; cursor: pointer; }
@media (max-width: 560px) { .colour-field .colour-hint { min-height: 0; } }

/* --- legal pages --- */
.legal-page { padding: 0 18px 64px; }
.legal-wrap { max-width: 760px; margin: 0 auto; padding-top: 40px; }
.legal-wrap h2 { font-size: 20px; margin: 34px 0 6px; padding-top: 22px; border-top: 1px solid var(--border); }
.legal-wrap h3 { font-size: 14px; margin: 20px 0 4px; color: var(--ink); }
.legal-wrap p, .legal-wrap li { color: var(--ink-2); line-height: 1.6; }
.legal-wrap ul { padding-left: 20px; }
.legal-meta { font-size: 12.5px; color: var(--muted); }
.legal-nav { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 6px; font-size: 13px; }
.legal-callout { border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--gold) 9%, transparent);
  padding: 11px 14px; border-radius: 0 10px 10px 0; }
.legal-foot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; }
.auth-legal { margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted); }
.auth-legal a { color: var(--muted); }

/* --- plan toggle on the subscribe page --- */
.plan-seg { display: flex; width: 100%; margin: 0 0 14px; }
.plan-seg button { flex: 1; justify-content: center; }
.plan-save { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; opacity: .85; margin-left: 5px; }
.price-note { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

/* --- landing page --- */
.landing { padding: 0; }
.lp-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 20; }
.lp-brand { display: flex; align-items: center; gap: 9px; font-size: 15px; letter-spacing: -0.01em; }
.lp-brand strong { white-space: nowrap; }
.lp-nav nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lp-nav .btn { white-space: nowrap; }
/* On a phone the brand, a theme toggle and two buttons cannot share one row
   without wrapping mid-word. The toggle goes first: the page already follows
   the system setting, and nobody lands here to change a theme. */
@media (max-width: 620px) {
  .lp-nav { padding: 10px 16px; }
  .lp-nav #btn-theme { display: none; }
  .lp-nav .btn { font-size: 13px; padding: 7px 12px; }
  .lp-brand { font-size: 14px; }
  .lp-brand .auth-logo { font-size: 1.15rem; }
}
@media (max-width: 400px) {
  .lp-brand strong { display: none; }   /* keep the mark, drop the wordmark */
}

/* One column, one width, one left edge for everything on the page. */
.lp { --lp-w: 920px; max-width: var(--lp-w); margin: 0 auto; padding: 0 24px 72px; }
/* Prose gets a shorter measure than the figures — long lines read as unedited. */
.lp-sub, .lp-lead, .lp-points, .lp-fine p { max-width: 68ch; }

.lp-hero { padding: 68px 0 0; }
@media (max-width: 620px) { .lp-hero { padding-top: 44px; } .lp { padding: 0 20px 56px; } }
.lp-hero h1 { font-size: clamp(27px, 4.2vw, 41px); line-height: 1.16; letter-spacing: -0.025em;
  margin: 0 0 16px; max-width: 24ch; background: none; -webkit-text-fill-color: currentColor;
  color: var(--ink); font-weight: 760; }
.lp-accent { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent; }
.lp-sub { font-size: 16px; line-height: 1.62; color: var(--ink-2); margin: 0 0 26px; }
.lp-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 40px; }
.btn-lg { font-size: 15px; padding: 12px 28px; }
.lp-cta-note { font-size: 12.5px; color: var(--muted); }

/* Figures share one frame so stacked screenshots line up exactly. */
.lp-figure { margin: 0; }
.lp-figure img { width: 100%; height: auto; display: block; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); background: var(--surface-2); }
.lp-figure figcaption { font-size: 12.5px; color: var(--muted); margin-top: 10px;
  line-height: 1.5; max-width: 62ch; }
.lp-figure-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; align-items: start; }
@media (max-width: 720px) { .lp-figure-row { grid-template-columns: 1fr; } }

/* Even rhythm: every section separated the same way. */
.lp-section { padding: 56px 0 0; margin-top: 56px; border-top: 1px solid var(--border); }
.lp-section h2 { font-size: 23px; letter-spacing: -0.02em; margin: 0 0 12px; font-weight: 700; }
.lp-lead { font-size: 15px; color: var(--ink-2); line-height: 1.65; margin: 0 0 24px; }
.lp-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.lp-points li { padding-left: 22px; position: relative; color: var(--ink-2); line-height: 1.6; }
.lp-points li::before { content: ""; position: absolute; left: 0; top: .62em;
  width: 11px; height: 2px; border-radius: 2px; background: var(--gold); }
.lp-points strong { color: var(--ink); }
.lp-points-compact { margin-top: 26px; grid-template-columns: 1fr 1fr; gap: 13px 28px; max-width: none; }
@media (max-width: 720px) { .lp-points-compact { grid-template-columns: 1fr; } }

.lp-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 32px; align-items: stretch; }
@media (max-width: 560px) { .lp-plans { grid-template-columns: 1fr; } }
.lp-plan { border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; background: var(--surface);
  display: flex; flex-direction: column; gap: 3px; }
.lp-plan-best { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.lp-plan-name { display: flex; align-items: center; gap: 8px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.lp-plan-price { font-size: 32px; font-weight: 760; letter-spacing: -0.03em; margin: 8px 0 2px; line-height: 1; }
.lp-plan-price span { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.lp-plan p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.lp-pricing .lp-cta { margin-bottom: 0; }

.lp-fine { border-top: 1px solid var(--border); }
.lp-fine p { font-size: 13px; color: var(--muted); line-height: 1.65; margin: 0; }
.lp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 920px; margin: 0 auto; padding: 20px 24px 48px; font-size: 12.5px; color: var(--muted); }
.lp-foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.lp-foot a { color: var(--muted); }
.lp-foot a:hover { color: var(--ink-2); }

/* --- login page with a product preview beside the form --- */
/* The form stays first in the DOM, so on a phone people reach it without
   scrolling past the sales pitch; the preview sits alongside on wider screens. */
.auth-split { align-items: flex-start; }
.auth-wrap > .auth-card { max-width: none; }
.auth-wrap { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 460px);
  gap: 30px; align-items: start; justify-content: center; width: 100%;
  max-width: 920px; margin: 0 auto; padding: 32px 18px 48px; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: minmax(0, 420px); } }

.auth-preview { border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  padding: 20px; box-shadow: var(--shadow); }
.auth-preview h2 { font-size: 16px; margin: 0 0 4px; }
.auth-preview-lead { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; margin: 0 0 14px; }
.auth-preview figure { margin: 0 0 14px; }
.auth-preview img { width: 100%; height: auto; display: block; border: 1px solid var(--border); border-radius: 9px; }
.auth-preview figcaption { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.auth-preview ul { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.auth-preview li { position: relative; padding-left: 17px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.auth-preview li::before { content: "—"; position: absolute; left: 0; color: var(--gold); }
.auth-preview-foot { margin: 0; font-size: 12.5px; color: var(--muted); }
/* Marketing screenshots are illustrations, not controls. They were never links,
   but browsers still offer to drag them and raise a save/open menu on long
   press, which reads as "this should do something". pointer-events closes all
   of that off. */
.lp-figure img, .auth-preview img {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
/* links styled as buttons shouldn't carry link underlines */
a.btn, a.btn:hover { text-decoration: none; }
/* Links inherit the accent rather than the browser's blue/purple pair, so a
   visited link doesn't suddenly change colour mid-page. */
.landing a:not(.btn), .auth-preview a, .legal-wrap a:not(.btn) { color: var(--gold); }
.landing a:visited:not(.btn), .auth-preview a:visited, .legal-wrap a:visited:not(.btn) { color: var(--gold); }
.lp-foot a, .lp-foot a:visited { color: var(--muted); }
.lp-foot a:hover { color: var(--ink-2); }
/* P&L sign toggle — a phone's numeric keypad has no minus key, so the sign
   needs to be reachable without typing it. */
.signed-field { display: flex; gap: 6px; align-items: stretch; }
/* The sign button eats roughly 50px, which leaves nothing for the number in a
   narrow grid cell, so this field takes the full row once the grid narrows. */
@media (max-width: 640px) { .grid label.full-sm { grid-column: 1 / -1; } }
.signed-field input { flex: 1; min-width: 0; }
.sign-toggle { flex: 0 0 auto; padding: 0 11px; font: inherit; font-size: 13px; font-weight: 650;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
  color: var(--ink-2); cursor: pointer; line-height: 1; }
.sign-toggle:hover { border-color: var(--gold); color: var(--ink); }
.sign-toggle:active { transform: translateY(1px); }
/* The two date filters are a range, not a repeated control. A title attribute
   never appears on a touchscreen, so the labels have to be visible. */
.filter-date { display: inline-flex; align-items: center; gap: 7px; font-size: 12px;
  color: var(--muted); white-space: nowrap; }
.filter-date input { margin: 0; }
@media (max-width: 640px) { .filter-date { flex: 1 1 auto; } .filter-date input { flex: 1; min-width: 0; } }

/* --- subscribe: code entry for the yearly plan --- */
.sub-code { display: block; margin: 0 0 12px; font-size: 13px; color: var(--ink-2); text-align: left; }
.sub-code input { width: 100%; margin-top: 5px; text-transform: uppercase; letter-spacing: .04em; }

.jr-prompt { font-size: 12.5px; margin: 0 0 10px; line-height: 1.5; }

.jr-dz { margin-top: 10px; }
.jr-mood { padding: 7px 14px; }
.jr-tag { padding: 3px 11px; }

.jr-dz { margin-top: 10px; }
.jr-mood { padding: 7px 14px; }
.jr-tag { padding: 3px 11px; }

/* --- pre-market plan: structured fields --- */
.plan-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: end; margin-bottom: 14px; }
@media (max-width: 560px) { .plan-grid { grid-template-columns: 1fr 1fr; } .plan-grid .plan-field:first-child { grid-column: 1 / -1; } }
.plan-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.plan-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.plan-field input { width: 100%; }
.plan-bias { width: 100%; }
.plan-bias button { flex: 1; font-size: 13px; padding: 7px 10px; }
.plan-bias button.on[data-bias="long"] { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good-text); }
.plan-bias button.on[data-bias="short"] { background: color-mix(in srgb, var(--critical) 18%, transparent); color: var(--crit-text); }
.plan-levels { margin-bottom: 14px; }
.plan-levels .plan-label { margin-bottom: 6px; }
.level-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; margin-bottom: 6px; align-items: center; }
@media (max-width: 560px) { .level-row { grid-template-columns: 95px 1fr auto; } }
.level-row input { font-variant-numeric: tabular-nums; }
.level-row .rm-level {
  font: inherit; font-size: 16px; line-height: 1; width: 30px; height: 30px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted);
}
.level-row .rm-level:hover { color: var(--crit-text); border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
.plan-add-level { padding: 5px 12px; font-size: 12px; }
.jr-today .plan-label { margin-top: 12px; margin-bottom: 6px; }
/* how the plan read against the day */
.plan-vs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.plan-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.plan-chip.kept { color: var(--good-text); border-color: color-mix(in srgb, var(--series-1) 35%, transparent); }
.plan-chip.broken { color: var(--crit-text); border-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.plan-chip .lvl { color: var(--muted); }

/* --- video check-in --- */
.plan-sub { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 7px; }
.vid-block {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  background: var(--surface-2);
}
.vid-stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 86px; border-radius: 10px; background: var(--surface);
  border: 1px dashed var(--border); padding: 10px; text-align: center;
}
.vid-none { margin: 0; font-size: 13px; max-width: 46ch; line-height: 1.5; }
.vid-player {
  width: 100%; max-width: 420px; max-height: 320px; border-radius: 9px;
  background: #000; display: block;
}
/* Mirrored, because a preview that moves the other way to you is disorienting
   to talk into. Only the preview — the recording itself is not flipped. */
.vid-live { transform: scaleX(-1); }
.vid-meta { margin: 7px 0 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.vid-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.vid-bar .btn { padding: 6px 15px; font-size: 13px; }
.vid-time {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.rec-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--crit-text);
  animation: rec-pulse 1.4s ease-in-out infinite;
}
@keyframes rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
.vid-pick { font-size: 12.5px; color: var(--gold); cursor: pointer; text-decoration: underline; }
.vid-del { margin-left: auto; color: var(--muted); }
.vid-del:hover { color: var(--crit-text); border-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.vid-del.armed { color: var(--crit-text); font-weight: 600; border-color: color-mix(in srgb, var(--critical) 55%, transparent); }
.vid-note { margin: 9px 0 0; font-size: 12.5px; color: var(--ink-2); }
.vid-note.bad { color: var(--crit-text); }
.vid-hint { margin: 8px 0 0; font-size: 12px; }
.jr-tag-vid { color: var(--ink-2); border-color: color-mix(in srgb, var(--gold) 40%, var(--border)); }
.jr-entry-vid, .day-note .jr-entry-vid {
  width: 100%; max-width: 360px; margin-top: 10px; border-radius: 9px;
  background: #000; display: block;
}

/* ---------- the emotion log ---------- */
.emo-block { display: flex; flex-direction: column; gap: 12px; }
.emo-editor {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  background: var(--surface-2); display: flex; flex-direction: column; gap: 9px;
}
.emo-group { display: flex; align-items: baseline; gap: 10px; }
.emo-group-name {
  font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  /* Fixed width so the five group names form a column and the chips line up
     beside them instead of starting at five different places. */
  flex: 0 0 62px; text-align: right; padding-top: 6px;
}
.emo-chips { display: flex; flex-wrap: wrap; gap: 7px; flex: 1; }
.emo-chip {
  font: inherit; font-size: 12.5px; padding: 5px 11px; border-radius: 999px;
  cursor: pointer; background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--border);
  transition: border-color .15s, background .15s, color .15s;
}
.emo-chip:hover { border-color: var(--baseline); background: var(--surface-2); }
/* Each group carries its own colour, so a log full of Reactive reads as a
   pattern at a glance rather than as twenty words of the same weight. */
.emo-chip.tone-good { border-color: color-mix(in srgb, var(--good) 34%, var(--border)); }
.emo-chip.tone-warn { border-color: color-mix(in srgb, var(--gold) 38%, var(--border)); }
.emo-chip.tone-bad  { border-color: color-mix(in srgb, var(--critical) 34%, var(--border)); }
/* A picked chip is filled, like the mood row and the segmented controls. The
   fills are fixed rather than themed: --good and --critical are mid-tones
   chosen to sit on text, and white on them failed in light mode — "Bored" on
   --baseline was pale grey on near-white and all but disappeared. These are
   dark enough to carry white text on either background. */
.emo-chip.on { border-color: transparent; font-weight: 600; color: #fff; }
.emo-chip.on.tone-good { background: #1d7a33; }
.emo-chip.on.tone-warn { background: var(--gold-grad); color: var(--gold-ink); }
.emo-chip.on.tone-bad  { background: #b3262c; }
.emo-chip.on.tone-flat { background: #6c6a64; }

.emo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.emo-sub { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.emo-optional { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; }
.emo-scale button { min-width: 34px; font-variant-numeric: tabular-nums; }
.emo-note { width: 100%; resize: vertical; min-height: 52px; font-size: 13px; }
.emo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; }
.emo-bar .btn { padding: 6px 15px; font-size: 13px; }
.emo-add:disabled { opacity: .55; cursor: default; }
.emo-add:disabled:hover { transform: none; }
.emo-msg { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.emo-msg.bad { color: var(--crit-text); }

.emo-log { display: flex; flex-direction: column; gap: 7px; }
.emo-empty { margin: 0; font-size: 12.5px; max-width: 56ch; line-height: 1.5; }
.emo-entry {
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
  background: var(--surface);
}
.emo-entry-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.emo-entry-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.emo-tag {
  font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--ink-2); background: var(--surface-2);
}
.emo-tag.tone-good { border-color: color-mix(in srgb, var(--good) 40%, var(--border)); color: var(--good-text); }
.emo-tag.tone-warn { border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.emo-tag.tone-bad  { border-color: color-mix(in srgb, var(--critical) 40%, var(--border)); color: var(--crit-text); }
.emo-dots { font-size: 9px; letter-spacing: 1px; color: var(--gold); line-height: 1; }
.emo-when { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.emo-del {
  margin-left: auto; padding: 2px 8px; font-size: 13px; line-height: 1.3;
  color: var(--muted); background: transparent;
}
.emo-del:hover { color: var(--crit-text); border-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.emo-del.armed { font-size: 11.5px; color: var(--crit-text); font-weight: 600; border-color: color-mix(in srgb, var(--critical) 55%, transparent); }
.emo-entry-note { margin: 7px 0 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* In the list of past plans: what the day felt like, in one line. */
.jr-emo-sum { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-left: 2px; }
.jr-emo-count { font-size: 11.5px; }

@media (max-width: 560px) {
  /* The group names stop being a column and sit above their own chips —
     62px of right-aligned label leaves too little room for a chip row. */
  .emo-group { flex-direction: column; align-items: stretch; gap: 4px; }
  .emo-group-name { flex: none; text-align: left; padding-top: 2px; }
  .emo-del { padding: 4px 10px; }
  /* The scale fills the row at this width, so "optional" wraps onto a line of
     its own and reads as a stray word. The field is plainly skippable. */
  .emo-optional { display: none; }
}
@media (max-width: 560px) {
  .vid-player, .jr-entry-vid { max-width: 100%; }
  .vid-del { margin-left: 0; }
}

/* ---------- read-only sharing ---------- */

/* One rule carries most of read-only mode. Every control that writes is marked
   data-write in the markup, so there is no list of ids here to fall out of step
   with the page — add a button without marking it and it shows up in a reader's
   view, which the server then refuses, which is the failure that gets noticed.
   !important because several of these manage their own `hidden` attribute (the
   record button, the delete confirmations) and would otherwise fight this. */
body.viewing [data-write] { display: none !important; }

.view-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: 1180px; margin: 0 auto; padding: 9px 20px;
  background: var(--gold-grad); color: var(--gold-ink);
  font-size: 13.5px; font-weight: 500;
}
.view-banner-eye { font-size: 15px; }
.view-banner-text { flex: 1 1 260px; }
.view-banner strong { font-weight: 700; }
/* Dark ink on gold, so the usual button colours would vanish into it. */
.view-banner-exit {
  background: rgba(0, 0, 0, 0.12); border-color: rgba(0, 0, 0, 0.25);
  color: var(--gold-ink); font-weight: 600; padding: 5px 11px; font-size: 12.5px;
}
.view-banner-exit:hover { background: rgba(0, 0, 0, 0.2); }

/* The banner scrolls away; the top bar does not. So the switcher is the signal
   that persists — gold while it is pointed at someone else's journal, ordinary
   while it is pointed at your own. */
.journal-select {
  max-width: 190px; font-size: 12.5px; padding: 6px 8px;
  border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink);
}
body.viewing .journal-select {
  border-color: color-mix(in srgb, var(--gold) 60%, transparent);
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  font-weight: 600;
}

/* A journal being read is still the owner's writing, so what is left on screen
   should not look like an input waiting for you. */
body.viewing textarea[readonly] {
  background: var(--surface-2); border-style: dashed; cursor: default;
}

.share-form .share-scopes { margin: 8px 0 12px; display: grid; gap: 4px; }
.share-form .share-always { opacity: 0.75; }
.share-list { display: grid; gap: 8px; margin: 10px 0 4px; }
.share-row {
  display: grid; gap: 3px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 11px; background: var(--surface-2);
}
.share-who { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.share-state, .share-scope { font-size: 12px; }
.share-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.share-acts .btn { font-size: 12px; padding: 4px 10px; }
/* Same two-tap confirmation the plan list and the emotion log use: revoking is
   immediate and there is no undo. */
.share-remove.armed {
  color: var(--crit-text); font-weight: 600;
  border-color: color-mix(in srgb, var(--critical) 55%, transparent);
}

/* The invitation page's summary of what is and is not included. */
.invite-list { margin: 4px 0 14px; padding-left: 20px; display: grid; gap: 5px; font-size: 13.5px; color: var(--ink-2); }
.invite-held { color: var(--muted); list-style: none; margin-left: -20px; padding-top: 3px; }
.invite-note { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }

@media (max-width: 560px) {
  .view-banner { padding: 8px 14px; font-size: 12.5px; }
  .journal-select { max-width: 140px; }
}
