/* LifeHub — "Gotham night" theme.
   Blue-black steel plates, one signal-yellow accent, condensed industrial type.
   The bold moment is the spotlight beam on Today's workout; everything else stays quiet. */

@font-face { font-family: "Big Shoulders"; src: url(../fonts/bigshoulders.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(../fonts/barlow-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(../fonts/barlow-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(../fonts/barlow-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(../fonts/barlow-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --night: #07090d;       /* page */
  --plate: #10141b;       /* cards */
  --plate-2: #181d26;     /* inputs, raised bits */
  --seam: #252b36;        /* hairlines */
  --steel: #8b94a5;       /* secondary text */
  --text: #e8ebf0;
  --signal: #f5c344;      /* the one accent */
  --signal-ink: #0b0d11;
  --gain: #4cc38a;
  --loss: #f0555a;
  --cut: 14px;            /* armor-plate corner cut */
  --display: "Big Shoulders", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow", -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(120% 60% at 50% -10%, #121826 0%, transparent 60%),
    var(--night);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  overflow-x: hidden; /* the spotlight beam is wider than the screen */
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 800; letter-spacing: .01em; line-height: 1; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 10px) 16px calc(env(safe-area-inset-bottom) + 48px);
}
.page > * + * { margin-top: 18px; }
section > * + * { margin-top: 10px; }

/* Header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 10px; }
.page-head h1 { font-size: 44px; font-weight: 900; }
.page-sub { font-size: 14px; color: var(--steel); margin-bottom: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 28px; gap: 12px; }
.section-head h2 { font-size: 24px; }
.muted { color: var(--steel); }
.small { font-size: 13px; }
.center { text-align: center; }
.danger-text { color: var(--loss); }
.gain { color: var(--gain); }
.loss { color: var(--loss); }
.num { font-family: var(--display); font-weight: 800; font-variant-numeric: tabular-nums; }

/* Armor plate: the card shape used across the app */
.plate, .card, .list, .stat-row > div {
  background: var(--plate);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.card { padding: 16px 18px; }
.card > * + * { margin-top: 8px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Buttons */
.btn {
  border: 1px solid var(--seam); background: var(--plate-2); border-radius: 4px;
  padding: 10px 16px; font-weight: 600; min-height: 44px; letter-spacing: .01em;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: #3a4250; }
.btn.primary { background: var(--signal); color: var(--signal-ink); border-color: transparent; font-weight: 700; }
.btn.primary:hover { background: #ffd35e; }
.btn.danger { color: var(--loss); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; }
.link { background: none; border: 0; color: var(--signal); font-weight: 600; padding: 6px 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 4px; border: 1px solid var(--seam);
  background: var(--plate-2); font-size: 18px; display: inline-grid; place-items: center; flex: none; color: var(--steel);
}
.icon-btn:hover { color: var(--text); }
.icon-btn.small { width: 32px; height: 32px; font-size: 14px; }
.nav-btns { display: flex; gap: 6px; align-items: center; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.actions .btn { flex: 1; }

/* Lists */
.list { overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; min-height: 54px;
  background: none; border: 0; border-bottom: 1px solid var(--seam); text-align: left; cursor: pointer;
}
.list-row:last-child { border-bottom: 0; }
button.list-row:hover, label.list-row:hover { background: rgba(255, 255, 255, .025); }
.list-row.static { cursor: default; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13px; color: var(--steel); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--steel); font-size: 22px; line-height: 1; }
.dot { width: 8px; height: 8px; border-radius: 1px; transform: rotate(45deg); flex: none; }
.pill {
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 3px; flex: none;
  color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent);
}
.badge { font-size: 12px; color: var(--steel); background: var(--plate-2); padding: 3px 8px; border-radius: 3px; }
.empty { color: var(--steel); text-align: center; padding: 22px 12px; border: 1px dashed var(--seam); border-radius: 4px; }
.empty.small { padding: 16px; font-size: 14px; border: 0; }

/* Today: the spotlight */
.hero {
  position: relative; isolation: isolate; padding: 34px 20px 22px; margin: 0 -16px;
  text-align: center;
}
.hero::before {               /* the beam */
  content: ""; position: absolute; z-index: -1; left: 50%; top: -60px; width: 140%; height: calc(100% + 60px);
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(245, 195, 68, .22), rgba(245, 195, 68, .04) 70%, transparent);
  clip-path: polygon(44% 0, 56% 0, 86% 100%, 14% 100%);
  animation: beam 1.4s ease-out both;
}
.hero::after {                /* where the beam lands */
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: 0; width: 80%; height: 46%;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(245, 195, 68, .16), transparent 70%);
}
@keyframes beam { from { opacity: 0; } }
.hero-kicker { color: var(--signal); font-weight: 600; font-size: 14px; }
.hero h2 { font-size: clamp(56px, 18vw, 92px); font-weight: 900; line-height: .9; margin: 8px 0 10px; text-shadow: 0 0 40px rgba(245, 195, 68, .18); }
.hero p { color: var(--steel); margin: 0 auto; max-width: 34ch; }
.hero .btn { margin-top: 18px; min-width: 200px; }
.hero.rest h2 { color: var(--steel); text-shadow: none; }
.hero.rest::before { opacity: .45; }
.hero-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Glance tiles on Today */
.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.glance a { text-decoration: none; color: inherit; }
.glance .plate { padding: 12px 12px 10px; display: block; }
.glance b { display: block; font-family: var(--display); font-size: 28px; font-weight: 800; line-height: 1; }
.glance span { font-size: 12px; color: var(--steel); }

/* Check rows (habits, to-dos) */
.tick {
  width: 28px; height: 28px; flex: none; border: 2px solid var(--seam); border-radius: 3px; background: none;
  display: grid; place-items: center; color: var(--signal-ink); font-weight: 900; font-size: 16px; padding: 0;
}
.tick.on { background: var(--signal); border-color: var(--signal); }
.done-row .row-title { color: var(--steel); text-decoration: line-through; }
.streak { font-family: var(--display); font-weight: 800; color: var(--signal); font-size: 18px; }
.kind { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 3px; background: var(--plate-2); color: var(--steel); }
.kind.dont { color: var(--loss); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--steel); font-weight: 600; padding: 4px 0; }
.cal-cell {
  aspect-ratio: 1 / 1.15; border: 1px solid transparent; background: var(--plate); border-radius: 3px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; min-width: 0;
}
.cal-cell:hover { border-color: var(--seam); }
.cal-cell.out { opacity: .35; }
.cal-cell.today .cal-num { background: var(--signal); color: var(--signal-ink); }
.cal-cell.sel { border-color: var(--signal); }
.cal-num { font-family: var(--display); font-size: 17px; font-weight: 800; width: 26px; height: 26px; border-radius: 2px; display: grid; place-items: center; }
.cal-w { font-size: 9px; font-weight: 700; color: #0b0d11; border-radius: 2px; padding: 1px 3px; max-width: 100%; overflow: hidden; white-space: nowrap; }
.cal-dots { display: flex; gap: 2px; margin-top: auto; }
.cal-dots i { width: 5px; height: 5px; border-radius: 1px; }
.inline-select { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--steel); margin-top: 12px; }
.inline-select select { flex: 1; }
.label { font-size: 13px; color: var(--steel); }

/* Forms */
input, select, textarea {
  width: 100%; background: var(--plate-2); border: 1px solid var(--seam); border-radius: 4px;
  padding: 10px 12px; min-height: 44px; font-size: 16px; /* 16px stops iOS zooming in */
}
input:focus, select:focus, textarea:focus { border-color: var(--signal); outline: none; }
input[type="color"] { padding: 4px; }
textarea { resize: vertical; }
select.full { width: 100%; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label, label.form { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--steel); font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.add-row { display: flex; gap: 8px; }
.add-row input, .add-row select { flex: 1; }

/* Segmented control */
.segmented { display: flex; background: var(--plate); border-radius: 4px; padding: 3px; gap: 3px; border: 1px solid var(--seam); }
.segmented button { flex: 1; border: 0; background: none; border-radius: 3px; padding: 8px; font-weight: 600; color: var(--steel); min-height: 38px; }
.segmented button.on { background: var(--plate-2); color: var(--signal); box-shadow: inset 0 -2px 0 var(--signal); }
.segmented.small button { min-height: 32px; padding: 5px; font-size: 14px; }

/* Stats */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-row > div { padding: 12px 10px; text-align: center; --cut: 10px; }
.stat-row b { display: block; font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1.05; }
.stat-row span { font-size: 12px; color: var(--steel); }

/* Workout: quick log */
.ex-card { border-left: 3px solid var(--seam); }
.ex-card.done { border-left-color: var(--signal); }
.ex-top { display: flex; align-items: center; gap: 12px; }
.ex-top h3 { font-size: 22px; }
.ex-sum { font-size: 15px; color: var(--steel); }
.ex-card.done .ex-sum { color: var(--text); }
.ex-done-btn {
  min-width: 92px; min-height: 48px; border-radius: 4px; border: 2px solid var(--signal); background: none;
  color: var(--signal); font-weight: 700; flex: none;
}
.ex-card.done .ex-done-btn { background: var(--signal); color: var(--signal-ink); }
.set-head, .set-row { display: grid; grid-template-columns: 40px 1fr 1fr 48px; gap: 8px; align-items: center; }
.set-head { font-size: 12px; color: var(--steel); font-weight: 600; }
.set-head span { text-align: center; }
.set-row input { text-align: center; padding: 8px 4px; }
.set-num { height: 40px; border-radius: 3px; border: 0; background: var(--plate-2); font-family: var(--display); font-weight: 800; font-size: 17px; color: var(--steel); }
.check { height: 44px; border-radius: 3px; border: 2px solid var(--seam); background: none; font-size: 20px; font-weight: 800; color: var(--signal-ink); }
.set-row.done .check { background: var(--signal); border-color: var(--signal); }
.set-row.done input { opacity: .75; }
.notes { margin-top: 16px; }

/* Plan editor */
.ex-edit-head, .ex-edit { display: grid; grid-template-columns: 1fr 52px 52px 60px 32px; gap: 6px; align-items: center; }
.ex-edit-head { font-size: 12px; color: var(--steel); font-weight: 600; }
.ex-edit input { padding: 8px 6px; }
.ex-edit input[type="number"] { text-align: center; }

/* Trades */
.pnl-big { font-family: var(--display); font-weight: 900; font-size: 64px; line-height: .95; }
.side { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 3px; background: var(--plate-2); }
.side.long { color: var(--gain); }
.side.short { color: var(--loss); }

/* Progress bar (nutrition) */
.bar { height: 8px; background: var(--plate-2); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--signal); }
.bar i.over { background: var(--loss); }

/* Chart */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--seam); stroke-dasharray: 3 3; }
.chart .axis { fill: var(--steel); font-size: 10px; font-family: var(--body); }
.chart .line { fill: none; stroke: var(--signal); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#chartFade); }
.chart .pt { fill: var(--plate); stroke: var(--signal); stroke-width: 2; }

/* Modal sheet */
.overlay { position: fixed; inset: 0; margin: 0; background: rgba(2, 3, 6, .7); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet {
  background: var(--night); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  border-top: 2px solid var(--signal);
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 20px);
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sheet-head h2 { font-size: 28px; }

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--night) 86%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--seam);
  padding: 0 6px calc(env(safe-area-inset-bottom) + 6px);
}
.tabbar a {
  flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--steel); text-decoration: none; font-size: 11px; font-weight: 600; padding: 9px 0 3px;
  border-top: 2px solid transparent;
}
.tabbar a.on { color: var(--signal); border-top-color: var(--signal); }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 360px) {
  .ex-edit-head, .ex-edit { grid-template-columns: 1fr 44px 44px 52px 30px; }
  .page-head h1 { font-size: 38px; }
}

