/* Myrdon — trading journal
   A journal built like a fortress. The logo is two towers with battlements and a lower wall between
   them, an M for Myrdon, with a lit gate in the wall: the place your discipline holds the line.

   Three looks, picked under Settings > Background color (theme.js sets [data-theme] on <html>):
     Gold      warm black, gold and ivory, like a medal. The default.
     Graphite  plain black and gray with a violet accent, like a trading terminal.
     Daylight  white cards and black ink with a marker-orange accent, like a scorecard.
   Every color below comes from the theme's tokens, so a new piece of UI only uses var(--…).
   Built from the ui-ux-pro-max "Financial Dashboard" profile: high-contrast, data first,
   tabular numbers, motion only where something changes.

   Money is always a block, in every look. Green and red are deep, by the user's choice
   (#003E24, #650103), so a money figure is never colored text on the page: it is set in white
   on a block of its color, from the month's result down to a single row in the table.

   Numbers and headings: Gloock, in every look. Everything else: Instrument Sans. */

/* Gloock ships in one weight. Declaring it for 400–700 means headings set in bold
   use the real letterforms instead of a browser-faked bold. */
@font-face {
  font-family: "Gloock";
  src: url("fonts/Gloock-Regular.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}
/* Gloock's plus and minus are hairline-thin, and in a P&L the sign matters most.
   Only those two characters come from Instrument Sans Bold. Declared after Gloock so it wins for them. */
@font-face {
  font-family: "Gloock";
  src: url("fonts/InstrumentSans-Bold.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+002B, U+2212;
}
/* Instrument Sans is served from this site, not Google's font servers, so visitors' browsers
   only ever talk to Myrdon (and to Google only when they sign in with Google). */
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-Variable.ttf") format("truetype");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nothing You Could Do";
  src: url("fonts/NothingYouCouldDo-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

/* ---------- Tokens ---------- */

/* What stays the same in every look. */
:root {
  /* Money: the user's green and red, always as a fill with white on top (12:1 and 13:1). */
  --gain: #003e24;
  --loss: #650103;
  --on-money: #ffffff;
  --money-edge: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 1px rgba(255, 255, 255, .06);

  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Nothing You Could Do", "Segoe Print", cursive;
  /* Money, numbers and headings: Gloock in every look (the user asked for one money font). */
  --display: "Gloock", Georgia, "Times New Roman", serif;
  --display-track: -.005em;

  /* Radius scale: small controls, blocks, tiles, big panels, pills. */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --side-w: 248px;
  --bar-h: 64px;
  --gutter: clamp(16px, 3.4vw, 40px);
  --max: 1180px;
  /* Room between a page's big blocks, and between cards that sit side by side. */
  --stack: 28px;
  --tiles: 16px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.3, 1.3, .5, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
}

/* Each look sets the same tokens. They're on [data-theme] as well as <html>, so a small preview
   (the swatches in Settings) can wear a look of its own inside a page wearing another.
     --well … --raise   surfaces, darkest to lightest (Daylight: page, then white cards)
     --text-3           the faintest text, 5:1 or better on every surface of its look
     --brand            the accent as a fill; --brand-text when it's text or a thin line
     --primary          the main button; --on-* is the text that goes on top of a fill
     --mark-1…4, -x     the logo's four strokes and the fifth across them
     --sheen            a faint light along the top of big panels
     --glow             the soft light at the top of the page */

/* Gold: warm black, gold and ivory, like a medal. The default look. */
:root,
[data-theme="gold"] {
  --well: #0b0a09;
  --bg: #11100e;
  --panel: #1a1815;
  --raise: #25221d;
  --line: rgba(255, 236, 200, .09);
  --line-strong: rgba(255, 236, 200, .2);

  --text: #f7f1e5;
  --text-2: #d5ccba;
  --text-3: #a39a8b;

  --brand: #c9a24f;
  --brand-text: #e3c37e;
  --on-brand: #17140f;
  --focus: #e3c37e;
  --primary: #e3c37e;
  --primary-hover: #eed49b;
  --on-primary: #17140f;

  --mark-1: #7d6127;
  --mark-2: #a8843a;
  --mark-3: #cfa95a;
  --mark-4: #ecd08f;
  --mark-x: #f7f1e5;
  /* The Fortress's accent (check-in ticks, pillar meters, top rules), as a fill, as text, and as a thin line. */
  --fort-gold: #c6a667;
  --fort-gold-text: #d8be86;
  --fort-gold-line: rgba(198, 166, 103, .55);

  --danger-text: #ffb4a8;
  --danger-line: rgba(255, 140, 130, .45);
  --invalid: #ff8f80;
  --scrim: rgba(6, 5, 4, .66);
  --scrim-strong: rgba(6, 5, 4, .9);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .55);
  --shadow-md: 0 20px 50px rgba(0, 0, 0, .5);
  --shadow-sm: 0 12px 30px rgba(0, 0, 0, .45);
  --lift: 0 14px 28px -10px rgba(0, 0, 0, .6);
  --tap: rgba(255, 245, 225, .12);
  --picker-filter: invert(.85);
  --sheen: rgba(255, 236, 200, .035);
  --glow: radial-gradient(1100px 560px at 50% -16%, rgba(214, 170, 82, .12), transparent 70%);

  color-scheme: dark;
}

/* Graphite: plain black and gray and a violet accent, like a trading terminal. */
[data-theme="graphite"] {
  --well: #08080a;
  --bg: #0d0d0f;
  --panel: #151518;
  --raise: #1f1f24;
  --line: rgba(255, 255, 255, .075);
  --line-strong: rgba(255, 255, 255, .17);

  --text: #f5f5f7;
  --text-2: #c6c6ce;
  --text-3: #92929e;

  --brand: #7c5cff;
  --brand-text: #b2a1ff;
  --on-brand: #ffffff;
  --focus: #b2a1ff;
  --primary: #7c5cff;
  --primary-hover: #6a4bf0;
  --on-primary: #ffffff;

  --mark-1: #4b34b8;
  --mark-2: #6447e6;
  --mark-3: #8a72ff;
  --mark-4: #b6a6ff;
  --mark-x: #f5f5f7;
  /* Check-in ticks, pillar meters and top rules take the look's violet, like its walls. */
  --fort-gold: #8a72ff;
  --fort-gold-text: #b2a1ff;
  --fort-gold-line: rgba(138, 114, 255, .55);

  --danger-text: #ffb4b4;
  --danger-line: rgba(255, 140, 140, .45);
  --invalid: #ff8f8f;
  --scrim: rgba(4, 4, 6, .66);
  --scrim-strong: rgba(4, 4, 6, .9);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .55);
  --shadow-md: 0 20px 50px rgba(0, 0, 0, .5);
  --shadow-sm: 0 12px 30px rgba(0, 0, 0, .45);
  --lift: 0 14px 28px -10px rgba(0, 0, 0, .6);
  --tap: rgba(255, 255, 255, .12);
  --picker-filter: invert(.85);
  --sheen: rgba(255, 255, 255, .03);
  --glow: radial-gradient(900px 520px at 12% -20%, rgba(124, 92, 255, .16), transparent 70%);

  color-scheme: dark;
}

/* Daylight: white cards on a pale page, black ink, one marker orange, like a scorecard. */
[data-theme="daylight"] {
  --well: #eef0f3;
  --bg: #f3f4f7;
  --panel: #ffffff;
  --raise: #eceef3;
  --line: rgba(17, 22, 34, .1);
  --line-strong: rgba(17, 22, 34, .2);

  --text: #121419;
  --text-2: #3d4350;
  --text-3: #5f6673;

  --brand: #e8590c;
  --brand-text: #c2410c;
  --on-brand: #ffffff;
  --focus: #e8590c;
  --primary: #121419;
  --primary-hover: #2a2e36;
  --on-primary: #ffffff;

  --mark-1: #121419;
  --mark-2: #121419;
  --mark-3: #121419;
  --mark-4: #121419;
  --mark-x: #e8590c;
  /* Check-in ticks, pillar meters and top rules take the look's orange. */
  --fort-gold: #e8590c;
  --fort-gold-text: #c2410c;
  --fort-gold-line: rgba(232, 89, 12, .45);

  /* On white the money blocks need no light edge. */
  --money-edge: none;

  --danger-text: #b42318;
  --danger-line: rgba(180, 35, 24, .4);
  --invalid: #d92d20;
  --scrim: rgba(18, 20, 25, .42);
  --scrim-strong: rgba(10, 11, 14, .88);
  --shadow-lg: 0 30px 80px rgba(17, 22, 34, .22);
  --shadow-md: 0 20px 50px rgba(17, 22, 34, .16);
  --shadow-sm: 0 12px 30px rgba(17, 22, 34, .14);
  --lift: 0 14px 28px -12px rgba(17, 22, 34, .25);
  --tap: rgba(17, 22, 34, .08);
  --picker-filter: none;
  --sheen: transparent;
  --glow: none;

  color-scheme: light;
}

/* A few gold-edged rooms stay dark in every look: near-black charcoal with fine gold lines.
   Anything inside them uses these tokens. */
.rule-preview,
.test-banner,
.admin-mode.is-on {
  --well: #080b0a;
  --bg: #0c1110;
  --panel: #121816;
  --raise: #1c2421;
  --line: rgba(198, 166, 103, .14);
  --line-strong: rgba(198, 166, 103, .3);
  --text: #f3efe4;
  --text-2: #cbc6b8;
  --text-3: #9b9a8f;
  --brand: #c6a667;
  --brand-text: #d8be86;
  --on-brand: #151b19;
  --focus: #d8be86;
  --primary: #e3c37e;
  --primary-hover: #eed49b;
  --on-primary: #17140f;
  --fort-gold: #c6a667;
  --fort-gold-text: #d8be86;
  --fort-gold-line: rgba(198, 166, 103, .55);
  --money-edge: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 1px rgba(255, 255, 255, .06);
  --danger-text: #ffb4a8;
  --danger-line: rgba(255, 140, 130, .45);
  --tap: rgba(255, 245, 225, .12);
  color: var(--text);
  color-scheme: dark;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: var(--glow);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button, a { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: var(--tap); }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Money blocks ---------- */

/* Any money figure: white on its own small block of green or red. Sizes in em so the block
   scales with the number, from a table cell to the month's result. */
.gain, .loss {
  display: inline-block;
  padding: .1em .38em .08em;
  border-radius: .3em;
  color: var(--on-money);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--money-edge);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.gain { background: var(--gain); }
.loss { background: var(--loss); }
.flat { color: var(--text-3); }

/* ---------- App frame ---------- */

/* Tablet: one row across the top. Desktop turns it into a sidebar; phones move the tabs to the bottom. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  letter-spacing: .005em;
  border-radius: var(--r-sm);
}
.wordmark .logo-mark { flex: none; }
/* The logo wears the look: towers in the brightest --mark colors, the wall a step darker so it sits
   behind them, and the gate lit in --mark-x. */
.fm-t:nth-of-type(1) { fill: var(--mark-3); }
.fm-t:nth-of-type(2) { fill: var(--mark-4); }
.fm-w { fill: var(--mark-2); }
.fm-g { fill: var(--mark-x); }
.wordmark-lg { gap: 12px; font-size: 38px; }

.tabs { position: relative; display: flex; gap: 4px; }
.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}
.tab:hover, .tab[aria-current="page"] { color: var(--text); }
.tab-ico { flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab-ico .ico-fill { fill: currentColor; stroke: none; }
/* The current tab's highlight (sized and slid into place by app.js). */
.tabs:not(.has-ink) .tab[aria-current="page"] { background: var(--raise); }
.tab-ink {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: var(--r-pill);
  background: var(--raise);
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
  transition: transform .45s var(--ease-spring), width .45s var(--ease-spring), height .45s var(--ease-spring);
}
.tab-ink.no-anim { transition: none; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

#appShell { min-height: 100vh; }

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) 72px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease-spring);
}
.btn:active, .icon-btn:active, .seg button:active, .btn-social:active { transform: scale(.96); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; font-weight: 500; }
.btn-lg { height: 52px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:hover:not(:active) { transform: translateY(-1px); }

.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--raise); border-color: var(--text-3); }

.btn-danger { background: transparent; border-color: var(--danger-line); color: var(--danger-text); }
.btn-danger:hover { background: var(--loss); border-color: var(--loss); color: var(--on-money); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text);
  transition: background-color .15s, border-color .15s, transform .15s var(--ease-spring);
}
.icon-btn:hover { background: var(--raise); border-color: var(--text-3); }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease-spring); }
/* Arrows lean the way they'll take you. */
.icon-btn[aria-label^="Previous"]:hover svg { transform: translateX(-2px); }
.icon-btn[aria-label^="Next"]:hover svg { transform: translateX(2px); }
.icon-btn[aria-label="Close"]:hover svg { transform: rotate(90deg); }

.link-btn {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--text-2);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  transition: color .15s, text-decoration-color .15s;
}
.link-btn:hover { color: var(--text); text-decoration-color: var(--text-2); }

.file-btn { position: relative; overflow: hidden; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Sample banner ---------- */

.sample-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max);
  width: calc(100% - 2 * var(--gutter));
  margin: 20px auto 0;
  padding: 10px 10px 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  color: var(--text-2);
  font-size: 14px;
}

/* ---------- Page heads (every view starts the same way) ---------- */

.month-head, .trades-head { padding: 32px 0 0; }
.trades-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding-bottom: 24px;
}
.month-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
}
.month-name, .page-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
  letter-spacing: var(--display-track);
  color: var(--text);
}
.page-lede { margin-top: 10px; color: var(--text-2); max-width: 52ch; }
.month-nav { display: flex; align-items: center; gap: 8px; }

/* ---------- Month result + the four numbers beside it ---------- */

.month-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--tiles);
  margin-top: 28px;
}
.month-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sheen), transparent 55%), var(--panel);
  /* The total is sized against this panel's width, so a big month still fits on one line. */
  container-type: inline-size;
}
.month-net {
  max-width: 100%;
  font-family: var(--display);
  font-weight: 700;
  font-size: min(clamp(52px, 7.2vw, 108px), 14cqi);
  line-height: 1;
  letter-spacing: var(--display-track);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* The month's result is the biggest block on the page. */
.month-net.gain, .month-net.loss { padding: .1em .26em .09em; border-radius: 22px; }
.month-net.flat { color: var(--text-2); }
.month-sub { color: var(--text-3); font-size: 14px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tiles);
  margin: 0;
}
.kpi, .stat {
  min-width: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  transition: background-color .2s, border-color .2s;
}
.kpi:hover, .stat:hover { background: color-mix(in srgb, var(--raise) 70%, transparent); border-color: var(--line-strong); }
.kpi dt, .stat dt { font-size: 13px; font-weight: 500; color: var(--text-3); }
.kpi dd, .stat dd {
  margin: 10px 0 0;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.kpi dd small, .stat dd small {
  display: block;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-3);
}
.kpi .gain, .kpi .loss, .stat .gain, .stat .loss { border-radius: 10px; }

/* ---------- The sheet: the month drawn as blocks ---------- */

.sheet,
.equity-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel);
}
.sheet { margin-top: var(--stack); padding: 26px 28px; }

/* The calendar is a size container, so amounts scale with the width the days actually get. */
.calendar-wrap { min-width: 0; container-type: inline-size; }
.calendar {
  --cols: 5;
  --dx: 0px;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr)) minmax(0, 1.05fr);
  gap: 10px;
}
.calendar.from-next { --dx: 26px; }
.calendar.from-prev { --dx: -26px; }

/* Column heads: the weekday, and under it your average day on that weekday (all time). */
.cal-dow {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  min-height: 26px;
  padding: 4px 0 2px 4px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
}
.cal-dow.week-col { padding-left: 22px; }
.dow-avg {
  align-self: flex-start;
  padding: 2px 6px 1px;
  border-radius: 6px;
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.15;
  box-shadow: none;
  font-variant-numeric: tabular-nums;
}
.dow-avg.gain { background: color-mix(in srgb, var(--gain) 70%, transparent); }
.dow-avg.loss { background: color-mix(in srgb, var(--loss) 75%, transparent); }

/* A day: its number and the news on top, its result at the bottom, its marks down the right. */
.day {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  column-gap: 4px;
  min-height: 104px;
  padding: 10px 8px 12px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--raise) 72%, transparent);
  color: var(--text);
  text-align: left;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color .15s, transform .2s var(--ease-spring), box-shadow .2s;
}
.day:not(.outside):hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--lift); }
.day:not(.outside):active { transform: scale(.97); }
.day.outside { background: transparent; pointer-events: none; }
.day.outside .day-num { color: color-mix(in srgb, var(--text-3) 45%, transparent); }
/* Days still ahead are only a faint outline, waiting for their mark. */
.day.future { background: color-mix(in srgb, var(--raise) 22%, transparent); border-color: var(--line); }
.day.future .day-num { color: var(--text-3); }
.day.today { box-shadow: 0 0 0 2px var(--brand-text); }
.day.today.blank { background: transparent; border-color: var(--line-strong); }
/* A day the market is closed: faint stripes. */
.day.closed {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--raise) 40%, transparent) 0 6px, transparent 6px 12px);
  border-color: var(--line);
}

/* One green for every up day and one red for every down day: the color says which way it went,
   the number says how much. */
.day.up { background: var(--gain); box-shadow: var(--money-edge); color: var(--on-money); }
.day.down { background: var(--loss); box-shadow: var(--money-edge); color: var(--on-money); }
.day.today:is(.up, .down) { box-shadow: var(--money-edge), 0 0 0 2px var(--brand-text); }
.day.zero { border-color: var(--text-3); }