/* ===== The brain (home) ===== */
#brain { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; }
body.home #brain { pointer-events: auto; touch-action: none; cursor: grab; }
#brain-labels { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
#dim {                                   /* darkens the neurons behind section pages so text stays readable */
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 1; transition: opacity .8s ease;
  background: linear-gradient(180deg, rgba(5, 7, 11, 0) 0, rgba(5, 7, 11, .05) 20vh, rgba(5, 7, 11, .82) 36vh, rgba(5, 7, 11, .92) 100%);
}
body.home #dim { opacity: 0; }
#app { position: relative; z-index: 2; }
body.home { overflow: hidden; }
body.home #app { pointer-events: none; }  /* let drags reach the canvas; UI pieces opt back in */

.home-ui { position: fixed; inset: 0; }
.home-ui > * { pointer-events: auto; }
.home-ui.leaving > * { opacity: 0; transition: opacity .4s ease; pointer-events: none; }

.hud {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start;
  padding: calc(env(safe-area-inset-top) + 16px) 18px 0; pointer-events: none;
}
.hud > * { pointer-events: auto; }
.wordmark { font-family: var(--display); font-weight: 900; font-size: 34px; line-height: .9; letter-spacing: .01em; }
.hud-date { color: var(--steel); font-size: 14px; margin-top: 4px; }
.hud-actions { display: flex; gap: 8px; }
.hud-actions .icon-btn { text-decoration: none; background: rgba(16, 20, 27, .7); backdrop-filter: blur(8px); }

.view-switch {
  position: absolute; top: calc(env(safe-area-inset-top) + 82px); left: 50%; transform: translateX(-50%);
  width: min(300px, calc(100% - 36px)); background: rgba(16, 20, 27, .72); backdrop-filter: blur(8px);
}

.brain-loading, .brain-hint {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 26px); transform: translateX(-50%);
  color: var(--steel); font-size: 14px; text-align: center; width: calc(100% - 40px); pointer-events: none !important;
}
.brain-loading { color: var(--signal); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .4; } }
.hover-tip {
  position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 64px); transform: translateX(-50%);
  font-family: var(--display); font-weight: 800; font-size: 26px; pointer-events: none !important; text-shadow: 0 2px 20px #000;
}

/* Labels: dot on the region, leader line, box off to the side */
#brain-labels { transition: opacity .3s ease; }
.brain-label { position: absolute; left: 0; top: 0; width: 0; height: 0; padding: 0; border: 0; background: none; color: var(--text); transition: opacity .3s ease; }
.brain-label > * { position: absolute; left: 0; top: 0; will-change: transform; }
.bl-dot {
  width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--signal); pointer-events: none;
  box-shadow: 0 0 0 4px rgba(245, 195, 68, .18), 0 0 14px rgba(245, 195, 68, .8);
}
.bl-line { height: 1px; transform-origin: 0 0; background: linear-gradient(90deg, rgba(245, 195, 68, .9), rgba(245, 195, 68, .35)); pointer-events: none; }
.bl-text {
  display: flex; flex-direction: column; line-height: 1.05; padding: 5px 10px 6px; text-align: left; white-space: nowrap; cursor: pointer;
  background: rgba(8, 10, 15, .72); backdrop-filter: blur(6px); border-left: 2px solid var(--signal);
}
.bl-text b { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: .02em; }
.bl-text small { font-size: 11px; color: var(--steel); }
.brain-label:hover .bl-text, .brain-label.on .bl-text { background: rgba(245, 195, 68, .18); }
@media (max-width: 420px) { .bl-text small { display: none; } .bl-text b { font-size: 15px; } .bl-text { padding: 4px 8px; } }