.day-top { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.day-num { font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.day:is(.up, .down) .day-num { color: rgba(255, 255, 255, .85); }
.day-body { grid-column: 1; grid-row: 3; display: block; min-width: 0; }
.day-pnl, .day-meta { display: block; }
/* Amounts never wrap (a minus sign alone on a line reads as a different number) and shrink to fit the day. */
.day-pnl {
  font-family: var(--display);
  font-size: clamp(15px, 2.85cqi, 24px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.day-meta { margin-top: 4px; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day:is(.up, .down) .day-meta { color: rgba(255, 255, 255, .85); }
.day-closed { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.closed .day-meta { color: var(--text-3); }
.v-compact { display: none; }

/* News on the day: the Fed, CPI, an early close. */
.day-ev {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 5px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-text) 45%, transparent);
  color: var(--brand-text);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
}
.day-ev.ev-early { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); }
.day:is(.up, .down) .day-ev { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); color: #fff; }

/* The marks: plan, note, chart, check-in, and a crack when something broke the day. */
.day-marks { grid-column: 2; grid-row: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mk-ico { display: block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.day-marks .mk-ico { color: var(--text-3); }
.day:is(.up, .down) .day-marks .mk-ico { color: rgba(255, 255, 255, .8); }
/* The block itself says how you kept your rules. Strong: a solid block with depth. Cracked: one
   crack down from the top. Broken: a crack all the way through, another from the side, and a
   corner knocked off. Days with nothing in them stay flat and empty. */
.day { overflow: hidden; }
.day > :not(.day-stone) { position: relative; z-index: 1; }
.day-stone { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.ds-crack { fill: none; stroke: rgba(0, 0, 0, .58); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ds-glint { fill: none; stroke: rgba(255, 255, 255, .3); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; transform: translate(.9px, 1.1px); }
.ds-shade { fill: rgba(0, 0, 0, .16); }
.ds-chip { fill: var(--panel); stroke: rgba(255, 255, 255, .28); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
/* On a day without trades (a check-in, a plan followed), the block is plain stone and its cracks are red. */
.day:not(.up):not(.down) .ds-crack { stroke: color-mix(in srgb, var(--danger-text) 80%, transparent); }
.day:not(.up):not(.down) .ds-glint { display: none; }
.day:not(.up):not(.down) .ds-chip { stroke: color-mix(in srgb, var(--danger-text) 60%, transparent); }
.day.st-strong:not(.up):not(.down), .day.st-cracked:not(.up):not(.down), .day.st-broken:not(.up):not(.down) {
  background: color-mix(in srgb, var(--mark-3) 16%, var(--raise));
  border-color: transparent;
}
/* A strong block has depth: light along the top, a shadowed base. */
.day.st-strong:is(.up, .down) {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 50%);
  box-shadow: var(--money-edge), inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -6px 0 rgba(0, 0, 0, .28);
}
.day.st-strong:not(.up):not(.down) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -6px 0 rgba(0, 0, 0, .24); }
.day.st-strong.today:is(.up, .down) { box-shadow: var(--money-edge), inset 0 -6px 0 rgba(0, 0, 0, .28), 0 0 0 2px var(--brand-text); }
.day.st-strong.today:not(.up):not(.down) { box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .24), 0 0 0 2px var(--brand-text); }
[data-theme="daylight"] .day.st-strong:not(.up):not(.down) { box-shadow: inset 0 -6px 0 rgba(17, 22, 34, .14); }
/* A cracked or broken block loses its depth and sits flat. */
.day.st-broken:is(.up, .down) { box-shadow: none; }

/* The same three blocks, small, in the key and the quick look. */
.ck-stone { position: relative; display: inline-block; flex: none; width: 34px; height: 22px; overflow: hidden; border-radius: 4px; background: var(--gain); box-shadow: var(--money-edge); }
.ck-stone.st-strong { background-image: linear-gradient(180deg, rgba(255, 255, 255, .1), transparent 50%); box-shadow: var(--money-edge), inset 0 -3px 0 rgba(0, 0, 0, .3); }
.ck-stone.st-broken { box-shadow: none; }
.ck-stone .day-stone { position: absolute; inset: 0; }
.ck-stone .ds-chip { fill: var(--panel); }
.peek .ck-stone .ds-chip { fill: var(--panel); }
.pk-facts .ck-stone { margin-top: 1px; width: 22px; height: 15px; }

/* The week: its result, how many days and how often you won, its best day, and its review. */
.week {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-height: 104px;
  margin-left: 6px;
  padding: 10px 2px 12px 16px;
  border-left: 1px solid var(--line);
}
.week-label { font-size: 12px; color: var(--text-3); }
.week-body { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; max-width: 100%; }
.week-pnl {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(14px, 2.5cqi, 21px);
  white-space: nowrap;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.week-meta, .week-best { display: block; max-width: 100%; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-best .gain, .week-best .loss { padding: 0 .3em; font-size: 11.5px; font-weight: 600; box-shadow: none; }
.wk-review {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: var(--brand-text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brand-text) 45%, transparent);
  text-underline-offset: 3px;
  white-space: nowrap;
}
.wk-review:hover { text-decoration-color: currentColor; }
.wk-review.is-done { color: var(--text-3); text-decoration: none; font-weight: 500; }
.wk-review.is-done:hover { color: var(--text-2); }
.wk-review svg { width: 13px; height: 13px; fill: none; stroke: var(--brand-text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.week-meta > span + span::before { content: " · "; }
/* A narrow calendar keeps the week to its result, days, win rate and review. */
@container (max-width: 760px) {
  .week-best { display: none; }
  .week-meta > span { display: block; }
  .week-meta > span + span::before { content: none; }
  .day-ev { height: 15px; padding: 0 4px; font-size: 9.5px; }
}

/* What the marks mean, under the calendar. */
.cal-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 20px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  color: var(--text-3);
  font-size: 12.5px;
}
.cal-key li { display: inline-flex; align-items: center; gap: 7px; }
.cal-key .mk-ico { color: var(--text-2); }
.cal-key .ck-scale { display: inline-flex; gap: 3px; }
.cal-key .ys { width: 12px; height: 12px; }

/* ---------- Trades this month ---------- */

.recent { margin-top: calc(var(--stack) * 2); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-head h2 { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; }

.month-total {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 16px;
}
.month-total:empty { display: none; }
.mt-label { font-size: 14px; color: var(--text-3); }
.mt-net {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.mt-net.gain, .mt-net.loss { border-radius: 12px; }
.mt-break { font-size: 14px; color: var(--text-2); }
.mt-break .gain, .mt-break .loss { font-weight: 600; font-size: 13px; padding: .2em .55em; border-radius: var(--r-pill); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 0 16px; height: 48px; text-align: left; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
th {
  position: sticky;
  top: 0;
  height: 42px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
}
td { border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); font-variant-numeric: tabular-nums; transition: background-color .15s; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: color-mix(in srgb, var(--raise) 70%, transparent); }
tbody tr:focus-visible { outline-offset: -2px; }
tfoot td {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: color-mix(in srgb, var(--well) 70%, transparent);
  font-weight: 600;
}
td.num, th.num { text-align: right; }
td.sym { font-weight: 600; }
td.muted { color: var(--text-3); }
td.pnl { font-weight: 600; }
td.pnl .gain, td.pnl .loss { padding: .25em .6em; border-radius: var(--r-sm); }
.side-tag { color: var(--text-2); }

.empty { padding: 48px 24px; text-align: center; color: var(--text-2); }
.empty p + p { margin-top: 6px; color: var(--text-3); font-size: 14px; }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.show-more {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: background-color .15s, color .15s;
}
.show-more:hover { background: var(--raise); color: var(--text); }

/* ---------- Stats ---------- */

.stats-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.stats-month {
  min-width: 8.5em;
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  color: var(--text-2);
}

.equity-card { padding: 24px 26px 18px; }
.equity-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.side-title { font-size: 17px; font-weight: 600; }
.side-hint { margin-top: 2px; font-size: 13px; color: var(--text-3); }
.equity-net {
  font-family: var(--display);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.equity-net.gain, .equity-net.loss { border-radius: 16px; }

/* The curve is in the text color; the area under it takes the money color, so the line itself stays readable. */
.chart { position: relative; margin-top: 14px; height: 168px; }
.chart-lg { height: 300px; margin-top: 22px; }
.chart svg { display: block; overflow: visible; }
.chart .zero { stroke: var(--text-3); stroke-width: 1; }
.chart .grid { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 5; }
.chart .axis-label { fill: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .line-gain,
.chart .line-loss { fill: none; stroke: var(--text); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .area-gain { fill: var(--gain); fill-opacity: .8; }
.chart .area-loss { fill: var(--loss); fill-opacity: .8; }
.chart .cross { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .dot { stroke: var(--text); stroke-width: 2.5; transition: cx .15s, cy .15s; }
.chart-empty {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 0 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
}

.tooltip {
  position: absolute;
  z-index: 5;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--raise);
  box-shadow: var(--shadow-sm);
  color: var(--text-2);
  font-size: 12.5px;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
}
.tooltip strong { display: block; margin: 2px 0 4px; color: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip .gain, .tooltip .loss { font-weight: 600; border-radius: 6px; }

.stats {
  --stat-cols: 4;
  display: grid;
  grid-template-columns: repeat(var(--stat-cols), minmax(0, 1fr));
  gap: var(--tiles);
  margin: var(--stack) 0 0;
}

/* ---------- Under the Fortress's wall: XP, pillars, check-in, rules, badges ---------- */

/* The five pillars: thin gold lines, one per pillar. */
.traits { display: grid; gap: 14px; margin: 18px 0 0; padding: 0; list-style: none; }
.traits li { display: grid; grid-template-columns: 128px minmax(0, 1fr) 48px; align-items: center; gap: 14px; }
.tr-name strong { display: block; font-family: var(--display); font-size: 18px; font-weight: 700; line-height: 1.1; }
.tr-meter { display: block; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--fort-gold) 22%, transparent); overflow: hidden; }
.tr-meter span { display: block; height: 100%; background: var(--fort-gold); transition: width .8s var(--ease-out); }
.tr-value { font-size: 14px; font-weight: 600; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Daily check-in: tick what you did. */
.checkin-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; }
.checkin-day { min-width: 7.5em; text-align: center; font-size: 14px; font-weight: 600; color: var(--text-2); }
.checkin .icon-btn:disabled { opacity: .35; pointer-events: none; }
.checkin-list { display: grid; gap: 14px; margin-top: 16px; }
.ci-group h3 { margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.ci-group ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ci-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  text-align: left;
  transition: background-color .15s, border-color .15s, color .15s;
}
.ci-item:hover { background: color-mix(in srgb, var(--raise) 60%, transparent); }
.ci-box { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border: 1.5px solid var(--text-3); border-radius: 6px; transition: background-color .15s, border-color .15s; }
.ci-box svg { width: 13px; height: 13px; fill: none; stroke: #151b19; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .15s; }
[data-theme="daylight"] .ci-box svg { stroke: #ffffff; }
.ci-label { flex: 1; }
.ci-xp { font-size: 12.5px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ci-item[aria-pressed="true"] { color: var(--text); }
.ci-item[aria-pressed="true"] .ci-box { border-color: var(--fort-gold); background: var(--fort-gold); }
.ci-item[aria-pressed="true"] .ci-box svg { opacity: 1; }
.ci-item[aria-pressed="true"] .ci-xp { color: var(--fort-gold-text); }

/* A rule in the check-in: tick it as kept, or mark it broken when it carries a penalty. */
.ci-row { display: flex; align-items: center; gap: 6px; }
.ci-row .ci-item { flex: 1; min-width: 0; }
.ci-when { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.ci-broke {
  flex: none;
  height: 30px;
  padding: 0 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.ci-broke:hover { border-color: var(--text-3); color: var(--text-2); }
.ci-broke[aria-pressed="true"] { border: 1px solid var(--loss); background: var(--loss); color: var(--on-money); }

/* Your rules: each one with its pillar, how often it applies, its tier and what it's worth. */
.section-actions { display: flex; align-items: center; gap: 16px; }
.section-lede { max-width: 70ch; margin: -4px 0 16px; font-size: 14px; line-height: 1.5; color: var(--text-3); }
.rule-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--panel) 85%, transparent); overflow: hidden; }
.rule-list > li + li { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.rule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px 18px;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background-color .15s;
}
.rule-row:hover { background: color-mix(in srgb, var(--raise) 60%, transparent); }
.rule-main strong { display: block; font-size: 15px; font-weight: 600; }
.rule-main span { display: block; margin-top: 3px; font-size: 13px; color: var(--text-3); }
.rule-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.rule-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.rule-chip.tier-1 { color: var(--text-3); }
.rule-chip.tier-3 { border-color: var(--fort-gold-line); color: var(--fort-gold-text); }
.rule-chip.tier-4 { border-color: var(--fort-gold); background: var(--fort-gold); color: #151b19; font-weight: 600; }
[data-theme="daylight"] .rule-chip.tier-4 { color: #ffffff; }
.rule-xp { display: inline-flex; justify-content: flex-end; gap: 4px; min-width: 96px; }
.rule-xp b, .rp-xp b {
  display: inline-block;
  min-width: 44px;
  padding: 3px 6px;
  border-radius: 8px;
  background: var(--raise);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--brand-text);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rule-xp .xp-pen, .rp-xp .xp-pen { background: var(--loss); box-shadow: none; color: var(--on-money); }
.rules-empty { padding: 28px 20px; color: var(--text-3); text-align: center; }

.rule-dialog { width: min(560px, calc(100% - 24px)); }
.rule-dialog .foot-actions { margin-left: auto; }
.rule-selects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rule-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid rgba(198, 166, 103, .28);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #121816, #0c1110);
}
.rp-xp { font-size: 13.5px; color: var(--text-2); }
.rp-xp b { margin-right: 4px; min-width: 0; }
.rp-empty { font-size: 13.5px; color: var(--text-3); }

.chk em { margin-left: 2px; font-style: normal; font-weight: 700; }
.dx-xp.is-neg { color: var(--danger-text); }

/* Your discipline so far, in three tiles under the month's wall. */
.level-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--tiles); margin: var(--tiles) 0 0; }
.level-stats > div { min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel); }
.level-stats dt { font-size: 13px; font-weight: 500; color: var(--text-3); }
.level-stats dd { margin: 8px 0 0; font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.level-stats .dd-word { display: block; font-size: 22px; line-height: 1.1; overflow-wrap: anywhere; }
.level-stats small { display: block; margin-top: 6px; font-family: var(--sans); font-size: 12.5px; font-weight: 400; line-height: 1.35; color: var(--text-3); }
.discipline .level-stats { margin-top: 0; }
#levelNote { margin-top: 12px; }
#levelNote:empty { display: none; }

.level-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; gap: var(--tiles); margin-top: var(--tiles); }
.level-card {
  min-width: 0;
  padding: 22px 24px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel);
}
.level-section { margin-top: calc(var(--stack) * 2); }
.section-count { font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* Recent days: what each day earned, and the rule that got away. */
.day-xp { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--panel) 85%, transparent); overflow: hidden; }
.day-xp > li {
  display: grid;
  grid-template-columns: 112px 104px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.day-xp > li:last-child { border-bottom: 0; }
.dx-date { font-size: 14px; color: var(--text-2); }
.dx-pnl { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.dx-pnl .gain, .dx-pnl .loss { padding: .25em .6em; border-radius: var(--r-sm); }
.dx-checks { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chk { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 9px; border-radius: var(--r-pill); font-size: 12.5px; white-space: nowrap; }
.chk svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chk.ok { background: var(--raise); color: var(--text-2); }
.chk.ok svg { color: var(--brand-text); }
/* A rule that slipped is drawn like an unbuilt block: dashed, waiting for next time. */
.chk.miss { border: 1px dashed var(--text-3); color: var(--text); }
.dx-xp { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--brand-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dx-empty { display: block !important; padding: 28px 20px !important; color: var(--text-3); text-align: center; }
.day-xp.rows-in > li { animation: row-in .45s var(--ease-out) backwards; animation-delay: calc(var(--r, 0) * 35ms + .15s); }

/* Badges: earned ones are solid medals, the rest are dashed outlines still to earn. */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.badge {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 16px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  color: var(--text-3);
}
.badge.is-done { border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--raise) 55%, transparent); color: var(--text-2); }
.badge-ico { width: 38px; height: 38px; flex: none; color: var(--text-3); }
/* An earned badge is a medal in the look's accent. */
.badge-ico .bi-disc { fill: var(--brand); stroke: var(--brand-text); }
.badge-ico .bi-star { fill: var(--on-brand); }
.badge strong { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.badge span { display: block; margin-top: 4px; font-size: 13px; line-height: 1.4; }
.badge em { display: inline-block; margin-top: 8px; font-size: 12px; font-style: normal; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.badge.is-done em { color: var(--brand-text); }

/* ---------- Owner panel (only ever shown to the owner's account) ---------- */

/* Its way in is a section on the Settings page, with a gold edge like the rest of the owner's tools. */
.settings-group.owner-group { border-color: var(--fort-gold-line); }
.owner-link { border-color: var(--fort-gold-line); color: var(--fort-gold-text); }
.owner-link:hover { border-color: var(--fort-gold); color: var(--text); }

/* While test mode is on, a gold strip under the top bar says so on every page. */
.test-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  max-width: var(--max);
  width: calc(100% - 2 * var(--gutter));
  margin: 16px auto 0;
  padding: 10px 10px 10px 18px;
  border: 1px solid rgba(198, 166, 103, .55);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #161c18, #101512);
  color: var(--text-2);
  font-size: 14px;
}
.test-banner strong { color: #e2cc95; }

.admin-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}
.admin-mode.is-on { border-color: rgba(198, 166, 103, .55); background: linear-gradient(180deg, #151b18, #0f1412); }
.admin-mode .side-hint { max-width: 62ch; font-size: 14px; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 16px; margin-top: 16px; }
.admin-wide { grid-column: 1 / -1; }
.admin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.admin-col { display: grid; gap: 8px; margin-top: 16px; }
.admin-col .btn { justify-content: flex-start; }
.admin-lock { margin-top: 14px; font-size: 13px; color: var(--text-3); }
.admin-card .btn:disabled, .admin-card .link-btn:disabled { opacity: .4; pointer-events: none; }

.admin-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.admin-facts > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: color-mix(in srgb, var(--well) 55%, transparent); }
.admin-facts dt, .admin-list dt { font-size: 12.5px; color: var(--text-3); }
.admin-facts dd { margin: 6px 0 0; font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }

.admin-list { display: grid; gap: 10px; margin: 16px 0 0; }
.admin-list > div { display: flex; justify-content: space-between; gap: 12px; }
.admin-list dd { margin: 0; font-size: 13.5px; color: var(--text-2); text-align: right; overflow-wrap: anywhere; }
.admin-mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px !important; }

/* People using Myrdon: one row per account, most recently opened first. */
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.admin-head .side-hint { max-width: 70ch; }
.admin-empty { margin-top: 16px; font-size: 13.5px; color: var(--text-3); }
.admin-people { max-height: 440px; margin: 16px 0 0; padding: 0; overflow-y: auto; list-style: none; border-top: 1px solid var(--line); }
.admin-people li { display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.ap-who, .ap-when { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-who strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ap-who span, .ap-when span { font-size: 12.5px; color: var(--text-3); }
.ap-when { flex: none; text-align: right; }
.ap-when span:first-child { color: var(--text-2); }
@media (max-width: 560px) {
  .admin-head { flex-direction: column; }
  .admin-people li { flex-direction: column; align-items: flex-start; }
  .ap-when { text-align: left; }
}

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

/* ---------- Data footer: backup, restore, spreadsheet ---------- */

.data-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 13px;
}
.data-footer p { max-width: 62ch; }
.data-actions { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.data-actions .link-btn { font-size: 13px; }
/* The disclaimer and the legal pages: their own row along the bottom of the footer. */
.legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 24px;
  flex-basis: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ---------- Form controls ---------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field em, legend em { font-style: normal; color: var(--text-3); font-weight: 400; }
.field-hint { font-size: 13px; color: var(--text-3); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], select, textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--well);
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  transition: border-color .15s;
}
textarea { height: auto; padding: 10px 14px; resize: vertical; line-height: 1.6; }
select { padding-right: 32px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[name="symbol"] { text-transform: uppercase; }
input[name="symbol"]::placeholder { text-transform: none; }
input:hover, select:hover, textarea:hover { border-color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-text); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
input[aria-invalid="true"] { border-color: var(--invalid); }
input[type="number"]::-webkit-inner-spin-button { opacity: .4; }
::-webkit-calendar-picker-indicator { filter: var(--picker-filter); }
.journal-text { font-size: 15px; line-height: 1.6; font-variant-numeric: normal; }

.form-error { color: var(--danger-text); font-size: 14px; }
.form-error:empty { display: none; }

/* Segmented switches: the chosen option is a pill in the text color that slides (positioned by app.js). */
.seg {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--well);
}
.seg button {
  position: relative;
  z-index: 1;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: background-color .15s, color .25s, transform .15s var(--ease-spring);
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { color: var(--bg); }
.seg:not(.has-ink) button[aria-checked="true"] { background: var(--text); }
.seg-ink {
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  border-radius: var(--r-pill);
  background: var(--text);
  opacity: 0;
  transition: transform .42s var(--ease-spring), width .42s var(--ease-spring), background-color .3s;
}
.seg.has-ink .seg-ink { opacity: 1; }
.seg-ink.no-anim { transition: none; }
.seg-sm button { height: 28px; padding: 0 12px; font-size: 13px; }
.seg-wide { display: flex; }
.seg-wide button { flex: 1; }

/* ---------- Dialogs ---------- */

dialog {
  padding: 0;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background-color: var(--panel);
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
}
/* Older browsers don't pass custom properties to ::backdrop, hence the fallback. */
dialog::backdrop {
  background: var(--scrim, rgba(6, 5, 4, .62));
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 32px); border-radius: var(--r-xl); }
.modal form { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.modal-head h2 { font-family: var(--display); font-size: 32px; font-weight: 700; line-height: 1; }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}
.foot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- Import trades ---------- */

.btn-ico { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* In the top bar, Import sits just before Log trade; on phones it moves next to "Trades this month". */
#importBtn { order: -1; }
.import-inline { display: none; }

.import-dialog { width: min(620px, calc(100% - 24px)); }

.im-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.im-steps li { display: flex; align-items: baseline; gap: 12px; font-size: 15px; line-height: 1.45; color: var(--text-2); counter-increment: step; }
.im-steps li::before {
  content: counter(step);
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--raise);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
  font-family: var(--display);
  font-size: 13px;
  line-height: 1;
}
.im-steps b { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.inline-ico { display: inline-block; width: 17px; height: 17px; margin: 0 1px; vertical-align: -3px; fill: none; stroke: var(--text); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* The drop zone is drawn like a planned day on the calendar: a dashed block waiting to be filled. */
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 188px;
  margin-top: 20px;
  padding: 28px 20px;
  border: 1.5px dashed color-mix(in srgb, var(--brand-text) 55%, var(--line-strong));
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--well) 60%, transparent);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .25s var(--ease-spring);
}
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop > :not(input) { pointer-events: none; }
.drop:hover, .drop.is-over { border-color: var(--brand-text); background: color-mix(in srgb, var(--brand) 14%, var(--well)); }
.drop.is-over { border-style: solid; transform: scale(1.012); }
.drop:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.drop-ico { width: 34px; height: 34px; margin-bottom: 4px; fill: none; stroke: var(--brand-text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease-spring); }
.drop:hover .drop-ico, .drop.is-over .drop-ico { transform: translateY(3px); }
.drop strong { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.1; }
.drop span { font-size: 14px; color: var(--text-3); }
.im-pick .form-error { margin-top: 14px; }
.im-pick .form-error:empty { display: none; }

.im-review { display: flex; flex-direction: column; gap: 16px; }
.im-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--well) 60%, transparent);
}
.im-count { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.15; }
.im-file { margin-top: 4px; font-size: 13px; color: var(--text-3); }
.im-net { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.im-net .gain, .im-net .loss { border-radius: 12px; }
.im-notes { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.im-notes li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.im-notes li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 7px; height: 7px; border-radius: 2px; background: var(--brand-text); }
.im-table { max-height: 264px; overflow: auto; }
.im-table th, .im-table td { height: 42px; }
.im-table tbody tr { cursor: default; }
.im-table tbody tr:hover td { background: none; }
.im-review .modal-foot { padding-top: 16px; }
.im-review.im-in > * { animation: view-rise .4s var(--ease-out) backwards; }
.im-review.im-in > :nth-child(2) { animation-delay: .05s; }
.im-review.im-in > :nth-child(3) { animation-delay: .1s; }
.im-review.im-in > :nth-child(4) { animation-delay: .15s; }

/* ---------- Day panel: made or lost, and how much ---------- */

.day-panel { width: min(400px, calc(100% - 24px)); border-radius: var(--r-xl); }
.dp-inner { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.dp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dp-head h2 { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; }
.dp-total { margin-top: 8px; font-size: 14px; color: var(--text-3); }
.dp-total strong { font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 8px; }

.money-seg button { height: 42px; font-size: 15px; }
/* "Made" and "Lost" light up in the same green and red as the calendar blocks. */
.money-seg button[aria-checked="true"] { color: var(--on-money); }
.money-seg:not(.has-ink) button[data-value="made"][aria-checked="true"] { background: var(--gain); }
.money-seg:not(.has-ink) button[data-value="lost"][aria-checked="true"] { background: var(--loss); }
.money-seg[data-value="made"] .seg-ink { background: var(--gain); }
.money-seg[data-value="lost"] .seg-ink { background: var(--loss); }

/* The amount you type is the block you're about to add: it takes the green or red, white figures on top. */
.amount-field {
  display: flex;
  align-items: baseline;
  gap: 2px;
  padding: 12px 20px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  background: var(--gain);
  box-shadow: var(--money-edge);
  cursor: text;
  transition: background-color .3s, box-shadow .2s;
}
.day-panel[data-dir="lost"] .amount-field { background: var(--loss); }
.amount-field:focus-within { box-shadow: var(--money-edge), 0 0 0 2px var(--focus); }
.amount-sign,
.amount-field input {
  font-family: var(--display);
  font-weight: 700;
  color: var(--on-money);
}
.amount-sign { display: inline-block; font-size: 46px; }
.amount-field input,
.amount-field input:focus,
.amount-field input:focus-visible {
  flex: 1;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 64px;
  line-height: 1.05;
}
.amount-field input::placeholder { color: rgba(255, 255, 255, .45); }
.amount-field:has(input[aria-invalid="true"]) { box-shadow: var(--money-edge), 0 0 0 2px var(--invalid); }

.dp-entries-wrap h3 { margin-bottom: 4px; font-size: 13px; font-weight: 500; color: var(--text-3); }
.dp-entries {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 216px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line-strong);
}
.dp-entries li {
  display: grid;
  grid-template-columns: 1fr auto 36px;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 4px 0 4px 2px;
  border-bottom: 1px solid var(--line);
}
/* The trade itself (and its note) is a button: tap it to change the amount or the note. */
.de-edit {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 6px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.de-edit:hover .de-label { text-decoration: underline; text-underline-offset: 3px; }
.de-label { font-weight: 600; }
.de-label span { margin-left: 8px; font-weight: 400; font-size: 13px; color: var(--text-3); }
.de-note {
  max-width: 100%;
  overflow: hidden;
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.de-amt { font-family: var(--display); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.de-amt.gain, .de-amt.loss { border-radius: 9px; }
.de-remove {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-3);
  transition: background-color .15s, color .15s;
}
.de-remove:hover { background: var(--raise); color: var(--text); }
.de-remove svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; transition: transform .2s var(--ease-spring); }
.de-remove:hover svg { transform: rotate(90deg); }
.dp-entries li.is-removed { grid-template-columns: 1fr auto; padding-right: 4px; }
.dp-journal li { grid-template-columns: minmax(0, 1fr); }
/* The trade that's open above is marked in the list with an edge in the accent color. */
.dp-entries li.is-current { box-shadow: inset 3px 0 0 var(--brand-text); padding-left: 12px; background: color-mix(in srgb, var(--brand) 9%, transparent); }
.dp-editbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: -4px; }
.dp-add-another { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; text-decoration: none; }
.dp-add-another:hover { text-decoration: underline; }
.dp-add-another .btn-ico { width: 16px; height: 16px; }
/* Switching to another trade: its amount and note settle in. */
.amount-field.swap-in, .journal-text.swap-in { animation: view-rise .38s var(--ease-out); }
.dp-entries-wrap + .dp-entries-wrap { margin-top: -4px; }
.dp-entries li.is-removed > * { animation: fade-in .25s ease both; }
.de-removed { color: var(--text-3); font-size: 14px; }
.dp-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Journal: each trade you took, in your own words and pictures ---------- */

.journal-month + .journal-month { margin-top: 40px; }
.jm-title { margin-bottom: 14px; font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1; }
.entries { display: grid; gap: var(--tiles); margin: 0; padding: 0; list-style: none; }
.entry {
  padding: 20px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  transition: border-color .2s;
}
.entry:hover { border-color: var(--line-strong); }
.entry-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.entry-date { min-width: 0; }
.entry-side { display: flex; flex: none; align-items: center; gap: 10px; }
.entry-pnl { font-family: var(--display); font-size: 20px; font-weight: 700; }
.entry-pnl.gain, .entry-pnl.loss { border-radius: 9px; }
.entry-date { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.entry-date time { font-family: var(--display); font-size: 25px; font-weight: 700; line-height: 1.1; }
.entry-date span { font-size: 14px; color: var(--text-3); }
.entry-notes {
  margin-top: 12px;
  max-width: 72ch;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Pictures: one shows whole and wide; two or more share a row and open full size on a click. */
.entry-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.entry-photos[data-count="1"] { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.entry-photos[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pic { position: relative; min-width: 0; }
.pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pic-open {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--well);
  overflow: hidden;
  transition: border-color .15s, transform .2s var(--ease-spring);
}
.pic-open:hover { border-color: var(--text-3); transform: translateY(-2px); }
.entry-photos[data-count="1"] .pic-open { aspect-ratio: 16 / 9; }
.entry-photos[data-count="1"] img { object-fit: contain; }
.pic.is-missing img { visibility: hidden; }
.pic.is-missing::after {
  content: "Picture missing";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--text-3);
  font-size: 13px;
  pointer-events: none;
}

/* No entries yet: a dashed block waiting to be filled, like a planned day on the calendar. */
.journal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-xl);
  text-align: center;
  color: var(--text-3);
}
.je-ico { width: 42px; height: 42px; margin-bottom: 6px; fill: none; stroke: var(--brand-text); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.je-title { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--text); }
.journal-empty .btn { margin-top: 14px; }

/* The entry popup: date, notes, then the pictures above a drop zone for more. */
.entry-dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 32px); border-radius: var(--r-xl); }
.entry-dialog .dp-head { align-items: center; }
/* ----- The date: a field that unfolds into a small copy of your P&L calendar ----- */

.date-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 380px);
  height: 50px;
  padding: 0 14px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--well);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  transition: border-color .15s, background-color .15s, transform .15s var(--ease-spring);
}
.date-trigger:hover { border-color: var(--text-3); }
.date-trigger:active { transform: scale(.985); }
.date-trigger[aria-expanded="true"] { border-color: var(--brand-text); background: color-mix(in srgb, var(--brand) 10%, var(--well)); }
.dt-ico { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--brand-text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dt-ico .ico-fill { fill: var(--brand-text); stroke: none; transition: transform .35s var(--ease-spring); transform-box: fill-box; transform-origin: center; }
.date-trigger[aria-expanded="true"] .dt-ico .ico-fill { transform: translate(5.5px, -4px); }
.dt-text { display: inline-block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transform-origin: 50% 60%; }
.dt-text.date-flip { animation: date-flip .55s var(--ease-spring); }
@keyframes date-flip {
  0% { opacity: .2; transform: translateY(8px) rotateX(70deg); }
  60% { opacity: 1; transform: translateY(-1px) rotateX(-8deg); }
  100% { transform: none; }
}
.dt-tag {
  flex: none;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--brand) 26%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-text) 40%, transparent);
  color: var(--brand-text);
  font-size: 12px;
  font-weight: 600;
}
.dt-chev { flex: none; width: 16px; height: 16px; margin-left: auto; fill: none; stroke: var(--text-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease-spring); }
.date-trigger[aria-expanded="true"] .dt-chev { transform: rotate(180deg); }

/* The sheet unfolds downward (its height animates through a 0fr → 1fr grid row). */
.dp-fold { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .42s var(--ease-out), opacity .25s ease; }
.dp-fold.is-open { grid-template-rows: 1fr; opacity: 1; }
.dp-fold.no-anim { transition: none; }
.dp-clip { min-height: 0; overflow: hidden; }
.dp-sheet {
  width: min(100%, 380px);
  margin-top: 8px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background-color: var(--well);
  transform-origin: top left;
  transition: transform .42s var(--ease-out);
}
.dp-fold:not(.is-open) .dp-sheet { transform: translateY(-10px) scale(.97); }
.dp-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dp-month { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1; }
.dp-month.swap-prev { animation: label-in .4s var(--ease-out); --from: -14px; }
.icon-btn-sm { width: 34px; height: 34px; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn:disabled:hover { background: transparent; border-color: var(--line-strong); }

/* Weekday letters over a thin line. */
.dp-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.dp-week span { text-align: center; font-size: 11.5px; font-weight: 600; color: var(--text-3); }

.dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dp-day {
  position: relative;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color .15s, border-color .15s, color .15s, transform .2s var(--ease-spring), box-shadow .2s;
}
.dp-day:not(:disabled):hover { background: var(--raise); color: var(--text); transform: translateY(-2px); }
/* Days you traded are their money block, white on green or red. */
.dp-day.up { background: var(--gain); color: var(--on-money); box-shadow: var(--money-edge); }
.dp-day.down { background: var(--loss); color: var(--on-money); box-shadow: var(--money-edge); }
.dp-day.zero { border-color: var(--text-3); }
.dp-day.up:hover { background: var(--gain); }
.dp-day.down:hover { background: var(--loss); }
/* Today wears a ring in the accent color, like today on the big calendar. */
.dp-day.is-today { border: 1.5px solid var(--brand-text); color: var(--text); }
/* Days still to come can't hold a trade yet. */
.dp-day:disabled { color: color-mix(in srgb, var(--text-3) 50%, transparent); cursor: default; }
/* The picked day: a block in the text color, or a ring of it around a green or red one. */
.dp-day[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); transform: translateY(-1px); }
.dp-day.up[aria-pressed="true"], .dp-day.down[aria-pressed="true"] { border-color: transparent; color: var(--on-money); box-shadow: 0 0 0 2px var(--well), 0 0 0 4px var(--text); }
.dp-day.up[aria-pressed="true"] { background: var(--gain); }
.dp-day.down[aria-pressed="true"] { background: var(--loss); }
.dp-day:focus-visible { outline-offset: 3px; z-index: 1; }

.dp-quick { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-chip {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background-color .15s, border-color .15s, transform .15s var(--ease-spring);
}
.dp-chip:hover { background: var(--raise); border-color: var(--text-3); }
.dp-chip:active { transform: scale(.94); }
.dp-legend { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 12px; color: var(--text-3); }
.dp-legend i { width: 10px; height: 10px; border-radius: 3px; box-shadow: var(--money-edge); }
.dp-legend i.up { background: var(--gain); }
.dp-legend i.down { background: var(--loss); margin-right: 4px; }

/* Opening: the days drop in one after another, like the calendar building itself. */
.dp-grid.dp-build .dp-day { animation: dp-day-in .42s cubic-bezier(.2, .9, .25, 1.2) backwards; animation-delay: calc(var(--i, 0) * 11ms + 80ms); }
@keyframes dp-day-in { from { opacity: 0; transform: translateY(8px) scale(.82); } }
/* Changing month: the days slide in from the side you moved toward. */
.dp-grid.from-next { animation: dp-slide .36s var(--ease-out); --from: 22px; }
.dp-grid.from-prev { animation: dp-slide .36s var(--ease-out); --from: -22px; }
@keyframes dp-slide { from { opacity: 0; transform: translateX(var(--from)); } }
/* Picking a day: it pops, then the sheet folds away. */
.dp-day.is-picked { animation: dp-pick .45s var(--ease-spring); }
@keyframes dp-pick { 0% { transform: scale(.82); } 55% { transform: scale(1.14); } 100% { transform: translateY(-1px); } }
/* Today's ring breathes once when the sheet opens. */
.dp-grid.dp-build .dp-day.is-today { animation: dp-day-in .42s cubic-bezier(.2, .9, .25, 1.2) backwards, dp-today .9s .6s ease-in-out 1; animation-delay: calc(var(--i, 0) * 11ms + 80ms), .65s; }
@keyframes dp-today { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-text) 22%, transparent); } }
.entry-dialog #saveEntryBtn { margin-left: auto; }
/* What you made or lost: the same green or red block as the day panel, a little smaller.
   It's optional, so while it's empty it waits as a dashed block. */