/* Card for the tapped region */
.region-card {
  position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 12px);
  max-width: 520px; margin: 0 auto; padding: 16px 18px 18px;
  background: rgba(12, 15, 21, .9); backdrop-filter: blur(14px); border-top: 2px solid var(--signal);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  animation: card-in .35s cubic-bezier(.2, .8, .2, 1);
}
@keyframes card-in { from { transform: translateY(24px); opacity: 0; } }
.region-card h2 { font-size: clamp(32px, 8vw, 44px); font-weight: 900; margin-top: 6px; }
.region-card .aka { color: var(--signal); font-size: 14px; margin-top: 4px; }
.region-card p { margin: 10px 0 14px; color: #c9cfda; max-width: 60ch; font-size: 15px; }
.lobe-tag { font-size: 12px; font-weight: 600; color: var(--steel); background: var(--plate-2); padding: 3px 8px; border-radius: 3px; }
.link-row { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--seam); }
.link-name { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.1; }
.link-row .btn { flex: none; }

/* ===== Section pages over the neurons ===== */
.section-page .hero::before, .section-page .hero::after { display: none; } /* the neurons are the bold moment now */
.section-page .hero { padding-top: 18px; }
.section-page { animation: page-in .6s cubic-bezier(.2, .8, .2, 1) backwards; } /* backwards: no leftover transform, so fixed overlays stay full screen */
@keyframes page-in { from { opacity: 0; transform: translateY(18px); } }
.neuron-hero {
  min-height: max(30vh, 210px); display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding-bottom: 14px; pointer-events: none;
}
.neuron-hero > * { pointer-events: auto; }
.neuron-hero.flat { min-height: 0; }
.nh-cap { display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 12px #000, 0 0 2px #000; }
.nh-type { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--text); }
.nh-src { font-size: 12px; color: var(--steel); max-width: 40ch; }
.brain-bar {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; padding: 6px 14px 6px 10px;
  background: rgba(16, 20, 27, .75); backdrop-filter: blur(8px); border: 1px solid var(--seam); border-radius: 4px; color: var(--text);
}
.brain-bar:hover { border-color: var(--signal); }
.bb-arrow { font-size: 26px; line-height: 1; color: var(--signal); }
.bb-text { display: flex; flex-direction: column; text-align: left; line-height: 1.1; }
.bb-text b { font-family: var(--display); font-weight: 800; font-size: 16px; }
.bb-text small { font-size: 12px; color: var(--steel); }

/* Music: sheet music photos */
.search { width: 100%; margin-bottom: 14px; }
.back-link { display: inline-block; margin-bottom: 4px; text-decoration: none; }
.pre { white-space: pre-wrap; }
.field-label { font-size: 14px; color: var(--steel); font-weight: 500; }
.music-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.music-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; background: var(--plate);
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut))); }
.music-card:hover .thumb img { opacity: .9; }
.mc-text { display: flex; flex-direction: column; padding: 10px 12px 12px; min-width: 0; }
.thumb { display: block; aspect-ratio: 3 / 4; background: var(--plate-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.thumb-ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--signal); font-size: 34px; opacity: .6; }
.pages { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.page-img { position: relative; padding: 0; border: 0; background: #fff; display: block; width: 100%; min-height: 120px; cursor: zoom-in; }
.page-img img { width: 100%; display: block; }
.page-no { position: absolute; left: 8px; bottom: 8px; background: var(--signal); color: var(--signal-ink); font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 3px; }
.edit-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 8px 0 10px; }
.edit-page { position: relative; }
.edit-page .page-no { bottom: auto; top: 6px; left: 6px; }
.edit-page-btns { display: flex; justify-content: space-between; margin-top: 6px; }
.form label.add-photos { flex-direction: row; justify-content: center; align-items: center; color: var(--text); font-weight: 600; font-size: 15px; margin-top: 8px; cursor: pointer; }
.viewer { position: fixed; inset: 0; margin: 0; z-index: 40; background: #000; display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: rgba(7, 9, 13, .92); }
.viewer-title { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-count { color: var(--steel); font-variant-numeric: tabular-nums; font-size: 14px; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; touch-action: pan-y pinch-zoom; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; user-select: none; -webkit-user-select: none; }
.viewer-stage.zoom { display: block; overflow: auto; cursor: zoom-out; touch-action: auto; }
.viewer-stage.zoom img { max-width: none; max-height: none; width: 200%; }
.viewer-nav { display: flex; gap: 10px; padding: 8px 12px calc(env(safe-area-inset-bottom) + 10px); background: rgba(7, 9, 13, .92); }
.viewer-nav .btn { flex: 1; }
@media (min-width: 700px) { .viewer-stage.zoom img { width: 140%; } }

/* ---------- Trades: simulator (play money) ---------- */
.journal > * + * { margin-top: 18px; }
.journal > .overlay { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--seam); background: var(--plate-2); color: var(--steel); border-radius: 3px; padding: 5px 10px; font-size: 13px; font-weight: 600; min-height: 32px; }
.chip.on { color: var(--signal); border-color: var(--signal); }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--signal); font-size: 14px; font-weight: 600; text-align: left; }
.link-btn.muted { color: var(--steel); font-weight: 500; font-size: 13px; }
.signal { color: var(--signal); }
.sim-err { background: color-mix(in srgb, var(--loss) 12%, var(--plate)); color: var(--text); }
.sim-name { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.05; }
.sim-flow { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sim-flow .num { font-size: 26px; }
.sim-flow .pnl-big { font-size: 56px; }
.sim-foot { text-align: center; padding: 8px 12px 0; }
.day-pick { display: flex; flex-direction: column; gap: 6px; }
.news-row { text-decoration: none; color: inherit; }
.news-row .row-title, .step .row-title + .row-sub, .news-row .row-sub { white-space: normal; }
.news-row .row-title { font-weight: 500; font-size: 15px; line-height: 1.3; }
.tag { font-size: 11px; color: var(--signal); background: var(--plate-2); padding: 1px 6px; border-radius: 3px; margin-left: 2px; }
.step { align-items: flex-start; }
.step-ic { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 3px; font-weight: 800; font-size: 13px; background: var(--plate-2); color: var(--steel); margin-top: 1px; }
.step.ok .step-ic { color: var(--gain); }
.step.loss .step-ic, .step.block .step-ic { color: var(--loss); }
.step.wait .step-ic { color: var(--signal); }
.odds { display: flex; height: 10px; border-radius: 2px; overflow: hidden; gap: 2px; }
.odds .gain { background: var(--gain); } .odds .loss { background: var(--loss); } .odds .mid { background: var(--seam); }
.sim-chart .base { stroke: var(--steel); stroke-opacity: .5; stroke-dasharray: 2 4; }
.sim-chart .zone { fill: var(--signal); fill-opacity: .1; }
.sim-chart .fan.outer { fill: var(--signal); fill-opacity: .12; }
.sim-chart .fan.inner { fill: var(--signal); fill-opacity: .24; }
.sim-chart .fan-mid { fill: none; stroke: var(--signal); stroke-width: 2; }
.sim-chart .line { stroke-width: 1.8; }
.sim-chart .hl { stroke-width: 1.2; stroke-dasharray: 4 3; }
.sim-chart .hl.gain { stroke: var(--gain); } .sim-chart .hl.loss { stroke: var(--loss); } .sim-chart .hl.signal { stroke: var(--signal); }
.sim-chart .hl-t { font-size: 9.5px; font-family: var(--body); font-weight: 600; }
.sim-chart .hl-t.gain { fill: var(--gain); } .sim-chart .hl-t.loss { fill: var(--loss); } .sim-chart .hl-t.signal { fill: var(--signal); }
.sim-chart .mk { stroke: var(--night); stroke-width: 2; }
.sim-chart .mk.in { fill: var(--signal); } .sim-chart .mk.win { fill: var(--gain); } .sim-chart .mk.lose { fill: var(--loss); }
.sim-chart .hl-t { paint-order: stroke; stroke: var(--plate); stroke-width: 3px; stroke-linejoin: round; }
.watch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.watch { background: var(--plate); padding: 9px 10px; display: flex; flex-direction: column; min-width: 0; }
.watch b { font-family: var(--display); font-size: 18px; line-height: 1.1; }
.watch span { font-size: 11.5px; color: var(--steel); line-height: 1.25; }
.watch.in b { color: var(--signal); } .watch.in span { color: var(--signal); }
.watch.win b { color: var(--gain); } .watch.win span { color: var(--gain); }
.watch.lose b { color: var(--loss); } .watch.lose span { color: var(--loss); }
.watch.wait span { color: var(--text); }
.trade-detail { padding: 4px 16px 14px; border-bottom: 1px solid var(--seam); display: flex; flex-direction: column; gap: 6px; }
.journal .section-head:first-child { margin-top: 10px; }

/* ---------- Trades: portfolios + Claude's briefing ---------- */
.pf-hero .pnl-big { font-size: 60px; }
.pf-gain { font-size: 16px; font-weight: 600; }
.stat-row.two { grid-template-columns: 1fr 1fr; }
.stat-row.two > div { background: var(--plate-2); }
.stat-row.two b { font-size: 24px; }
.brief-card > .label:first-child { color: var(--signal); font-weight: 600; }
.brief-sum { margin: 0; font-size: 16px; line-height: 1.5; }
.comment { background: var(--plate); }
.comment + .comment { margin-top: 6px; }
.comment.open { background: var(--plate-2); }
.comment-head { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px 14px; background: none; border: 0; text-align: left; }
.c-title { font-weight: 700; line-height: 1.3; }
.c-action { font-size: 14px; color: var(--steel); line-height: 1.35; margin-top: 2px; }
.comment-body { padding: 0 14px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.comment-body p { margin: 0; line-height: 1.55; font-size: 15px; }
.c-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--steel); }
.c-meta b { color: var(--text); }
.kchip { flex: none; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 7px; border-radius: 3px; margin-top: 2px; background: var(--plate-2); min-width: 46px; text-align: center; }
.k-hold { color: #8fb6ff; } .k-buy { color: var(--gain); } .k-sell { color: var(--loss); }
.k-wait { color: var(--signal); } .k-idea { color: #c79bff; } .k-news { color: var(--steel); }
.sources { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--seam); padding-top: 10px; }
.sources a { color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.3; padding-left: 12px; position: relative; }
.sources a::before { content: "›"; position: absolute; left: 0; color: var(--signal); }
.sources a small { display: block; color: var(--steel); font-size: 12px; }
.sources a:hover { color: var(--signal); }
.spark { flex: none; }
.spark path { fill: none; stroke-width: 1.6; }
.spark.up path { stroke: var(--gain); } .spark.down path { stroke: var(--loss); }
.idea-px { font-size: 14px; background: var(--plate-2); padding: 8px 10px; }
.plan-card { margin-top: 10px; }
.key-gate { align-items: center; z-index: 50; } .key-gate .sheet { max-width: 420px; margin: 16px; }