.entry-money { gap: 8px; }
.entry-dialog .amount-field { padding: 10px 18px 12px; border-width: 1.5px; }
.entry-dialog .amount-sign { font-size: 34px; }
.entry-dialog .amount-field input { font-size: 46px; }
.entry-dialog[data-dir="lost"] .amount-field { background: var(--loss); }
.entry-dialog .amount-field:has(input:placeholder-shown) { background: transparent; border-style: dashed; border-color: var(--line-strong); box-shadow: none; }
.entry-dialog .amount-field:has(input:placeholder-shown) .amount-sign { color: var(--text-3); }
.entry-dialog .amount-field:has(input:placeholder-shown):focus-within { border-color: var(--brand-text); box-shadow: 0 0 0 2px var(--focus); }
.entry-dialog .amount-field:has(input[aria-invalid="true"]) { box-shadow: 0 0 0 2px var(--invalid); }
.entry-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 0 0 4px; padding: 0; list-style: none; }
.entry-pics .pic { aspect-ratio: 1; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--well); overflow: hidden; }
.entry-pics .pic.is-new { animation: pic-in .38s var(--ease-spring) backwards; }
@keyframes pic-in { from { opacity: 0; transform: scale(.7); } }
.pic-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  /* It sits on a picture, so it's dark glass with a white ×, whatever the look. */
  background: rgba(12, 12, 14, .78);
  color: #ffffff;
  transition: background-color .15s, transform .15s var(--ease-spring);
}
.pic-remove svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pic-remove:hover { background: var(--loss); color: var(--on-money); }
.pic-remove:active { transform: scale(.9); }
.drop-sm { min-height: 128px; margin-top: 0; padding: 20px; }
.drop-sm strong { font-size: 20px; }
.hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hint-pointer { display: none; }
  .hint-touch { display: inline; }
}

/* Full size: the picture fills the screen on the darkest surface, with arrows when there are more. */
.lightbox {
  width: min(1240px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  border-radius: var(--r-xl);
  background: var(--well);
}
.lightbox::backdrop { background: var(--scrim-strong, rgba(6, 5, 4, .88)); }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 14px 14px 22px; }
.lb-caption { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.lb-caption strong { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.1; }
.lb-caption span { font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lb-frame { position: relative; display: grid; place-items: center; padding: 0 14px 14px; touch-action: pan-y; }
.lb-frame img { display: block; max-width: 100%; max-height: calc(100dvh - 120px); border-radius: var(--r-md); object-fit: contain; }
.lb-frame img.lb-in { animation: fade-in .3s ease; }
.lb-prev, .lb-next { position: absolute; top: 50%; border-color: rgba(255, 255, 255, .28); background: rgba(12, 12, 14, .72); color: #ffffff; transform: translateY(-50%); }
.lb-prev:hover, .lb-next:hover { background: rgba(12, 12, 14, .9); border-color: rgba(255, 255, 255, .5); }
.lb-prev { left: 24px; }
.lb-next { right: 24px; }
.lb-prev:active, .lb-next:active { transform: translateY(-50%) scale(.96); }

/* ---------- Export ---------- */

.export-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.export-controls {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}
.export-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.export-actions .btn { flex: 1; }
.export-note:empty { display: none; }
.export-preview {
  position: relative;
  display: grid;
  place-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--well) 75%, transparent);
}
.export-preview canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(72vh, 760px);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

/* ---------- Splash ---------- */

.splash {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.splash svg { animation: splash-breathe 1.4s 1s ease-in-out infinite; }
@keyframes splash-breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ---------- Sign-in screen ---------- */

.auth-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 48px 56px 56px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 60%, transparent), transparent 70%);
}
/* What Myrdon is, in a small label over the slogan. */
.pitch-kicker {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 22px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-pitch .pitch-title {
  max-width: none;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(50px, 4.6vw, 80px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.01em;
  text-wrap: balance;
}
/* The promise under the slogan, set off by a short soft rule. */
.auth-pitch .pitch-sub {
  position: relative;
  max-width: 34ch;
  margin-top: 30px;
  padding-top: 26px;
  color: var(--text-2);
  font-size: clamp(18px, 1.7vw, 23px);
  font-weight: 500;
  line-height: 1.45;
  text-wrap: pretty;
}
.auth-pitch .pitch-sub::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-text), transparent);
}

/* The slogan, drawn. In front, today's wall: the foundation you're laying, under siege by losses
   (arrows and cannonballs) that break against it, with an armed gate and the top-left stone still
   a dashed outline until it's laid. Behind it, tomorrow: a road paved with stones runs over the
   land to the horizon, to a finished castle with the sun rising behind it, who you're building
   into. Colors come from the look: stones, towers and land are the logo's mark tones, the sun,
   road and flags the accent. */
.ward { --threat: #d9534a; --iron: #1b1815; --fire: #ff9a3c; --fire-hot: #ffe2a0; width: min(460px, 100%); }
[data-theme="graphite"] .ward { --iron: #101014; }
[data-theme="daylight"] .ward { --threat: #c23b32; --iron: #121419; }
.ward-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ward-glow-in { stop-color: var(--brand); stop-opacity: .4; }
.ward-glow-out { stop-color: var(--brand); stop-opacity: 0; }
.ward-disc { fill: var(--brand-text); }
.ward-beams path { fill: var(--brand); opacity: .22; }
.ward-far-c { stop-color: color-mix(in srgb, var(--mark-1) 24%, var(--bg)); }
.ward-near-c { stop-color: color-mix(in srgb, var(--mark-1) 36%, var(--bg)); }
.ward-land.is-far { fill: url(#wardFar); }
.ward-land.is-near { fill: url(#wardNear); }
.ward-road { fill: color-mix(in srgb, var(--brand-text) 20%, transparent); }
.ward-paver { fill: var(--brand-text); opacity: .7; }
.ward-castle rect { fill: var(--mark-1); }
.ward-lit > * { fill: var(--mark-x); }
.ward-lit { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--mark-x) 70%, transparent)); }
.ward-pole { fill: none; stroke: var(--text-2); stroke-width: 1.1; stroke-linecap: round; }
.ward-pennant { fill: var(--brand-text); transform-box: fill-box; transform-origin: 0 50%; animation: ward-wave 2.4s ease-in-out infinite alternate; }
@keyframes ward-wave { from { transform: skewY(-7deg) scaleX(.92); } to { transform: skewY(6deg) scaleX(1.04); } }
.ward-mortar { fill: var(--well); }
.ward-tower rect { fill: var(--mark-3); }
.ward-tower.is-2 rect { fill: var(--mark-4); }
/* A lit window in each tower, set in a dark frame so it shows on the pale tower too. */
.ward-frame { fill: var(--mark-1); }
.ward-window { fill: var(--mark-x); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--mark-x) 60%, transparent)); }
.ward-stone { fill: var(--tint, var(--mark-3)); fill-opacity: var(--shade, 1); }
.ward-arch { fill: var(--mark-2); }
.ward-gate { fill: var(--mark-x); filter: drop-shadow(0 0 9px color-mix(in srgb, var(--mark-x) 45%, transparent)); }
.ward-ground { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-linecap: round; }
/* Today's stone: a dashed outline that fills as you type a password, and is laid at 8 characters. */
.ward-slot { fill: none; stroke: var(--brand-text); stroke-width: 1.4; stroke-dasharray: 3 3.5; animation: ft-today 2.4s ease-in-out infinite; }
.ward-fill, .ward-laid { transform-box: fill-box; transform-origin: 50% 100%; }
.ward-fill { fill: var(--brand-text); opacity: .5; transform: scaleY(var(--fill, 0)); transition: transform .35s var(--ease-out), opacity .3s; }
.ward-laid { fill: var(--mark-4); opacity: 0; }
.ward-today.is-laid :is(.ward-slot, .ward-fill) { opacity: 0; animation: none; }
.ward-today.is-laid .ward-laid { opacity: 1; }
.ward-dust circle { fill: var(--brand-text); opacity: 0; transform-box: fill-box; transform-origin: center; }
/* The arrows: three fly in and break, the pieces of earlier ones lie at the foot of the wall. */
.ward-broken path { fill: none; stroke: var(--threat); stroke-width: 2; stroke-linecap: round; opacity: .7; }
.ward-broken .ward-head { fill: var(--threat); stroke: none; }
.ward-broken .ward-fletch { stroke-width: 1.4; }
.ward-shot, .ward-spark { opacity: 0; }
.ward-shaft { fill: none; stroke: var(--threat); stroke-width: 2.2; stroke-linecap: round; }
.ward-arrow .ward-head { fill: var(--threat); }
.ward-arrow .ward-fletch { fill: none; stroke: var(--threat); stroke-width: 1.4; stroke-linecap: round; }
.ward-spark { fill: none; stroke: var(--threat); stroke-width: 2; transform-box: fill-box; transform-origin: center; }
/* Cannonballs: an iron ball on an arc, then a burst of fire, chips and smoke where it hits. */
.ward-fly-y, .ward-boom > * { opacity: 0; }
.ward-shell { fill: var(--iron); stroke: color-mix(in srgb, var(--text) 25%, transparent); stroke-width: .8; }
.ward-shell-hi { fill: color-mix(in srgb, var(--text) 40%, transparent); }
.ward-boom > * { transform-box: fill-box; transform-origin: center; }
.ward-flash { fill: var(--fire); }
.ward-flash-in { fill: var(--fire-hot); }
.ward-rays { fill: none; stroke: var(--fire); stroke-width: 2.4; stroke-linecap: round; }
.ward-chip { fill: var(--fire); }
.ward-smoke { fill: color-mix(in srgb, var(--text-3) 55%, transparent); }
/* The armed gate: an iron portcullis with spikes, and two torches that flicker. */
.ward-portcullis path { fill: none; stroke: var(--iron); stroke-width: 2.6; stroke-linecap: round; }
.ward-portcullis .is-cross { stroke-width: 2; }
.ward-portcullis .ward-spike { fill: var(--iron); stroke: none; }
.ward-bracket { fill: var(--iron); }
.ward-flame-out { fill: var(--fire); }
.ward-flame-in { fill: var(--fire-hot); }
.ward-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: ward-flicker 1.3s ease-in-out infinite alternate; animation-delay: calc(var(--f, 0) * -.6s); filter: drop-shadow(0 0 5px color-mix(in srgb, var(--fire) 70%, transparent)); }
@keyframes ward-flicker { 0% { transform: scale(1, 1); } 35% { transform: scale(.9, 1.12) skewX(-3deg); } 70% { transform: scale(1.06, .92) skewX(2deg); } 100% { transform: scale(.95, 1.06); } }
/* Pencil notes in the margins: today's stone, and tomorrow. */
.ward-note text { fill: var(--text); font-family: var(--hand); font-size: 21px; }
.ward-note path { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; opacity: .9; }

.auth-panel { display: grid; place-items: center; margin: 0; padding: 48px 24px; }
.auth-card { display: flex; flex-direction: column; gap: 22px; width: min(400px, 100%); }
.auth-card h1 { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: .95; }
.auth-sub { margin-top: 10px; color: var(--text-2); }

.auth-setup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  color: var(--text-2);
  font-size: 14px;
}
.auth-setup code { font-size: 13px; color: var(--text); }

.social { display: flex; flex-direction: column; gap: 10px; }
/* "Continue with Google" follows Google's dark button on the dark looks: #131314 fill, a 1px #8E918F edge, #E3E3E3
   text at 14/20, the standard-colour G at 20px, 10px between the G and the words. Google asks for
   Google Sans, which it doesn't license for other sites, so the closest system fonts stand in. */
.btn-social {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 12px;
  border: 1px solid #8e918f;
  border-radius: var(--r-pill);
  background: #131314;
  color: #e3e3e3;
  font-family: "Google Sans", Roboto, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  transition: background-color .15s, transform .15s var(--ease-spring);
}
.btn-social:hover { background: #1f1f20; }
/* On Daylight's white page it's Google's light button instead: white, a #747775 edge, #1F1F1F text. */
[data-theme="daylight"] .btn-social { border-color: #747775; background: #ffffff; color: #1f1f1f; }
[data-theme="daylight"] .btn-social:hover { background: #f8f9fa; }
.btn-social svg { flex: none; }
.btn-social[disabled], .auth-form .btn[disabled] { opacity: .5; cursor: default; }
.is-busy { cursor: progress !important; }

.auth-divider { display: flex; align-items: center; gap: 14px; color: var(--text-3); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.auth-form input[type="email"], .auth-form input[type="password"], .auth-form input[type="text"] { height: 50px; font-size: 16px; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.forgot { font-size: 13px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 72px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transform: translateY(-50%);
}
.pw-toggle:hover { background: var(--raise); color: var(--text); }
.auth-note { font-size: 14px; color: var(--text-2); }
.auth-note:empty { display: none; }
.auth-switch { text-align: center; font-size: 14px; color: var(--text-3); }
.auth-switch .link-btn { font-size: 14px; color: var(--text); }
/* What signing up agrees to, under the buttons that do it. */
.auth-legal { margin-top: -6px; text-align: center; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
.auth-legal a { color: var(--text-2); text-underline-offset: 3px; }
.auth-legal a:hover { color: var(--text); }

/* ---------- Account menu ---------- */

.account { position: relative; }
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  transition: border-color .15s, transform .2s var(--ease-spring);
}
.avatar:hover { border-color: var(--text-3); transform: scale(1.05); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: 260px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  transform-origin: top right;
  animation: menu-in .2s var(--ease-out);
}
.am-name { font-weight: 600; }
.am-email { margin: 2px 0 14px; font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }

/* ---------- Settings ---------- */

/* The way in: a gear beside the account on phones and tablets (the desktop sidebar turns it into
   a row of its own, below). It turns one tooth when you point at it. */
.settings-link {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--text-2);
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease-spring);
}
.settings-link:hover { background: var(--raise); border-color: var(--text-3); color: var(--text); }
.settings-link:active { transform: scale(.94); }
.settings-link[aria-current="page"] { border-color: var(--brand-text); background: var(--raise); color: var(--brand-text); }
.settings-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.settings-ico .gear { transform-box: fill-box; transform-origin: center; transition: transform .5s var(--ease-spring); }
.settings-link:hover .gear { transform: rotate(45deg); }
.settings-label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The page: one panel per setting, in a column that stays readable on wide screens. */
.settings-list { display: grid; gap: var(--stack); max-width: 780px; }
.settings-group {
  min-width: 0;
  margin: 0;
  padding: 22px 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel);
}
.settings-group legend { float: left; width: 100%; padding: 0; }
.sg-title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.sg-hint { clear: both; max-width: 62ch; margin: 4px 0 18px; padding-top: 2px; font-size: 13px; color: var(--text-3); }

.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
/* Each card measures itself, so the tiny Myrdon inside scales with the card. */
.theme-option { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; cursor: pointer; container-type: inline-size; }
/* The real radio button covers the card, so a tap anywhere picks it and arrow keys move between them. */
.theme-option input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.to-name { font-size: 14px; font-weight: 500; color: var(--text-2); text-align: center; transition: color .15s; }
.theme-option:has(input:checked) .to-name { color: var(--text); font-weight: 600; }

/* Each card is a tiny Myrdon in its own look: the logo, the main button, a month total and a week of days. */
.to-swatch {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 5cqi;
  aspect-ratio: 5 / 4;
  padding: 7cqi;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--glow), var(--bg);
  background-size: 260% 200%;
  background-position: 50% 0;
  overflow: hidden;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow .25s var(--ease-out), transform .25s var(--ease-spring);
}
.theme-option:hover .to-swatch { transform: translateY(-2px); }
.to-mark { width: 15cqi; height: 15cqi; }
.to-btn { justify-self: end; align-self: center; width: 34%; height: 7cqi; border-radius: var(--r-pill); background: var(--primary); }
.to-net {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: start;
  font-family: var(--display);
  font-size: 12.5cqi;
  font-weight: 700;
  line-height: 1;
  letter-spacing: var(--display-track);
  font-variant-numeric: tabular-nums;
  border-radius: 4cqi;
}
.to-days { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3cqi; }
.to-days i { display: block; height: 11cqi; border-radius: 3.5cqi; background: color-mix(in srgb, var(--raise) 85%, transparent); }
.to-days i.up { background: var(--gain); }
.to-days i.down { background: var(--loss); }
.to-days i.later { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
/* The chosen look gets a ring in the accent of the look you're in now. */
.theme-option:has(input:checked) .to-swatch { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--focus); }
.theme-option:has(input:focus-visible) .to-swatch { outline: 2px solid var(--focus); outline-offset: 6px; }

/* Switching looks: the new one spreads out in a circle from the card you picked (app.js runs it
   as a view transition). Turned off for reduced motion, where the look just changes. */
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  /* Sized to its message (left: 50% would otherwise squeeze it into half the screen). */
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  text-align: center;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .25s, transform .4s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Chips: setups, mistakes and planned setups you tap on or off ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s var(--ease-spring);
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip:active { transform: scale(.95); }
.chip svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* A chosen setup is filled in the text color; a mistake in the loss red; "Followed plan" in the gain green. */
.chip[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--bg); }
.chips[data-kind="tags"] .chip[aria-pressed="true"] { border-color: var(--loss); background: var(--loss); color: var(--on-money); }
.chips[data-kind="tags"] .chip-good[aria-pressed="true"] { border-color: var(--gain); background: var(--gain); color: var(--on-money); }
.chip[aria-pressed="true"]:active { transform: scale(.95); }
.chip-add { border-style: dashed; color: var(--text-3); }
.chip-input { width: 170px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); font-size: 13px; }

/* ---------- Setup and mistakes, folded under a trade's note ---------- */

.tagger { border: 1px solid var(--line); border-radius: var(--r-md); background: color-mix(in srgb, var(--well) 55%, transparent); }
.tagger summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}
.tagger summary::-webkit-details-marker { display: none; }
.tagger summary:hover { color: var(--text); }
.tagger summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tg-title { flex: none; }
.tg-sum { flex: 1; min-width: 0; overflow: hidden; color: var(--text-3); font-weight: 400; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.tagger.has-value .tg-sum { color: var(--text); }
.tg-chev { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease-out); }
.tagger[open] .tg-chev { transform: rotate(180deg); }
.tg-body { display: grid; gap: 14px; padding: 2px 14px 16px; }
.tagger[open] .tg-body { animation: view-rise .3s var(--ease-out); }
.tg-group { display: grid; gap: 8px; }
.tg-label { font-size: 12px; font-weight: 600; color: var(--text-3); }

/* ---------- Calendar: the month's goal, today's limits, and marks on the days ---------- */

.goal { display: grid; gap: 8px; }
.goal-track { height: 8px; overflow: hidden; border-radius: var(--r-pill); background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); }
.goal-track span { display: block; width: calc(var(--p, 0) * 100%); height: 100%; border-radius: inherit; background: var(--brand); transition: width .8s var(--ease-out); }
.goal.is-done .goal-track span { background: var(--gain); }
.goal-text { font-size: 13px; color: var(--text-3); }
.goal-text strong { color: var(--text); font-weight: 600; }

.limit-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 14px 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
}
.limit-alert.is-loss { border-color: var(--danger-line); background: color-mix(in srgb, var(--loss) 18%, var(--panel)); }
.limit-alert:not([hidden]) { animation: view-rise .45s var(--ease-out); }
.limit-alert p { flex: 1; min-width: 0; }
.limit-alert strong { color: var(--text); }
.la-ico { flex: none; width: 26px; height: 26px; fill: none; stroke: var(--danger-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.limit-alert .btn { flex: none; }

/* ---------- Stats: what your mistakes cost ---------- */

.mistakes-card {
  margin-top: var(--stack);
  padding: 28px 30px 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel);
}
.mk-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; }
.mk-empty { max-width: 70ch; margin-top: 14px; color: var(--text-3); font-size: 14px; line-height: 1.55; }
.mk-empty strong { color: var(--text-2); font-weight: 600; }
.mk-total { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin-top: 24px; }
.mk-big { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1; }
.mk-big.gain, .mk-big.loss { border-radius: 14px; }
.mk-total-text { color: var(--text-2); font-size: 14px; }
.mk-rows { display: grid; margin: 24px 0 0; padding: 0; list-style: none; }
.mk-rows li {
  display: grid;
  grid-template-columns: minmax(110px, 220px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.mk-tag { display: grid; gap: 2px; min-width: 0; color: var(--text); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.mk-tag small { color: var(--text-3); font-size: 12px; font-weight: 400; }
.mk-bar { height: 10px; overflow: hidden; border-radius: var(--r-pill); background: var(--raise); }
.mk-bar span { display: block; width: calc(var(--w, 0) * 100%); min-width: 4px; height: 100%; border-radius: inherit; transform-origin: left; }
.mk-bar .is-loss { background: var(--loss); }
.mk-bar .is-gain { background: var(--gain); }
.mk-net { min-width: 84px; font-family: var(--display); font-size: 17px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.mk-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--tiles); margin: 24px 0 0; }
.mk-compare > div { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: color-mix(in srgb, var(--well) 55%, transparent); }
.mk-compare dt { color: var(--text-3); font-size: 12.5px; }
.mk-compare dd { margin: 6px 0 0; color: var(--text-2); font-size: 14px; }
.mk-compare .sv { color: var(--text); font-family: var(--display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mk-compare small { display: block; margin-top: 4px; color: var(--text-3); font-size: 12.5px; }
.mk-over { margin-top: 16px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.mk-over strong { color: var(--danger-text); }
.mistakes-card.rows-in .mk-rows li { animation: row-in .45s var(--ease-out) backwards; animation-delay: calc(var(--r, 0) * 40ms + .2s); }
.mistakes-card.rows-in .mk-bar span { animation: dim-grow .7s var(--ease-out) backwards; animation-delay: calc(var(--r, 0) * 40ms + .3s); }

/* ---------- Journal: the weekly review ---------- */

.week-review {
  margin: 0 0 calc(var(--stack) + 8px);
  padding: 28px 30px 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel);
}
.week-review:empty { display: none; }
.week-review.is-due { border-color: color-mix(in srgb, var(--brand-text) 55%, var(--line)); }
.wr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wr-kicker { color: var(--brand-text); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.wr-title { margin-top: 6px; font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.05; }
.week-review.swap-next .wr-title { animation: label-in .45s var(--ease-out); --from: 18px; }
.week-review.swap-prev .wr-title { animation: label-in .45s var(--ease-out); --from: -18px; }
.wr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 24px 0 0; }
.wr-stats > div { min-width: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: color-mix(in srgb, var(--well) 55%, transparent); }
.wr-stats dt { color: var(--text-3); font-size: 12.5px; }
.wr-stats dd { margin: 8px 0 0; font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.wr-stats small { display: block; margin-top: 6px; color: var(--text-3); font-family: var(--sans); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.wr-none { margin-top: 14px; color: var(--text-3); font-size: 14px; }
.wr-form { display: grid; gap: 20px; margin-top: 28px; }
.wr-last { padding: 10px 14px; border-left: 3px solid var(--brand-text); border-radius: 4px; background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--text); font-size: 14px; line-height: 1.5; }
.wr-last span { display: block; margin-bottom: 2px; color: var(--text-3); font-size: 12px; }
.wr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wr-answers { display: grid; gap: 14px; margin: 20px 0 16px; }
.wr-answers dt { color: var(--text-3); font-size: 12.5px; }
.wr-answers dd { max-width: 72ch; margin: 4px 0 0; color: var(--text-2); font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.wr-focus dd { color: var(--text); font-family: var(--display); font-size: 22px; line-height: 1.25; }
.review-entry { border-color: color-mix(in srgb, var(--brand-text) 30%, var(--line)); }
.rv-focus { margin-top: 12px; color: var(--text); font-family: var(--display); font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.rv-focus span { display: block; margin-bottom: 4px; color: var(--text-3); font-family: var(--sans); font-size: 12.5px; }

/* ---------- Daily plan ---------- */

.plan-nav { flex-wrap: wrap; }
.plan-day { min-width: 9.5em; }
.plan-day.swap-next { animation: label-in .4s var(--ease-out); --from: 14px; }
.plan-day.swap-prev { animation: label-in .4s var(--ease-out); --from: -14px; }
.plan-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 10px; margin: 0 0 var(--stack); padding: 0; list-style: none; }
.pw-day {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "dow mark" "num mark" "pnl pnl";
  gap: 2px 6px;
  width: 100%;
  padding: 10px 12px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-2);
  text-align: left;
  transition: border-color .15s, background-color .15s, transform .2s var(--ease-spring);
}
.pw-day:hover { border-color: var(--text-3); transform: translateY(-2px); }
.pw-day.has-plan { border-style: solid; background: color-mix(in srgb, var(--raise) 70%, transparent); }
.pw-day.is-current { border-color: var(--brand-text); box-shadow: 0 0 0 1px var(--brand-text); }
.pw-dow { grid-area: dow; color: var(--text-3); font-size: 12px; font-weight: 600; }
.pw-day.is-today .pw-dow { color: var(--brand-text); }
.pw-num { grid-area: num; color: var(--text); font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.1; }
.pw-mark { grid-area: mark; align-self: start; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.pw-mark:empty { display: none; }
.pw-mark svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.followed-yes .pw-mark { background: var(--gain); color: var(--on-money); }
.followed-no .pw-mark { border: 1px dashed var(--text-3); color: var(--text); }
.pw-pnl { grid-area: pnl; justify-self: start; margin-top: 6px; font-size: 12.5px; font-weight: 600; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; gap: var(--stack); }
.plan-grid.rows-in .plan-card { animation: view-rise .45s var(--ease-out) backwards; }
.plan-grid.rows-in .plan-card + .plan-card { animation-delay: .08s; }
.plan-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.plan-card-head .link-btn { flex: none; font-size: 13px; }
.plan-form { display: grid; gap: 22px; }
.plan-limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.money-input { position: relative; display: block; }
.money-input > span { position: absolute; top: 50%; left: 14px; color: var(--text-3); font-size: 15px; transform: translateY(-50%); pointer-events: none; }
.money-input input { padding-left: 28px; }
.watchlist { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wl-row, .sr-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 36px; align-items: center; gap: 8px; }
.wl-sym { font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.wl-sym::placeholder { font-weight: 400; letter-spacing: 0; text-transform: none; }
.wl-remove { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-3); transition: background-color .15s, color .15s; }
.wl-remove:hover { background: var(--raise); color: var(--text); }
.wl-remove svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.wl-add { justify-self: start; margin-top: 2px; }
.wl-add .btn-ico { width: 16px; height: 16px; }
.grade-seg button { font-family: var(--display); font-size: 17px; font-weight: 700; }
.plan-result { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.pr-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.pr-net { font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1; }
.pr-net.gain, .pr-net.loss { border-radius: 12px; }
.pr-meta { color: var(--text-3); font-size: 14px; }
.pr-checks { margin-top: 14px; }
.pr-checks .chk { height: auto; min-height: 28px; padding: 5px 12px 5px 9px; line-height: 1.35; white-space: normal; }
.pr-empty { color: var(--text-3); font-size: 14px; line-height: 1.5; }
.pr-checks + .pr-empty, .pr-top + .pr-empty { margin-top: 12px; }
.plan-saved { min-height: 20px; margin-top: 14px; color: var(--text-3); font-size: 13px; text-align: right; }

/* ---------- Playbook ---------- */

.pb-summary { margin: 0 0 var(--stack); }
.pb-summary[hidden] { display: none; }
.pb-summary .sv { overflow-wrap: anywhere; }
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--tiles); }
.pb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel);
  transition: border-color .2s, transform .25s var(--ease-spring), box-shadow .25s;
}
.pb-card:not(.is-found):hover { border-color: var(--line-strong); box-shadow: var(--lift); transform: translateY(-3px); }
.pb-card.is-found { border-style: dashed; border-color: var(--line-strong); background: transparent; }
.pb-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pb-name { min-width: 0; font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.pb-net { flex: none; font-family: var(--display); font-size: 20px; font-weight: 700; }
.pb-net.gain, .pb-net.loss { border-radius: 10px; }
.pb-desc { display: -webkit-box; overflow: hidden; color: var(--text-3); font-size: 14px; line-height: 1.5; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pb-spark { display: block; width: 100%; height: 52px; overflow: visible; }
.pb-line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pb-area { stroke: none; opacity: .75; }
.pb-spark.is-up .pb-area { fill: var(--gain); }
.pb-spark.is-down .pb-area { fill: var(--loss); }
.pb-zero { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.pb-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.pb-nums > div { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.pb-nums dt { color: var(--text-3); font-size: 11.5px; line-height: 1.3; }
.pb-nums dd { margin: 4px 0 0; font-family: var(--display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-none { padding-top: 12px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 14px; }
.pb-foot { color: var(--text-3); font-size: 12.5px; }
/* The whole card opens the setup. */
.pb-open { position: absolute; inset: 0; z-index: 1; width: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.pb-open:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.pb-add { position: relative; z-index: 2; align-self: flex-start; }
.pb-add svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pb-found { margin-top: calc(var(--stack) * 2); }
.pb-callout { margin-bottom: 8px; padding: 18px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--text-2); font-size: 14px; line-height: 1.5; }
.pb-callout .link-btn { padding: 0; font-size: inherit; }
.pb-untagged { max-width: 72ch; margin-top: 24px; color: var(--text-3); font-size: 14px; line-height: 1.55; }
.pb-untagged strong { color: var(--text-2); font-weight: 600; }
.pb-empty p:not(.je-title) { max-width: 52ch; line-height: 1.5; }
.pb-empty .empty-actions .btn { margin-top: 0; }
.pb-list.pb-in .pb-card { animation: view-rise .45s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 45ms + .05s); }

/* The setup popup: its numbers first, then what it looks like, your rules and example charts. */
.setup-dialog { width: min(640px, calc(100% - 24px)); }
.setup-stats { display: grid; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--well) 55%, transparent); }
.setup-stats[hidden] { display: none; }
.ss-empty { color: var(--text-3); font-size: 14px; line-height: 1.5; }
.ss-empty strong { color: var(--text-2); font-weight: 600; }
.ss-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin: 0; }
.ss-nums dt { color: var(--text-3); font-size: 11.5px; }
.ss-nums dd { margin: 4px 0 0; font-family: var(--display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ss-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ss-charts h3, .ss-sub { margin-bottom: 8px; color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.ss-bars { display: flex; align-items: flex-end; gap: 6px; height: 88px; margin: 0; padding: 0; list-style: none; }
.ss-bars li { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 4px; min-width: 0; height: 100%; }
.ss-col { display: flex; flex: 1; align-items: flex-end; width: 100%; }
.ss-bar { display: block; width: 100%; height: calc(var(--h, 0) * 100%); border-radius: 5px 5px 2px 2px; box-shadow: var(--money-edge); }
.ss-bar.is-gain { background: var(--gain); }
.ss-bar.is-loss { background: var(--loss); }
.ss-lab { color: var(--text-3); font-size: 10.5px; white-space: nowrap; }
.ss-trades { display: grid; margin: 0; padding: 0; list-style: none; }
.ss-trades li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); color: var(--text-2); font-size: 13.5px; }
.ss-trades .gain, .ss-trades .loss { font-weight: 600; }
.setup-rules { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sr-row { grid-template-columns: 26px minmax(0, 1fr) 36px; }
.sr-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--raise); color: var(--text-2); font-size: 12px; font-weight: 700; }
.entry-pics .pic-open { height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; }
.entry-pics .pic-open:hover { transform: none; }

/* ---------- Settings: risk and goals ---------- */

.goals-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.goals-saved { min-height: 18px; margin-top: 12px; }

/* The month's share button: Export's way in from the calendar (and the only one on phones). */
.month-share { text-decoration: none; }

@media (max-width: 960px) {
  .plan-grid { grid-template-columns: 1fr; }
}
@media (max-width: 719px) {
  .goals-form { grid-template-columns: 1fr; }
  .mistakes-card, .week-review { padding: 22px 18px 22px; border-radius: var(--r-lg); }
  .mk-net { min-width: 0; }
  .wr-form { gap: 18px; margin-top: 22px; }
  .mk-rows li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .mk-bar { grid-column: 1 / -1; grid-row: 2; }
  .mk-big { font-size: 34px; }
  .wr-title { font-size: 24px; }
  .wr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-week { gap: 6px; }
  .pw-day { padding: 8px 8px 10px; }
  .pw-num { font-size: 19px; }
  .wl-row { grid-template-columns: 84px minmax(0, 1fr) 36px; }
  .plan-day { min-width: 0; font-size: 19px; }
  .pb-card { padding: 18px 16px 16px; border-radius: var(--r-lg); }
  .pb-name { font-size: 22px; }
  .limit-alert { flex-wrap: wrap; }
  .limit-alert p { flex-basis: calc(100% - 40px); }
  .limit-alert .btn { margin-left: 40px; }
}

/* ---------- Motion ----------
   Motion answers something: a month builds when you open it, numbers count to their new value,
   a popup grows out of what you clicked. All of it switches off for reduced motion. */

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes view-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes label-in { from { opacity: 0; transform: translateX(var(--from, 18px)); } }
@keyframes dim-grow { from { transform: scaleX(0); } }
@keyframes pencil-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes note-in { from { opacity: 0; transform: rotate(-16deg) scale(.6); } }
@keyframes menu-in { from { opacity: 0; transform: scale(.94) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateX(-12px); } }

/* Switching tabs: the page's pieces rise in one after another. */
.view.view-in > :not(.reveal) { animation: view-rise .5s var(--ease-out) backwards; }
.view.view-in > :nth-child(2) { animation-delay: .06s; }
.view.view-in > :nth-child(3) { animation-delay: .12s; }
.view.view-in > :nth-child(4) { animation-delay: .18s; }

/* A month places its blocks one after another, sliding from the side you moved toward. */
.calendar.cal-build .day,
.calendar.cal-build .week { animation: block-in .5s cubic-bezier(.2, .9, .25, 1.15) backwards; animation-delay: calc(var(--i, 0) * 20ms + 60ms); }
.calendar.cal-build .week { animation-name: week-in; }
@keyframes block-in { from { opacity: 0; transform: translate(var(--dx, 0px), 14px) scale(.9); } }
@keyframes week-in { from { opacity: 0; transform: translateX(calc(var(--dx, 0px) + 10px)); } }
.calendar.cal-build .cal-dow > span { animation: fade-in .4s ease backwards; }
.kpis.kpis-in .kpi { animation: view-rise .45s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 50ms + .08s); }

/* ---------- The calendar's story: last month, the running total, one pattern ---------- */

.month-title .month-name { margin-right: auto; }
.cal-mode button { height: 30px; padding: 0 14px; font-size: 13px; }

/* Against last month: a chip with the difference, then what last month was. */
.month-vs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--text-3); font-size: 13.5px; line-height: 1.5; }
.month-vs .gain, .month-vs .loss { padding: 0 .35em; font-size: 12.5px; font-weight: 600; box-shadow: none; }
.vs-was { flex-basis: 100%; font-size: 12.5px; }
.vs-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--on-money);
  box-shadow: var(--money-edge);
}
.vs-chip span { font-family: var(--sans); font-size: 9px; }
.vs-chip.is-up { background: var(--gain); }
.vs-chip.is-down { background: var(--loss); }

/* The running total, drawn across the month (or the year). */
.month-line { width: 100%; height: 56px; }
.ml-svg { display: block; overflow: visible; }
.ml-zero { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.ml-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ml-svg.is-gain .ml-line, .ml-svg.is-flat .ml-line { stroke: color-mix(in srgb, var(--gain) 55%, #6fd3a3); }
.ml-svg.is-loss .ml-line { stroke: color-mix(in srgb, var(--loss) 50%, #ff8a80); }
.ml-svg.is-gain .ml-dot, .ml-svg.is-flat .ml-dot { fill: color-mix(in srgb, var(--gain) 55%, #6fd3a3); }
.ml-svg.is-loss .ml-dot { fill: color-mix(in srgb, var(--loss) 50%, #ff8a80); }
.ml-dot { stroke: var(--panel); stroke-width: 2; }
.ml-area { fill: url(#mlFill); }
.ml-svg.is-gain .ml-stop-a, .ml-svg.is-flat .ml-stop-a { stop-color: #6fd3a3; stop-opacity: .22; }
.ml-svg.is-loss .ml-stop-a { stop-color: #ff8a80; stop-opacity: .2; }
.ml-stop-b { stop-color: var(--panel); stop-opacity: 0; }
[data-theme="daylight"] .ml-svg.is-gain .ml-line, [data-theme="daylight"] .ml-svg.is-flat .ml-line { stroke: #1f7a4d; }
[data-theme="daylight"] .ml-svg.is-gain .ml-dot, [data-theme="daylight"] .ml-svg.is-flat .ml-dot { fill: #1f7a4d; }
[data-theme="daylight"] .ml-svg.is-loss .ml-line { stroke: #b42318; }
[data-theme="daylight"] .ml-svg.is-loss .ml-dot { fill: #b42318; }
.month-line.line-in .ml-line { stroke-dasharray: 2000; animation: line-draw 1.2s var(--ease-out) backwards .15s; }
.month-line.line-in :is(.ml-area, .ml-dot) { animation: fade-in .6s ease backwards .7s; }
@keyframes line-draw { from { stroke-dashoffset: 2000; } to { stroke-dashoffset: 0; } }

/* Each number's small note against last month. */
.kpi-vs { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--text-3); line-height: 1.3; }
.kpi-vs > span:first-child {
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--raise);
  color: var(--text-2);
  font-size: 8px;
}
.kpi-vs.is-up > span:first-child { background: var(--gain); color: var(--on-money); }
.kpi-vs.is-down > span:first-child { background: var(--loss); color: var(--on-money); }

/* An empty month: how to start, and how the last one went. */
.kpis.is-empty { display: block; }
.kpi-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  height: 100%;
  padding: 24px 26px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}
.ke-title { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--text); }
.ke-text { max-width: 46ch; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.ke-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ke-last { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; line-height: 1.5; }
.ke-last .gain, .ke-last .loss { padding: 0 .35em; font-weight: 600; box-shadow: none; }
.kpis.kpis-in .kpi-empty { animation: view-rise .45s var(--ease-out) backwards .08s; }

/* One pattern in your trades. */
.cal-insight {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: var(--tiles);
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 9%, transparent), transparent 60%), var(--panel);
}
.cal-insight p { flex: 1; min-width: 0; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.cal-insight strong { color: var(--text); font-weight: 600; }
.cal-insight .gain, .cal-insight .loss { padding: 0 .35em; font-weight: 600; }
.cal-insight .link-btn { flex: none; }
.ci-spark { flex: none; width: 24px; height: 24px; fill: none; stroke: var(--brand-text); stroke-width: 1.7; stroke-linecap: round; }

/* ---------- The year: a square a day ---------- */

.calendar.is-year { display: block; }
.year-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 14px; }
@container (min-width: 600px) { .year-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; } }
@container (min-width: 880px) { .year-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px 20px; } }
.ym { min-width: 0; }
.ym-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  margin: 0 0 8px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
}
.ym-name { font-size: 13.5px; font-weight: 600; }
.ym-head:hover .ym-name { text-decoration: underline; text-underline-offset: 3px; }
.ym-net { font-family: var(--display); font-size: 12.5px; font-weight: 700; padding: 0 .35em; box-shadow: none; white-space: nowrap; }
.ym-grid { display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)); gap: 3px; }
.ym-grid > span:not(.ys) { color: var(--text-3); font-size: 9px; text-align: center; line-height: 1.6; }
.ym-meta { margin-top: 7px; color: var(--text-3); font-size: 11.5px; }
.ys { display: block; aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, var(--raise) 85%, transparent); }
.ys.is-out { background: transparent; }
.ys.future { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.ys.closed { background: repeating-linear-gradient(135deg, var(--line-strong) 0 2px, transparent 2px 4px); }
.ys.today { box-shadow: 0 0 0 2px var(--brand-text); }
/* Four shades each way, from a small day to a big one. */
.ys.up.l1 { background: color-mix(in srgb, #2f9d6a 30%, var(--raise)); }
.ys.up.l2 { background: color-mix(in srgb, #2f9d6a 55%, var(--raise)); }
.ys.up.l3 { background: color-mix(in srgb, #2f9d6a 80%, var(--raise)); }
.ys.up.l4 { background: #3fbf83; }
.ys.down.l1 { background: color-mix(in srgb, #d9534a 30%, var(--raise)); }
.ys.down.l2 { background: color-mix(in srgb, #d9534a 55%, var(--raise)); }
.ys.down.l3 { background: color-mix(in srgb, #d9534a 80%, var(--raise)); }
.ys.down.l4 { background: #ef5a4f; }
.ys.zero { background: var(--text-3); }
[data-peek-date] { cursor: pointer; }
[data-peek-date]:hover { outline: 2px solid var(--text-2); outline-offset: 1px; }
.calendar.cal-build .ym { animation: view-rise .45s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 35ms + 40ms); }
.cal-key.is-year .ys { display: inline-block; }

/* ---------- A quick look at a day ---------- */

.peek {
  position: fixed;
  z-index: 60;
  width: 300px;
  max-height: calc(100vh - 24px);
  overflow: hidden auto;
  padding: 16px 16px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  color: var(--text);
  pointer-events: none;
}
[data-theme="daylight"] .peek { box-shadow: 0 18px 50px rgba(17, 22, 34, .18); }
.peek.peek-in { animation: menu-in .2s var(--ease-out); }
.peek.is-touch {
  left: 12px;
  right: 12px;
  top: auto;
  bottom: calc(var(--bar-h, 0px) + 12px + env(safe-area-inset-bottom));
  width: auto;
  max-height: 70vh;
  pointer-events: auto;
}
.pk-head { display: flex; flex-direction: column; gap: 6px; }
.pk-date { font-size: 13px; font-weight: 600; color: var(--text-2); }
.pk-result { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.pk-pnl { font-family: var(--display); font-size: 24px; font-weight: 700; }
.pk-sub { color: var(--text-3); font-size: 12.5px; }
.pk-trades { display: grid; gap: 2px; margin: 12px 0 0; padding: 0; list-style: none; }
.pk-trades li { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px auto; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.pk-time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.pk-sym { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-side { color: var(--text-3); }
.pk-tp { justify-self: end; padding: 0 .35em; font-size: 12px; font-weight: 600; box-shadow: none; }
.pk-more { margin-top: 6px; color: var(--text-3); font-size: 12px; }
.pk-note { margin-top: 12px; padding-left: 10px; border-left: 2px solid var(--line-strong); color: var(--text-2); font-size: 13px; line-height: 1.5; }
.pk-pics { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.pk-pics .pic { display: block; width: 50%; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--r-sm); background: var(--raise); }
.pk-pics img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pk-facts { display: grid; gap: 7px; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; }
.pk-facts li { display: flex; align-items: flex-start; gap: 8px; color: var(--text-2); font-size: 12.5px; line-height: 1.4; }
.pk-facts .mk-ico { flex: none; margin-top: 1px; color: var(--text-3); }
.pk-facts .day-ev { flex: none; }
.pk-hint { margin-top: 12px; color: var(--text-3); font-size: 11.5px; }
.pk-actions { display: flex; gap: 8px; margin-top: 14px; }
.pk-actions .btn { flex: 1; }


/* The month name slides in from the side you moved toward. */
.month-name.swap-next { animation: label-in .45s var(--ease-out); --from: 18px; }
.month-name.swap-prev { animation: label-in .45s var(--ease-out); --from: -18px; }
.month-net.reveal { animation: view-rise .5s cubic-bezier(.2, .7, .2, 1); }

/* The day you just changed gives a small pulse. */
.day.pulse { animation: day-pulse .75s cubic-bezier(.2, .7, .2, 1); }
@keyframes day-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--text) 45%, transparent); }
  30% { transform: scale(1.06); }
  100% { transform: scale(1); box-shadow: 0 0 0 12px transparent; }
}

/* Popups grow out of what you clicked and shrink back toward it. */
dialog.enter { animation: dlg-in .42s var(--ease-out) both; }
dialog.leave { animation: dlg-out .22s var(--ease-in) both; pointer-events: none; }
dialog.enter::backdrop { animation: fade-in .32s ease both; }
dialog.leave::backdrop { animation: fade-out .22s ease both; }
@keyframes dlg-in { from { opacity: 0; transform: scale(.82); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes dlg-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.86); } }

/* The fortress raises itself: on load, on the splash screen, and when you hover it, the two towers
   rise out of the ground one after the other, then the wall between them... */
.logo-mark .fm-t,
.logo-mark .fm-w,
.logo-mark .fm-g { transform-box: fill-box; transform-origin: 50% 100%; }
.splash .logo-mark :is(.fm-t, .fm-w),
.logo-mark.logo-build :is(.fm-t, .fm-w),
.wordmark:hover .logo-mark :is(.fm-t, .fm-w),
.auth-screen.enter .logo-mark :is(.fm-t, .fm-w) { animation: fort-rise .46s cubic-bezier(.3, .7, .4, 1.2) backwards; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes fort-rise { from { opacity: 0; transform: scaleY(.2); } 40% { opacity: 1; } }
/* ...and last, the gate lights up. */
.splash .logo-mark .fm-g,
.logo-mark.logo-build .fm-g,
.wordmark:hover .logo-mark .fm-g,
.auth-screen.enter .logo-mark .fm-g { animation: gate-light .5s .44s cubic-bezier(.2, .8, .3, 1) backwards; }
@keyframes gate-light { from { opacity: 0; transform: scaleY(.35); } }

/* Stats rise in turn while their numbers count up; the equity curve draws itself. */
.stats.stats-in .stat { animation: view-rise .5s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 50ms + .1s); }
.chart.draw .line-gain,
.chart.draw .line-loss { stroke-dasharray: 1; animation: pencil-draw 1.3s .15s cubic-bezier(.45, 0, .2, 1) backwards; }
.chart.draw .area-gain,
.chart.draw .area-loss { animation: fade-in .7s .9s ease backwards; }
.chart.draw .grid,
.chart.draw .axis-label { animation: fade-in .5s ease backwards; }
.chart.draw .zero { animation: dim-grow .7s cubic-bezier(.2, .8, .2, 1) backwards; transform-box: fill-box; transform-origin: center; }

/* Journal entries rise in one after another; a saved entry gives a small pulse. */
.entries-in .entry { animation: view-rise .5s var(--ease-out) backwards; animation-delay: calc(min(var(--r, 0), 8) * 45ms + .08s); }
.entry.entry-saved { animation: entry-pulse .9s var(--ease-out); }
@keyframes entry-pulse {
  0% { border-color: var(--brand-text); box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-text) 45%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; }
}

/* Trades this month: rows slide in top to bottom. */
.rows-in tbody tr { animation: row-in .45s var(--ease-out) backwards; animation-delay: calc(var(--r, 0) * 35ms + .15s); }

/* Sections lower down rise into view the first time you scroll to them. */
html.motion .reveal { transition: opacity .7s ease, transform .7s var(--ease-out); }
html.motion .reveal:not(.is-in) { opacity: 0; transform: translateY(24px); }

/* Day panel: entries slide in, and the sign flips when you switch Made/Lost. */
.day-panel.enter .dp-entries li { animation: row-in .4s var(--ease-out) backwards; animation-delay: calc(var(--r, 0) * 45ms + .18s); }
.amount-sign.flip { animation: sign-flip .45s var(--ease-spring); }
@keyframes sign-flip {
  0% { transform: none; }
  40% { transform: rotateX(90deg) scale(.8); opacity: .3; }
  100% { transform: none; }
}


.export-preview canvas.canvas-in { animation: canvas-in .5s var(--ease-out); }
@keyframes canvas-in { from { opacity: .35; transform: translateY(8px) scale(.975); } }

.sample-banner.leaving { animation: banner-out .32s var(--ease-in) forwards; }
@keyframes banner-out { to { opacity: 0; transform: translateY(-10px) scale(.98); } }

/* The sign-in screen assembles itself: brand side, then the form row by row, then the wall goes
   up, the sun rises behind it, the arrows break on it, and the pencil notes point things out. */
.auth-screen.enter .auth-card > * { animation: auth-in .55s var(--ease-out) backwards; }
.auth-screen.enter .auth-card > :nth-child(2) { animation-delay: .05s; }
.auth-screen.enter .auth-card > :nth-child(3) { animation-delay: .1s; }
.auth-screen.enter .auth-card > :nth-child(4) { animation-delay: .15s; }
.auth-screen.enter .auth-card > :nth-child(5) { animation-delay: .2s; }
.auth-screen.enter .auth-card > :nth-child(6) { animation-delay: .25s; }
.auth-screen.enter .auth-card > :nth-child(7) { animation-delay: .3s; }
.auth-screen.enter .auth-brand > * { animation: auth-in .7s var(--ease-out) backwards; }
.auth-screen.enter .auth-brand > :nth-child(2) { animation-delay: .06s; }
.auth-screen.enter .auth-brand > :nth-child(3) { animation-delay: .12s; }
.auth-screen.enter .ward-tower { animation: view-rise .6s .25s var(--ease-out) backwards; }
.auth-screen.enter .ward-stone, .auth-screen.enter .ward-today { transform-box: fill-box; transform-origin: 50% 100%; animation: fort-rise .46s cubic-bezier(.3, .7, .4, 1.2) backwards; animation-delay: calc(.3s + var(--i, 0) * 24ms); }
.auth-screen.enter :is(.ward-arch, .ward-gate) { animation: fade-in .6s .9s ease backwards; }
.auth-screen.enter .ward-land { animation: fade-in .7s .2s ease backwards; }
.auth-screen.enter .ward-road { animation: fade-in .6s 1s ease backwards; }
.auth-screen.enter .ward-paver { animation: fade-in .35s ease backwards; animation-delay: calc(1.1s + var(--p, 0) * 80ms); }
.auth-screen.enter .ward-castle { animation: view-rise .7s 1.9s var(--ease-out) backwards; }
.auth-screen.enter .ward-sun { animation: ward-rise 1.4s 2.1s cubic-bezier(.2, .7, .2, 1) backwards; }
@keyframes ward-rise { from { opacity: 0; transform: translateY(46px); } }
/* The arrows and cannonballs are flown by landing.js: a barrage once the wall is up, then a shot
   every few seconds. The pieces at the wall's foot show up after the barrage. */
.auth-screen.enter :is(.ward-portcullis, .ward-torch) { animation: fade-in .5s 1.1s ease backwards; }
.auth-screen.enter .ward-broken { animation: fade-in .6s 3.4s ease backwards; }
.auth-screen.enter .ward-note { animation: fade-in .5s 3.8s ease backwards; }
.auth-screen.enter .ward-note.is-tomorrow { animation-delay: 4.2s; }
.auth-screen.enter .ward-note path { animation: pencil-draw .55s 4s cubic-bezier(.45, 0, .2, 1) backwards; }
.auth-screen.enter .ward-note.is-tomorrow path { animation-delay: 4.4s; }
.swap-next { animation: label-in .4s var(--ease-out); --from: 14px; }
.auth-screen.leave { animation: auth-out .26s ease both; }
@keyframes auth-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes auth-out { to { opacity: 0; transform: scale(.985); } }
#appShell.enter { animation: fade-in .35s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Desktop: the top bar becomes a sidebar ---------- */

@media (min-width: 1024px) {
  #appShell { padding-left: var(--side-w); }
  .topbar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side-w);
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 24px 16px 18px;
    border-bottom: 0;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 55%, var(--bg));
  }
  .wordmark { align-self: flex-start; padding: 0 8px; margin-bottom: 18px; }
  /* Log trade sits right under the logo; the account drops to the bottom. */
  .top-actions { display: contents; }
  #logTradeBtn { order: 1; width: 100%; height: 46px; margin-bottom: 8px; font-size: 15px; }
  #importBtn { order: 1; width: 100%; height: 42px; margin-bottom: 14px; }
  .tabs { order: 2; flex-direction: column; gap: 2px; }
  .tab { height: 46px; padding: 0 14px; gap: 12px; border-radius: var(--r-md); font-size: 15px; }
  .tab-ink { border-radius: var(--r-md); }
  .tab-ink::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 50%;
    width: 4px;
    height: 22px;
    border-radius: 0 4px 4px 0;
    background: var(--brand-text);
    transform: translateY(-50%);
  }
  /* Settings gets a row of its own at the bottom of the sidebar, like a tab, just above the account. */
  .settings-link {
    order: 3;
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    height: 46px;
    margin-top: auto;
    padding: 0 14px;
    border: 0;
    border-radius: var(--r-md);
    color: var(--text-3);
    font-size: 15px;
    font-weight: 500;
  }
  .settings-link:hover { background: transparent; color: var(--text); }
  .settings-link[aria-current="page"] { background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); }
  .settings-link[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 50%;
    width: 4px;
    height: 22px;
    border-radius: 0 4px 4px 0;
    background: var(--brand-text);
    transform: translateY(-50%);
  }
  .settings-ico { width: 19px; height: 19px; stroke-width: 1.7; }
  .settings-label { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
  .account { order: 4; margin-top: 10px; padding: 0 2px; }
  .account-menu { top: auto; right: auto; left: 0; bottom: calc(100% + 10px); transform-origin: bottom left; }
}

/* ---------- Tablet and below ---------- */

/* Tablets: the logo and buttons share the first row, and the tabs get a row of their own. */
@media (min-width: 720px) and (max-width: 1023px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; padding-bottom: 10px; }
  .tabs { order: 3; flex: 1 0 100%; margin: 0 -4px; gap: 2px; }
  /* Six tabs share the row. */
  .tab { gap: 6px; padding: 0 10px; font-size: 13.5px; }
}
@media (min-width: 720px) and (max-width: 819px) {
  .tab { gap: 5px; padding: 0 8px; font-size: 13px; }
  .tab-ico { width: 17px; height: 17px; }
}

/* In the top bar there's only room for Import's icon; its name stays for screen readers. */
@media (max-width: 1023px) {
  #importBtn { width: 42px; padding: 0; }
  #importBtn .btn-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}

/* When the result can't sit beside the four numbers, they line up in one row under it. */
@media (max-width: 1100px) {
  .month-hero { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

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

@media (max-width: 860px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-brand { padding: 22px 20px 14px; border-right: 0; gap: 0; background: none; }
  .ward, .auth-pitch .pitch-sub { display: none; }
  .auth-pitch { margin-top: 24px; }
  .pitch-kicker { margin-bottom: 6px; font-size: 11px; }
  .auth-pitch .pitch-title { color: var(--text-2); font-size: clamp(22px, 6.2vw, 30px); line-height: 1.1; }
  .auth-panel { align-items: start; padding: 18px 20px 40px; }

  .export-layout { grid-template-columns: 1fr; gap: 20px; }
  .export-preview { order: -1; padding: 16px; }
  .export-preview canvas { max-height: 62vh; }
  .export-controls { position: static; }
}

/* On short laptop screens the wall shrinks so the whole side fits without scrolling. */
@media (max-height: 820px) and (min-width: 861px) {
  .auth-brand { gap: 24px; padding-top: 32px; padding-bottom: 36px; }
  .ward { width: min(360px, 100%); }
  .auth-screen .auth-panel { padding-top: 24px; padding-bottom: 24px; }
}

/* ---------- Phones: the tabs become a bottom bar ---------- */

@media (max-width: 719px) {
  :root { --stack: 20px; --tiles: 12px; }
  body { font-size: 16px; }
  #appShell { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
  /* No blur here: a blurred parent would trap the fixed bottom bar inside the top bar. */
  .topbar { gap: 12px; padding: 10px 16px; background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .wordmark { font-size: 25px; gap: 7px; }
  .wordmark .logo-mark { width: 28px; height: 28px; }
  .top-actions .btn { height: 40px; padding: 0 14px; font-size: 13px; }
  .top-actions { gap: 8px; }
  .settings-group { padding: 18px 16px 20px; border-radius: var(--r-lg); }
  .theme-options { gap: 10px; }
  .to-name { font-size: 13px; }
  #importBtn { display: none; }
  .import-inline { display: inline-flex; }

  .traits li { grid-template-columns: 96px minmax(0, 1fr) 42px; gap: 10px; }
  .rule-row { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; }
  .rule-meta { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .rule-selects { grid-template-columns: 1fr; }
  .section-actions { gap: 10px; }
  .section-actions .link-btn { display: none; }
  .level-stats { gap: 8px; }
  .level-stats > div { padding: 12px; }
  .level-stats dd { font-size: 24px; }
  .level-card { padding: 18px; border-radius: var(--r-lg); }
  .day-xp > li { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; }
  .dx-checks { grid-column: 1 / -1; }
  .dx-pnl { justify-self: end; }
  .dx-xp { grid-column: 1 / -1; font-size: 17px; }
  .badges { grid-template-columns: 1fr; }
  .im-steps li { font-size: 14px; }
  .drop { min-height: 150px; }
  .im-count { font-size: 21px; }
  .im-review .modal-foot .btn-primary { flex: 1; }

  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    height: calc(var(--bar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .tab { position: relative; flex-direction: column; justify-content: center; gap: 3px; height: var(--bar-h); padding: 0; border-radius: 0; font-size: 11.5px; }
  /* All six tabs fit across a phone. */
  .tab-ico { width: 22px; height: 22px; }
  .tabs:not(.has-ink) .tab[aria-current="page"] { background: none; }
  /* In the bottom bar the highlight is a pill behind the icon. */
  .tab-ink { background: none; box-shadow: none; border-radius: 0; }
  .tab-ink::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 7px;
    width: min(54px, 90%);
    height: 30px;
    border-radius: var(--r-pill);
    background: var(--raise);
    box-shadow: inset 0 0 0 1px var(--line);
    transform: translateX(-50%);
  }
  .toast { bottom: calc(var(--bar-h) + 16px + env(safe-area-inset-bottom)); }

  main { padding-bottom: 40px; }
  .month-head, .trades-head { padding-top: 22px; }
  .month-hero { margin-top: 22px; }
  .month-result { padding: 20px; border-radius: var(--r-lg); }
  .month-net { font-size: min(15vw, 14cqi); }
  .month-net.gain, .month-net.loss { border-radius: 16px; }
  .kpi, .stat { padding: 14px 14px 16px; }
  .kpi dd, .stat dd { font-size: 26px; }
  .kpis, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .sheet { padding: 16px 10px 14px; border-radius: var(--r-lg); }
  .equity-card { padding: 20px 16px 14px; border-radius: var(--r-lg); }
  .equity-net { font-size: 36px; }
  .chart-lg { height: 220px; }
  .calendar { gap: 4px; }
  .cal-dow { padding-left: 2px; font-size: 11px; }
  .cal-dow.week-col { padding-left: 8px; }
  .day { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; min-height: 68px; padding: 7px 6px 7px; border-radius: var(--r-sm); }
  .week { min-height: 68px; margin-left: 2px; padding: 7px 0 8px 6px; gap: 4px; }
  .day-pnl { font-size: 16px; }
  .week-pnl { font-size: 14px; }
  .day-meta, .week-meta, .week-best { display: none; }
  .day-num { font-size: 11px; }
  .day-top { gap: 3px; }
  .day-ev { height: 13px; padding: 0 3px; border-radius: 4px; font-size: 8.5px; letter-spacing: 0; }
  .day-closed { font-size: 10.5px; }
  .day-marks { grid-column: 1; grid-row: 4; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: 4px; }
  .day-marks .mk-ico { width: 9px; height: 9px; stroke-width: 2.6; }
  .wk-review { font-size: 10.5px; gap: 2px; }
  .wk-review svg { width: 12px; height: 12px; }
  .cal-dow { min-height: 22px; gap: 2px; }
  .dow-avg { padding: 1px 3px; border-radius: 4px; font-size: 10px; }
  .cal-key { gap: 7px 14px; margin-top: 14px; padding: 12px 4px 0; font-size: 11.5px; }
  .cal-key .mk-ico { width: 13px; height: 13px; stroke-width: 2.1; }
  .cal-key .day-ev { height: 16px; padding: 0 5px; font-size: 10px; }
  .month-title { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 8px; }
  .month-title .month-name { grid-column: 1 / -1; }
  .month-title .month-nav { justify-self: end; gap: 6px; }
  .kpi-empty { padding: 18px; border-radius: var(--r-lg); }
  .ke-title { font-size: 22px; }
  .cal-insight { flex-wrap: wrap; gap: 10px 12px; padding: 14px 16px; }
  .cal-insight p { flex-basis: calc(100% - 40px); }
  .cal-insight .link-btn { margin-left: 36px; }
  .month-line { height: 44px; }
  .v-full { display: none; }
  .v-compact { display: inline; }
  .icon-btn { width: 44px; height: 44px; }
  /* The trade table drops the time on phones so the money always shows. */
  .t-time { display: none; }
  th, td { padding: 0 10px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }

  input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], select, textarea { font-size: 16px; }
  .modal form { padding: 18px; }
  .foot-actions { width: 100%; }
  .foot-actions .btn-primary { flex: 1; }
  .sample-banner { flex-direction: column; align-items: flex-start; }

  .entry { padding: 16px 16px 18px; }
  .entry-date time { font-size: 22px; }
  .entry-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .entry-photos[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
  .journal-empty { padding: 44px 20px; }
  .pic-remove { width: 36px; height: 36px; }
  .lb-top { padding: 10px 10px 10px 16px; }
  .lb-frame { padding: 0 8px 8px; }
  .lb-prev { left: 14px; }
  .lb-next { right: 14px; }
}

/* On phones the day panel is a bottom sheet that slides up and back down. */
@media (max-width: 600px) {
  .day-panel,
  .entry-dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-bottom: 0;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .entry-dialog { max-height: calc(100dvh - 24px); }
  .day-panel.enter, .entry-dialog.enter { animation: sheet-up .44s var(--ease-out) both; }
  .day-panel.leave, .entry-dialog.leave { animation: sheet-down .26s var(--ease-in) both; }
  .date-trigger, .dp-sheet { width: 100%; }
  .dp-day { height: 42px; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { from { transform: none; } to { transform: translateY(100%); } }

/* The narrowest phones: the tab names get a little smaller so all six fit. */
@media (max-width: 380px) {
  .tab { font-size: 10.5px; letter-spacing: -.01em; }
}

/* =====================================================================================
   Accounts, prop firm challenges, imports from any broker, how you feel, and the fortress
   ===================================================================================== */

/* Status colors for a prop firm challenge: on track and close to a limit. */
:root, [data-theme="gold"], [data-theme="graphite"] { --ok: #4cc38a; --warn: #f0b545; }
[data-theme="daylight"] { --ok: #12804c; --warn: #a35f00; }

/* ---------- The account bar ---------- */

.acct-bar {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  max-width: calc(var(--max) - 2 * var(--gutter));
  width: calc(100% - 2 * var(--gutter));
  margin: 20px auto 0;
}
.acct-bar:not([hidden]) { animation: view-rise .45s var(--ease-out); }
.acct-pick { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; }
.acct-label { flex: none; color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: 100%;
  height: 40px;
  padding: 0 12px 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  transition: border-color .15s, background-color .2s, transform .15s var(--ease-spring);
}
.acct-btn:hover, .acct-btn[aria-expanded="true"] { border-color: var(--text-3); background: var(--raise); }
.acct-btn:active { transform: scale(.97); }
.acct-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.acct-btn.acct-swap { animation: pic-in .35s var(--ease-spring); }
.acct-name { min-width: 0; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-chev { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--text-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease-spring); }
.acct-btn[aria-expanded="true"] .acct-chev { transform: rotate(180deg); }
.acct-dot { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.acct-dot.is-warn { background: var(--warn); }
.acct-dot.is-failed { background: var(--danger-text); }
.acct-dot.is-passed { background: var(--brand-text); }
.acct-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: min(330px, calc(100vw - 2 * var(--gutter)));
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  transform-origin: top left;
}
.acct-pop.menu-in { animation: menu-in .2s var(--ease-out); }
.acct-menu { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.acct-menu [role="option"] { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); cursor: pointer; transition: background-color .15s; }
.acct-menu [role="option"]:hover, .acct-menu [role="option"]:focus { outline: none; background: var(--raise); }
.acct-menu [role="option"]:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.ao-main { display: grid; flex: 1; gap: 2px; min-width: 0; }
.ao-name { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.ao-sub { color: var(--text-3); font-size: 12.5px; }
.acct-check { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--brand-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.acct-menu [aria-selected="true"] .acct-check { visibility: visible; }
.acct-manage { display: block; margin-top: 4px; padding: 11px 12px 9px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.acct-manage:hover { color: var(--text); }

/* ---------- Prop firm challenge (calendar) ---------- */

.prop-card {
  margin-top: var(--stack);
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel);
}
.prop-card:not([hidden]) { animation: view-rise .45s var(--ease-out); }
.prop-card .side-title { font-size: 19px; }
.pc-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; }
.pc-kicker { margin-bottom: 4px; color: var(--brand-text); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.pc-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--ok) 50%, transparent);
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.pc-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.pc-status.is-warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.pc-status.is-warn::before { background: var(--warn); }
.pc-status.is-failed { border-color: var(--danger-line); color: var(--danger-text); }
.pc-status.is-failed::before { background: var(--danger-text); }
.pc-status.is-passed { border-color: color-mix(in srgb, var(--brand-text) 55%, transparent); color: var(--brand-text); }
.pc-status.is-passed::before { background: var(--brand-text); }
.pc-balance { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-top: 18px; }
.pc-big { color: var(--text); font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.pc-sub { color: var(--text-3); font-size: 13.5px; }
.pc-alert, .pc-win { margin-top: 16px; padding: 12px 16px; border-radius: var(--r-md); color: var(--text); font-size: 14px; line-height: 1.5; }
.pc-alert { border: 1px solid var(--danger-line); background: color-mix(in srgb, var(--loss) 18%, var(--panel)); }
.pc-win { border: 1px solid color-mix(in srgb, var(--brand-text) 45%, transparent); background: color-mix(in srgb, var(--brand) 12%, var(--panel)); }
.pc-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; }
.pc-rows li { display: grid; align-content: start; gap: 7px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: color-mix(in srgb, var(--well) 55%, transparent); }
.pc-label { color: var(--text-3); font-size: 12.5px; }
.pc-value { order: 1; color: var(--text); font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.pc-bar { order: 2; height: 8px; overflow: hidden; border-radius: var(--r-pill); background: var(--raise); }
.pc-bar > span { display: block; width: calc(var(--p, 0) * 100%); height: 100%; border-radius: inherit; background: var(--text-2); transform-origin: left; animation: dim-grow .8s var(--ease-out) backwards .15s; }
.pc-bar.is-gain > span { background: var(--ok); }
.pc-bar.is-loss > span { background: var(--danger-text); }
.pc-note { order: 3; color: var(--text-3); font-size: 12.5px; line-height: 1.4; }
.pc-foot { margin-top: 16px; color: var(--text-3); font-size: 13px; line-height: 1.5; }
.pc-foot .link-btn { margin-left: 4px; font-size: 13px; }
.pc-empty { max-width: 62ch; margin: 12px 0 16px; color: var(--text-2); font-size: 14px; line-height: 1.55; }

/* ---------- Accounts (Settings) ---------- */

.sg-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.sg-head .sg-hint { margin-bottom: 0; }
.acct-list { display: grid; margin: 18px 0 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--well) 45%, transparent); overflow: hidden; }
.acct-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 14px 16px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.acct-row:first-child { border-top: 0; }
.acct-main { display: grid; flex: 1 1 240px; gap: 2px; min-width: 0; }
.acct-main strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.acct-main span { color: var(--text-3); font-size: 13px; }
.acct-note { color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.acct-row .pc-status { padding: 4px 10px; font-size: 12px; }

.account-dialog { width: min(560px, calc(100% - 24px)); }
.prop-rules { display: grid; gap: 16px; min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--well) 50%, transparent); }
.prop-rules:not([hidden]) { animation: view-rise .35s var(--ease-out); }
.prop-rules legend { float: left; width: 100%; padding: 0; }
.prop-rules > .field-hint { margin-top: -10px; }
.prop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pct-input { position: relative; display: block; }
.pct-input > span { position: absolute; top: 50%; right: 14px; color: var(--text-3); font-size: 15px; transform: translateY(-50%); pointer-events: none; }
.pct-input input { padding-right: 32px; }
.check-row { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; cursor: pointer; }
.check-row input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.dp-account select, .im-account select { height: 42px; }

/* ---------- Import: where the trades are from, and any other file ---------- */

.im-pick > .field { margin-bottom: 18px; }
.im-brokers .chip { height: 32px; }
.im-steps.rows-in li { animation: row-in .4s var(--ease-out) backwards; animation-delay: calc(var(--r, 0) * 45ms); }
.im-map { display: flex; flex-direction: column; gap: 16px; }
.im-map-lede { color: var(--text-2); font-size: 15px; line-height: 1.5; }
.im-map .seg button { height: auto; min-height: 36px; padding: 7px 12px; line-height: 1.25; }
.im-map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.im-sample { max-height: none; }
.im-sample th, .im-sample td { height: 36px; font-size: 13px; white-space: nowrap; }
.im-map .modal-foot { padding-top: 16px; }
.im-map.im-in > * { animation: view-rise .4s var(--ease-out) backwards; }
.im-map.im-in > :nth-child(2) { animation-delay: .05s; }
.im-map.im-in > :nth-child(3) { animation-delay: .1s; }
.im-map.im-in > :nth-child(4) { animation-delay: .15s; }

/* ---------- How you feel (plan) ---------- */

.feel-rows { display: grid; gap: 8px; }
.feel-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 12px; }
.feel-name { color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.feel-seg button { height: 32px; padding: 0 6px; font-size: 13px; white-space: nowrap; }
/* A hint written as a span sits in the hint color, not the label's. */
.field > .field-hint { color: var(--text-3); font-weight: 400; }

/* ---------- How you feel, and how you trade (stats) ---------- */

.feel-card {
  margin-top: var(--stack);
  padding: 28px 30px 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel);
}
.fl-lead { max-width: 64ch; margin-top: 18px; color: var(--text); font-size: 17px; line-height: 1.6; }
.fl-lead .gain, .fl-lead .loss { font-size: 15px; font-weight: 600; }
.fl-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--tiles); margin: 22px 0 0; padding: 0; list-style: none; }
.fl-row { display: grid; align-content: start; gap: 14px; padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: color-mix(in srgb, var(--well) 55%, transparent); }
.fl-row h3 { display: grid; gap: 2px; color: var(--text); font-size: 15px; font-weight: 600; }
.fl-row h3 small { color: var(--text-3); font-size: 12px; font-weight: 400; }
.fl-side { display: grid; gap: 6px; }
.fl-name { color: var(--text-3); font-size: 12.5px; }
.fl-bar { position: relative; height: 8px; border-radius: var(--r-pill); background: var(--raise); }
.fl-bar::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: 50%; width: 1px; background: var(--line-strong); }
.fl-bar > span { position: absolute; top: 0; bottom: 0; width: calc(var(--w, 0) * 50%); min-width: 3px; border-radius: var(--r-pill); }
.fl-bar .is-gain { left: 50%; background: var(--gain); box-shadow: var(--money-edge); transform-origin: left; }
.fl-bar .is-loss { right: 50%; background: var(--loss); box-shadow: var(--money-edge); transform-origin: right; }
.fl-value { color: var(--text-2); font-size: 13.5px; }
.fl-value .gain, .fl-value .loss { font-size: 13px; font-weight: 600; }
.fl-value small { display: block; margin-top: 3px; color: var(--text-3); font-size: 12px; }
.fl-foot { margin-top: 16px; color: var(--text-3); font-size: 13px; }
.feel-card .mk-empty a { color: var(--brand-text); }
.feel-card.rows-in .fl-row { animation: row-in .45s var(--ease-out) backwards; animation-delay: calc(var(--r, 0) * 60ms + .2s); }
.feel-card.rows-in .fl-bar > span { animation: dim-grow .7s var(--ease-out) backwards; animation-delay: calc(var(--r, 0) * 60ms + .35s); }

/* ---------- Your fortress (Mastery) ---------- */

.fortress {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin-top: 18px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel);
}
.ft-art { min-width: 0; }
.ft-svg { display: block; width: 100%; max-width: 500px; height: auto; margin: 0 auto; overflow: visible; }
.ft-stone rect { fill: var(--tint, var(--mark-3)); fill-opacity: var(--shade, 1); }
.ft-stone.is-cracked rect { fill-opacity: .34; stroke: color-mix(in srgb, var(--danger-text) 55%, transparent); stroke-width: 1; }
.ft-crack { fill: none; stroke: var(--danger-text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ft-slot rect { fill: none; stroke-width: 1.1; }
.ft-slot.is-gap rect { fill: color-mix(in srgb, var(--well) 35%, transparent); stroke: color-mix(in srgb, var(--text-3) 38%, transparent); }
.ft-slot.is-future rect { stroke: var(--line-strong); stroke-dasharray: 3 3.5; }
.ft-slot.is-today rect { fill: color-mix(in srgb, var(--brand) 12%, transparent); stroke: var(--brand-text); stroke-dasharray: 3 3.5; animation: ft-today 2.4s ease-in-out infinite; }
@keyframes ft-today { 50% { opacity: .45; } }
.ft-shell rect { fill: none; stroke: var(--line-strong); stroke-width: 1.1; stroke-dasharray: 3 3.5; }
.ft-fill rect { fill: var(--mark-3); }
.ft-tower.is-2 .ft-fill rect { fill: var(--mark-4); }
.ft-slit { fill: var(--mark-x); }
.ft-crown rect { fill: none; stroke: var(--line-strong); stroke-width: 1.1; stroke-dasharray: 3 3.5; }
.ft-crown.is-strong rect { fill: var(--mark-4); stroke: none; }
.ft-pole { fill: none; stroke: var(--text-2); stroke-width: 1.6; stroke-linecap: round; }
.ft-pennant { fill: var(--mark-x); }
.ft-ground { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-linecap: round; }
.ft-svg.is-building .ft-stone { transform-box: fill-box; transform-origin: 50% 100%; animation: fort-rise .46s cubic-bezier(.3, .7, .4, 1.2) backwards; animation-delay: calc(var(--i, 0) * 26ms + .1s); }
.ft-svg.is-building .ft-fill { animation: fade-in .7s ease backwards .2s; }
.ft-svg.is-building :is(.ft-crown, .ft-flag) { animation: view-rise .5s var(--ease-out) backwards .75s; }
.ft-info { display: grid; align-content: center; gap: 14px; min-width: 0; }
.ft-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; color: var(--text-2); font-size: 14px; }
.ft-big { color: var(--text); font-family: var(--display); font-size: 48px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ft-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.ft-stats > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: color-mix(in srgb, var(--well) 55%, transparent); }
.ft-stats dt { color: var(--text-3); font-size: 12px; }
.ft-stats dd { margin: 4px 0 0; color: var(--text); font-family: var(--display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ft-say { color: var(--text); font-size: 15px; line-height: 1.5; }
.ft-key { display: grid; gap: 7px; margin: 2px 0 0; padding: 0; list-style: none; }
.ft-key li { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; }
.ft-key svg { flex: none; width: 22px; height: 14px; overflow: visible; }
.ft-key .ft-stone { --tint: var(--mark-3); }

@media (max-width: 860px) {
  .fortress { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .ft-svg { max-width: 440px; }
}

@media (max-width: 719px) {
  .acct-bar { margin-top: 14px; }
  .acct-btn { height: 38px; font-size: 14px; }
  .prop-card, .feel-card { padding: 20px 16px 22px; border-radius: var(--r-lg); }
  .pc-big { font-size: 34px; }
  .pc-rows { gap: 8px; margin-top: 16px; }
  .pc-rows li { gap: 5px; padding: 12px 14px; }
  .pc-value { font-size: 17px; }
  .fortress { padding: 18px 16px 20px; border-radius: var(--r-lg); }
  .ft-big { font-size: 40px; }
  .ft-stats > div { padding: 10px 12px; }
  .ft-stats dd { font-size: 19px; }
  .fl-lead { font-size: 16px; }
  .im-map-grid { grid-template-columns: minmax(0, 1fr); }
  .feel-row { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .feel-seg button { padding: 0 2px; font-size: 12.5px; }
  .prop-rules { padding: 14px; }
}

@media (max-width: 380px) {
  .feel-seg button { font-size: 11.5px; letter-spacing: -.01em; }
  .prop-grid { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================================
   Myrdon Wrapped, charts on trades, reminders, and Myrdon as an app
   ===================================================================================== */

/* ---------- Charts on a trade (day panel and edit popup) ---------- */

.chart-field .chart-pics { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.chart-pics .pic-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.chart-add { display: flex; align-items: stretch; gap: 8px; }
.chart-drop {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 10px 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--well) 60%, transparent);
  color: var(--text-3);
  font-size: 13.5px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.chart-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.chart-drop > :not(input) { pointer-events: none; }
.chart-drop:hover, .chart-field.is-over .chart-drop { border-color: var(--brand-text); background: color-mix(in srgb, var(--brand) 12%, var(--well)); color: var(--text-2); }
.chart-field.is-over .chart-drop { border-style: solid; }
.chart-drop:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.chart-ico { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--brand-text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chart-paste { flex: none; align-self: center; }
kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--raise);
  color: var(--text-2);
  font: 600 12px/1.45 var(--sans);
  text-align: center;
}
.sym-chart { width: 14px; height: 14px; margin-left: 6px; vertical-align: -2px; fill: none; stroke: var(--text-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Reminders ---------- */

.remind-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 18px;
  padding: 12px 14px 12px 18px;
  border: 1px solid color-mix(in srgb, var(--brand-text) 45%, var(--line));
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
}
.remind-bar:not([hidden]) { animation: view-rise .45s var(--ease-out); }
.remind-bar p { flex: 1 1 220px; min-width: 0; }
.remind-bar strong { color: var(--text); }
.la-ico.rm-ico { stroke: var(--brand-text); }
.rm-actions { display: flex; flex: none; align-items: center; gap: 14px; }

.rm-rows { display: grid; gap: 10px; }
.rm-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: color-mix(in srgb, var(--well) 45%, transparent); }
.rm-switch { display: flex; flex: 1 1 220px; align-items: center; gap: 14px; min-width: 0; cursor: pointer; }
.rm-switch input {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: var(--r-pill);
  background: var(--raise);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color .2s;
}
.rm-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-3); transition: transform .25s var(--ease-spring), background-color .2s; }
.rm-switch input:checked { background: var(--primary); box-shadow: none; }
.rm-switch input:checked::after { background: var(--on-primary); transform: translateX(18px); }
.rm-switch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.rm-text { display: grid; gap: 2px; min-width: 0; }
.rm-text strong { color: var(--text); font-size: 15px; font-weight: 600; }
.rm-text span { color: var(--text-3); font-size: 13px; }
.rm-row input[type="time"] { flex: none; width: 132px; }
.rm-row input[type="time"]:disabled { opacity: .45; }
.rm-head { margin: 22px 0 6px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.rm-ways { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rm-ways li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rm-way { flex: 1 1 260px; color: var(--text-3); font-size: 13.5px; line-height: 1.5; }
.rm-way strong { color: var(--text); font-weight: 600; }
#remindNotifyState { color: var(--text-2); }

/* ---------- Myrdon as an app ---------- */

.app-state { display: flex; align-items: flex-start; gap: 12px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.app-state strong { color: var(--text); }
.app-ok { flex: none; width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: var(--ok); fill: none; stroke: #ffffff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.app-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.app-note { margin-top: 12px; }
.app-steps + .field-hint { margin-top: 10px; }

/* ---------- Myrdon Wrapped: the card on Export, and the player ---------- */

.wrapped-btn .btn-ico, .wc-actions .btn-ico { fill: currentColor; stroke: none; }
.wrapped-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px 32px;
  margin: 0 0 var(--stack);
  padding: 26px 30px;
  border: 1px solid color-mix(in srgb, var(--brand-text) 35%, var(--line));
  border-radius: var(--r-xl);
  background: radial-gradient(600px 300px at 88% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%), linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel);
}
.wc-text { min-width: 0; }
.wc-title { margin-top: 6px; color: var(--text); font-family: var(--display); font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; line-height: 1.05; }
.wc-lede { max-width: 52ch; margin-top: 10px; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.wc-years { margin-top: 16px; }
.wc-actions { margin-top: 18px; }
.wrapped-card .field-hint { margin-top: 10px; }
.wc-peek {
  position: relative;
  width: 140px;
  aspect-ratio: 9 / 16;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--well);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transform: rotate(3deg);
  transition: transform .35s var(--ease-spring);
}
.wc-peek:hover { transform: rotate(0) scale(1.04); }
.wc-peek:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.wc-peek canvas { display: block; width: 100%; height: 100%; }
.wc-play { position: absolute; inset: 0; display: grid; place-items: center; }
.wc-play svg { width: 46px; height: 46px; padding: 13px 11px 13px 15px; border-radius: 50%; background: rgba(0, 0, 0, .55); fill: #ffffff; }

dialog.wrapped {
  --h: min(calc(100dvh - 110px), calc((100vw - 24px) * 16 / 9), 960px);
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}
dialog.wrapped[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
dialog.wrapped::backdrop { background: rgba(5, 5, 6, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.wr-stage {
  position: relative;
  flex: none;
  width: calc(var(--h) * 9 / 16);
  height: var(--h);
  border-radius: 22px;
  background: #000000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
/* A little shade at the top so the progress bars and buttons read on every look. */
.wr-stage::before { content: ""; position: absolute; inset: 0 0 auto; z-index: 1; height: 96px; background: linear-gradient(rgba(0, 0, 0, .38), transparent); pointer-events: none; }
#wrCanvas { display: block; width: 100%; height: 100%; }
#wrCanvas.wr-in { animation: wr-in .5s var(--ease-out); }
#wrCanvas.wr-back { animation: wr-back .5s var(--ease-out); }
@keyframes wr-in { from { opacity: .35; transform: translateX(26px) scale(.985); } }
@keyframes wr-back { from { opacity: .35; transform: translateX(-26px) scale(.985); } }
.wr-bars { position: absolute; top: 12px; right: 12px; left: 12px; z-index: 3; display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr)); gap: 5px; margin: 0; padding: 0; list-style: none; transition: opacity .2s; }
.wr-bars li { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .32); overflow: hidden; }
.wr-bars span { display: block; width: calc(var(--p, 0) * 100%); height: 100%; background: #ffffff; }
.wr-top { position: absolute; top: 22px; right: 8px; z-index: 3; display: flex; gap: 2px; transition: opacity .2s; }
.wr-icon { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #ffffff; transition: background-color .15s; }
.wr-icon:hover { background: rgba(255, 255, 255, .16); }
.wr-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wr-icon .wr-play-ico { display: none; fill: currentColor; stroke: none; }
.wrapped.is-paused .wr-pause-ico { display: none; }
.wrapped.is-paused .wr-icon .wr-play-ico { display: inline; }
.wr-tap { position: absolute; top: 70px; bottom: 0; z-index: 2; padding: 0; border: 0; background: transparent; cursor: pointer; }
.wr-prev { left: 0; width: 32%; }
.wr-next { right: 0; width: 68%; }
.wr-prev:disabled { cursor: default; }
.wr-tap:focus-visible { outline: 2px solid var(--focus); outline-offset: -6px; border-radius: 18px; }
.wrapped.is-held :is(.wr-bars, .wr-top) { opacity: 0; }
.wr-actions { display: flex; flex: none; flex-wrap: wrap; justify-content: center; gap: 10px; }
.wr-actions .btn-ghost { border-color: rgba(255, 255, 255, .3); color: #ffffff; }

@media (max-width: 719px) {
  .wrapped-card { padding: 20px 16px; border-radius: var(--r-lg); gap: 16px; }
  .wc-peek { width: 92px; border-radius: 12px; }
  .wc-lede { font-size: 14px; }
  dialog.wrapped { --h: min(calc(100dvh - 78px), calc(100vw * 16 / 9)); }
  dialog.wrapped[open] { gap: 10px; justify-content: flex-start; padding-top: max(0px, calc((100dvh - var(--h) - 68px) / 2)); }
  .wr-stage { border-radius: 14px; }
  .chart-drop { font-size: 13px; }
  .rm-row input[type="time"] { width: 100%; }
}

/* =====================================================================================
   Fortress and Wrapped as pages of their own, More, and the Settings tabs
   ===================================================================================== */

/* ---------- Pages that share a tab: a row of tabs at the top switches between them ---------- */

.page-tabs.group-tabs { margin: 28px 0 -6px; }
a.page-tab { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.page-tab[aria-current="page"] { background: var(--text); color: var(--bg); }

/* ---------- Settings tabs ---------- */

.page-tabs {
  display: flex;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 var(--stack);
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--well);
}
.page-tab {
  height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .2s, color .2s, transform .15s var(--ease-spring);
}
.page-tab:hover { color: var(--text); }
.page-tab:active { transform: scale(.96); }
.page-tab[aria-selected="true"] { background: var(--text); color: var(--bg); }
.page-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.settings-list.view-in > * { animation: view-rise .45s var(--ease-out) backwards; }
.settings-list.view-in > :nth-child(2) { animation-delay: .06s; }

/* ---------- The Fortress page ---------- */

#view-fortress .fortress { margin-top: 0; }
#view-fortress .ft-svg { max-width: 560px; }
.fort-year { margin-top: calc(var(--stack) * 2); }
.fort-year .section-lede { margin-bottom: 16px; }
.fort-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--tiles); margin: 0; padding: 0; list-style: none; }
.fm-month { min-width: 0; }
.fm-pick, .fm-month.is-later {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  color: var(--text);
  text-align: left;
  transition: border-color .2s, transform .2s var(--ease-spring), background-color .2s;
}
.fm-pick { cursor: pointer; }
.fm-pick:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.fm-pick[aria-pressed="true"] { border-color: color-mix(in srgb, var(--brand-text) 60%, transparent); background: color-mix(in srgb, var(--brand) 8%, var(--panel)); }
.fm-pick:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.fm-art { display: block; aspect-ratio: 340 / 200; }
.fm-art .ft-svg { width: 100%; height: 100%; }
.fm-month:is(.is-later, .is-empty) .fm-art { border: 1.5px dashed var(--line); border-radius: var(--r-md); }
.fm-month.is-later { opacity: .6; }
.fm-month.is-empty { display: grid; gap: 4px; padding: 12px 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--text-2); }
.fm-name { margin-top: 6px; font-size: 14px; font-weight: 600; }
.fm-sub { color: var(--text-3); font-size: 12.5px; }
.fort-months.rows-in .fm-month { animation: row-in .4s var(--ease-out) backwards; animation-delay: calc(var(--r, 0) * 30ms); }

/* ---------- The Wrapped page ---------- */

#view-wrapped .wrapped-card { margin-top: 0; }
#view-wrapped .wc-peek { width: 176px; }
.wrap-slides { margin-top: calc(var(--stack) * 2); }
.wrap-slides .section-lede { margin-bottom: 16px; }
.wrap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--tiles); margin: 0; padding: 0; list-style: none; }
.wrap-grid li { display: grid; gap: 8px; min-width: 0; }
.wrap-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--well);
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s var(--ease-spring), box-shadow .25s;
}
.wrap-thumb canvas { display: block; width: 100%; height: 100%; }
.wrap-thumb:hover { transform: translateY(-3px); box-shadow: var(--lift); }
.wrap-thumb:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.wrap-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px; color: var(--text-2); font-size: 13px; }
.wrap-foot span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap-foot .link-btn { flex: none; font-size: 13px; }
.wrap-grid.rows-in li { animation: row-in .4s var(--ease-out) backwards; animation-delay: calc(var(--r, 0) * 45ms); }
#view-wrapped .trades-head .wc-years { margin: 0; }

/* ---------- Phones ---------- */

@media (max-width: 719px) {
  .page-tabs.group-tabs { margin-top: 20px; }
  .group-tabs .page-tab { padding: 0 6px; }
  .page-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .page-tabs.group-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-tab { padding: 0 4px; font-size: 13.5px; }
  .fort-months, .wrap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #view-wrapped .wc-peek { width: 96px; }
}
@media (max-width: 380px) {
  .page-tab { font-size: 12.5px; }
}

/* ---------- The front page (landing.js): what Myrdon is, before anyone signs up ---------- */

.landing { min-height: 100vh; overflow-x: clip; }
/* The page's own main, not the journal's: full width, no gutter. */
.landing .ld-main { max-width: none; margin: 0; padding: 0; }
.ld-wrap { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }

/* The bar along the top: the name, the sections, and the two ways in. */
.ld-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.ld-nav-in { display: flex; align-items: center; gap: 24px; height: 68px; }
.ld-nav .wordmark { align-self: center; margin: 0; padding: 0; font-size: 26px; }
.ld-links { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.ld-links a, .ld-signin { color: var(--text-2); font-size: 14.5px; font-weight: 500; text-decoration: none; transition: color .15s; }
.ld-links a:hover, .ld-signin:hover { color: var(--text); }
.ld-nav-actions { display: flex; align-items: center; gap: 18px; margin-left: 32px; }
.ld-nav-actions .btn { height: 38px; padding: 0 16px; }

/* ---------- The promise ---------- */
.ld-hero { padding: 92px 0 0; text-align: center; }
.ld-hero-in { display: flex; flex-direction: column; align-items: center; }
.ld-kicker { color: var(--brand-text); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ld-title {
  margin-top: 22px;
  font-family: var(--display);
  font-size: clamp(56px, 8.6vw, 118px);
  font-weight: 700;
  line-height: .94;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.ld-title em { font-style: normal; color: var(--brand-text); }
.ld-lede { max-width: 58ch; margin-top: 28px; color: var(--text-2); font-size: 18.5px; line-height: 1.6; text-wrap: pretty; }
.ld-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.ld-fine { margin-top: 16px; color: var(--text-3); font-size: 13.5px; }

/* A look at the calendar, in a window. */
.ld-shot {
  position: relative;
  margin: 72px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--bg);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .65), 0 0 0 1px color-mix(in srgb, var(--brand) 10%, transparent);
  text-align: left;
  overflow: hidden;
}
[data-theme="daylight"] .ld-shot { box-shadow: 0 40px 90px -36px rgba(17, 22, 34, .32); }
.ld-shot::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto;
  height: 70%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 16%, transparent), transparent);
  pointer-events: none;
}
.ld-shot-bar { position: relative; display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.ld-shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.ld-shot-bar span { margin-left: 12px; color: var(--text-3); font-size: 12px; }
.ld-shot-body { position: relative; display: grid; grid-template-columns: 172px minmax(0, 1fr); }
.ld-shot-side { display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; border-right: 1px solid var(--line); }
.ld-side-item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 10px; color: var(--text-3); font-size: 13.5px; }
.ld-side-item span { width: 14px; height: 14px; border: 1.6px solid currentColor; border-radius: 4px; opacity: .8; }
.ld-side-item.is-on { background: var(--raise); color: var(--text); }
.ld-shot-main { min-width: 0; padding: 22px 24px 26px; }
.ld-shot-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ld-shot-month { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; }
.ld-shot-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--well); font-size: 12px; }
.ld-shot-seg > * { padding: 5px 12px; border-radius: var(--r-pill); color: var(--text-2); font-weight: 500; }
.ld-shot-seg b { background: var(--text); color: var(--bg); }
.ld-shot-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; margin-top: 18px; }
.ld-shot-result { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 18px 20px 14px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, var(--sheen), transparent 55%), var(--panel); }
.ld-shot-net { font-family: var(--display); font-size: clamp(30px, 4vw, 48px); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ld-shot-net .gain, .ld-shot-net .loss { border-radius: 14px; }
.ld-shot-sub { color: var(--text-3); font-size: 12.5px; }
.ld-shot-line { height: 44px; }
.ld-shot-line svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ld-line { fill: none; stroke: color-mix(in srgb, var(--gain) 55%, #6fd3a3); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ld-line-area { fill: color-mix(in srgb, #6fd3a3 14%, transparent); }
[data-theme="daylight"] .ld-line { stroke: #1f7a4d; }
.ld-shot-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.ld-shot-kpis > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--panel) 80%, transparent); }
.ld-shot-kpis dt { color: var(--text-3); font-size: 11.5px; }
.ld-shot-kpis dd { margin: 6px 0 0; font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ld-shot-kpis dd .gain, .ld-shot-kpis dd .loss { border-radius: 8px; font-size: 18px; }
.ld-shot-kpis small { display: block; margin-top: 6px; font-family: var(--sans); font-size: 11.5px; font-weight: 400; color: var(--text-3); }
.ld-shot-cal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel); container-type: inline-size; }
.ld-dow { padding-left: 4px; color: var(--text-3); font-size: 11.5px; font-weight: 500; }
.ld-shot-cal .day { min-height: 78px; padding: 8px 6px 9px 10px; border-radius: 12px; cursor: default; }
.ld-shot-cal .day-pnl { font-size: clamp(13px, 3.1cqi, 20px); }
.ld-shot-cal .day-meta { font-size: 11px; }
.ld-shot-cal .day-marks .mk-ico { width: 12px; height: 12px; }

/* ---------- At a glance ---------- */
.ld-strip { margin-top: 96px; border-block: 1px solid var(--line); }
.ld-strip-in { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ld-strip-in > div { padding: 30px 16px; text-align: center; }
.ld-strip-in > div + div { border-left: 1px solid var(--line); }
.ld-strip-big { font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1.05; }
.ld-strip-in p:not(.ld-strip-big) { margin-top: 8px; color: var(--text-3); font-size: 13.5px; }

/* ---------- Sections ---------- */
.ld-section { padding-top: 120px; scroll-margin-top: 40px; }
.ld-eyebrow { color: var(--brand-text); font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.ld-h2 { max-width: 24ch; margin-top: 14px; font-family: var(--display); font-size: clamp(36px, 4.6vw, 58px); font-weight: 700; line-height: 1.02; letter-spacing: -.01em; text-wrap: balance; }
.ld-h2-sub { display: block; max-width: 34ch; margin-top: 14px; color: var(--text-3); font-family: var(--sans); font-size: clamp(18px, 1.8vw, 22px); font-weight: 500; line-height: 1.4; letter-spacing: 0; }
.ld-body { max-width: 50ch; margin-top: 20px; color: var(--text-2); font-size: 17px; line-height: 1.65; }

/* Features: a grid of cards, each with a small picture of the thing itself. */
.ld-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 52px; }
.ld-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel);
}
.ld-card-wide { grid-column: span 2; }
/* The last card runs the full width: words on the left, what it means on the right. */
.ld-card-full { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 40px; align-items: center; grid-column: 1 / -1; }
.ld-card-full > h3 { grid-column: 1; }
.ld-card-full > p { grid-column: 1; max-width: 62ch; }
.ld-card-full > .ld-ticks { grid-column: 2; grid-row: 1 / span 2; margin: 0 !important; padding: 0 !important; }
.ld-card h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.ld-card > p { margin-top: 8px; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.ld-card > :last-child:not(p) { margin-top: auto; padding-top: 22px; }

.ld-blocks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; container-type: inline-size; }
.ld-block { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ld-block .day { min-height: 96px; cursor: default; }
.ld-block .day-pnl { font-size: 21px; }
.ld-block p { color: var(--text-3); font-size: 12.5px; text-align: center; }

.ld-plan { display: grid; gap: 10px; }
.ld-plan p { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13.5px; }
.ld-plan p > span { width: 76px; color: var(--text-3); font-size: 12.5px; }
.ld-plan b { font-weight: 600; }
.ld-chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: 12.5px; }
.ld-chip.is-on { border-color: transparent; background: var(--text); color: var(--bg); }
.ld-dots {
  display: inline-block;
  width: 82px;
  height: 10px;
  background: linear-gradient(90deg, var(--brand) calc(var(--dots) * 20%), var(--line-strong) 0);
  -webkit-mask: radial-gradient(circle 5px at 5px 50%, #000 96%, transparent) 0 0 / 18px 100% repeat-x;
  mask: radial-gradient(circle 5px at 5px 50%, #000 96%, transparent) 0 0 / 18px 100% repeat-x;
}

.ld-chart { position: relative; }
.ld-chart svg { display: block; width: 100%; height: 112px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--well); }
.ld-chart line { stroke-width: 1.4; }
.ld-chart .is-up rect { fill: #2f9d6a; } .ld-chart .is-up line { stroke: #2f9d6a; }
.ld-chart .is-down rect { fill: #d9534a; } .ld-chart .is-down line { stroke: #d9534a; }
.ld-keys { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 4px; }
kbd { display: inline-grid; place-items: center; min-width: 28px; height: 26px; padding: 0 7px; border: 1px solid var(--line-strong); border-bottom-width: 3px; border-radius: 7px; background: var(--panel); color: var(--text); font-family: var(--sans); font-size: 12px; font-weight: 600; }

.ld-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.ld-tiles > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.ld-tiles dt { color: var(--text-3); font-size: 11.5px; }
.ld-tiles dd { margin: 8px 0 0; font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1; }
.ld-tiles dd .gain { border-radius: 8px; font-size: 17px; }

.ld-brokers { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ld-brokers li { padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--text-2); font-size: 12.5px; }

.ld-prop { display: grid; gap: 8px; }
.ld-prop p { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ld-prop p span { color: var(--text-3); }
.ld-prop p b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ld-prop i { display: block; height: 7px; margin-bottom: 6px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--gain) calc(var(--prop) * 100%), var(--raise) 0); box-shadow: inset 0 0 0 1px var(--line); }
.ld-prop i.is-warn { background: linear-gradient(90deg, var(--brand) calc(var(--prop) * 100%), var(--raise) 0); }

.ld-story { position: relative; height: 200px; }
.ld-story-card {
  position: absolute;
  left: 50%;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  width: 104px;
  height: 154px;
  padding: 14px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent), var(--bg);
  box-shadow: var(--lift);
  top: 30px;
  transform: translateX(-30%) rotate(5deg);
}
.ld-story-card.is-back { z-index: -1; transform: translateX(-85%) rotate(-7deg); opacity: .9; }
.ld-story-card p { color: var(--text-3); font-size: 11px; }
.ld-story-card b { align-self: flex-start; font-family: var(--display); font-size: 17px; border-radius: 8px; }
.ld-story-card span { color: var(--text-3); font-size: 10.5px; line-height: 1.3; }
.ld-story { isolation: isolate; }

.ld-looks { display: flex; flex-wrap: wrap; gap: 8px; }
.ld-looks button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 500; transition: border-color .15s, color .15s; }
.ld-looks button:hover { color: var(--text); }
.ld-looks button[aria-checked="true"] { border-color: var(--brand-text); color: var(--text); box-shadow: 0 0 0 1px var(--brand-text); }
.ld-swatch { width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.ld-swatch.is-gold { background: conic-gradient(from 200deg, #11100e 0 50%, #cfa95a 0); }
.ld-swatch.is-graphite { background: conic-gradient(from 200deg, #0d0d0f 0 50%, #7c5cff 0); }
.ld-swatch.is-daylight { background: conic-gradient(from 200deg, #f3f4f7 0 50%, #e8590c 0); box-shadow: inset 0 0 0 1px rgba(17, 22, 34, .2); }

.ld-ticks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.ld-ticks li { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 13px; }
.ld-ticks li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5 6.8 11 12 5' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }

/* The deep dives: words on one side, the thing itself on the other. */
.ld-split-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 72px; }
.ld-split.is-flip .ld-split-text { order: 2; }
.ld-points { display: grid; gap: 14px; margin: 28px 0 0; padding: 0; list-style: none; }
.ld-points li { position: relative; padding-left: 24px; color: var(--text-2); font-size: 15.5px; line-height: 1.55; }
.ld-points li::before { content: ""; position: absolute; left: 0; top: .5em; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
.ld-points b { color: var(--text); font-weight: 600; }
.ld-panel { padding: 28px; border: 1px solid var(--line); border-radius: var(--r-xl); background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--panel); box-shadow: var(--lift); }
.ld-panel-title { color: var(--text-3); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.ld-wall .ft-svg { max-width: 440px; }
.ld-wall-say { margin-top: 10px; color: var(--text-2); font-size: 14px; text-align: center; }
.ld-wall-say b { color: var(--text); font-family: var(--display); font-size: 22px; }
.ld-checkin { display: grid; gap: 8px; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); list-style: none; }
.ld-checkin li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--raise); color: var(--text-2); font-size: 14px; }
.ld-checkin li span { flex: none; width: 18px; height: 18px; border-radius: 6px; }
.ld-checkin li.is-kept span { background: var(--fort-gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5 6.8 11 12 5' fill='none' stroke='%23111' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; }
.ld-checkin li.is-broke span { border: 1.5px dashed var(--danger-text); }
.ld-checkin li b { margin-left: auto; font-family: var(--display); font-size: 16px; color: var(--fort-gold-text); }
.ld-checkin li.is-broke b { color: var(--danger-text); }

.ld-bars { display: grid; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.ld-bars li { display: grid; grid-template-columns: 52px minmax(0, 1fr) 70px; align-items: center; gap: 14px; font-size: 14px; }
.ld-bars.is-cost li { grid-template-columns: 112px minmax(0, 1fr) 70px; }
.ld-bars li > span { color: var(--text-2); }
.ld-bars i { display: block; height: 10px; border-radius: var(--r-pill); background: linear-gradient(90deg, #2f9d6a calc(var(--bar) * 100%), var(--raise) 0); }
.ld-bars i.is-loss { background: linear-gradient(90deg, #d9534a calc(var(--bar) * 100%), var(--raise) 0); }
.ld-bars b { justify-self: end; font-size: 13px; font-weight: 600; box-shadow: none; }
.ld-insight { margin-top: 22px; padding: 14px 16px; border-left: 2px solid var(--brand-text); border-radius: 0 12px 12px 0; background: color-mix(in srgb, var(--brand) 8%, transparent); color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.ld-insight b { color: var(--text); font-weight: 600; }
.ld-insight .gain, .ld-insight .loss { padding: 0 .35em; font-weight: 600; box-shadow: none; }
.ld-cost { margin-top: 14px; color: var(--text-2); font-size: 14px; }
.ld-cost .loss { margin-right: 6px; font-family: var(--display); font-size: 26px; border-radius: 10px; }

/* How it works. */
.ld-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 52px 0 0; padding: 0; list-style: none; }
.ld-steps li { padding: 28px 26px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--panel); }
.ld-step-n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--brand); color: var(--on-brand); font-family: var(--display); font-size: 22px; font-weight: 700; }
.ld-steps h3 { margin-top: 20px; font-size: 18px; font-weight: 600; }
.ld-steps p { margin-top: 8px; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }

/* Your data. */
.ld-trust-in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; padding: 44px 48px; border: 1px solid var(--line); border-radius: var(--r-xl); background: color-mix(in srgb, var(--panel) 70%, transparent); }
.ld-trust .ld-h2 { margin-top: 0; font-size: clamp(32px, 3.6vw, 44px); }
.ld-trust-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.ld-trust-list li { position: relative; padding-left: 30px; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.ld-trust-list li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 6px; background: var(--fort-gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5 6.8 11 12 5' fill='none' stroke='%23111' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; }
.ld-trust-list b { color: var(--text); font-weight: 600; }

/* Questions. */
.ld-faq-in { max-width: 820px; }
.ld-faq { margin-top: 40px; border-top: 1px solid var(--line); }
.ld-faq details { border-bottom: 1px solid var(--line); }
.ld-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 4px;
  font-size: 17.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.ld-faq summary::-webkit-details-marker { display: none; }
.ld-faq summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--brand-text); font-size: 18px; font-weight: 500; line-height: 1; transition: transform .25s var(--ease-out); }
.ld-faq details[open] summary::after { content: "−"; }
.ld-faq summary:hover { color: var(--brand-text); }
.ld-faq details p { max-width: 64ch; padding: 0 4px 24px; color: var(--text-2); font-size: 15.5px; line-height: 1.65; }
.ld-faq a { color: var(--brand-text); }

/* The last word. */
.ld-final { margin-top: 130px; padding: 96px 0 100px; border-top: 1px solid var(--line); background: radial-gradient(60% 80% at 50% 0%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%); text-align: center; }
.ld-final-in { display: flex; flex-direction: column; align-items: center; }
.ld-final-title { margin-top: 26px; font-family: var(--display); font-size: clamp(38px, 5.2vw, 68px); font-weight: 700; line-height: 1.02; letter-spacing: -.01em; text-wrap: balance; }

.ld-foot { border-top: 1px solid var(--line); }
.ld-foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; padding: 28px 0 36px; color: var(--text-3); font-size: 13px; }
.ld-foot-brand b { margin-right: 8px; color: var(--text); font-family: var(--display); font-size: 18px; }
.ld-foot-links { display: flex; gap: 20px; }
.ld-foot-links a { color: var(--text-2); }

/* The way back from the sign-in screen. */
.auth-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: -20px 0 -24px; color: var(--text-3); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.auth-back svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-back:hover { color: var(--text); }

/* ---------- Motion: the hero rises in, the rest as it scrolls into view ---------- */
.landing.enter .ld-hero-in > * { animation: view-rise .6s var(--ease-out) backwards; }
.landing.enter .ld-hero-in > :nth-child(2) { animation-delay: .06s; }
.landing.enter .ld-hero-in > :nth-child(3) { animation-delay: .12s; }
.landing.enter .ld-hero-in > :nth-child(4) { animation-delay: .18s; }
.landing.enter .ld-hero-in > :nth-child(5) { animation-delay: .22s; }
.landing.enter .ld-shot { animation: view-rise .8s var(--ease-out) backwards .3s; }
.landing.enter .ld-shot-cal .day { animation: block-in .5s cubic-bezier(.2, .9, .25, 1.15) backwards; animation-delay: calc(var(--i, 0) * 22ms + .55s); }
.landing.enter .wordmark .logo-mark :is(.fm-t, .fm-w) { animation: fort-rise .46s cubic-bezier(.3, .7, .4, 1.2) backwards; animation-delay: calc(var(--i, 0) * 90ms); }
.ld-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.ld-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .ld-reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1023px) {
  .ld-links { display: none; }
  .ld-nav-actions { margin-left: auto; }
  .ld-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-card-full { display: flex; grid-column: auto; }
  .ld-card-full > .ld-ticks { margin-top: auto !important; padding-top: 22px !important; }
  .ld-split-in { grid-template-columns: 1fr; gap: 40px; }
  .ld-split.is-flip .ld-split-text { order: 0; }
  .ld-shot-body { grid-template-columns: 1fr; }
  .ld-shot-side { display: none; }
  .ld-trust-in { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 719px) {
  .ld-wrap { width: calc(100% - 32px); }
  .ld-nav-in { height: 60px; gap: 12px; }
  .ld-nav .wordmark { font-size: 22px; }
  .ld-nav .wordmark .logo-mark { width: 28px; height: 28px; }
  .ld-nav-actions { gap: 12px; }
  .ld-signin { font-size: 14px; }
  .ld-hero { padding-top: 56px; }
  .ld-title { font-size: clamp(46px, 14vw, 64px); }
  .ld-lede { font-size: 16.5px; }
  .ld-cta { width: 100%; }
  .ld-cta .btn { flex: 1 1 100%; }
  .ld-shot { margin-top: 48px; border-radius: 18px; }
  .ld-shot-main { padding: 16px 12px 16px; }
  .ld-shot-month { font-size: 22px; }
  .ld-shot-hero { grid-template-columns: 1fr; }
  .ld-shot-kpis { display: none; }
  .ld-shot-cal { gap: 4px; padding: 10px 8px; border-radius: 14px; }
  .ld-shot-cal .day { min-height: 54px; padding: 6px 5px; border-radius: 8px; grid-template-columns: minmax(0, 1fr); }
  .ld-shot-cal .day-meta, .ld-shot-cal .day-marks, .ld-shot-cal .day-ev { display: none; }
  .ld-shot-cal .day-pnl { font-size: 12.5px; }
  .ld-shot-cal .day-num { font-size: 10px; }
  .ld-strip { margin-top: 64px; }
  .ld-strip-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-strip-in > div { padding: 22px 10px; }
  .ld-strip-in > div:nth-child(3) { border-left: 0; }
  .ld-strip-in > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .ld-strip-big { font-size: 26px; }
  .ld-section { padding-top: 84px; }
  .ld-grid, .ld-steps { grid-template-columns: 1fr; }
  .ld-card-wide { grid-column: auto; }
  .ld-card { padding: 22px 20px 20px; border-radius: var(--r-lg); }
  .ld-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-panel { padding: 20px 18px; border-radius: var(--r-lg); }
  .ld-bars.is-cost li { grid-template-columns: 96px minmax(0, 1fr) 58px; gap: 10px; }
  .ld-trust-in { padding: 28px 22px; border-radius: var(--r-lg); }
  .ld-faq summary { font-size: 16px; padding: 18px 2px; }
  .ld-final { margin-top: 96px; padding: 72px 0 80px; }
  .ld-foot-in { flex-direction: column; align-items: flex-start; }
  .auth-back { margin: 0 0 16px; }
}
@media (max-width: 380px) {
  .ld-nav-actions .btn { padding: 0 12px; }
  .ld-signin { display: none; }
}

/* ---------- More motion: the sign-in screen and the front page ----------
   All of it stops for anyone who asks for less motion (the rule near the top of this file). */

/* Numbers and fills that can be animated smoothly. */
@property --dots { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --prop { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --bar { syntax: '<number>'; inherits: false; initial-value: 0; }

@keyframes word-rise { from { opacity: 0; transform: translateY(.4em); } }
/* "set in stone": each word drops like a stone, and the line takes the weight. */
@keyframes stone-drop {
  0% { opacity: 0; transform: translateY(-.9em) rotate(-4deg); }
  62% { opacity: 1; transform: translateY(.06em) rotate(1deg); }
  100% { transform: none; }
}
@keyframes thud { 30% { transform: translateY(3px); } 60% { transform: translateY(-1px); } }
@keyframes rule-grow { from { transform: scaleX(0); } }
@keyframes aura-drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(14%, 18%) scale(1.15); }
  100% { transform: translate(-8%, 34%) scale(.95); }
}
@keyframes pop-in { from { opacity: 0; transform: scale(.86) translateY(6px); } }
@keyframes crack-draw { from { stroke-dashoffset: 1; } }
@keyframes shake { 15%, 85% { transform: translateX(-2px); } 30%, 70% { transform: translateX(5px); } 45%, 55% { transform: translateX(-7px); } }
@keyframes busy-stripes { to { background-position: 28px 0; } }

.pitch-title .pw, .ld-title .pw { display: inline-block; }

/* ----- The sign-in screen ----- */

/* A slow light drifts behind the slogan. */
.auth-brand { isolation: isolate; overflow: clip; }
.auth-aura {
  position: absolute;
  z-index: -1;
  left: -15%;
  top: 8%;
  width: 95%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 15%, transparent), transparent);
  pointer-events: none;
  animation: aura-drift 18s ease-in-out infinite alternate;
}
.auth-screen.enter .auth-brand > .auth-aura { animation: fade-in 1.2s ease backwards, aura-drift 18s ease-in-out 1.2s infinite alternate; }

.auth-screen.enter .pitch-title .pw { animation: word-rise .6s var(--ease-out) backwards; animation-delay: calc(.15s + var(--w) * 90ms); }
.auth-screen.enter .pitch-title .pw.is-stone { animation: stone-drop .55s cubic-bezier(.3, .7, .4, 1) backwards; animation-delay: calc(.25s + var(--w) * 110ms); }
.auth-screen.enter .pitch-title { animation: thud .35s .86s ease-out, thud .4s 2.4s ease-out; }
.auth-pitch .pitch-sub::before { transform-origin: left; }
.auth-screen.enter .auth-pitch .pitch-sub::before { animation: rule-grow .7s 1s var(--ease-out) backwards; }

/* Tomorrow's light breathes slowly once it's up. */
.ward-halo { animation: ward-glow 7s ease-in-out infinite alternate; }
@keyframes ward-glow { from { opacity: .75; } to { opacity: 1; } }

/* Today's stone drops into place, with a puff of dust, when the password is long enough. */
.ward-today.lay .ward-laid { animation: ward-lay .7s cubic-bezier(.3, .7, .4, 1.2); }
@keyframes ward-lay {
  0% { opacity: .3; transform: translateY(-34px) scale(.94); }
  55% { opacity: 1; transform: translateY(2px) scale(1.02); }
  75% { transform: translateY(-1px); }
  100% { transform: none; }
}
.ward-today.lay .ward-dust circle { animation: dust .7s .32s ease-out; }
@keyframes dust { 0% { opacity: .9; transform: none; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }

/* The form: fields glow when you're in them, buttons catch the light, a mistake gets a shake. */
.auth-form input { transition: border-color .2s, box-shadow .25s var(--ease-out); }
.auth-form input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent); }
.btn-social, .auth-form .btn-primary, .landing .btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-social::after, .auth-form .btn-primary::after, .landing .btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .32) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}
.btn-social:hover::after, .auth-form .btn-primary:hover::after, .landing .btn-primary:hover::after { transform: translateX(120%); transition: transform .75s var(--ease-out); }
.btn-social svg { transition: transform .5s var(--ease-spring); }
.btn-social:hover svg { transform: rotate(-14deg) scale(1.08); }
.btn-social.is-busy, .auth-form .btn.is-busy {
  background-image: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(255, 255, 255, .14) 10px 20px);
  background-size: 28px 28px;
  animation: busy-stripes .8s linear infinite;
}
.auth-form.shake { animation: shake .45s cubic-bezier(.36, .07, .19, .97); }
.auth-form .form-error:not(:empty) { animation: word-rise .3s var(--ease-out); }
.auth-back svg { transition: transform .2s var(--ease-out); }
.auth-back:hover svg { transform: translateX(-3px); }
.pw-toggle { transition: background-color .15s, color .15s, transform .15s var(--ease-spring); }
.pw-toggle:active { transform: scale(.9); }

/* Signing in: the wall lifts away, the form steps back, the gate in the logo lights. */
.auth-screen.leave { animation: auth-out .2s .22s ease both; }
.auth-screen.leave .ward { animation: block-up .38s var(--ease-in) both; }
.auth-screen.leave .auth-card { animation: card-out .32s var(--ease-in) both; }
.auth-screen.leave .logo-mark .fm-g { animation: gate-light .4s ease both; }
@keyframes block-up { to { opacity: 0; transform: translateY(-40%) scale(.9); } }
@keyframes card-out { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ----- The front page ----- */

/* A slow light, and a few stones drifting behind the headline. */
.ld-hero { position: relative; isolation: isolate; }
.ld-hero::before {
  content: "";
  position: absolute;
  z-index: -2;
  left: 50%;
  top: -140px;
  width: 960px;
  height: 640px;
  margin-left: -480px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 13%, transparent), transparent);
  pointer-events: none;
  animation: aura-drift 22s ease-in-out infinite alternate;
}
.ld-hero-stones { position: absolute; inset: 0 0 auto; height: 660px; z-index: -1; pointer-events: none; }
.ld-hero-stones i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  aspect-ratio: 1.35;
  border-radius: 6px;
  background: color-mix(in srgb, var(--mark-3) 34%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  opacity: .6;
  transform: rotate(var(--r));
  animation: stone-float var(--t) ease-in-out infinite alternate;
}
[data-theme="daylight"] .ld-hero-stones i { background: color-mix(in srgb, var(--mark-x) 22%, transparent); opacity: .7; }
@keyframes stone-float { from { transform: translateY(0) rotate(var(--r)); } to { transform: translateY(-28px) rotate(calc(var(--r) * -1)); } }
.landing.enter .ld-hero-stones i { animation: pop-in .9s var(--ease-out) backwards .5s, stone-float var(--t) ease-in-out 1.4s infinite alternate; }

/* The headline lands word by word. */
.landing.enter .ld-hero-in > .ld-title { animation: thud .35s 1s ease-out, thud .4s 2.55s ease-out; }
.landing.enter .ld-title .pw { animation: word-rise .65s var(--ease-out) backwards; animation-delay: calc(.1s + var(--w) * 90ms); }
.landing.enter .ld-title .pw.is-stone { animation: stone-drop .6s cubic-bezier(.3, .7, .4, 1) backwards; animation-delay: calc(.3s + var(--w) * 120ms); }

/* The calendar picture: blocks land, then their cracks run, and the month's line draws itself. */
.ds-crack, .ds-glint { stroke-dasharray: 1; }
.landing.enter .ld-shot-cal :is(.ds-crack, .ds-glint) { animation: crack-draw .45s ease-out backwards; animation-delay: calc(var(--i, 0) * 22ms + 1.1s + var(--c, 0) * 120ms); }
.landing.enter .ld-shot-cal :is(.ds-chip, .ds-shade) { animation: fade-in .4s ease backwards; animation-delay: calc(var(--i, 0) * 22ms + 1.45s); }
.ld-line { stroke-dasharray: 1; }
.landing.enter .ld-line { animation: crack-draw 1.5s .7s var(--ease-out) backwards; }
.landing.enter .ld-line-area { animation: fade-in .8s 1.6s ease backwards; }
.calendar.cal-build :is(.ds-crack, .ds-glint) { animation: crack-draw .45s ease-out backwards; animation-delay: calc(var(--i, 0) * 20ms + .45s + var(--c, 0) * 110ms); }
.calendar.cal-build :is(.ds-chip, .ds-shade) { animation: fade-in .35s ease backwards; animation-delay: calc(var(--i, 0) * 20ms + .75s); }

/* A pointer visits a day and opens its quick look. */
.ld-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 22px;
  height: 22px;
  fill: var(--text);
  stroke: var(--bg);
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35));
  transform: translate(70%, 60%);
  transition: transform .7s var(--ease-out);
  pointer-events: none;
}
.ld-demo-peek {
  position: absolute;
  z-index: 2;
  width: 232px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  pointer-events: none;
}
[data-theme="daylight"] .ld-demo-peek { box-shadow: 0 16px 40px rgba(17, 22, 34, .18); }
.ld-demo-peek.peek-in { animation: menu-in .22s var(--ease-out); }
.dp-date { color: var(--text-2); font-size: 12px; font-weight: 600; }
.dp-result { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; color: var(--text-3); font-size: 12px; }
.dp-result > span:first-child { font-family: var(--display); font-size: 19px; font-weight: 700; border-radius: 8px; }
.dp-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--text-2); font-size: 12px; }
.dp-line .ck-stone { width: 24px; height: 16px; }
.dp-soft { margin-top: 6px; color: var(--text-3); }
.ld-shot-cal .day { transition: transform .25s var(--ease-out), box-shadow .25s; }
.ld-shot-cal .day.is-pointed { transform: translateY(-3px); box-shadow: var(--lift), 0 0 0 2px var(--brand-text); }

/* Cards and their pictures come to life as they scroll in. */
.ld-card.is-in .ld-block { animation: pop-in .5s cubic-bezier(.2, .9, .25, 1.15) backwards; animation-delay: calc(.15s + var(--k, 0) * 90ms); }
.ld-card.is-in .ld-blocks :is(.ds-crack, .ds-glint) { animation: crack-draw .5s ease-out backwards; animation-delay: calc(.6s + var(--k, 0) * 90ms + var(--c, 0) * 120ms); }
.ld-card.is-in .ld-blocks :is(.ds-chip, .ds-shade) { animation: fade-in .4s ease backwards; animation-delay: calc(1s + var(--k, 0) * 90ms); }
.ld-card.is-in .ld-plan > p { animation: row-in .45s var(--ease-out) backwards; animation-delay: calc(.15s + var(--k, 0) * 80ms); }
.ld-card.is-in .ld-plan .ld-chip { animation: pop-in .35s var(--ease-spring) backwards; animation-delay: calc(.35s + var(--k, 0) * 60ms); }
.ld-card.is-in .ld-dots { animation: dots-fill .9s .7s var(--ease-out) backwards; }
@keyframes dots-fill { from { --dots: 0; } }
.ld-card.is-in .ld-keys kbd { animation: key-press .55s ease-in-out backwards .2s; }
.ld-card.is-in .ld-keys kbd + kbd { animation-delay: .34s; }
@keyframes key-press { 0% { opacity: 0; transform: translateY(-8px); } 45% { opacity: 1; transform: none; } 65% { transform: translateY(2px); } 100% { transform: none; } }
.ld-card.is-in .ld-chart svg { animation: paste-flash .7s .62s ease-out; }
@keyframes paste-flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
#ldCandles g { transform-box: fill-box; transform-origin: 50% 100%; }
.ld-card.is-in #ldCandles g { animation: candle-in .35s var(--ease-out) backwards; animation-delay: calc(.7s + var(--k, 0) * 45ms); }
@keyframes candle-in { from { opacity: 0; transform: scaleY(0); } }
.ld-card.is-in .ld-tiles > div { animation: view-rise .45s var(--ease-out) backwards; animation-delay: calc(.15s + var(--k, 0) * 90ms); }
.ld-card.is-in .ld-brokers li { animation: pop-in .35s var(--ease-spring) backwards; animation-delay: calc(.15s + var(--k, 0) * 55ms); }
.ld-card.is-in .ld-prop i { animation: prop-fill 1.1s var(--ease-out) backwards; animation-delay: calc(.3s + var(--k, 0) * 220ms); }
@keyframes prop-fill { from { --prop: 0; } }
.ld-card.is-in .ld-story-card { animation: fan-front .8s cubic-bezier(.2, .9, .25, 1.15) backwards .2s; }
.ld-card.is-in .ld-story-card.is-back { animation-name: fan-back; animation-delay: .32s; }
@keyframes fan-front { from { opacity: 0; transform: translateX(-55%) translateY(30px) rotate(0deg); } }
@keyframes fan-back { from { opacity: 0; transform: translateX(-55%) translateY(30px) rotate(0deg); } }
.ld-card.is-in .ld-looks button { animation: pop-in .35s var(--ease-spring) backwards; animation-delay: calc(.2s + var(--k, 0) * 80ms); }
.ld-looks button[aria-checked="true"] .ld-swatch { animation: swatch-turn .6s var(--ease-out); }
@keyframes swatch-turn { from { transform: rotate(-180deg) scale(.7); } }
.ld-card.is-in .ld-ticks li { animation: pop-in .35s var(--ease-spring) backwards; animation-delay: calc(.2s + var(--k, 0) * 90ms); }

/* The Fortress panel: the wall builds stone by stone, then the check-in ticks its rules off. */
.ld-split-art.is-in .ld-checkin li { animation: row-in .45s var(--ease-out) backwards; animation-delay: calc(1s + var(--k, 0) * 150ms); }
.ld-split-art.is-in .ld-checkin li.is-kept span { animation: pop-in .4s var(--ease-spring) backwards; animation-delay: calc(1.25s + var(--k, 0) * 150ms); }
.ld-split-art.is-in .ld-checkin li.is-broke { animation: row-in .45s var(--ease-out) backwards calc(1s + var(--k, 0) * 150ms), shake .45s 1.85s cubic-bezier(.36, .07, .19, .97); }
/* Bars grow to their length; the sentence under them follows. */
.ld-split-art.is-in .ld-bars i { animation: bar-fill 1s var(--ease-out) backwards; animation-delay: calc(.25s + var(--k, 0) * 90ms); }
@keyframes bar-fill { from { --bar: 0; } }
.ld-split-art.is-in .ld-bars b { animation: fade-in .4s ease backwards; animation-delay: calc(.8s + var(--k, 0) * 90ms); }
.ld-split-art.is-in .ld-insight { animation: view-rise .5s var(--ease-out) backwards 1.1s; }

/* Steps, the strip, the questions and the last word. */
.ld-steps li.is-in .ld-step-n { animation: pop-in .45s var(--ease-spring) backwards .2s; }
.ld-steps li:nth-child(2).is-in .ld-step-n { animation-delay: .32s; }
.ld-steps li:nth-child(3).is-in .ld-step-n { animation-delay: .44s; }
.ld-strip-in.is-in > div { animation: view-rise .5s var(--ease-out) backwards; animation-delay: calc(var(--k, 0) * 90ms); }
.ld-faq details[open] p { animation: word-rise .35s var(--ease-out); }
.ld-faq details[open] summary::after { transform: rotate(180deg); }
.ld-final-in.is-in .logo-mark :is(.fm-t, .fm-w) { animation: fort-rise .46s cubic-bezier(.3, .7, .4, 1.2) backwards; animation-delay: calc(.15s + var(--i, 0) * 90ms); }
.ld-final-in.is-in .logo-mark .fm-g { animation: gate-light .5s .55s cubic-bezier(.2, .8, .3, 1) backwards; }
.ld-nav { transition: box-shadow .3s, background-color .3s; }
.ld-nav.is-scrolled { box-shadow: 0 12px 30px -20px rgba(0, 0, 0, .7); }
[data-theme="daylight"] .ld-nav.is-scrolled { box-shadow: 0 12px 30px -22px rgba(17, 22, 34, .35); }
@media (max-width: 719px) {
  .ld-hero-stones i:nth-child(n + 4) { display: none; }
  .ld-hero::before { width: 600px; margin-left: -300px; }
}

/* ---------- "Set in stone" ----------
   Once the slogan has landed, its words turn to stone: the ink drains away from the bottom up,
   leaving carved stone with depth, a little grit falls away, and a light passes over it once it has
   set. The stone is the resting state, so with reduced motion the words are simply stone.
   Each word is two spans: the outer one (.pw) moves, the inner one (.st) is the stone. */
@property --ink { syntax: '<percentage>'; inherits: false; initial-value: 100%; }
@property --glint { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@property --depth { syntax: '<number>'; inherits: false; initial-value: 1; }

.pitch-title .pw, .ld-title .pw {
  --stone: #e2d5bb;
  --stone-side: color-mix(in srgb, var(--stone) 52%, #000);
  --stone-shade: rgba(0, 0, 0, .55);
  position: relative;
}
.ld-title em .pw { --stone: #e0b866; }
[data-theme="graphite"] :is(.pitch-title, .ld-title) .pw { --stone: #d4d4dc; }
[data-theme="graphite"] .ld-title em .pw { --stone: #b3a5f0; }
[data-theme="daylight"] :is(.pitch-title, .ld-title) .pw { --stone: #5d626c; --stone-side: #2a2d33; --stone-shade: rgba(17, 22, 34, .3); }
[data-theme="daylight"] .ld-title em .pw { --stone: #c95a28; --stone-side: #6e290d; }

.pitch-title .st, .ld-title .st {
  display: inline-block;
  /* Room for the descenders and the stone's edge, without moving anything. */
  padding: .08em .06em .24em;
  margin: -.08em -.06em -.24em;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .pitch-title .st, .ld-title .st {
    --ink: 100%;
    --glint: 0%;
    --depth: 1;
    background-image:
      linear-gradient(100deg, transparent 45%, rgba(255, 255, 255, .75) 50%, transparent 55%),
      linear-gradient(to bottom, currentColor 40%, transparent 60%),
      linear-gradient(to bottom, rgba(255, 255, 255, .14), transparent 50%, rgba(0, 0, 0, .2)),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='s' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeDiffuseLighting surfaceScale='1.3' lighting-color='%23fff'%3E%3CfeDistantLight azimuth='235' elevation='52'/%3E%3C/feDiffuseLighting%3E%3CfeComponentTransfer result='g'%3E%3CfeFuncR type='linear' slope='.46' intercept='.6'/%3E%3CfeFuncG type='linear' slope='.46' intercept='.6'/%3E%3CfeFuncB type='linear' slope='.46' intercept='.6'/%3E%3C/feComponentTransfer%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.022 .034' numOctaves='3' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='.3 0 0 0 .78 .3 0 0 0 .78 .3 0 0 0 .78 0 0 0 0 1'/%3E%3CfeBlend in2='g' mode='multiply' result='gm'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='1' seed='21' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 3 0 0 0 -1.62'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='0 .55'/%3E%3C/feComponentTransfer%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 .32 0 0 0 0 .32 0 0 0 0 .32 0 0 0 1 0'/%3E%3CfeComposite in2='gm' operator='over' result='lum'/%3E%3CfeColorMatrix in='lum' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.7 0 0 0 1.58' result='dk'/%3E%3CfeColorMatrix in='lum' type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 2.2 0 0 0 -2.05' result='lt'/%3E%3CfeComposite in='lt' in2='dk' operator='over'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23s)'/%3E%3C/svg%3E");
    background-color: var(--stone);
    background-size: 300% 100%, 100% 300%, 100% 100%, clamp(110px, 2.8em, 260px) clamp(110px, 2.8em, 260px);
    background-position: var(--glint) 0, 0 var(--ink), 0 0, calc(var(--w, 0) * -53px) calc(var(--w, 0) * -31px);
    background-repeat: no-repeat, no-repeat, no-repeat, repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter:
      drop-shadow(0 calc(max(.5px, .014em) * var(--depth)) 0 var(--stone-side))
      drop-shadow(0 calc(max(.5px, .014em) * var(--depth)) 0 var(--stone-side))
      drop-shadow(0 calc(.05em * var(--depth)) calc(.05em * var(--depth)) var(--stone-shade));
  }
}
@keyframes stone-set {
  from { --ink: 0%; --depth: 0; }
  55% { --depth: .2; }
}
@keyframes stone-glint { from { --glint: 100%; } to { --glint: 0%; } }
.auth-screen.enter .pitch-title .st {
  animation: stone-set 1.1s cubic-bezier(.5, 0, .3, 1) backwards, stone-glint 1.2s ease-in-out backwards;
  animation-delay: calc(1.3s + var(--w) * 70ms), calc(2.5s + var(--w) * 90ms);
}
.landing.enter .ld-title .st {
  animation: stone-set 1.1s cubic-bezier(.5, 0, .3, 1) backwards, stone-glint 1.3s ease-in-out backwards;
  animation-delay: calc(1.45s + var(--w) * 70ms), calc(2.65s + var(--w) * 90ms);
}

/* As each word sets, a little grit falls away from it. */
.pitch-title .pw::after, .ld-title .pw::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 72%;
  height: .45em;
  background:
    radial-gradient(circle, var(--stone, currentColor) 0 1.3px, transparent 1.9px) 8% 30% / 6px 6px no-repeat,
    radial-gradient(circle, var(--stone, currentColor) 0 0.9px, transparent 1.5px) 19% 70% / 6px 6px no-repeat,
    radial-gradient(circle, var(--stone, currentColor) 0 1.1px, transparent 1.7px) 31% 15% / 6px 6px no-repeat,
    radial-gradient(circle, var(--stone, currentColor) 0 1.4px, transparent 2.0px) 44% 55% / 6px 6px no-repeat,
    radial-gradient(circle, var(--stone, currentColor) 0 0.8px, transparent 1.4px) 52% 90% / 6px 6px no-repeat,
    radial-gradient(circle, var(--stone, currentColor) 0 1px, transparent 1.6px) 63% 35% / 6px 6px no-repeat,
    radial-gradient(circle, var(--stone, currentColor) 0 1.2px, transparent 1.8px) 74% 75% / 6px 6px no-repeat,
    radial-gradient(circle, var(--stone, currentColor) 0 0.9px, transparent 1.5px) 86% 20% / 6px 6px no-repeat,
    radial-gradient(circle, var(--stone, currentColor) 0 1.1px, transparent 1.7px) 95% 60% / 6px 6px no-repeat;
  opacity: 0;
  pointer-events: none;
}
@keyframes grit-fall {
  from { opacity: .85; transform: translateY(0); }
  to { opacity: 0; transform: translateY(.7em); }
}
.auth-screen.enter .pitch-title .pw::after { animation: grit-fall .9s cubic-bezier(.4, 0, .8, .6); animation-delay: calc(1.75s + var(--w) * 70ms); }
.landing.enter .ld-title .pw::after { animation: grit-fall .9s cubic-bezier(.4, 0, .8, .6); animation-delay: calc(1.9s + var(--w) * 70ms); }

/* On a phone the slogan sits right above the form, so the drifting light moves out to the whole
   screen, behind the form, instead of being cut off under the slogan. */
@media (max-width: 860px) {
  .auth-screen { position: relative; isolation: isolate; overflow: clip; }
  .auth-brand { position: static; isolation: auto; overflow: visible; }
}
