  /* ============================================================
     TOKENS — see DESIGN_SYSTEM.md. One semantic set; colour carries
     meaning only:
       accent  the trader's process: main action, selection, focus,
               links, disciplined (kept) days
       gain / loss   P&L direction, nothing else
       close   approaching a limit, or anything that needs attention
       breach  an actual broken limit (always with an icon or a word);
               also destructive controls, as outlined text only
     Sat-out, paused and "not kept" are neutral (--muted / --raised /
     a dashed --line). Dark is the default; html[data-theme="light"]
     swaps the values (THEME_KEY in core.js; set before first paint by
     js/app-head.js, app.html's first <head> script, then kept by applyTheme in app.js).
  ============================================================ */
  :root, html[data-theme="dark"] {
    --page: #0E1013;
    --card: #15181C;
    --raised: #1C2026;
    --line: #2A2F37;
    --text: #E9EBEF;
    --muted: #9CA3AF;
    --accent: #8C9EFF;
    --accent-ink: #0E1013;
    --gain: #4CC38A;
    --loss: #E8806F;
    --close: #E3B04B;
    --breach: #F0524F;
    /* Account types (LIVE / PROP / SIM): a small dot beside a neutral
       label — never text, and none of the hues above. */
    --type-live: #3CC6D6;
    --type-prop: #E07BD3;
    --type-sim: #A9C25A;
    --emph-bg: color-mix(in srgb, var(--accent) 7%, var(--raised)); /* round S12e §3: the one thing not to miss */
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
  html[data-theme="light"] {
    --page: #F5F6F8;
    --card: #FFFFFF;
    --raised: #EDEFF2;
    --line: #DDE1E7;
    --text: #15181C;
    --muted: #555D6B;
    --accent: #3F51D9;
    --accent-ink: #FFFFFF;
    --gain: #137A4A;
    --loss: #B5452F;
    --close: #8F5E00;
    --breach: #C8262B;
    --type-live: #0B7A87;
    --type-prop: #A23A93;
    --type-sim: #5D7314;
    --emph-bg: color-mix(in srgb, var(--accent) 3%, var(--card));
    --shadow: 0 18px 48px rgba(21, 24, 28, 0.12);
    --shadow-sm: 0 6px 18px rgba(21, 24, 28, 0.10);
    /* Lighter than dark's tints (prototype: 14–16%): at 10% every coloured
       text on its tint — P&L on a kept/broken tile included — keeps 4.5:1. */
    --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
    --breach-soft: color-mix(in srgb, var(--breach) 10%, transparent);
    --close-soft: color-mix(in srgb, var(--close) 10%, transparent);
    --gain-soft: color-mix(in srgb, var(--gain) 10%, transparent);
    color-scheme: light;
  }
  :root {
    /* Derived tints — never a new hue. */
    --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
    --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
    --breach-soft: color-mix(in srgb, var(--breach) 14%, transparent);
    --close-soft: color-mix(in srgb, var(--close) 16%, transparent);
    --gain-soft: color-mix(in srgb, var(--gain) 14%, transparent);
    --raised-hover: color-mix(in srgb, var(--line) 60%, var(--raised));
    --scrim: color-mix(in srgb, var(--page) 72%, transparent);

    --font-display: "Fraunces", Georgia, "Times New Roman", serif; /* the Patienza wordmark only */
    --font-heading: "Newsreader", Georgia, "Times New Roman", serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --r-card: 16px;
    --r-ctl: 10px;
    --r-pill: 999px;
    --r-sheet: 20px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;

    /* Motion (Motion round; DESIGN_SYSTEM → Motion). Three durations, one
       decelerate curve for things that enter or move, one accelerate curve
       for things that leave. core.js mirrors them (MOTION_MS / MOTION_EASE)
       for the measured motions it plays itself. */
    --dur-fast: 150ms;     /* colours, borders, press */
    --dur-base: 200ms;     /* most movement */
    --dur-slow: 300ms;     /* sheets, folds, bars */
    --ease-out: cubic-bezier(0.2, 0, 0, 1);  /* decelerate — enters and moves; never overshoots */
    --ease-in: cubic-bezier(0.4, 0, 1, 1);   /* accelerate — exits, closes */
    --ease-move: cubic-bezier(0.3, 0, 0.4, 1); /* travel — a selection gliding across (even pace, soft landing, never overshoots) */
    --dur-highlight: 600ms; /* a changed total's wash fading out (not movement) */
    --dur-pulse: 800ms;     /* half of the AI wait's 1.6s pulse (not movement) */
    --wash-line: color-mix(in srgb, var(--text) 20%, transparent); /* AI-wait placeholder lines: ≥1.5:1 on card, raised and page in both themes */
    --highlight: color-mix(in srgb, var(--text) 12%, transparent); /* a changed total's wash */

    /* Mask icons (drawn in currentColor or a token via background). */
    --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --icon-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7l10 10M17 7L7 17' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round'/%3E%3C/svg%3E");
    --icon-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.5l9.5 17h-19z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M12 10v4.5M12 17.4v.4' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  }

  /* ============================================================
     BASE
  ============================================================ */
  * { box-sizing: border-box; }
  /* The hidden attribute always wins over a component's own display. */
  [hidden] { display: none !important; }
  /* Round N1 (CSP-READY STYLES, js/core.js): app.html's sections that start
     hidden, until the first body script moves them onto style.display. */
  [data-boot-hidden] { display: none !important; }
  .icon-sprite { position: absolute; }
  .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  /* Reduced motion: every CSS motion ends at once — pseudo-elements too,
     no repeats, no delays, no smooth scrolling. JS motion checks the same
     query itself (motionOK in core.js). Never add a newer pseudo-element
     (::details-content…) to this list: an unknown one voids the whole rule. */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      animation-delay: 0s !important;
      transition-duration: 0.001ms !important;
      transition-delay: 0s !important;
      scroll-behavior: auto !important;
    }
  }
  /* No browser tap flash on phones: every control has its own pressed
     state (the press scale, the selected fills) — #69. */
  html { background: var(--page); -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
  body {
    margin: 0;
    min-height: 100vh;
    background: var(--page);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
  }
  button, input, select, textarea { font-family: inherit; }
  button { color: inherit; }
  a { color: var(--accent); }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  input[type="file"] { display: none; }
  ::placeholder { color: var(--muted); opacity: 1; }

  /* ============================================================
     SHELL — a left rail + one focal column on desktop; below 720px a
     sticky top bar, one column and a bottom tab bar (see PHONE).
     The window scrolls; the rail is sticky.
  ============================================================ */
  .app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 24px 16px;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    background: var(--page);
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; border: 0; background: none; color: var(--text); text-decoration: none; cursor: pointer; }
  /* P2 mark: two candlesticks side by side read as a pause sign. */
  .brand-mark { width: 30px; height: 30px; flex: none; }
  .brand-mark rect { fill: var(--accent); }
  .brand-mark .brand-wicks { fill: none; stroke: var(--text); stroke-width: 1.4; stroke-linecap: round; }
  .wordmark { font-family: var(--font-display); font-optical-sizing: auto; font-weight: 500; font-size: 24px; letter-spacing: -0.01em; line-height: 1; color: var(--text); }

  /* "Log trades": today in the flow from anywhere (logTradesToday, app.js).
     A secondary button, not a nav item — it's never lit. */
  .sidebar .rail-log-btn { flex: 0 0 auto; justify-content: flex-start; gap: 10px; width: 100%; margin-top: -6px; padding: 0 14px; } /* .sidebar: outweighs .btn's flex: 1, which comes later */
  .rail-log-btn svg, .app-bar-log svg { width: 18px; height: 18px; }
  .nav-primary, .nav-secondary { display: flex; flex-direction: column; gap: 2px; }
  .rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
  .nav-secondary { padding-top: 12px; border-top: 1px solid var(--line); }
  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--r-ctl);
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  }
  .nav-item:hover { background: var(--raised); color: var(--text); }
  .nav-item.active { background: var(--raised); color: var(--text); }
  .nav-item.active .nav-icon { color: var(--accent); }
  .nav-icon { width: 20px; height: 20px; flex: none; }

  /* Theme: a two-button group in the rail and a single flip button in the
     phone bar show the theme on screen (either sets an explicit Dark or
     Light); Settings → Display's three-way seg shows the choice — Dark,
     Light or Match my device (app.js keeps all of them in step).
     The rail's pressed button and the flip's icon are drawn from
     html[data-theme] — set before the first paint by app.html's head
     script — not from aria-pressed, so the very first frame is right
     before app.js runs (Polish round 3, #53); app.js keeps aria-pressed
     and the flip's label in step for assistive tech, and the two always
     agree. Dark is anything not light, as the tokens read it. */
  .icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; flex: none; padding: 0; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); color: var(--text); cursor: pointer; }
  .icon-btn:hover { border-color: var(--muted); }
  .icon-btn svg { width: 18px; height: 18px; }
  html[data-theme="light"] .theme-flip .flip-to-light,
  html:not([data-theme="light"]) .theme-flip .flip-to-dark { display: none; }

  .app-bar, .tabbar { display: none; }
  .main { min-width: 0; }

  .wrap { max-width: 1080px; margin: 0 auto; padding: 32px 40px 64px; }
  @media (prefers-reduced-motion: no-preference) {
    .wrap { animation: pageSettle var(--dur-base) var(--ease-out); }
    @keyframes pageSettle { from { opacity: 0.4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
  }

  /* ---------- Page head: eyebrow, Newsreader title, sub-line ---------- */
  .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
  .page-head > :first-child { min-width: 0; }
  /* A page-head button keeps its own width beside the title (.btn grows
     by default) — the Journal's "+ Log today"; phones make the primary
     full width (PHONE). */
  .page-head > .btn { flex: none; }
  .eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
  .page-title { margin: 6px 0 0; font-family: var(--font-heading); font-weight: 500; font-size: 34px; line-height: 1.1; letter-spacing: -0.01em; color: var(--text); text-wrap: balance; }
  .page-head > div > .page-title:first-child { margin-top: 0; }
  .page-sub { margin: 6px 0 0; font-size: 15px; color: var(--muted); }
  .page-sub .link-btn { font-size: inherit; }
  .footnote { margin-top: 28px; font-size: 13px; line-height: 1.6; text-align: center; color: var(--muted); }

  /* ============================================================
     BUILDING BLOCKS
  ============================================================ */
  .card, .insight-card{
    min-width: 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    background: var(--card);
    scroll-margin-top: 24px;
  }
  .card { display: flex; flex-direction: column; gap: 16px; }
  .card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  /* Simplify round B: the one-time Consistency suggestion (Today, Plan) — a
     plain card, secondary buttons only, "Not now" on its label row. */
  .suggest-card[hidden] { display: none; }
  #planSuggest { margin-bottom: 24px; }
  /* Customize view's Insights toggles, under their section names. */

  .card-meta { font-size: 13px; color: var(--muted); }
  .card-note { margin: 0; font-size: 14px; color: var(--muted); }
  .card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  /* Today and Plan: a column of rows (.page-rows), each a full-width card
     or a pair (.row-pair) whose two cards share the row's height. A card
     whose partner is hidden — the hidden attribute or display:none — spans
     the row, and a row with both hidden takes no space. One column below
     1041px, in the DOM's order. */
  .page-rows { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
  .row-pair { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: stretch; min-width: 0; }
  .row-pair > :is([hidden], [data-boot-hidden], [style*="display: none"], [style*="display:none"]) + *,
  .row-pair > :has(+ :is([hidden], [data-boot-hidden], [style*="display: none"], [style*="display:none"])) { grid-column: 1 / -1; }
  .row-pair:not(:has(> :not([hidden], [data-boot-hidden], [style*="display: none"], [style*="display:none"]))) { display: none; }
  .stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

  /* Uppercase card labels — one spec everywhere. */
  .card-label, .dash-card-label,
  .focus-section-label, .coach-goal-label, .focus-plan-suits {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  /* The same label, inline before a sentence ("YOUR PLAN  If …"). */
  .coach-plan-label, .coach-read-label, .focus-read-label { margin-right: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

  /* ---------- Buttons ---------- */
  .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--raised);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  }
  .btn:hover { border-color: var(--muted); }
  .btn:active { transform: scale(0.98); }
  .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
  .btn:disabled:hover { border-color: var(--line); }
  .btn svg { width: 16px; height: 16px; flex: none; }
  /* Primary = the page's main action, in the accent. */
  .btn-primary, .btn-accent, .btn.focus-pill.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
  }
  .btn-primary:hover, .btn-accent:hover, .btn.focus-pill.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }
  .btn-primary:disabled:hover, .btn-accent:disabled:hover { border-color: var(--accent); filter: none; }
  .btn-outline { background: transparent; }
  .btn-ghost { flex: 0 0 auto; background: transparent; border-color: transparent; color: var(--muted); }
  .btn-ghost:hover { border-color: transparent; color: var(--text); }
  /* Destructive: outlined text in --breach, never a solid fill. */
  .btn-danger { background: transparent; border-color: color-mix(in srgb, var(--breach) 55%, transparent); color: var(--breach); }
  .btn-danger:hover { background: var(--raised); border-color: var(--breach); }
  .btn-pill { border-radius: var(--r-ctl); }
  .btn.small, .btn.focus-pill { flex: 0 0 auto; min-height: 36px; padding: 0 12px; font-size: 13px; }
  .btn.focus-add-btn { background: var(--raised); color: var(--text); }
  .btn.session-row-delete, .btn.focus-clear-btn { background: transparent; border-color: color-mix(in srgb, var(--breach) 45%, transparent); color: var(--breach); }
  .btn.session-row-delete:hover, .btn.focus-clear-btn:hover { background: var(--raised); border-color: var(--breach); }
  .link-btn { padding: 0; border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; }
  a.link-btn { text-decoration: none; } /* a link that looks like its button siblings (Settings' "Account → Your data") */

  /* ---------- Pills and chips: selected = accent-soft + accent line ---------- */
  .mood-row { display: flex; flex-wrap: wrap; gap: 6px; }
  .mood-pill {
    min-height: 34px;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  }
  @media (hover: hover) { .mood-pill:hover { color: var(--text); border-color: var(--muted); } }
  .mood-pill.active, .mood-pill[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }

  /* Segmented control (Settings → Display, Subscription). */
  .seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--r-ctl); background: var(--raised); }
  .seg .mood-pill, .seg button { min-height: 34px; padding: 6px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
  @media (hover: hover) { .seg .mood-pill:hover, .seg button:hover { color: var(--text); } }
  .seg .mood-pill.active, .seg button[aria-pressed="true"], .seg [role="tab"][aria-selected="true"] { background: var(--card); border: 0; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

  /* Status chip ("Broke a limit", "Current"). */
  .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--raised); font-size: 13px; font-weight: 500; white-space: nowrap; }

  /* Small status tag — "Cap reached" in the rules editor, "Archived" on an
     account, and "Not tracked" on over-cap limits wherever they're listed. */
  .cat-tag { display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; vertical-align: middle; }
  .cat-tag-soon { background: var(--raised); color: var(--muted); }
  .cat-tag-untracked { background: var(--close-soft); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--close) 45%, transparent); }
  /* Paused on Basic (build 3a, KEPT ON BASIC): greyed, with a small "Pro" — it counts again on Pro. */
  .cat-tag-paused { background: var(--accent-soft); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
  /* Over the plan's cap with the plan known: what's paused, in a sentence above the cap line (build 3a). */
  .limit-paused-note { margin: 0 0 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
  .is-paused, .is-paused .rule-row-text { color: var(--muted); }
  .limit-picker .pill-row.is-paused { opacity: 0.72; }
  .limit-picker-count.is-paused { color: var(--muted); }

  /* ---------- Fields ---------- */
  .field { margin-bottom: 14px; }
  .field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
  .field input, .field textarea, .field select {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-ctl);
    background: var(--raised);
    color: var(--text);
    font-size: 15px;
    line-height: 1.4;
  }
  .field textarea { resize: vertical; line-height: 1.5; }
  .field select {
    appearance: none;
    padding-right: 34px;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
    background-position: right 17px center, right 12px center;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
  }
  .field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  .field input:disabled { opacity: 0.6; cursor: not-allowed; }
  .field-hint { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--muted); }
  .note-empty { padding: 8px 0; font-size: 14px; color: var(--muted); }

  /* Note length counter (bindNoteCounter in core.js): quiet until the note
     passes the suggested length, then --close — a nudge, never an error. */

  /* An autosaving note's foot (fixes round 1): the save status on the left,
     the counter on the right, one line high whatever either says. */
  .note-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 20px; margin-top: 4px; }

  .save-status { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; opacity: 1; }
  .save-status.is-failed { color: var(--close); white-space: normal; }
  .save-status.is-fading { opacity: 0; transition: opacity var(--dur-slow) var(--ease-in); } /* the global reduced-motion rule makes it a cut */

  /* ---------- Switch ---------- */

  .mini-switch { position: relative; flex-shrink: 0; padding: 0; border: none; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .mini-switch-track { position: relative; display: block; width: 44px; height: 26px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--raised); transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
  .mini-switch-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
  .mini-switch[aria-checked="true"] .mini-switch-track { background: var(--accent); border-color: var(--accent); }
  .mini-switch[aria-checked="true"] .mini-switch-knob { transform: translateX(18px); background: var(--accent-ink); }

  /* ---------- Banners ---------- */
  /* 3+ breach days in a row (the words say so), or its positive twin. */
  .storage-banner { display: none; margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; background: var(--close-soft); box-shadow: inset 3px 0 0 var(--close); color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.5; }
  .storage-banner.show { display: block; }

  /* ---------- Messages (build 3a, board Toasts — option B; js/core.js MESSAGES) ----------
     Dark cards in a stack at the bottom right (phones: bottom, full width,
     above the bars — placeMessages sets `bottom`), newest at the bottom.
     The card stays dark in both themes, as the board has it: a coloured
     mark, one sentence, at most one action, ×. */
  .messages {
    --msg-bg: #1C2026; --msg-line: #2A2F37; --msg-text: #E9EBEF; --msg-muted: #9CA3AF; --msg-action: #AAB2FF;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 220; /* above everything: popups (50–60), the version notice (210) */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
  }
  .msg {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-sizing: border-box;
    width: 360px;
    max-width: calc(100vw - 32px);
    padding: 14px 10px 14px 16px;
    border: 1px solid var(--msg-line);
    border-radius: 14px;
    background: var(--msg-bg);
    color: var(--msg-text);
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--dur-base) var(--ease-in), transform var(--dur-base) var(--ease-in);
  }
  .msg.show { opacity: 1; transform: none; transition-timing-function: var(--ease-out); }
  .msg-mark { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; font-size: 12px; font-weight: 700; line-height: 1; }
  .msg-success .msg-mark { background: rgba(76, 195, 138, 0.18); color: #4CC38A; }
  .msg-info .msg-mark { background: rgba(156, 163, 175, 0.18); color: var(--msg-muted); font-style: italic; font-family: Georgia, serif; }
  .msg-warning { border-color: rgba(227, 176, 75, 0.45); }
  .msg-warning .msg-mark { background: rgba(227, 176, 75, 0.18); color: #E3B04B; }
  .msg-error { border-color: rgba(232, 128, 111, 0.5); }
  .msg-error .msg-mark { background: rgba(232, 128, 111, 0.18); color: #E8806F; }
  .msg-text { flex: 1; min-width: 0; padding-top: 2px; overflow-wrap: anywhere; }
  .msg-action { flex: none; align-self: center; min-height: 32px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--msg-action); font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
  .msg-close { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; margin: -3px 0 -3px -2px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--msg-muted); cursor: pointer; }
  .msg-close svg { width: 14px; height: 14px; }
  .msg-action:hover, .msg-close:hover { background: rgba(255, 255, 255, 0.06); }
  .msg-action:focus-visible, .msg-close:focus-visible { outline: 2px solid var(--msg-action); outline-offset: 1px; }
  @media (prefers-reduced-motion: reduce) { .msg { transform: none; } }

  /* ---------- Popups (desktop: centred; phone: bottom sheets) ----------
     The scrim is the overlay's ::before, under the popup (z-index -1 in
     the overlay's own stacking context), so a phone's sheet can slide in
     opaque while only the scrim fades; a click on the scrim still targets
     the overlay. Opening shows at once (focus can move straight in);
     closing stays visible until the popup has left. */
  .overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear var(--dur-base);
  }
  .overlay::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--scrim); opacity: 0; transition: opacity var(--dur-base) var(--ease-in); }
  .overlay.open { visibility: visible; pointer-events: auto; transition: none; }
  .overlay.open::before { opacity: 1; transition: opacity var(--dur-slow) var(--ease-out); }
  /* confirmOverlay can open from inside another open popup and must win. */
  #confirmOverlay { z-index: 60; }
  .modal {
    width: 100%;
    max-width: 380px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--r-sheet);
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: scale(0.98);
    transition: transform var(--dur-base) var(--ease-in), opacity var(--dur-base) var(--ease-in);
  }
  .overlay.open .modal { opacity: 1; transform: none; transition-timing-function: var(--ease-out); }
  .modal h2 { margin: 0 0 4px; font-family: var(--font-heading); font-weight: 500; font-size: 26px; line-height: 1.2; color: var(--text); }
  .modal .modal-sub { margin: 0 0 18px; font-size: 14px; line-height: 1.5; color: var(--muted); }
  .modal-actions { display: flex; gap: 10px; margin-top: 20px; }
  .confirm-modal { max-width: 340px; }
  .tier-modal { max-width: 440px; }

  .modal-warning { display: none; align-items: flex-start; gap: 8px; margin: -6px 0 16px; padding: 10px 12px; border-radius: 12px; background: var(--close-soft); color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.5; }
  .modal-warning svg { color: var(--close); }
  .modal-warning.show { display: flex; }
  .modal-warning svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
  .modal-warning-lines div + div { margin-top: 2px; }

  /* ---------- Tooltips (round R7, js/info-tip.js; board design-round-7/tt3) ----------
     Three kinds, one card. The card (#tipCard) floats on <body>
     (position: fixed, placed by the script): opaque, never see-through. */
  .tip-card {
    position: fixed; z-index: 100; left: 0; top: 0;
    width: max-content; max-width: min(300px, calc(100vw - 32px));
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--raised); box-shadow: var(--shadow-sm);
    font-family: var(--font-body); font-weight: 400; text-align: left; white-space: normal; text-transform: none; letter-spacing: 0;
  }
  .tip-card[hidden] { display: none; }
  @media (max-width: 640px) { .tip-card { width: calc(100vw - 32px); max-width: none; } } /* phone: the content width, under the word */
  .tip-card-title { margin: 0 0 4px; color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.4; }
  .tip-card-body { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
  .tip-card-body .tip-line { display: block; } /* round P1b: one setting a line */
  .tip-card-body .tip-line + .tip-line { margin-top: 6px; }
  .tip-card-body .tip-line b { color: var(--text); font-weight: 600; }
  /* 1. A word you can tap: the word itself, a faint dotted underline, no
     icon; the text's own colour (links stay accent). Open: a soft accent. */
  .tip-term {
    display: inline; margin: 0 -2px; padding: 0 2px; border: 0; border-radius: 4px;
    background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-align: inherit; line-height: inherit;
    text-decoration: underline dotted color-mix(in srgb, var(--muted) 70%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 3px;
    cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  }
  .tip-term[aria-expanded="true"] { background: var(--accent-soft); }
  .tip-term:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  /* 2. Why this card: an 18px ring by the title, its "?" 11px semibold,
     muted until open. Its bottom edge is its baseline (no in-flow text),
     so it sits centred on the title's cap height: half a cap above the
     baseline, less half the ring. 0.8em (Inter's cap plus a pixel of
     rounding) measured within 0.6px on an uppercase eyebrow, a serif h2
     and a 15px sentence (round R7); --tip-cap is the hook for a title
     whose font needs its own. */
  .tip-ring {
    position: relative; display: inline-block; flex: none;
    width: 18px; height: 18px; margin: 0 0 0 8px; padding: 0;
    border: 1.5px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted);
    font-size: inherit; line-height: 0; letter-spacing: 0; text-transform: none;
    vertical-align: calc(var(--tip-cap, 0.8em) / 2 - 9px);
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  }
  .tip-ring::before { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font: 600 11px/1 var(--font-body); }
  @media (pointer: coarse) { .tip-ring::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); } } /* a 44px target on touch (as the old "?" had) */
  .tip-ring[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
  @media (hover: hover) { .tip-ring:hover { color: var(--text); } }
  .tip-ring:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* 3. How it's counted: a folded line at the card's foot, opening in place. */
  .tip-how-slot[hidden] { display: none; }
  .tip-how { margin-top: 16px; border-top: 1px solid var(--line); }
  .tip-how-btn {
    display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin: 0; padding: 4px 0 0;
    border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
  }
  .tip-how-chev { width: 14px; height: 14px; flex: none; transition: transform var(--dur-fast) var(--ease-out); }
  .tip-how-btn[aria-expanded="true"] .tip-how-chev { transform: rotate(180deg); }
  @media (hover: hover) { .tip-how-btn:hover { color: var(--text); } }
  .tip-how-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
  .tip-how-body p { max-width: 70ch; margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

  /* ---------- Account type: neutral label + a dot in the type's hue ---------- */
  .acct-type { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
  .acct-type::before, .acct-type-pick .mood-pill::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--type-c, var(--muted)); }
  .acct-type-live, .acct-type-opt-live { --type-c: var(--type-live); }
  .acct-type-prop, .acct-type-opt-prop { --type-c: var(--type-prop); }
  .acct-type-sim, .acct-type-opt-sim { --type-c: var(--type-sim); }
  .acct-type-pick .mood-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

  /* ============================================================
     TODAY (internal page key "dashboard" — js/today.js)
     Head: eyebrow date, a short title, one primary action that follows
     the day — Check in / Reflect on today / Log trades / Open today — and,
     after a traded session, a quiet "Starting another session?" link
     (never beside Check in). Rows
     (.row-pair): [Readiness | Today's limits], This week's focus full
     width, [Lately | Today's P&L]. One column below 1041px, in that order.
  ============================================================ */
  .today-head { align-items: flex-end; }
  /* The title block grows into the row, and its scope line (2+ accounts)
     never sets where the head breaks: it wraps within the block's width
     instead of widening it, so the filter and the primary stay beside the
     title wherever they did before the line (Polish round 3). */
  .today-head > :first-child { flex: 1 1 auto; }
  .today-another { margin: 8px 0 0; font-size: 14px; }

  /* A dialog's status line (the first-run welcome's once; that popup is gone since build 3c). */
  .welcome-note { min-height: 1.4em; margin: 8px 0 0; color: var(--text); font-size: 13px; }

  /* The one-tap check-in on the head (Simplify round A): the question,
     optional toggles, three equal answers (none accent — an answer is
     never nudged), a quiet Skip. */
  .ready-ask { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 480px; }
  .ready-ask-q { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
  .ready-ask-extras { display: flex; flex-wrap: wrap; gap: 6px; }
  .ready-ask-answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ready-ask-answer { justify-content: center; }
  .ready-ask-skip { align-self: flex-start; justify-content: flex-start; color: var(--muted); }
  .ready-line { margin: 0; font-size: 15px; color: var(--text); }
  /* Once its session has trades the card is one line: it keeps its own
     height instead of stretching to Today's limits beside it. */
  .row-pair > .readiness-card.is-line { align-self: start; }
  .icon { width: 16px; height: 16px; flex: none; }

  /* ---------- Readiness: the band, its scale, the reasons ---------- */
  .ready-band { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px 14px; }
  .ready-word { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 44px; line-height: 1; color: var(--text); }
  .band-scale { display: flex; flex-wrap: wrap; gap: 6px; }
  .band-pill { padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--muted); font-size: 13px; font-weight: 500; }
  .band-pill.is-on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
  /* Not ready needs attention (--close), never a breach colour. */
  .band-pill.is-on.is-attention { border-color: color-mix(in srgb, var(--close) 45%, transparent); background: var(--close-soft); }
  .ready-reasons { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
  .ready-reasons li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 15px; }
  .ready-reasons .icon { width: 18px; height: 18px; margin-top: 2px; }
  .icon.is-up { color: var(--accent); }
  .icon.is-flat, .readiness-card .muted { color: var(--muted); }
  .icon.is-down { color: var(--close); }
  .rule-when { margin: 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; color: var(--muted); }
  .rule-when b { font-weight: 500; color: var(--text); }

  /* ---------- Focus titles (.focus-card) ---------- */
  .focus-card > p { margin: 0; }
  .focus-title { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 26px; line-height: 1.2; color: var(--text); text-wrap: balance; }
  .link-btn.is-quiet { color: var(--muted); font-size: 13px; }
  .link-btn.is-quiet:hover { color: var(--text); }

  /* ---------- Today's limits: room left on each ---------- */
  .limit-rows { display: flex; flex-direction: column; gap: 16px; }
  .limit-row { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  /* Line 1 (build 3c fix): the name, never cut, and the value on the
     right; when both don't fit, the value wraps under the name,
     right-aligned. Line 2: the account (per-account guardrails). */
 /* round P1: the value stays on the name's line */
 /* a chip's words can be long ("next trade 3 min after a loss"): it may go under */

  .limit-name { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; font-weight: 500; color: var(--text); }

 /* round F5: "3 of 6 · from your checks" */

  .limit-paused, .limit-untracked { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
  .limit-paused { align-items: flex-start; }
  .limit-paused .icon { margin-top: 2px; }
  .limit-untracked { flex-wrap: wrap; color: var(--text); }
  .limit-untracked .cat-tag { margin-left: 0; }

  /* Status chips with an icon: kept (accent), broke (breach icon + words,
     text stays --text on the tint), not yet (neutral dashed), couldn't
     check (needs attention). */
  .chip .icon { width: 14px; height: 14px; }
  .chip.is-kept { background: var(--accent-soft); color: var(--text); }
  .chip.is-kept .icon { color: var(--accent); }
  .chip.is-broke { background: var(--breach-soft); color: var(--text); }
  .chip.is-broke .icon { color: var(--breach); }
  .chip.is-quiet { border: 1px dashed var(--line); background: transparent; color: var(--muted); }

  /* A day's discipline mark (dayStatusChipHtml in core.js): the Journal's
     rows. Disciplined = accent tint and dot (a graded no-trade day: the
     rest ring instead, .is-kept.is-rest); broke =
     .is-broke above; sat out = dashed --muted, like its Calendar tile;
     limits paused = --raised; pending = a plain --line outline. */
  .status-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--accent); }
  .chip.is-satOut { padding: 2px 9px; border: 1px dashed var(--muted); background: transparent; color: var(--muted); }
  .chip.is-paused { background: var(--raised); color: var(--muted); }
  .chip.is-pending { padding: 2px 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); }

  /* ---------- Lately: the last 10 graded days ---------- */
  .big-stat { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 30px; line-height: 1.15; color: var(--text); text-wrap: balance; }

  .lately-card > p { margin: 0; }
  .lately-nudge { font-size: 14px; line-height: 1.5; color: var(--text); }
  /* "of the last 10 days" never splits: where the line can't hold it all,
     it breaks before that phrase. Lately sits in the row's wider column,
     so it keeps the 30px big-stat at every desktop width. */
  .big-stat .nowrap { white-space: nowrap; }

  /* ---------- Today's P&L: small, last ---------- */
  .pnl-card { gap: 10px; }
  .pnl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  /* The label shrinks and wraps before the amount does. */
  .pnl-head .card-label { flex: 1 1 auto; min-width: 0; }

  .pnl-body { display: flex; flex-direction: column; gap: 10px; }
  .pnl-body p { margin: 0; }

  /* ---------- Coach narrative and the Weekly Reflection's focus box ---------- */
  .coach-meta { margin-bottom: 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
  .coach-goal-box { margin-bottom: 16px; padding: 14px 16px; border-radius: 12px; background: var(--raised); }
  .coach-goal-label { margin-bottom: 5px; }
  .coach-goal-text { font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--text); }
  /* ---------- Weekly Reflection ---------- */

  /* ============================================================
     TRADING RULES POPUP (#rulesOverlay — js/settings.js)
  ============================================================ */
  .session-trade-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; padding: 8px 8px 8px 14px; border-radius: var(--r-ctl); background: var(--raised); }
  .session-trade-row.rule-row { flex-wrap: nowrap; } /* keep × beside a long rule, not wrapped under it */
  .session-trade-remove { min-width: 32px; min-height: 32px; padding: 2px 6px; border: none; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
  .session-trade-remove:hover { color: var(--breach); }
  .rule-row-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; color: var(--text); word-break: break-word; }
  /* The text is a button that opens an in-place edit (settings.js). */
  button.rule-row-text { margin: 0; padding: 0; border: 0; border-radius: 6px; background: none; text-align: left; cursor: text; }
  button.rule-row-text:hover { color: var(--accent); }
  .field input.rule-row-input { flex: 1; min-width: 0; }
  .rule-editor-row { display: flex; align-items: center; gap: 8px; }
  .rule-editor-row input { flex: 1; min-width: 0; }
  .rule-row.is-untracked .rule-row-text { color: var(--muted); }
  #rulesTierBanner .limit-upsell { margin-top: 10px; }
  /* At the tier's rule cap the row dims as one unit; "Cap reached" takes Add's place. */
  .rule-editor-row:has(input:disabled) { opacity: 0.45; }
  .rule-editor-row:has(input:disabled) input:disabled { opacity: 1; cursor: default; }
  .rule-editor-row .cat-tag { margin-left: 0; }
  .rule-reactivate-prompt { margin-top: 10px; padding: 14px 16px; border: 1px solid var(--accent-line); border-radius: 12px; background: transparent; }
  .rule-reactivate-title { font-size: 14px; font-weight: 600; color: var(--text); }
  .rule-reactivate-text { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
  .rule-reactivate-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .rule-archive { margin-top: 10px; }
  .rule-archive summary { cursor: pointer; font-size: 13px; color: var(--muted); }
  .rule-archive summary:hover { color: var(--text); }
  .rule-archive-note { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
  .rule-archive-list { margin: 8px 0 0; padding: 0; list-style: none; max-height: 252px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .rule-archive-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
  .rule-archive-row:first-child { border-top: none; }
  .rule-archive-text { grid-column: 1; font-size: 14px; line-height: 1.4; color: var(--text); word-break: break-word; }
  .rule-archive-date { grid-column: 1; font-size: 12px; color: var(--muted); }
  .rule-archive-row .btn { grid-column: 2; grid-row: 1 / span 2; }

  /* ============================================================
     RULE HISTORY (Plan page — js/settings.js)
     Current period: always open, accent-outlined. Historical periods are
     one-line rows that expand; gaps are dashed strips. The row layout
     keys off the card's own width (a container), not the viewport's.
  ============================================================ */
  /* Rule history (renderRuleHistory): one compact row per period — dates ·
     N limits · Current · Edit — that opens on a tap to its pills, its day
     count and Delete. Pills wrap; nothing is cut short. */
  .rule-history-empty-current { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; padding: 16px 18px; border: 1px dashed var(--accent-line); border-radius: 12px; background: transparent; }
  .rule-history-empty-text { flex: 1 1 220px; min-width: 0; }
  .rule-history-empty-title { font-size: 15px; font-weight: 600; color: var(--text); }
  .rule-history-empty-body { margin-top: 3px; font-size: 13px; line-height: 1.5; color: var(--muted); }
  .rule-history-badge { flex-shrink: 0; padding: 2px 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--text); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
  .rule-history-pills { display: flex; flex-wrap: wrap; gap: 6px; }
  .rule-history-pill { max-width: 100%; padding: 3px 10px; border-radius: 10px; background: var(--raised); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
  .rule-history-pill-empty { padding-left: 0; background: transparent; font-weight: 500; }
  .rh-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
  .rh-row { border-top: 1px solid var(--line); }
  .rh-list > :first-child { border-top: 0; }
  .rh-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 10px 0; }
  .rh-toggle { display: inline-flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; min-height: 36px; padding: 0; border: 0; background: none; color: var(--text); font-size: 14px; text-align: left; cursor: pointer; }
  .rh-chevron { flex: none; width: 14px; height: 14px; color: var(--muted); transition: transform var(--dur-base) var(--ease-out); }
  .rh-row.is-open .rh-chevron { transform: rotate(180deg); }
  .rh-range { font-weight: 600; }
  .rh-count { color: var(--muted); }
  .rh-count::before { content: "·"; margin-right: 8px; }
  .rh-line .cat-tag { margin-left: 0; }
  .rh-current { flex: none; }
  .rh-edit { flex: none; }
  .rh-detail { display: flex; flex-direction: column; gap: 10px; padding: 0 0 12px 22px; }
  .rh-detail[hidden] { display: none; }
  .rh-detail-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  .rh-days { color: var(--muted); font-size: 13px; }
  .rh-gap { padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; font-style: italic; }

  /* ============================================================
     PERIOD EDITOR (#settingsOverlay — js/settings.js): one popup, three
     shapes — Your focus, Discipline limits, Rule history's Edit/Add.
  ============================================================ */
  .focus-modal { max-width: 460px; }
  .focus-modal .modal-sub { margin-bottom: 20px; line-height: 1.5; }
  .focus-section + .focus-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
  .focus-section .field:last-child { margin-bottom: 0; }
  .focus-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
  .focus-section-bar { display: none; }
  .focus-modal-actions { align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 22px; }
  .focus-modal-actions .focus-clear-btn { margin-right: auto; }
  .focus-modal-actions .btn-outline, .focus-modal-actions .btn-primary { flex: 0 0 auto; }
  .period-editor-actions { justify-content: flex-end; }
  .period-editor-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
  .period-editor-title-row h2 { margin: 0; }
  .period-editor-title-row:has(+ .modal-sub[hidden]) { margin-bottom: 18px; }
  .period-date-row { display: flex; gap: 12px; }
  .period-date-row .field { flex: 1; min-width: 0; margin-bottom: 8px; }
  .period-editor label.is-disabled { color: var(--muted); opacity: 0.7; }
  .period-noend-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
  .period-noend-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
  /* Form errors need attention, not a verdict: --close. */
  .period-editor-error { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--close); }
  .period-editor-error:empty { display: none; }
  .period-editor .btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
  /* The broad wipe, a quiet link under the footer. Destructive → --breach on hover. */
  .focus-clear-link { display: block; margin-top: 12px; padding: 4px 0; border: none; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
  .focus-clear-link:hover { color: var(--breach); }
  .period-context-line { margin: 4px 0 18px; font-size: 14px; line-height: 1.5; color: var(--muted); }
  .period-context-line[hidden] { display: none; }
  .period-context-link { padding: 0; border: none; background: none; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
  .focus-switch-link { display: block; margin-top: 14px; }
  .focus-switch-link[hidden] { display: none; }

  /* Impact preview (period editor + delete confirm) — a neutral panel;
     the delete version is destructive. */
  .period-impact { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--raised); font-size: 14px; line-height: 1.45; }
  .period-impact-delete { margin-top: 0; background: var(--raised); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--breach) 45%, transparent); }
  .period-impact-title { font-weight: 600; color: var(--text); }
  .period-impact-line { display: flex; align-items: baseline; gap: 8px; color: var(--text); }
  .period-impact-muted { color: var(--muted); }
  .period-impact-arrow { flex-shrink: 0; font-size: 12px; }
  .period-impact .breach { color: var(--breach); }
  .period-impact .ok { color: var(--accent); }
  .period-impact-days summary { margin-top: 2px; font-size: 13px; color: var(--muted); cursor: pointer; }
  .period-impact-days summary:hover { color: var(--text); }
  .period-impact-days-list { display: flex; flex-direction: column; gap: 4px; max-height: 180px; margin-top: 8px; overflow-y: auto; }
  .period-impact-day { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; font-size: 13px; }
  .period-impact-day-date { color: var(--muted); }
  /* Round N1 (CSP-ready markup): the weekly reflection's own spacing, inline
     before; under its body's id, so they win as the inline styles did. */

  #reflectionCapNote { margin-top: 4px; }
  .period-close-notice { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--raised); color: var(--muted); font-size: 13px; line-height: 1.5; }

  /* ---------- Focus behavior + its if-then plan ---------- */
  .focus-read { margin: 2px 0 10px; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--accent-soft); color: var(--text); font-size: 14px; line-height: 1.5; }
  .focus-plan-templates { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
  .focus-plan-chip { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: transparent; color: var(--text); font-size: 14px; line-height: 1.45; text-align: left; cursor: pointer; }
  @media (hover: hover) { .focus-plan-chip:hover { background: var(--raised); } }
  .focus-plan-chip[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
  #focusPlanInput { width: 100%; resize: vertical; }
  #focusPlanField[hidden] { display: none; }

  /* ---------- Discipline limits picker (renderLimitPicker) ---------- */
  .limit-picker { display: flex; flex-direction: column; gap: 12px; }
  .limit-picker button { margin: 0; border: 0; font-family: inherit; }
  .limit-picker .val-pill-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
  .limit-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .limit-picker-title { font-size: 15px; font-weight: 600; color: var(--text); }
  .limit-picker-count { font-size: 13px; color: var(--muted); }
  .limit-picker-count.is-untracked { color: var(--close); }
  .limit-empty { padding: 2px 2px 4px; font-size: 14px; color: var(--muted); }
  .limit-rows { display: flex; flex-direction: column; gap: 8px; }
  .limit-picker .pill-row { display: flex; align-items: center; gap: 14px; padding: 12px 10px 12px 16px; border-radius: 12px; background: var(--raised); }
  .limit-picker .pill-row-text { flex: 1; min-width: 0; }
  .limit-picker .pill-row-label { font-size: 14px; font-weight: 600; color: var(--text); }
  .limit-picker .pill-row-sub { margin-top: 1px; font-size: 13px; color: var(--muted); }
  .limit-picker .pill-row-hint { margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--muted); }
  /* Over the tier cap: none of the period's limits count — needs attention. */
  .limit-picker .pill-row.is-untracked { border: 1px solid color-mix(in srgb, var(--close) 45%, transparent); background: var(--close-soft); }
  .limit-picker .pill-row .cat-tag { margin-left: 0; }
  .limit-picker .val-pill { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--text); font-size: 13px; line-height: normal; white-space: nowrap; cursor: pointer; }
  .limit-picker .val-pill-input { width: 76px; text-align: center; cursor: text; }
  .limit-picker .rm-circle { position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; padding: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted); font-size: 16px; font-weight: 600; cursor: pointer; }
  .limit-picker .rm-circle:hover { background: var(--card); color: var(--text); }
  .limit-catalog { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
  .limit-picker .section-label { padding: 0 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
  .limit-picker .cat-wrap { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-card); }
  .limit-picker .cat-wrap.is-locked { opacity: 0.55; }
  .limit-picker .cat-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--raised); color: inherit; font: inherit; text-align: left; cursor: pointer; }
  .limit-picker .cat-item:hover { background: var(--raised-hover); }
  .limit-picker .is-locked .cat-item { cursor: default; }
  .limit-picker .is-locked .cat-item:hover { background: var(--raised); }
  .limit-picker .cat-item-text, .limit-picker .cat-name, .limit-picker .cat-desc { display: block; }
  .limit-picker .cat-item-text { flex: 1; min-width: 0; }
  .limit-picker .cat-name { font-size: 14px; font-weight: 600; color: var(--text); }
  .limit-picker .cat-desc { margin-top: 3px; font-size: 13px; line-height: 1.4; color: var(--muted); }
  .limit-picker .cat-suggest { margin-top: 5px; color: var(--muted); }
  .limit-picker .plus-circle { position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--text); font-size: 16px; font-weight: 600; cursor: pointer; }
  .limit-upsell { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--accent-line); border-radius: 12px; background: transparent; }
  .limit-upsell-text { font-size: 13px; line-height: 1.5; color: var(--muted); }
  .limit-upsell-btn { flex-shrink: 0; min-height: 36px; margin: 0; padding: 0 14px; border: 0; border-radius: var(--r-ctl); background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
  .limit-upsell-btn:hover { filter: brightness(1.06); }
  /* A money/size limit's value per account, under its label. */
  .limit-picker .pill-row.has-accounts { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 14px; padding-bottom: 14px; }
  .limit-picker .pill-row.has-accounts .pill-row-text { grid-column: 1; grid-row: 1; }
  .limit-picker .pill-row.has-accounts .rm-circle { grid-column: 2; grid-row: 1; }
  .limit-picker .acct-limits { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 8px 16px; }
  .limit-picker .acct-limit { display: inline-flex; align-items: center; gap: 6px; }
  .limit-picker .acct-limit-name { max-width: 14ch; overflow: hidden; font-size: 12px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
  /* The catalog's column (#limitCatalog): the recommended types pinned on
     top, then Loss / Size / Pace / Time, each a collapsible list. One
     column: under the active list, after a --line. */
  .limit-catalog-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
  .limit-catalog-panel:empty { display: none; }
  .limit-catalog-panel .limit-catalog { gap: 12px; padding-top: 0; border-top: 0; }
  .limit-picker .cat-pinned, .limit-picker .cat-group { display: flex; flex-direction: column; gap: 6px; }
  .limit-picker .cat-pinned-label { padding: 0 2px; font-size: 13px; font-weight: 600; color: var(--text); }
  .limit-picker .cat-group-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 6px 4px; border-radius: var(--r-ctl); background: transparent; color: var(--text); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
  .limit-picker .cat-group-head:hover { background: var(--raised); }
  .limit-picker .cat-group-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .limit-picker .cat-group-label { flex: 1; min-width: 0; }
  .limit-picker .cat-group-count { font-size: 13px; font-weight: 500; color: var(--muted); }
  .limit-picker .cat-group.is-open .rh-chevron { transform: rotate(180deg); }
  /* From 1041px, wherever limits are edited (.is-wide — Discipline limits
     and Rule history's Edit/Add, set by openPeriodEditor): two columns.
     Left: the period line (or dates), the active limits, the impact
     preview and Clear limits; right: the catalog, spanning them. The 1fr
     row before Clear limits takes whatever height the catalog adds, so
     the left column stays packed at the top. */
  @media (min-width: 1041px) {
    .period-editor.is-wide {
      display: grid;
      max-width: 880px;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      grid-template-rows: auto auto auto auto auto auto auto 1fr auto auto auto;
      grid-template-areas:
        "head head"
        "sub sub"
        "ctx cat"
        "period cat"
        "active cat"
        "impact cat"
        "notice cat"
        "fill cat"
        "clear cat"
        "actions actions"
        "manage manage";
      column-gap: 32px;
      row-gap: 0;
      align-items: start;
    }
    .period-editor.is-wide > .period-editor-title-row { grid-area: head; }
    .period-editor.is-wide > .modal-sub { grid-area: sub; }
    .period-editor.is-wide > .period-context-line { grid-area: ctx; }
    .period-editor.is-wide > #periodSection { grid-area: period; }
    .period-editor.is-wide > #limitPicker { grid-area: active; }
    .period-editor.is-wide > #periodImpact { grid-area: impact; }
    .period-editor.is-wide > #periodCloseNotice { grid-area: notice; }
    /* The popup's max-height caps its rows, so a long catalog scrolls in
       its own column rather than running under the footer. */
    .period-editor.is-wide > #limitCatalog { grid-area: cat; align-self: stretch; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-top: 0; padding: 0 4px 0 28px; border-top: 0; border-left: 1px solid var(--line); }
    .period-editor.is-wide > #clearSettingsBtn { grid-area: clear; align-self: end; justify-self: start; text-align: left; }
    .period-editor.is-wide > .period-editor-actions { grid-area: actions; }
    .period-editor.is-wide > #manageLimitsLink { grid-area: manage; }
  }

  /* ============================================================
     CALENDAR (js/engines/performance.js)
  ============================================================ */
  .cal-chevron { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
  .cal-chevron:hover { border-color: var(--muted); }
  .cal-pill { appearance: none; min-height: 36px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--raised); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; }
  @media (hover: hover) { .cal-pill:hover { border-color: var(--muted); } }
  /* The month/year pills are the real <select>s, with a ▾ drawn in. */
  .cal-select {
    padding-right: 32px;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
    background-position: right 17px center, right 13px center;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
  }

  /* The month's header (renderSummary): the lead reading in Newsreader,
     then 2–4 smaller items beside it, then a quiet row. Items hide by
     Customize view (.hidden-tile). */
  /* The streak is a sentence, not a figure. A disciplined run is accent; a
     run of broken limits is --breach with its ✕ (red only for a breach). */
  /* Today's head and Readiness name a session by its own or its account's
     name (Polish round 3, #34) — user text, so a long unbroken one wraps
     instead of widening the page. */
  .today-head .page-title { overflow-wrap: anywhere; }

  .weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
  /* The week column: a summary cell after each row of seven — shown only
     from 1280px, where a full amount still fits every tile beside it. */
  .wk-head, .wk-sum { display: none; }
  .wk-sum { flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; min-height: 88px; padding: 10px; overflow: hidden; border-radius: 12px; background: var(--raised); font-size: 13px; }
  .wk-sum.is-empty { background: transparent; }
  .wk-disc { color: var(--muted); }
  .wk-disc b { color: var(--text); font-weight: 600; }
  .weekdays div { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-align: center; text-transform: uppercase; color: var(--muted); }
  .grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  @media (min-width: 1280px) {
    .weekdays, .grid { grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.1fr); }
    .wk-head { display: block; }
    .wk-sum { display: flex; }
  }

  /* Day tiles. Kept (clean) days take the accent tint; a broken limit takes
     the breach tint AND an × after the date; checked-in-without-trades is a
     dashed outline; a paused day is --raised. None of that is P&L — the
     amount carries gain/loss on its own. */
  .day { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 88px; padding: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
  .day.future { opacity: 0.4; }
  /* The neighbouring month's days in the first and last rows (account-plan
     round): whole tiles, dimmed, full strength on hover and focus. */
  .day.other { opacity: 0.5; }
  a.day.other:hover, a.day.other:focus-visible { opacity: 1; }
  .day-row.is-other-month { opacity: 0.55; }
  /* An amount never wraps after its sign (I6): the spans that hold one in
     a line of text; sentences put a word joiner after the sign instead
     (keepMoneyWhole, core.js). */
   .ins-amount, .ins-pay-each, .ins-feel-avg { white-space: nowrap; }
  .day-row.is-other-month:hover, .day-row.is-other-month:focus-within { opacity: 1; }
  .day.clean { border-color: transparent; background: var(--accent-soft); }
  .day.breach { border-color: transparent; background: var(--breach-soft); }
  .day.checked-in { border-style: dashed; border-color: var(--muted); background: transparent; }
  .day.is-paused { border-color: transparent; background: var(--raised); }
  .day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
  a.day { color: var(--text); text-decoration: none; transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
  a.day:hover { border-color: var(--muted); }
  a.day.clean:hover, a.day.breach:hover, a.day.is-paused:hover { border-color: var(--muted); }
  .day .num { font-size: 14px; font-weight: 600; color: var(--text); }
  .day.breach .num::after { content: ""; display: inline-block; width: 13px; height: 13px; margin-left: 4px; vertical-align: -2px; background: var(--breach); -webkit-mask: var(--icon-x) center / contain no-repeat; mask: var(--icon-x) center / contain no-repeat; }
  /* A no-trade day graded on its guardrails (build 3c fix 2): the clean
     tint plus a small ring after the date — the chip's i-rest mark. */
  .day.is-rest .num::after { content: ""; display: inline-block; box-sizing: border-box; width: 10px; height: 10px; margin-left: 5px; vertical-align: 0; border: 1.5px solid var(--accent); border-radius: 50%; }
  .day-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
  .day .today-label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
  .day.is-paused .day-top { align-items: flex-start; gap: 6px; }
  .day-top-labels { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 2px 6px; min-width: 0; }
  /* Round U1b: a tile too narrow for its date and a label (TODAY,
     PAUSED — about 100px; the rail's widths 721–1000) drops the label,
     as phones do: the tile's ring and tint still say it. */
  .grid > .day { container-type: inline-size; }
  @container (max-width: 99px) {
    .day .today-label { display: none; }
  }
  /* An amount is never cut: one line at the usual size, or — a month whose
     amounts don't all fit (phones, tablets, five-figure days;
     fitTileAmounts) — the whole month a size smaller, then broken once
     after the currency sign (.is-amt-wrap; round S12e: to the cent, no
     short form), or hidden whole (.is-clipped). */
  .day .amt, .wk-sum .amt { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; }
  .day .amt.pos, .wk-sum .amt.pos { color: var(--gain); }
  .day .amt.neg, .wk-sum .amt.neg { color: var(--loss); }
  #grid.is-amt-1 .amt, #homeWeek.is-amt-1 .hm-tile-pnl { font-size: 12px; letter-spacing: -0.01em; }
  #grid.is-amt-2 .amt, #homeWeek.is-amt-2 .hm-tile-pnl { font-size: 11px; letter-spacing: -0.02em; }
  #grid:is(.is-amt-3, .is-amt-wrap) .amt, #homeWeek:is(.is-amt-3, .is-amt-wrap) .hm-tile-pnl { font-size: 10px; letter-spacing: -0.02em; }
  #grid.is-amt-wrap .amt, #homeWeek.is-amt-wrap .hm-tile-pnl { white-space: normal; line-height: 1.2; }
  .day .amt.is-clipped, .wk-sum .amt.is-clipped { display: none; }
  .day .meta { font-size: 12px; line-height: 1.35; color: var(--muted); }
  .day .meta.is-bottom { margin-top: auto; }

  /* Month navigation: directional slide for prev/next, plain fade for jumps */
  @keyframes slideFromRight { from { transform: translateX(16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
  @keyframes slideFromLeft { from { transform: translateX(-16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

  /* ============================================================
     JOURNAL (js/trades.js) — one month: the bar (Show ▾ | ‹ month ›), then
     one card of weeks of day rows, newest first (core loop round 2 below)
  ============================================================ */
  #journalList { display: flex; flex-direction: column; gap: 24px; }
  .jweek-stats { display: inline-flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 4px 16px; margin-left: auto; color: var(--muted); font-size: 14px; } /* round P1b: at the right edge even when it wraps under the title */

  /* One row per day. Every row in the list is the same grid with fixed
     columns, so the P&L column lines up from row to row and week to week
     (a split P&L stacks inside its column, never widening it). The layout
     follows the list's own width (a container query), not the viewport's:
     one line when there's room, two below 860px, a phone card below 560px. */
  .list-card { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); container-type: inline-size; }
  .day-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); transition: background-color var(--dur-fast) var(--ease-out); }
  .list-card > .day-row:first-child { border-radius: 15px 15px 0 0; }
  .list-card > .day-row:last-child { border-bottom: none; border-radius: 0 0 15px 15px; }
  .list-card > .day-row:only-child { border-radius: 15px; }
  .day-row:hover { background: var(--raised); }
  .day-row-open {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 156px 140px minmax(0, 1fr) 72px 112px 232px 14px; /* round P1: "Tue 27 Oct TODAY" and a split's account names fit on one line */
    grid-template-areas: "date status line trades review pnl chev";
    align-items: center;
    gap: 6px 12px;
    padding: 14px 0 14px 20px;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
  }
  /* Round F3: the date and the TODAY tag wrap inside the date's own cell (the
     tag drops under the date when both don't fit), so it never runs into the
     Disciplined / Crossed tag beside it. */

  .day-row-menu-wrap { position: relative; padding: 0 16px 0 8px; }
  .kebab-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: -1px; cursor: pointer; }
  .kebab-btn:hover, .kebab-btn[aria-expanded="true"] { background: var(--raised-hover); color: var(--text); }
  .day-row-menu { position: absolute; top: calc(100% + 4px); right: 16px; z-index: 20; min-width: 150px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow-sm); }
  .day-row-menu-item { width: 100%; min-height: 36px; padding: 8px 12px; border: none; border-radius: 8px; background: transparent; color: var(--breach); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
  .day-row-menu-item:hover, .day-row-menu-item:focus-visible { background: var(--raised); outline: none; }
  /* The fill alone is 1.1:1 on the menu's card: keyboard focus also gets
     the field ring, inset (≥5.3:1 in both themes) — #68. */
  .day-row-menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

  .dv-nav-btn:disabled { opacity: 0.35; cursor: default; }
  .dv-nav-btn:disabled:hover { border-color: var(--line); }
  .dv-nav-btn.is-small { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); color: var(--text); font-size: 15px; line-height: 1; cursor: pointer; }
  .dv-nav-btn.is-small:hover { border-color: var(--muted); }

  /* Pill toggles: the check-in's extras, and the reflection's "Did you
     keep your focus?" answers (Simplify round A). */
  .dv-pill { min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; }
  @media (hover: hover) { .dv-pill:hover { border-color: var(--muted); color: var(--text); } }
  .dv-pill.is-on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
  /* "Not today" picked: selected, but neutral. */

  /* The check-in's prep toggles and its "Sat out" line (the flow's
     Prepare; the class names are Day View's, where they started). */
  .dv-prep-satout { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--line); }
  .dv-prep-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px; font-size: 14px; text-align: left; }
  .dv-prep-box { width: 16px; height: 16px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--muted); border-radius: 4px; color: var(--accent-ink); font-size: 12px; line-height: 1; }
  .dv-prep-opt.is-on .dv-prep-box { border-color: var(--accent); background: var(--accent); }
  .dv-prep-box .icon { width: 12px; height: 12px; }
  .dv-prep-satout { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  /* Sat out: disciplined, but neutral — never accent, never green. */
  .dv-prep-satout-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
  .dv-prep-satout-badge svg { width: 16px; height: 16px; flex-shrink: 0; }

  .dv-session-name { field-sizing: content; min-width: 6ch; max-width: 24ch; padding: 2px 0; border: none; border-bottom: 1px dashed transparent; background: transparent; color: var(--text); font-size: 17px; font-weight: 600; outline: none; }
  .dv-session-name:hover, .dv-session-name:focus { border-bottom-color: var(--muted); }
  .dv-time { width: 52px; padding: 2px 0; border: none; border-bottom: 1px dashed transparent; background: transparent; color: var(--muted); font-size: 14px; text-align: center; outline: none; }
  .dv-time:hover, .dv-time:focus { border-bottom-color: var(--muted); color: var(--text); }
  /* 12-hour (html[data-time-format="12h"], set by applyTimeFormat in
     core.js only while it's on): the head's time fields are wide enough
     for "12:59 pm". (A phone card's time fields are a third of the card,
     which holds "12:59 pm" from 300px — every phone width from 320.) */
  html[data-time-format="12h"] .dv-time { width: 72px; }

  .chip.is-attention { background: var(--close-soft); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--close) 45%, transparent); }

  .dv-cell { width: 100%; padding: 11px 12px; border: none; border-radius: 4px; background: transparent; color: var(--text); font: inherit; outline: none; }
  .dv-cell::placeholder { color: var(--muted); font-style: italic; }
  .dv-cell.num { text-align: right; font-variant-numeric: tabular-nums; }
  .dv-cell[data-time-mask] { padding-left: 6px; padding-right: 6px; }
  .dv-cell.pos { color: var(--gain); font-weight: 600; }
  .dv-cell.neg { color: var(--loss); font-weight: 600; }
  /* L / S: a joined pair. Long and Short are directions, not results —
     both are selected the same way. */
  .dv-dir-group { display: inline-flex; gap: 2px; margin: 7px 0 7px 12px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-pill); }
  .dv-dir { width: 30px; height: 26px; border: 1px solid transparent; border-radius: var(--r-pill); background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1; cursor: pointer; }
  .dv-dir:hover { color: var(--text); }
  .dv-dir.is-long, .dv-dir.is-short { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
  .dv-row-del { width: 28px; height: 28px; border: none; border-radius: 6px; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; }
  .dv-row-del:focus-visible { opacity: 1; }
  .dv-row-del:hover { background: var(--raised); color: var(--breach); }
  @media (hover: none) { .dv-row-del { opacity: 1; } }

  .dv-text-btn { padding: 4px 0; border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
  .dv-text-btn:hover { color: var(--text); }

  /* On a phone (≤720px) the trade cells, L / S and × keep the filled,
     rounded look Day View's phone trade cards gave them (Polish round 4). */
  @media (max-width: 720px) {
    .dv-cell { padding: 8px 6px; border-radius: 8px; background: var(--raised); }
    .dv-cell.num, .dv-cell[data-time-mask] { padding: 8px 4px; }
    .dv-dir-group { margin: 0; padding: 0; gap: 2px; border: 0; }
    .dv-dir { border-color: var(--line); border-radius: 8px; }
    .dv-row-del { opacity: 1; }
  }

  .dv-picker { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: 300px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow); }
  .dv-pick-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
  .dv-pick-month { color: var(--text); font-size: 14px; font-weight: 600; }
  .dv-pick-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .dv-pick-wk { padding-bottom: 4px; color: var(--muted); font-size: 12px; text-align: center; }
  .dv-pick-day { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
  button.dv-pick-day:hover { background: var(--raised); color: var(--text); }
  .dv-pick-day.is-other { opacity: 0.3; cursor: default; }
  .dv-pick-day.is-today { color: var(--accent); font-weight: 600; }
  .dv-pick-day.is-selected { border-color: var(--accent); background: var(--raised); color: var(--text); font-weight: 600; }
  .dv-pick-dot { position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; }
  .dv-pick-dot.pos { background: var(--gain); }
  .dv-pick-dot.neg { background: var(--loss); }
  .dv-pick-dot.is-mixed { background: var(--muted); }
  .dv-pick-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
  .dv-pick-today { padding: 0; border: none; background: transparent; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; }

  /* ============================================================
     SESSION REFLECTION POPUP (js/session-modal.js)
  ============================================================ */

  /* "More" (Simplify round A): the behavior tags, folded until wanted. */

  #sessionMoreBody { margin-top: 14px; }

  #sessionKeptPlan { margin: -4px 0 10px; }

  /* Trading rules (Polish round 5, #58/#60): each rule's text, then a
     Followed / Broke pair — two aria-pressed pills a 6px gap apart, so the
     popup's 2px --text focus ring never overlaps the neighbour. Pressed
     Followed is the selected look (--accent-soft + --accent-line); pressed
     Broke is neutral, like a slipped focus day (--raised + a --muted
     border) — a rule is the trader's own, never a broken limit, so never
     --breach. The mark (the sprite's check / x) shows only on the pressed
     button — a cue that isn't colour alone; its space is kept, and the same
     space mirrored after the word, so the word sits centred pressed or not
     and never moves. Weight stays 500. Below 721px the pair sits under the
     text as equal halves. */

  /* .reflect-pill's own hover would make an unpressed answer look like a
     pressed Broke (and stick after a tap on touch): only the words light
     up, and only where there's a real hover. */

  /* An archived or untracked rule: read-only, with the answer it has. */

  /* Selected is the accent fill and line; keyboard focus is a separate
     2px --text ring at an offset, so a focused pill never reads as a
     second selected one (backlog #19). Every control in the popup
     shares that ring. */

  /* Save and Cancel stay in reach at the foot while the popup scrolls —
     and a control Tab moves to scrolls clear of that foot (measured 90px
     in a popup, 81px on a sheet) with its focus ring, never under it. */

  /* ============================================================
     INSIGHTS (js/insights.js) — Part 4 redesigns the content
  ============================================================ */
  .ins-stack { display: flex; flex-direction: column; gap: 20px; container-type: inline-size; }
  /* Simplify round B — the three sections: one tablist under the page
     head, in the .seg look (the track outlined, since it sits on the page,
     not a card), then one panel at a time, each opening with its one-line
     lead and, the first time something shows here, a quiet "New:" line.
     A tab with something new behind it carries a small --accent dot (and
     ", new" for a screen reader). Phones: three equal 44px segments. */
  .ins-sections { display: inline-flex; flex-wrap: nowrap; margin: 0 0 20px; box-shadow: inset 0 0 0 1px var(--line); }
  .ins-sections [role="tab"] { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 18px; font-size: 14px; font-weight: 600; white-space: nowrap; }

  .ins-section[hidden] { display: none; }

   /* the dot takes its 12px from the padding: the tabs never shift (phones: below) */
  @media (forced-colors: active) {
    .seg [role="tab"][aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
    .seg [role="tab"][aria-selected="true"]:focus-visible { outline: 3px solid CanvasText; outline-offset: 2px; }
    .seg button[aria-pressed="true"], .seg .mood-pill.active { forced-color-adjust: none; background: Highlight; color: HighlightText; }

  }
  @media (max-width: 720px) {
    .ins-sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
    .ins-sections [role="tab"] { min-height: 44px; padding: 6px 8px; }
  }
  /* Getting started / Coming up: what the section's waiting cards need. */
  /* The waiting cards folded to one line per section (round 4c): the line is the card's heading, a button. */

  .ins-caption { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

  /* The weekly reflection card's "written before this week's data changed"
     line (the modal's notice; Polish round 3, #55) — gone while empty. */

  /* This week's finding: the title, its trigger, the cost / days / trend
     items, and the line into Plan's focus. */

   /* round P1b: "−$219.00 / a day", never "day" alone */

  /* Your best days: one sentence, Newsreader, with both numbers in it. */

  .ins-disclosure { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: none; background: none; color: var(--muted); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
  .ins-disclosure:hover { color: var(--text); }
  .ins-disclosure[aria-disabled="true"] { font-weight: 500; cursor: default; }
  .ins-disclosure[aria-disabled="true"] .ins-chevron { display: none; }
  .ins-chevron { width: 14px; height: 14px; flex-shrink: 0; transition: transform var(--dur-base) var(--ease-out); }
  .ins-disclosure[aria-expanded="true"] .ins-chevron { transform: rotate(180deg); }

  /* Basic's manual run: smaller than the card's other controls. Pro has
     none — only "Couldn’t update · Try again" after a failed automatic run. */

  .ins-chart { position: relative; height: 140px; margin-top: 16px; }
  .ins-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
  /* The read-out (Polish round 6, #72): a guide, a dot on the nearest
     point and a small label — drawn by insights.js's handlers, never by a
     render. A horizontal drag scrubs; a vertical one still scrolls. */
  .ins-chart { touch-action: pan-y pinch-zoom; }
  .chart-scrub { position: absolute; inset: 0; pointer-events: none; }
  .chart-scrub[hidden] { display: none; }
  .chart-scrub-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: 0.6; }
  .chart-scrub-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--card); }
  .chart-scrub-label { position: absolute; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--raised); color: var(--text); box-shadow: var(--shadow-sm); font-size: 12px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
  @media (forced-colors: active) {
    .chart-scrub-guide { background: CanvasText; opacity: 1; }
    .chart-scrub-dot { background: Highlight; box-shadow: 0 0 0 2px Canvas; forced-color-adjust: none; }
    .chart-scrub-label { border-color: CanvasText; }
  }
  .ins-ref-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 4; }
  .ins-chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; color: var(--muted); font-size: 14px; text-align: center; }
  .ins-axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 12px; }
  .ins-axis[hidden] { display: none; }
  /* Round R8: a value tag under the chart's lowest point (P&L over time's
     low, often its last day) hangs below the chart — the dates move down
     clear of it (it ran into the last date at every width, R6/R7). */
  .ins-chart:has(.chart-tag.is-below) + .ins-axis { margin-top: 22px; }
  /* Round 5a: the zero line, the area under it, dots, value tags and guide labels (insights.js chartMarksHtml). */
  .ins-zero-line { stroke: var(--muted); stroke-width: 1; opacity: 0.6; }
  .ins-below-zero { fill: var(--breach); fill-opacity: 0.2; stroke: none; }
  .chart-dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--card); pointer-events: none; }
  .chart-dot.is-high, .chart-dot.is-low, .chart-dot.is-end { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; }
  .chart-tag.is-end { color: var(--text); font-weight: 600; } /* round P1b: the end value — the result — always shown */
  .chart-tag.is-high, .chart-tag.is-low { color: var(--muted); }
  .chart-dot.is-low { background: var(--breach); }
  .chart-tag { position: absolute; color: var(--text); font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
  .chart-tag.is-above { margin-top: -8px; transform: translateY(-100%); }
  .chart-tag.is-below { margin-top: 8px; }
  .chart-tag.a-c.is-above { transform: translate(-50%, -100%); }
  .chart-tag.a-c.is-below { transform: translateX(-50%); }
  .chart-tag.a-l.is-above { margin-left: -3px; }
  .chart-tag.a-r { transform: translateX(-100%); }
  .chart-tag.a-r.is-above { transform: translate(-100%, -100%); } /* round P1b: no 3px nudge — at the last point it ran past the chart's right edge, so the end value had no place inside */
  /* The guide labels (0%, 50%, $0) sit in a gutter left of the plot. */
  #insTrendChart, #insEquityChart, #insTrendAxis, #insEquityAxis { margin-left: 34px; }
  .ins-chart:has(.chart-scrub:not([hidden])) .chart-tag { visibility: hidden; } /* the read-out replaces the value tags while it's out */
  .chart-guide-label { position: absolute; right: 100%; margin-right: 8px; transform: translateY(-50%); color: var(--muted); font-size: 11px; line-height: 1; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }

  /* Correlations: a segmented tab row that scrolls inside itself. */

  .ins-bar-track { height: 10px; overflow: hidden; border-radius: var(--r-pill); background: var(--raised); }
  .ins-bar-fill { height: 100%; border-radius: var(--r-pill); }
  /* A breach RATE isn't a broken limit: the condition's bar is --close,
     the baseline --muted. */
  .ins-bar-fill.is-breach { background: var(--close); }
  .ins-bar-fill.is-clean { background: var(--muted); }

  /* Your trajectory: text, a fixed stat column and a fixed badge column. */

   /* round W1: may wrap (the words are longer) */

   /* the fade comes back as the rows fold (Motion round) */

  /* Your journey (AI reviews round 1, engines/progress.js; round R6, boards
     in2-progress and in6-progress-back): a stepper — four numbered circles
     on one line joined by a thin line, the label and a small status under
     each (done: an accent check; current: filled accent with a soft ring;
     reached before moving back: a dashed accent ring) — then the current
     stage's milestones as a checklist with their live values, and the next
     one in a sentence. Nothing moves. */

  .ins-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
  .ins-step + .ins-step::before { content: ""; position: absolute; top: 15px; right: calc(50% + 21px); left: calc(-50% + 21px); height: 1px; background: var(--line); }

  /* After moving back: what failed, in one sentence, above the stage title (board in6). */

  /* Discipline pays: the sentence, then the two sides side by side (two columns on a phone too). */

   /* round P1: a side under the minimum, said under the stats */

  .ins-amount.pos { color: var(--gain); }
  .ins-amount.neg { color: var(--loss); }

  /* Discipline (Simplify round B): Discipline pays' sentence first, then
     the last 30 days — the ring beside the two sides, stacking on a narrow
     card — then the 14-day trend. A part with nothing yet is hidden. */

   .ins-numbers-sub[hidden]{ display: none; }

  /* Month review (AI reviews round 2, js/reviews.js): the headline in the
     Newsreader sentence style, one tally line, then "What to do next" —
     each recommendation's behaviour, its reason in muted text, what it's
     tracking so far this month, and its one-tap action (a ghost pill) or
     what that action is now. The rest folds under "Show the full review";
     earlier months under "Past reviews". */

  /* Round R6 (board in2-progress): each recommendation a row that folds —
     a number circle, its title and a chevron; the first open to start. */

  /* The long view, inside Your journey (the Journey review). */

  /* Your focuses, inside Your journey (was its own card, Your trajectory). */

   #insDividendCaption:empty, #insNumbersFoot:empty{ display: none; }
  /* Your numbers: the per-trade numbers as tiles (label, value, its
     sample), then the groups as rows. */

  .ins-num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px 24px; margin: 16px 0 0; }
  .ins-num-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .ins-num-tile dt { color: var(--muted); font-size: 13px; }
  .ins-num-tile dd, .ins-num-row dd { margin: 0; }
  .ins-num-value { color: var(--text); font-size: 18px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
  .ins-num-n { color: var(--muted); font-size: 12px; line-height: 1.4; text-wrap: balance; }
  .ins-num-tile .nowrap { white-space: nowrap; } /* "+$94.23 vs −$95" breaks before "vs", and "37 losses" stays one piece */
  .ins-num-rows { margin: 6px 0 0; }
  .ins-num-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "n n"; gap: 0 16px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); }
  .ins-num-row:first-child { border-top: none; }
  .ins-num-row dt { grid-area: label; color: var(--text); font-size: 14px; }
  .ins-num-row .ins-num-value { grid-area: value; font-size: 15px; text-align: right; }
  .ins-num-row .ins-num-n { grid-area: n; }
  .ins-numbers-sub { margin: 22px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
  @container (min-width: 681px) {
    .ins-num-row { grid-template-columns: 200px minmax(170px, auto) minmax(0, 1fr); grid-template-areas: "label value n"; }
    .ins-num-row .ins-num-value { text-align: left; }
  }
  .ins-numbers-groups:empty { display: none; }
  /* Show details: the rest of Your numbers, and every part still short of
     its sample, folded (foldOpen / foldClose — Motion). */
  .ins-details-btn { margin-top: 14px; }
  .ins-details-btn[hidden], .ins-numbers-details[hidden], .ins-num-headnote[hidden], #insNumbersTerms[hidden] { display: none; }
  .ins-numbers-details { overflow: hidden; }
  .ins-num-head:empty { display: none; }
  /* Stacked by the column's own width, not the viewport's. */
  @container (max-width: 680px) {

    .ins-num-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }

  }

  /* What fees cost you (round R6, boards in3-numbers-fees / in5-phone-fees):
     the headline, four numbers (2 × 2 in a narrow column), then the flipped
     days and the top symbols under a divider, and the foot with its link. */

  /* A phone's stepper (board in4): circles and labels, no status words (still read out). */

  /* ---------- Rule check-in (js/rule-fit.js): on Insights, and inset on Rule history ---------- */
  .rf-card[hidden] { display: none; }
  .rf-card-inset { margin-bottom: 14px; padding: 18px; border-radius: 12px; background: var(--raised); }

  /* ============================================================
     PLAN (js/settings.js, PLAN PAGE) — what the trader commits to
  ============================================================ */
  /* The limits pause (LIMITS PAUSE SETTINGS in js/settings.js). */
  .limits-pause-status { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
  .limits-pause-line { color: var(--text); font-size: 15px; }
  .limits-pause-reason { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
  .limits-pause-status .field-hint { margin-top: 2px; }
  .btn.limits-pause-btn { flex: 0 0 auto; min-height: 36px; padding: 0 14px; font-size: 13px; }
  .limits-pause-form { padding-top: 4px; }
  .limits-pause-confirm { margin: 0 0 12px; color: var(--text); font-size: 14px; line-height: 1.5; }
  .limits-pause-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
  .limits-pause-actions .btn { flex: 0 0 auto; }
  .checkin-settings .field:last-child { margin-bottom: 0; }

  /* ============================================================
     SETTINGS — app setup only; one section at a time
  ============================================================ */
  .settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
  .subnav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
  .subnav button { padding: 10px 12px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; text-align: left; white-space: nowrap; cursor: pointer; }
  .subnav button:hover { color: var(--text); }
  .subnav button[aria-current="true"] { background: var(--raised); color: var(--text); }
  .settings-section { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
  .set-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
  .card > .set-row:first-of-type, .card-label + .set-row { border-top: 0; }
  .set-row-label { min-width: 0; }
  .set-row-label b { display: block; color: var(--text); font-size: 15px; font-weight: 500; }
  .set-row-label span { display: block; color: var(--muted); font-size: 13px; }
  .set-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }

  /* Trading accounts (js/settings.js, TRADING ACCOUNTS). */
  .acct-list { display: flex; flex-direction: column; }
  .acct-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding: 12px 0; border-top: 1px solid var(--line); }
  .acct-row:first-child { border-top: none; }
  .acct-row.is-archived .acct-name, .acct-row.is-archived .acct-switch-label { color: var(--muted); }
  .acct-row-main { flex: 1 1 220px; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
  .acct-name { color: var(--text); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
  .acct-name-input { width: 220px; max-width: 100%; min-width: 0; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--raised); color: var(--text); font-size: 15px; font-weight: 600; }
  .acct-name-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  .acct-row .cat-tag { margin-left: 0; }
  .acct-count { color: var(--muted); font-size: 13px; }
  .acct-row-switches { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; }
  .acct-switch { display: inline-flex; align-items: center; gap: 8px; }
  .acct-switch-label { color: var(--muted); font-size: 13px; white-space: nowrap; }
  .day-row-menu-wrap.acct-menu-wrap { padding: 0; }
  .acct-menu { right: 0; min-width: 170px; }
  .acct-menu .day-row-menu-item { color: var(--text); font-weight: 500; }
  .acct-menu .day-row-menu-item.is-danger { color: var(--breach); font-weight: 600; }
  .acct-add { padding: 4px 0 12px; }
  .acct-add-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
  .acct-add-hint { margin: 8px 0 0; font-size: 13px; }
  .acct-add-actions { display: flex; gap: 8px; margin-top: 10px; }
  /* What "Count for discipline" is for, once under the list (2+ accounts,
     Polish round 3 #13); the card's gap spaces it. */
  .acct-list-note { margin: 0; }
  .acct-status { margin: 8px 0 0; color: var(--close); font-size: 13px; line-height: 1.5; }
  .acct-status:empty { display: none; }
  #accountTierBanner .limit-upsell { margin-top: 12px; }
  /* An account's inline editors under the row (commission, file imports) and their summary lines. The acct-eval
     names are from the eval rules editor (AI reviews round 1, removed in round A10); the other editors share them. */
  .acct-eval-summary { flex-basis: 100%; margin: -4px 0 0; font-size: 13px; }
  .acct-eval { flex-basis: 100%; padding: 4px 0 2px; }
  .acct-eval-hint { margin: 0 0 10px; font-size: 13px; }
  .acct-eval-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; }
  .acct-eval-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .acct-eval-label { color: var(--muted); font-size: 13px; }
  .acct-eval-input { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--raised); }
  .acct-eval-input:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
  .acct-eval-sym { color: var(--muted); font-size: 14px; }
  .acct-eval-input input { width: 9ch; min-width: 0; padding: 6px 0; border: 0; background: transparent; color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; outline: none; }
  /* A downgrade's one question: which account stays active. */
  .tier-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
  .tier-choice { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "radio name type" "radio meta meta"; align-items: center; gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); color: var(--text); cursor: pointer; }
  .tier-choice:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
  .tier-choice input { grid-area: radio; accent-color: var(--accent); }
  .tier-choice-name { grid-area: name; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
  .tier-choice .acct-type { grid-area: type; }
  .tier-choice-meta { grid-area: meta; color: var(--muted); font-size: 13px; }
  .tier-modal .tier-note { margin: 14px 0 0; line-height: 1.5; }

  /* The account filter (js/money-scope.js, round AF; only with 2+
     accounts): a pill naming the selection — an accent outline, "· 1 of 3"
     and "Show all" beside it while filtered, "1 new" when something new is
     left out — and its panel: floating under it on a desktop (the
     attempts beside it), a bottom sheet on a phone. */
  .page-head:has(.money-scope) { row-gap: 12px; }
  .money-scope { display: inline-flex; align-items: center; gap: 4px 12px; min-width: 0; max-width: 100%; margin-left: auto; }
  /* Round R8 (boards mf1 / mf3): one place on every page — the right end of
     the title row, its middle on the title's (the head's bottom is the
     title's line; --mf-lift is half of what the title's line is taller
     than the button). The day page keeps it in its top row, by the date. */
  .page-head > .money-scope { --mf-lift: calc((37.4px - 36px) / 2); flex: none; align-self: flex-end; margin-bottom: var(--mf-lift); } /* the 34px title's 37.4px line, the 36px pill */
  .ins-head > .money-scope { --mf-lift: calc((46px - 36px) / 2); } /* Insights: its title row is the Customize icon's 46px, the title centred in it */
  .page-head:has(> .money-scope) { align-items: flex-end; } /* the Accounts list's head centred its row */
  .page-head:has(> .money-scope) > :first-child { flex: 1 1 0; min-width: 0; }
  .mf-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 0 12px 0 16px; white-space: nowrap; }
  .mf-btn.is-filtered { border-color: var(--accent); background: var(--card); box-shadow: inset 0 0 0 0.5px var(--accent); }
  .mf-btn-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .mf-btn-of { flex: none; color: var(--muted); }
  .mf-new { flex: none; padding: 1px 7px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 600; line-height: 1.5; }
  .mf-chev { flex: none; width: 16px; height: 16px; color: var(--muted); }
  .mf-btn[aria-expanded="true"] .mf-chev { transform: rotate(180deg); }
  .mf-showall { flex: none; white-space: nowrap; }
  .mf-layer { position: relative; z-index: 60; }
  .mf-layer[hidden], .mf-panel[hidden] { display: none; }
  .mf-panel { position: fixed; top: 0; left: 0; display: flex; flex-direction: column; width: 300px; max-width: calc(100vw - 16px); max-height: 70vh; overflow-y: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); color: var(--text); }
  .mf-body { display: flex; flex-direction: column; }
  .mf-search { width: 100%; min-height: 40px; margin: 2px 0 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--raised); color: var(--text); font: inherit; font-size: 15px; }
  .mf-search:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .mf-row-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; border-radius: 8px; }
  .mf-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
  .mf-row[aria-disabled="true"] { cursor: default; }
  .mf-row:focus-visible, .mf-more:focus-visible, .mf-arch-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .mf-row-wrap .mf-row { grid-column: 1; }
  .mf-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .mf-name { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
  .mf-all .mf-name { font-weight: 600; }
  .mf-line { color: var(--muted); font-size: 13px; }
  .mf-box { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: 1.5px solid var(--muted); border-radius: 5px; background: var(--card); color: var(--accent-ink); }
  .mf-box .icon { width: 14px; height: 14px; }
  .mf-row[aria-checked="true"] .mf-box { border-color: var(--accent); background: var(--accent); }
  .mf-row[aria-checked="mixed"] .mf-box { border-color: var(--accent); color: var(--accent); }
  .mf-only { grid-column: 2; display: inline-flex; justify-self: end; padding: 0 10px; color: var(--muted); font-size: 13px; } /* round R8: on every row, always */
  .mf-only:focus-visible { color: var(--text); }
  @media (hover: hover) { .mf-only:hover { color: var(--text); } }
  .mf-pick { margin: 10px 10px 4px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
  .mf-foot { margin: 8px 10px 4px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.45; } /* round P1: the Dashboard's grading line, once its tip is closed */
  .mf-more { grid-column: 3; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 40px; margin-right: 2px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
  .mf-more .icon { width: 16px; height: 16px; }
  .mf-row-wrap.is-open { background: var(--raised); }
  @media (hover: hover) {
    .mf-row-wrap:hover { background: var(--raised); }
    .mf-all:hover, .mf-sub .mf-row:hover { background: var(--raised); }
    .mf-more:hover { color: var(--text); }
  }
  .mf-rule { flex: none; height: 1px; margin: 6px 4px; background: var(--line); }
  .mf-group { display: flex; flex-direction: column; }
  .mf-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 10px 10px 4px; }
  .mf-group-name { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
  .mf-group-link { font-size: 13px; }
  .mf-group-link[aria-disabled="true"] { color: var(--muted); cursor: default; }
  .mf-arch { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
  .mf-arch-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; }
  .mf-arch-icon { width: 14px; height: 14px; transition: transform var(--dur-fast) var(--ease-out); }
  .mf-arch-btn[aria-expanded="true"] .mf-arch-icon { transform: rotate(90deg); }
  .mf-none { margin: 6px 10px; color: var(--muted); font-size: 14px; }
  .mf-sub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 10px 2px; }
  .mf-sub-name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
  .mf-sub-of { flex: none; color: var(--muted); font-size: 13px; }
  .mf-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 8px 4px; }
  .mf-title { margin: 0; font-family: var(--font-heading); font-size: 24px; font-weight: 500; }
  .mf-done, .mf-back { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; font-size: 16px; }
  .mf-back .icon { width: 16px; height: 16px; }
  /* A phone: one bottom sheet over a dimmed page, one screen at a time. */
  .mf-layer.is-sheet { position: fixed; inset: 0; z-index: 70; background: var(--scrim); }
  .mf-layer.is-sheet .mf-panel { top: auto; right: 0; bottom: 0; left: 0; width: auto; max-width: none; max-height: 86vh; max-height: 86dvh; padding: 8px 14px calc(16px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
  .mf-layer.is-sheet .mf-panel::before { content: ""; flex: none; display: block; width: 40px; height: 4px; margin: 2px auto 6px; border-radius: 4px; background: var(--line); }
  .mf-layer.is-sheet .mf-only { min-height: 44px; padding: 0 12px; font-size: 14px; }
  .mf-layer.is-sheet .mf-row { min-height: 48px; }
  .mf-layer.is-sheet .mf-more { width: 44px; height: 48px; }
  @media (prefers-reduced-motion: reduce) { .mf-arch-icon { transition: none; } }
  /* A card head with a link on the right (Today's limits, This week's
     focus): the link stays on the label's row,
     right-aligned, at every width, and a long label wraps beside it
     rather than pushing the link onto a line of its own (Polish round 2,
     #47 — since Polish round 3 for any such head, now no head carries a
     scope tag). */
  .card-row:has(> .link-btn) { flex-wrap: nowrap; align-items: baseline; }
  .card-row:has(> .link-btn) > .card-label { flex: 0 1 auto; min-width: 0; }
  .card-row:has(> .link-btn) > .link-btn { flex: none; margin-left: auto; }

  /* ============================================================
     MOTION (Motion round — DESIGN_SYSTEM.md → Motion). Motion only shows
     what changed or where something went. These classes are added by
     core.js's motion helpers on an action, and dropped when they end;
     nothing here animates from a state selector, so a page that opens
     with an answer already given stays still. Under reduced motion the
     helpers add none of them (and BASE's rule ends any CSS motion).
  ============================================================ */
  @keyframes motionFade { from { opacity: 0; } to { opacity: 1; } }
  /* D: a new trade row or session arrives. */
  .motion-fade-fast { animation: motionFade var(--dur-fast) var(--ease-out); }
  /* 1: AI-written text arriving; A: a limit's "✕ Broke" mark, once. */
  .motion-fade { animation: motionFade var(--dur-base) var(--ease-out); }
  /* F (a day) and the Calendar's month: in from the direction of
     travel. The page column clips sideways only while it runs. */
  .motion-from-left { animation: slideFromLeft var(--dur-base) var(--ease-out); }
  .motion-from-right { animation: slideFromRight var(--dur-base) var(--ease-out); }
  .main.motion-clip-x { overflow-x: clip; }

  /* 2. A mark draws itself on the tap that sets it: one rule for every
     mark — the sprite's strokes all have pathLength 1, so Broke's ✕ draws
     exactly as Followed's ✓ (both strokes of the ✕ at once). The 2-long
     gap keeps a round cap from showing as a dot before it starts. */
  @keyframes markDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
  .icon.is-drawing { stroke-dasharray: 1 2; animation: markDraw var(--dur-base) var(--ease-out); }

  /* 1. AI waits: placeholder lines shaped like the text to come, pulsing
     gently while the wait lasts — the only motion that repeats. The pulse
     runs on the card holding them (a registered property the lines read),
     so a re-render mid-wait doesn't restart it; still under reduced motion,
     and where @property isn't supported. */
  @property --ai-pulse { syntax: "<number>"; inherits: true; initial-value: 1; }
  @keyframes aiPulse { from { --ai-pulse: 0.6; } to { --ai-pulse: 1; } }
  .ai-wait { display: grid; gap: 8px; margin: 10px 0 0; }
  .ai-line { display: block; width: 100%; height: 0.9em; border-radius: 6px; background: var(--wash-line); opacity: var(--ai-pulse, 1); }
  .ai-line.is-92 { width: 92%; }
  .ai-line.is-80 { width: 80%; }
  .ai-line.is-64 { width: 64%; }
  .ai-line.is-40 { width: 40%; }
  .ai-line.is-pill { width: 168px; height: 32px; border-radius: var(--r-pill); }
  .ai-wait-block { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }

  #insReflectionHead.is-ai-waiting { display: none; }
   /* Basic's row is already there */

  #insCard-reflection:has(#insReflectionHead.is-ai-waiting),
  :is(#reflectionBody, #insRuleFit, #ruleHistoryRuleFit, #insMonthBody, #insLongBody):has(.ai-wait) {
    animation: aiPulse var(--dur-pulse) ease-in-out infinite alternate;
  }
  @media (prefers-reduced-motion: reduce) {
    #insCard-reflection:has(#insReflectionHead.is-ai-waiting),
    :is(#reflectionBody, #insRuleFit, #ruleHistoryRuleFit, #insMonthBody, #insLongBody):has(.ai-wait) { animation: none; }
  }

  /* B. A changed total: a neutral wash behind the number fades out —
     never gain/loss, never a count. */
  @keyframes totalChanged { from { opacity: 1; } to { opacity: 0; } }

  /* 7. Sliding highlight: segmented controls and tab sets hold the ghost
     (core.js glideSelection) under their labels; the new option's own fill
     waits until it lands. */
  .seg { position: relative; }
  .seg, .subnav { isolation: isolate; }
  .motion-glide { position: absolute; z-index: -1; pointer-events: none; }
  .glide-target { background-color: transparent !important; box-shadow: none !important; border-color: transparent !important; }
  /* The rail's Dark/Light while its knob travels: both icons in --text,
     their own colours back as it lands. A --page icon on the bare track
     (1.2:1), or a --muted one over the dark --muted knob (1:1), would
     vanish; no one colour reaches 3:1 on both the dark track and that knob,
     and --text gives the most: 13.7:1 on the track, 2.1:1 over the knob
     passing under it (light: legible on both). */

  /* 3. Switches: a small ✓ / ✕ rides in the knob — on / off isn't colour
     alone. */
  .mini-switch-knob::before {
    content: ""; position: absolute; inset: 3px;
    background: var(--card);
    -webkit-mask: var(--icon-x) center / contain no-repeat; mask: var(--icon-x) center / contain no-repeat;
    transition: background-color var(--dur-fast) var(--ease-out);
  }
  .mini-switch[aria-checked="true"] .mini-switch-knob::before { background: var(--accent); -webkit-mask-image: var(--icon-check); mask-image: var(--icon-check); }

  /* 6. Text links: an underline on hover (a real pointer) and on keyboard
     focus. On a desktop pointer it grows from the centre; in the touch
     layout, where a link's tap box is 44px, it's a plain underline. */
  @media (hover: hover) {
    .link-btn:hover, .period-context-link:hover { text-decoration: underline; }
  }
  .link-btn:focus-visible, .period-context-link:focus-visible { text-decoration: underline; }
  @media (min-width: 721px) and (pointer: fine) {
    .link-btn, .period-context-link, .dv-text-btn {
      background-image: linear-gradient(currentColor, currentColor);
      background-origin: content-box;
      background-position: 50% 100%;
      background-size: 0 1px;
      background-repeat: no-repeat;
    }
    .link-btn, .period-context-link, .dv-text-btn { transition: background-size var(--dur-base) var(--ease-out); }
    .link-btn:focus-visible, .period-context-link:focus-visible, .dv-text-btn:focus-visible { text-decoration: none; background-size: 100% 1px; }
  }
  @media (min-width: 721px) and (pointer: fine) and (hover: hover) {
    .link-btn:hover, .period-context-link:hover, .dv-text-btn:hover { text-decoration: none; background-size: 100% 1px; }
  }

  /* 8. Fields: the focus ring and border ease in (they go at once on blur;
     no outline at rest, so forced colours show none). */
  .field input, .field textarea, .field select,
  .acct-name-input, .limit-picker .val-pill-input, .dv-session-name, .dv-time {
    outline-color: transparent;
    transition: border-color var(--dur-fast) var(--ease-out), outline-color var(--dur-fast) var(--ease-out);
  }

  /* E. Native <details>: a chevron that turns in place of the marker, and
     the same height motion where the browser can animate one. */
  details > summary { list-style: none; }
  details > summary::-webkit-details-marker { display: none; }
  details > summary::before {
    content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px;
    background: currentColor;
    -webkit-mask: var(--icon-chevron) center / contain no-repeat; mask: var(--icon-chevron) center / contain no-repeat;
    transition: transform var(--dur-base) var(--ease-out);
  }
  details[open] > summary::before { transform: rotate(180deg); }
  @media (prefers-reduced-motion: no-preference) {
    @supports selector(::details-content) {
      details { interpolate-size: allow-keywords; }
      details::details-content { height: 0; overflow: clip; transition: height var(--dur-slow) var(--ease-in), content-visibility var(--dur-slow) var(--ease-in) allow-discrete; }
      details[open]::details-content { height: auto; transition-timing-function: var(--ease-out); }
      details.fold-instant::details-content { transition: none; }
    }
  }

  /* 9. The Settings icon (inline in the rail and the phone bar): on a real
     pointer's hover its two knobs slide apart a little along their lines —
     the line under each knob is cut by a mask hole that moves with it, so
     at rest it's the sprite's icon exactly. */
  .settings-icon .knob-a, .settings-icon .knob-b { transition: transform var(--dur-base) var(--ease-out); }
  @media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    #navSettings:hover .knob-a, .icon-btn[data-nav="settings"]:hover .knob-a { transform: translateX(-2px); }
    #navSettings:hover .knob-b, .icon-btn[data-nav="settings"]:hover .knob-b { transform: translateX(2px); }
  }

  /* Nav icons (Motion follow-up): every rail icon has one small move of
     its own, as Settings' knobs do — Today's sun turns 30°, Journal's lines
     write in, Calendar's binder tabs dip, Insights' bars rise from their
     baseline (the whole icon scaled from y 20 of 24, so the baseline stays
     put), Plan's check draws, Log trades' pencil writes along its own
     stroke. A real pointer's hover shows it and leaving takes it back —
     hover only, so an item opened from the keyboard never stays posed; and
     a hover never erases: Journal and Plan, whose phone move is a draw,
     lift 2px on the desktop instead (Motion follow-up 2). On phones the
     tapped tab's (and the bar's Log trades' and gear's) plays once from the
     tap (.icon-play, playIconMove in core.js). At rest each is the sprite's
     icon exactly; none of it under reduced motion. */
  /* An icon whose parts move draws the sprite's own shapes at rest
     (.ic-rest — a path split in two anti-aliases a little differently) and
     swaps to its parts (.ic-parts) only while its move plays; they stay
     until the move has come back. */
  .ic-parts { visibility: hidden; }
  @media (prefers-reduced-motion: no-preference) {
    .ic-rest, .ic-parts { transition: visibility 0s linear var(--dur-base); }
    .icon-play .ic-rest { visibility: hidden; transition: none; }
    .icon-play .ic-parts { visibility: visible; transition: none; }
    #navHome .nav-icon, .tab-item[data-nav="home"] svg, #navInsights .nav-icon, .tab-item[data-nav="insights"] svg,
    #navJournal .nav-icon, #navPlan .nav-icon, .ic-pencil { transition: transform var(--dur-base) var(--ease-out); }
    #navInsights .nav-icon, .tab-item[data-nav="insights"] svg { transform-origin: 50% 83.333%; }
    .tab-item.icon-play[data-nav="home"] svg { transform: translateY(-2px); } /* round D1: the Dashboard's squares lift, as Journal and Plan do on a hover */
    .tab-item.icon-play[data-nav="insights"] svg { transform: scaleY(1.12); }
    .icon-play .ic-pencil { transform: translate(-1.06px, 1.06px); }
    .icon-play .ic-draw { stroke-dasharray: 1 2; animation: markDraw var(--dur-base) var(--ease-out); }
    .icon-btn.icon-play[data-nav="settings"] .knob-a { transform: translateX(-2px); }
    .icon-btn.icon-play[data-nav="settings"] .knob-b { transform: translateX(2px); }
  }
  @media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .rail-log-btn:hover .ic-rest { visibility: hidden; transition: none; }
    .rail-log-btn:hover .ic-parts { visibility: visible; transition: none; }
    #navInsights:hover .nav-icon { transform: scaleY(1.12); }
    #navHome:hover .nav-icon, #navJournal:hover .nav-icon, #navPlan:hover .nav-icon { transform: translateY(-2px); }
    .rail-log-btn:hover .ic-pencil { transform: translate(-1.06px, 1.06px); }
  }
  /* The phone bar's theme button: the glyph it replaced stays drawn over
     the new one while it turns away (flipGlyph in core.js). */
  .theme-flip { position: relative; }
  .theme-flip svg.motion-flip-old { display: block !important; position: absolute; inset: 0; margin: auto; pointer-events: none; }

  /* B's wash in the light theme: at 12% a loss or gain at its peak fell
     under 4.5:1 on --page; 4% keeps every number at 4.5:1 or more. A later
     rule, outside the colour blocks. */
  html[data-theme="light"] { --highlight: color-mix(in srgb, var(--text) 4%, transparent); }

  /* J. Press: what you tap gives a little, as a button does — never a
     field, a trade card or a native select. */
   .dv-pill, .filter-chip, .focus-plan-chip:not(.mood-pill), button.cal-pill, .seg button:not(.mood-pill), .dv-dir, .subnav button, .day-row-open, .tab-item {
    transition: transform var(--dur-fast) var(--ease-out);
  }

  :is(.mood-pill, .dv-pill, .filter-chip, .focus-plan-chip, button.cal-pill, .seg button, .theme-btn, .dv-dir, .subnav button, a.day, .day-row-open, .nav-item, .tab-item):not(:disabled):not([aria-disabled="true"]):active {
    transform: scale(0.98);
  }

  /* Forced colours: the gradient underline and the knob's glyph would
     vanish — a plain underline, and the switch in system colours. */
  @media (forced-colors: active) {
    .link-btn:hover, .period-context-link:hover, .dv-text-btn:hover,
    .link-btn:focus-visible, .period-context-link:focus-visible, .dv-text-btn:focus-visible { text-decoration: underline; }
    .mini-switch-knob, .mini-switch-knob::before { forced-color-adjust: none; }
    .mini-switch-knob { background: CanvasText; }
    .mini-switch[aria-checked="true"] .mini-switch-knob { background: Highlight; }
    .mini-switch-knob::before, .mini-switch[aria-checked="true"] .mini-switch-knob::before { background: Canvas; }
    details > summary::before { forced-color-adjust: none; background: CanvasText; }
    .ai-line { forced-color-adjust: none; background: GrayText; }
  }

  /* ============================================================
     TABLET (≤1040px)
  ============================================================ */
  @media (max-width: 1040px) {
    .row-pair { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 900px) and (min-width: 721px) {
    .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
    .wrap { padding-inline: 28px; }
    .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .subnav { position: relative; top: auto; flex-direction: row; overflow-x: auto; }
    .subnav-group { display: none; } /* a row of sections: the group headings would break it up */
  }

  /* ============================================================
     PHONE (≤720px): top bar, one column, bottom tab bar, bottom sheets
  ============================================================ */
  @media (max-width: 720px) {
    /* The bar keeps its own height and the page takes the rest: a page
       shorter than the screen (a fresh install, an empty Journal) used to
       share the spare height between the two rows and stretch the bar. */
    .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .sidebar { display: none; }
    /* Round U1b: a scroll to a place in the page (an attempt picked on the
       prop account's strip, a field brought into view) stops below the
       sticky bar (61px), never under it — an iPad in Split View is here too. */
    html { scroll-padding-top: calc(73px + env(safe-area-inset-top, 0px)); }
    .app-bar {
      position: sticky;
      top: 0;
      z-index: 30;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px;
      border-bottom: 1px solid var(--line);
      background: var(--page);
    }
    .app-bar .brand { padding: 0; min-height: 44px; }
    .app-bar .brand-mark { width: 26px; height: 26px; }
    .app-bar .wordmark { font-size: 21px; }
    .app-bar-actions { display: flex; align-items: center; gap: 8px; }
    .app-bar .app-bar-log { flex: 0 0 auto; min-height: 44px; padding: 0 12px; gap: 6px; white-space: nowrap; }
    .app-bar .icon-btn { width: 44px; height: 44px; }
    .tabbar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 30;
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
      border-top: 1px solid var(--line);
      background: var(--card);
    }
    .tab-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; }
    .tab-item svg { width: 22px; height: 22px; }
    .tab-item.active { color: var(--accent); }

    .wrap { padding: 20px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
    .card, .insight-card{ padding: 18px; scroll-margin-top: 80px; }
    .card { gap: 14px; }
    .page-head { margin-bottom: 16px; }
    .page-title { font-size: 28px; }
    .page-head .btn-primary { width: 100%; }
    .stack, .ins-stack { gap: 16px; }
    .page-rows, .row-pair { gap: 16px; }

    .focus-title { font-size: 22px; }
    .ready-word { font-size: 38px; }
    .big-stat { font-size: 26px; }

    /* Messages: the bottom, full width within the gutters, above the tab
       bar and the "+ Trade / Done" bar (js/core.js placeMessages sets the
       exact `bottom`). A sheet is up (the profile menu, any popup): they
       move to the top so they never cover the sheet's rows. */
    .messages { left: 16px; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); align-items: center; } /* round S1: bottom centre, above the phone bar */
    .msg { width: 100%; max-width: 440px; }
    html:has(.overlay.open) .messages { top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto !important; }

    /* Every popup is a bottom sheet. */
    .overlay { align-items: flex-end; padding: 0; }
    .modal, .focus-modal, .confirm-modal, .tier-modal{
      width: 100%;
      max-width: none !important; /* showConfirm sets an inline width */
      max-height: 92vh;
      max-height: 92dvh;
      padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px));
      border-radius: var(--r-sheet) var(--r-sheet) 0 0;
      border-bottom: 0;
      opacity: 1; /* a sheet slides in whole; only the scrim fades */
      transform: translateY(100%);
      transition: transform var(--dur-base) var(--ease-in);
    }
    .overlay.open .modal { transition: transform var(--dur-slow) var(--ease-out); }
    .modal h2 { font-size: 24px; }

    .focus-modal-actions .btn-outline, .focus-modal-actions .btn-primary { flex: 1 1 40%; }
    .focus-modal-actions .focus-clear-btn { order: 3; margin-right: 0; }
    .period-editor-actions { justify-content: flex-start; }
    .period-date-row { flex-direction: column; gap: 0; }

    /* Journal: each row is a card by its list's width (see JOURNAL). */
    .day-row-menu-wrap { padding: 0 8px 0 4px; }
    /* Settings → Accounts: the "⋯" stays on the row's first line, beside
       the name; the switches take the line under (backlog #26). */
    .acct-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main menu" "switches switches"; align-items: center; }
    .acct-row-main { grid-area: main; }
    .acct-row-switches { grid-area: switches; }
    .acct-row .acct-menu-wrap { grid-area: menu; align-self: start; }
    .acct-row .acct-eval, .acct-row .acct-eval-summary { grid-column: 1 / -1; }
    .acct-eval-input input { width: 100%; }
    .acct-eval-fields { display: grid; grid-template-columns: 1fr; }
    .journal-filters { margin-bottom: 16px; }
    #journalList { gap: 20px; }

    /* Calendar */
    #tile-streakCurrent { grid-column: 1 / -1; }
    .weekdays, .grid { gap: 3px; }
    .weekdays div { font-size: 12px; letter-spacing: 0; }
    .day { min-height: 64px; padding: 5px 2px; gap: 2px; border-radius: 8px; }
    .day .num { font-size: 13px; }
    .day.breach .num::after { width: 10px; height: 10px; margin-left: 2px; }
    .day.is-rest .num::after { width: 8px; height: 8px; margin-left: 3px; }
    .day .today-label { display: none; }
    .day .meta { display: none; }
    /* 12px, one line, never cut: the full amount when the whole month's
       fit, else the short form for the whole month (fitTileAmounts). The
       tile's aria-label keeps the full amount. */
    .day .amt { font-size: 12px; line-height: 1.25; letter-spacing: -0.02em; }
    /* Weekday-only months (no weekend day logged): five columns. */
    .grid.no-weekends, .weekdays.no-weekends { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .grid.no-weekends > .is-weekend, .weekdays.no-weekends > .is-weekend { display: none; }

    /* The flow's date picker and session head (Day View's class names) */
    .dv-picker { left: 0; right: 0; width: auto; max-width: 360px; padding: 8px; }
    .dv-pick-grid { gap: 0; }
    .dv-session-name { order: 1; flex: 0 1 auto; }
    .dv-prep-satout { padding: 14px 16px; }

    /* Settings: the section nav becomes a scrolling chip row. */
    .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .subnav { position: relative; top: auto; flex-direction: row; gap: 6px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
    .subnav button { padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); }
    .subnav button[aria-current="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
    .money-scope { margin-left: 0; }
    .page-head > .money-scope { --mf-lift: calc((30.8px - 44px) / 2); margin-left: auto; } /* round R8: at the title row's right on a phone too — the 28px title's 30.8px line, the 44px pill */
    .ins-head > .money-scope { --mf-lift: calc((46px - 44px) / 2); }
    .limit-upsell { flex-wrap: wrap; }
  }

  /* Narrow phones (under 390px): the top bar tightens so "Log trades"
     keeps its whole label beside the mark, the theme and Settings inside
     the bar's 16px sides — every button still 44px. */
  @media (max-width: 389px) {
    .app-bar { gap: 6px; }
    .app-bar-actions { gap: 4px; }
    .app-bar .app-bar-log { padding: 0 8px; gap: 4px; }
    .app-bar .brand { gap: 6px; }
    .app-bar .wordmark { font-size: 19px; }
  }
  /* Under 360px (a 320px phone, or a bigger one zoomed in): the wordmark's
     text gives way so the bar fits and "Log trades" keeps its whole label —
     the mark stays, and the button keeps its name ("Patienza, Today") and
     a 44px target (Polish round 4). */
  @media (max-width: 359px) {
    .app-bar .wordmark { display: none; }
    .app-bar .brand { min-width: 44px; justify-content: center; }
  }

  /* ============================================================
     TOUCH TARGETS — ≥44px on phones and touch screens only; desktop
     keeps the prototype's sizes.
  ============================================================ */
  @media (max-width: 720px), (pointer: coarse) {
    .btn, .btn.small, .btn.focus-pill, .btn.limits-pause-btn,
    .mood-pill, .seg .mood-pill, .seg button, .dv-pill, .dv-prep-opt,
    .cal-pill, .filter-chip, .limit-upsell-btn,
    .limit-picker .val-pill, .limit-picker .cat-item, .focus-plan-chip, .subnav button, .nav-item, .tab-item,
    .day-row-menu-item, .acct-name-input, .field input, .field select, .dv-cell, .dv-time, .dv-session-name, .link-btn, .ins-disclosure, .period-context-link,
    .focus-clear-link, .dv-text-btn, .dv-pick-today, .period-noend-row,
    .tier-choice, .acct-add-actions .btn, .rh-toggle, .limit-picker .cat-group-head, .acct-eval-input{ min-height: 44px; }
    .link-btn, .period-context-link, .focus-clear-link, .dv-text-btn, .dv-pick-today { display: inline-flex; align-items: center; }
    /* Round P1b: a flex box drops the space before a link's trailing arrow ("if-then→") — put it back. */
    :is(.link-btn, .period-context-link, .focus-clear-link, .dv-text-btn) > span[aria-hidden="true"]:last-child { margin-left: 0.28em; }
    /* Round P1b: a flex box drops the space before a link's trailing arrow ("if-then→") — put it back. */

    .focus-clear-link, .focus-switch-link { display: flex; }
    .cal-chevron, .dv-nav-btn, .dv-nav-btn.is-small, .kebab-btn, .dv-row-del, .dv-dir, .theme-btn, .session-trade-remove, .icon-btn { min-width: 44px; min-height: 44px; }
    .dv-pick-day { min-height: 44px; aspect-ratio: auto; }
    .link-btn, .limit-picker .val-pill, .dv-text-btn { min-width: 44px; justify-content: center; }
    .ready-ask .ready-ask-skip { justify-content: flex-start; } /* Today's "Skip" keeps its text on the question's edge (Simplify round A) */
    .seg .mood-pill, .seg button { min-width: 44px; } /* a one-character choice ("$", "€", "£") stays a 44px target */
    .ins-sections [role="tab"] { min-height: 44px; } /* touch screens wider than a phone too (Simplify round B) */
    button.rule-row-text { min-height: 44px; }
    .msg-action, .msg-close, .version-notice-btn, .version-notice-close { min-width: 44px; min-height: 44px; } /* launch polish */
    /* Core loop round 1 (js/flow.js): the stepper, the panel's chips and options, the decision cards, the Table's cells, a list row. */
    .fl-chip, .fl-dec, .fl-prep-opt, .fl-answer, .fl-input, .fl-reason, .fl-felt, .fl-form-select { min-height: 44px; }
 /* round A1: a trade's pencil */
    .fl-more > .link-btn{ display: inline-flex; align-items: center; min-height: 44px; }
    .period-impact-days summary { padding: 12px 0; line-height: 20px; }
    /* A link inside a sentence: a 44px hit area without breaking the line. */
    .page-sub .link-btn, .rule-when .link-btn, .card-note .link-btn, .cal-empty .link-btn, .cal-lead-why .link-btn{ display: inline-block; min-width: 0; min-height: 0; padding: 14px 8px; margin: -14px -8px; }
    .theme-btn { width: 44px; height: 44px; }
    /* iOS Safari zooms the page into a focused field set under 16px, so on
       touch screens every field is 16px (desktop keeps its sizes). :is()
       gives textarea and select the input selector's weight, so no
       component rule undercuts it. */
    :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), textarea, select) { font-size: 16px; }
    html[data-time-format="12h"] .dv-time { width: 82px; } /* "12:59 pm" at 16px */
    /* Controls that stay small on screen get an invisible 44px hit area. */
    .limit-picker .rm-circle, .limit-picker .plus-circle, .mini-switch { position: relative; }
    .limit-picker .rm-circle::after, .limit-picker .plus-circle::after, .mini-switch::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 44px;
      height: 44px;
      transform: translate(-50%, -50%);
    }
  }

  /* ============================================================
     CORE LOOP (round 1, js/flow.js) — Today is Prepare · Trade · Review.
     The head keeps Today's eyebrow and title; the stepper sits where the
     head's action was (#dashHeadAction). The body is the step's card and,
     on Prepare and Trade, a 300px right column (Today's limits with this
     week's compact focus under it, the full Coach card when it has a
     proposal or review, Done trading). Review is one column, at most
     820px. The + Trade panel is a side panel (a bottom sheet on phones);
     Done trading is a centred popup (a sheet on phones). Colour follows
     the tokens: a criterion met is accent (the trader's process), one
     missed is neutral with a ✗ (never breach), Long and Short are plain
     words (never gain / loss), a "late" check-in is muted text.
  ============================================================ */
  .fl-head { align-items: flex-end; }
  .fl-head > :first-child { flex: 1 1 auto; }

  #dashboardPage[data-step="review"] .fl-main { max-width: 820px; }
  .fl-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }

  .fl-card { padding: 28px; gap: 18px; }
  .fl-q { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 28px; line-height: 1.15; color: var(--text); text-wrap: balance; }
  .fl-card .is-quiet{ color: var(--muted); font-weight: 400; }
  .fl-card .pos{ color: var(--gain); }
  .fl-card .neg{ color: var(--loss); }
  .fl-card .is-met { color: var(--accent); }
  .fl-card .is-missed { color: var(--muted); }

  /* ---------- Prepare ---------- */
  .fl-answers { display: flex; gap: 10px; flex-wrap: wrap; }
  .fl-answer { flex: 0 1 auto; min-width: 130px; min-height: 46px; font-size: 15px; }
  .fl-answer.is-on { border-color: var(--accent-line); background: var(--accent-soft); }
  /* Locked since the first trade (account-plan round, T9): the answer stays
     selected with a small lock; the others are muted, not greyed out. */
  .fl-answer.is-locked:disabled { opacity: 1; cursor: default; gap: 6px; color: var(--text); }
  .fl-answer.is-locked svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
  .fl-answer.is-muted:disabled { opacity: 1; cursor: default; border-style: dashed; background: transparent; color: var(--muted); }
  .fl-answered { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text); }
  .fl-answered.is-late { color: var(--muted); }
  /* Not ready is a decision point, not a failure: --close-soft, never red. */
  .fl-notready { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid color-mix(in srgb, var(--close) 35%, transparent); border-radius: 14px; background: var(--close-soft); }
  .fl-notready-rule { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text); }
  .fl-notready-rule b { font-weight: 600; }
  .fl-decs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
  .fl-dec { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 44px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
  .fl-dec:hover { border-color: var(--muted); }
  .fl-dec.is-strong { border-color: var(--accent-line); }
  .fl-dec b { font-weight: 600; }
  .fl-dec span { color: var(--muted); font-size: 13px; }
  .fl-reason-label { font-size: 14px; font-weight: 600; color: var(--text); }
  .fl-reason { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); color: var(--text); font: inherit; font-size: 14px; }
  .fl-reason:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  .fl-dec-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .fl-prep { display: flex; flex-direction: column; gap: 8px; }
  .fl-prep-label { margin: 0; font-size: 14px; color: var(--muted); }
  .fl-prep-opts { display: flex; flex-wrap: wrap; gap: 8px; }
  .fl-prep-opt { min-height: 36px; border-radius: var(--r-pill); background: var(--raised); color: var(--text); }
  .fl-prep-opt:disabled { opacity: 0.6; cursor: default; }
  .fl-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); }
  .fl-foot .btn { flex: 0 0 auto; min-height: 46px; padding: 0 20px; font-size: 15px; }
  .fl-foot .card-note { flex: 1 1 200px; }
  .fl-acct { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
  .fl-acct-select { max-width: 220px; }
  .fl-card .fl-satout { padding: 0; border-top: 0; }

  /* ---------- Trade ---------- */

  /* The list: groups of trades (ROUND A1 below); the Table's divider per session. */

  /* Fixes 3: the divider is the session's head — its name and times typed
     over in place, its account, its ⋯ menu (Day View's session head). */

  .fl-menu-btn { min-width: 28px; min-height: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
  .fl-menu-btn:hover, .fl-menu-btn[aria-expanded="true"] { border-color: var(--line); background: var(--card); color: var(--text); }
  .fl-menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .fl-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; display: flex; flex-direction: column; min-width: 240px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); white-space: normal; }
  .fl-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
  .fl-menu-item:hover, .fl-menu-item:focus-visible { background: var(--raised); outline: none; }
  .fl-menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } /* the fill alone is faint (#68) */
  .fl-menu-item:disabled { color: var(--muted); cursor: default; background: transparent; }
  .fl-menu-item.is-danger { color: var(--breach); }

  .fl-list-more { padding: 4px 24px 8px; font-size: 14px; }

  /* ---------- Fields, chips and options (Review, the add form) ---------- */

  /* Round 4b (L18): a P&L field's +/− (iOS's decimal keypad has no minus). */
  .fl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .fl-chip { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--raised); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
  @media (hover: hover) { .fl-chip:hover { border-color: var(--muted); } }
  .fl-chip.is-on { border-color: var(--accent-line); background: var(--accent-soft); }

  .fl-chip:disabled { opacity: 0.6; cursor: default; }

  .fl-input { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--page); color: var(--text); font: inherit; font-size: 15px; }
  .fl-input.num { font-variant-numeric: tabular-nums; }
  .fl-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  .fl-input::placeholder { color: var(--muted); }

  /* ---------- Review ---------- */
  /* The day graded (round 5a): the status chip and the streak line opening a finished Review. */
  .fl-textarea { width: 100%; min-height: 72px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--page); color: var(--text); font: inherit; font-size: 15px; line-height: 1.5; resize: vertical; }
  .fl-textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  .fl-textarea::placeholder { color: var(--muted); }
  .fl-textarea:disabled, .fl-input:disabled { opacity: 0.7; }
  .fl-more { display: flex; flex-direction: column; gap: 12px; }
  .fl-more > .link-btn { align-self: flex-start; }
  #flowMoreBody { display: flex; flex-direction: column; gap: 16px; }
  #flowMoreBody[hidden] { display: none; }
  .fl-add-row { margin-top: 0; }
  .fl-add-row[hidden] { display: none; }
  .fl-after { display: flex; flex-direction: column; gap: 12px; }
  .fl-after-seg { align-self: flex-start; }
  .fl-summary { display: flex; flex-direction: column; padding: 4px 16px 6px; border: 1px solid var(--line); border-radius: 14px; }
  .fl-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
  .fl-summary-row:first-child { border-top: 0; }
  .fl-summary-row .fl-input { width: 140px; text-align: right; }
  .fl-summary-of { display: inline-flex; align-items: center; gap: 8px; }
  .fl-summary-of .is-quiet { white-space: nowrap; } /* round P1: "of 6" never splits */
  .fl-stepper { display: inline-flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
  .fl-stepper button { min-width: 44px; height: 42px; border: 0; background: var(--raised); color: var(--muted); font: inherit; font-size: 18px; cursor: pointer; }
  .fl-stepper button:hover { color: var(--text); }
  .fl-stepper button:disabled { opacity: 0.4; cursor: default; }
  .fl-stepper b { min-width: 40px; text-align: center; font-weight: 600; }

  /* ---------- This week's focus, compact (under Today's limits) ---------- */
  #flowDrillText { display: flex; flex-direction: column; gap: 6px; }
  #flowDrillText[hidden] { display: none; }

  /* The head's date: today's (round OD; fixes 3 had a switcher here). */
  .fl-date-row { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
  .fl-date { display: inline-flex; align-items: center; gap: 2px; }
  /* Your part's "Delete this day…". */
  .fl-delete-day { margin: 8px 0 0; }
  .link-btn.is-danger { color: var(--breach); }

  /* Phones: the stepper is a segmented row above the title; Trade's and
     Prepare's main button sits in a fixed bar above the tab bar; the list
     reads Time · Symbol · "L · ✓ Met" · P&L; the panel is a bottom sheet. */
  @media (max-width: 720px) {
    .fl-head { flex-wrap: nowrap; gap: 12px; } /* round R8: the filter stays on the title row */

     /* round P1b: the same inner room in every pill */

    .fl-card { padding: 18px; gap: 14px; }
    .fl-q { font-size: 24px; }
    .fl-answer { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; white-space: nowrap; } /* round P1b: "Not ready" on one line */
    .fl-foot .btn[data-flow="start"], .fl-foot .btn[data-flow="go-trade"] { display: none; } /* the bar below carries these two */
    .fl-foot:not(:has(> :not([data-flow="start"], [data-flow="go-trade"]))) { display: none; }

    /* Round 4b (L17): name, times and account stack, no dangling dots. */

    .fl-list-more { padding: 2px 16px 6px; }

    .fl-summary-row .fl-input { width: 120px; }

  }
  /* ============================================================
     ROUND A1 — THE TRADING DAY (18 Oct; boards R4Window, R4Today,
     R4List, R2Manual, R3Phone, R3List in design-reference/
     trade-redesign-2026-10-18). Nothing is logged while trading:
     the head's steps sit right under a one-line title on every step and
     date; Prepare opens with today's one thing and Before you trade, the
     progress tile in its right column; Trade is groups that fold, each
     trade with its part (a checklist that wraps, how it felt) and a
     pencil, and the add form inline at the end of the list. Colour per
     the tokens: a rule met is accent, one missed neutral (never breach);
     a crossed guardrail in the form's line wears an icon, its text --text.
  ============================================================ */
  /* The head: date, title (one line), the steps — the same place on every step. */
  .fl-head-main { display: flex; flex-direction: column; min-width: 0; }
  .fl-head .page-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-wrap: nowrap; }

  /* Before you trade. */

  .fl-row-lines { display: flex; flex-direction: column; }
  .fl-row-line { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--text); }
  .fl-row-line:first-child { border-top: 0; }
  .fl-row-line-val { color: var(--muted); font-variant-numeric: tabular-nums; }
 /* round P1: a label over its value, by design */
  .fl-row-line-actions { display: inline-flex; align-items: center; gap: 6px; }
  .fl-row-lines .fl-intention { padding: 10px 0; border-radius: 0; background: transparent; align-items: center; }
  .fl-row-lines .fl-intention-text { font-size: 14.5px; }

  /* The day squares (round D1: the Dashboard's guardrail grid, js/home.js; the progress tile before it). */
  .fl-progress-of { font-size: 18px; color: var(--muted); }
  .fl-progress-day { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; }
  .fl-progress-day .icon { width: 10px; height: 10px; }
  .fl-progress-day.is-kept { background: var(--accent); color: var(--accent-ink); }
  .fl-progress-day.is-rest .icon { width: 9px; height: 9px; }
  .fl-progress-day.is-broke { background: var(--breach-soft); color: var(--breach); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--breach) 45%, transparent); }
  .fl-progress-day.is-today { outline: 2px solid var(--accent); outline-offset: 1px; }

  /* Trade's head and lines. */
  /* Round A5: a date past the answer window — one quiet line, answers read only */

  .fl-rule-label { color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

  /* The groups: windows, sessions from before, runs of trades. */

  /* A trade and its part (board R4List). */

  /* Round W1 §6: "fees not set" is wider than "fees?" was — under the amount on every width (it ran under the pencil in the 96px column). */

  /* …and that row reads from its first line, the pencil on it (as on a phone). */

  /* Round P1: a narrow Trade card on a wide screen (the 1100 two-column
     page): a trade's row reads as on a phone — its details under it, not
     a 130px column of three lines. */

  .fl-felt, .fl-form-select { appearance: none; width: 100%; min-height: 40px; padding: 0 32px 0 12px; border: 1px solid var(--line); border-radius: 10px; background-color: var(--raised); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
  .fl-felt.is-empty, .fl-form-select.is-empty { border-style: dashed; border-color: color-mix(in srgb, var(--muted) 55%, var(--line)); background-color: transparent; color: var(--muted); }
  .fl-felt:focus-visible, .fl-form-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  @media (hover: hover) { .fl-felt:hover, .fl-form-select:hover { border-color: var(--muted); } }

  /* Trade's foot. */

  /* The add / edit form, inline (boards R2Manual, R3Phone, R3List). */
  .fl-form { display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 22px 24px; border-top: 1px solid var(--accent-line); background: color-mix(in srgb, var(--accent) 4%, var(--card)); }

  .fl-form-more { flex-direction: row; flex-wrap: wrap; gap: 10px 16px; }

  .fl-form-select { min-height: 44px; }

  .fl-form-hint { color: var(--muted); font-size: 13px; }

  /* ============================================================
     ROUND A2 — IMPORT FIRST, ADD BY HAND SECOND (19 Oct; boards
     R3TradeTab, R3Platform, R3Preview, R4Accounts, R3List). The Trade
     tab's card (a drop zone, how to export, + Add a trade by hand), the
     import sheet's steps, the file markers. Colour per the tokens:
     "matched" and "new" are accent (never the gain green, which is
     money and completion), "already here" muted.
  ============================================================ */
  /* Round A8: the card is compact — a title with "How to export" on its
     right, one drop strip (the drop text, and "Where do you trade?" on its
     right), the steps folded under it. ~100px closed; two lines on a phone. */

  /* Round F3: the question, and the account's name as a small line under it. */

  /* Round U1b: "· or paste ⌘V" (and "· or") wrap whole — never "⌘V" or a "·" alone on a line. */
  .imp-drop-icon { flex: 0 0 auto; width: 22px; height: 22px; color: var(--accent); }
  .imp-file { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
  .imp-how-steps[hidden] { display: none; }
  .imp-how-steps ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: imp-step; }
  .imp-how-steps li { counter-increment: imp-step; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: color-mix(in srgb, var(--text) 82%, var(--muted)); font-size: 14px; line-height: 1.45; }
  .imp-how-steps li::before { content: counter(imp-step) " · "; color: var(--text); font-weight: 600; }
  .imp-how-steps b { color: var(--text); font-weight: 600; }
  .imp-how-note { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
  .imp-how-note b, .imp-prop-hint b { color: var(--text); font-weight: 600; }
  .imp-how-note .link-btn, .imp-prop-note .link-btn { font-size: inherit; min-height: 0; vertical-align: baseline; } /* inline in a sentence: a text link, not a 44px row */
  /* The sheet's own drop step (round A8). */
  .imp-busy { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text); font-size: 15px; }
  .imp-busy-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
  /* The accounts step's why-lines and the cap's ways on (round A8). */
  .imp-acct-why { margin: 0; padding-top: 10px; padding-bottom: 10px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
  .imp-acct-why .link-btn, .imp-acct-why a { font-size: inherit; }
  .imp-acct-why + .imp-acct-why { padding-top: 0; }
  /* After an import: the summary card (round A8), bottom right; a sheet above the tab bar on a phone. */
  /* Round U1b: on a wider screen too, the page scrolls on past the card
     while it shows (its height: impSummaryPad, js/import/ui.js), so the
     page's end is never left under it. */
  /* "See them in the Journal": the imported days lit for a moment. */
  .day-row.is-imported { background-color: var(--accent-soft); } /* the class goes after a moment (js/trades.js); the row's own transition fades it */

  /* With "Import another file" the foot holds four things: the two adds
     together on the left, the view switch and Done on the right. */

  .imp-undo { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; margin: 0 24px 4px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); color: var(--text); font-size: 14px; }
  .imp-undo .btn { flex: 0 0 auto; min-height: 40px; padding: 0 16px; font-size: 14px; }

  .fl-file-note { flex-basis: 100%; margin: 0; }

  /* The sheet. */
  .import-modal { position: relative; max-width: 760px; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
  .import-overlay { z-index: 55; }
  .imp-x { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--muted); cursor: pointer; }
  .imp-x .icon { width: 18px; height: 18px; }
  .imp-x:hover { color: var(--text); background: var(--raised); }
  .imp-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .imp-head { display: flex; flex-direction: column; gap: 6px; padding-right: 48px; }
  .modal .imp-title { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 30px; line-height: 1.15; color: var(--text); }
  .imp-sub { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
  .imp-sub b { color: var(--text); font-weight: 600; }
  .imp-foot { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding-top: 4px; }
  .imp-foot .btn { flex: 0 0 auto; min-height: 52px; padding: 0 24px; font-size: 15px; white-space: nowrap; }
  .imp-foot-note { margin-left: auto; color: var(--muted); font-size: 13px; line-height: 1.45; }
  .imp-title[tabindex]:focus { outline: none; } /* round R8b: the funded question's title holds the focus, so no answer is picked by a key */
  .imp-note { margin: 0; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--page) 70%, var(--card)); color: color-mix(in srgb, var(--text) 82%, var(--muted)); font-size: 14px; line-height: 1.55; }
  .imp-error, .imp-pv-error { margin: 0; color: var(--breach); font-size: 14px; }
  .imp-error:empty, .imp-pv-error:empty { display: none; }
  .imp-tz { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
  .imp-tz select, .imp-map select, .imp-accts select { min-height: 44px; }
  .imp-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .imp-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 84px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
  .imp-choice b { font-size: 17px; font-weight: 600; }
  .imp-choice span { color: var(--muted); font-size: 14px; }
  .imp-choice:hover { border-color: var(--accent-line); }
  .imp-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .imp-table { display: flex; flex-direction: column; margin: 0 -32px; border-top: 1px solid var(--line); }
  .imp-table > div, .imp-table > .imp-acct-why { padding-left: 32px; padding-right: 32px; }
  .imp-th { color: var(--muted); font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; }
  .imp-map-row, .imp-acct-row { display: grid; grid-template-columns: 200px 200px minmax(0, 1fr); gap: 12px; align-items: center; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
  .imp-acct-row { grid-template-columns: 220px 120px minmax(0, 1fr); padding-top: 14px; padding-bottom: 14px; }
  .imp-map-row.imp-th, .imp-acct-row.imp-th { padding-top: 10px; padding-bottom: 10px; }
  .imp-map-col b, .imp-acct-row b { font-weight: 600; overflow-wrap: anywhere; }
  .imp-map-val { color: var(--muted); overflow-wrap: anywhere; }
  .imp-map-as, .imp-acct-to { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
  .imp-map-as select, .imp-acct-to select { width: auto; min-width: 180px; }
  .imp-map-row.is-ignored .imp-map-col b { color: var(--muted); font-weight: 500; }
  .imp-map-hint, .imp-acct-hint { color: var(--muted); font-size: 13px; }
  .imp-acct-hint.is-new { color: var(--close); }
  /* Round A5: a new account's name and type, under its row */
  .imp-new-acct { display: flex; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; padding-top: 4px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
  .imp-new-field { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
  .imp-new-name { width: 260px; max-width: 100%; min-height: 44px; }
  .imp-new-types { display: inline-flex; gap: 6px; }
  .imp-new-type-opt { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--raised); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
  .imp-new-type-opt.is-on { border-color: var(--accent); background: var(--accent-soft); }
  .imp-new-type-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .imp-new-problem { margin: 0; color: var(--close); font-size: 14px; }
  .imp-new-problem:empty { display: none; }
  .imp-map-missing, .imp-map-preview { margin: 0; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--page) 70%, var(--card)); color: color-mix(in srgb, var(--text) 82%, var(--muted)); font-size: 14px; }
  .imp-map-missing { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--close) 45%, transparent); }
  .imp-map-preview b { color: var(--text); font-weight: 600; }
  .imp-check { display: inline-flex; align-items: center; gap: 8px; color: color-mix(in srgb, var(--text) 82%, var(--muted)); font-size: 14px; }
  .imp-check input { width: 18px; height: 18px; accent-color: var(--accent); }
  .imp-pv { display: flex; flex-direction: column; gap: 10px; }
  .imp-pv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; }
  .imp-pv-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
  .imp-pv-field input { width: 140px; min-height: 44px; }
  .imp-symbol-field input { width: 200px; }
  .imp-toggle { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
  .imp-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
  .imp-box { display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid color-mix(in srgb, var(--muted) 70%, var(--line)); border-radius: 6px; }
  .imp-box .icon { width: 13px; height: 13px; }
  .imp-toggle[aria-checked="true"] .imp-box { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
  .imp-copy-row { display: grid; grid-template-columns: 64px minmax(110px, 1fr) repeat(var(--imp-n, 2), minmax(80px, 1fr)) 100px; gap: 12px; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
  .imp-copy-row > span { min-width: 0; overflow-wrap: anywhere; }
  .imp-num { text-align: right; }
  .imp-more { margin: 0; color: var(--muted); font-size: 13px; }

  @media (max-width: 1040px) {
    /* Round A8: a narrower sheet (721–1040px) keeps the preview's columns inside it — a history file's two accounts add one. */
  }
  /* Phones: the sheet fills the screen; each table row stacks. */
  @media (max-width: 720px) {

    .imp-how-steps ol { grid-template-columns: minmax(0, 1fr); }
    /* Round F2: while it shows, the page scrolls on past it (its height: impSummaryPad, js/import/ui.js) — #main outranks Today's phone-bar padding. */
    .imp-undo { margin: 0 16px 4px; }
    .import-overlay { padding: 0; align-items: stretch; }
    .import-modal { max-width: none; max-height: 100vh; height: 100%; border-radius: 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); gap: 16px; }
    .modal .imp-title { font-size: 24px; }
    .imp-table { margin: 0 -16px; }
    .imp-table > div, .imp-table > .imp-acct-why { padding-left: 16px; padding-right: 16px; }
    .imp-map-row, .imp-acct-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px; }
    .imp-map-as, .imp-acct-to { grid-column: 1 / -1; }
    .imp-map-as select, .imp-acct-to select { width: 100%; min-width: 0; }
    .imp-new-field { flex: 1 1 100%; }
    .imp-new-name { width: 100%; }
    .imp-th { display: none !important; }
    .imp-choices { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .imp-copy-row { grid-template-columns: 40px minmax(0, 1.3fr) repeat(var(--imp-n, 2), minmax(0, 1fr)) minmax(0, 1fr); gap: 6px; font-size: 12.5px; }
    .imp-copy .imp-copy-row.imp-th { display: grid !important; font-size: 10px; letter-spacing: 0.04em; }
    .imp-foot .btn { flex: 1 1 auto; min-height: 56px; border-radius: 16px; font-size: 17px; }
    .imp-foot-note { margin-left: 0; flex-basis: 100%; }
    .imp-pv-field input { width: 100%; }
  }
  /* While the add / edit form is open, the right column (the guardrails
     first) stays in view as the page scrolls (R2Manual: "the guardrails
     stay in view") — two columns only. */

  /* Round A9 (found by its width check, there since A1): beside the guardrails
     (1041–1279px) the form is ~420px wide — the fixed columns left Entry and
     Exit 2px each. Three even columns there, as below 1040px. */

  /* Phones: the steps above the title (it may wrap there); a trade's row
     reads time · what · P&L · pencil with its details under; its part and
     the form full width; nothing scrolls sideways. */
  @media (max-width: 720px) {

    .fl-head .page-title { white-space: normal; text-wrap: balance; }

    /* Round U1b: "NQ Short · 2" keeps 64px beside the P&L on a 360 phone —
       the amount's "fees?" mark goes under it instead of over the words. */

    /* Round P1: the row's first line reads across (time, what, P&L) and the pencil sits on it; "fees?" goes under the amount, so "NQ Long · 1" has its room. */

    .fl-form { padding: 18px 16px; gap: 16px; }

    /* Round U1b: on a 360 phone the field's half is 125px — inside its box
       the buttons are 44px with no gap and the number takes what's left,
       so "+" stays in the box. */

    .fl-form-hint { flex-basis: 100%; }

  }
  /* ============================================================
     CORE LOOP ROUND 2 (Oct 10) — Plan (PlanV2), tick
     each, the live-logging tip, the Journal's month (JournalV2)
  ============================================================ */

  .rule-history-card[hidden] { display: none; }
  /* Radio cards: a circle, a bold title and one muted line; picked = the
     accent border and a filled circle. */

  /* Three of them (Plan's not-ready rule, account-plan round): three across, one column on phones. */

  #notReadyRuleLabel { margin: 0 0 8px; }
  /* A row missing a value a limit needs (Day View's dot, in Trade's list). */
  .fl-gap { position: absolute; left: 0; top: 50%; z-index: 2; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--close); }
  /* The live-logging tip (Review; Prepare the day after). */
  /* The Calendar tile's detail on keyboard focus (js/engines/performance.js). */
  /* An empty past day's Review (loop-2 fixes): one line and Add a session. */
  .fl-empty-day { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; padding: 16px 18px; border: 1px dashed var(--line); border-radius: 14px; background: var(--raised); }
  .fl-empty-day-text { margin: 0; color: var(--text); font-size: 15px; }
  .fl-empty-day .btn { flex: 0 0 auto; }
  @media (max-width: 720px) { .fl-empty-day .btn { width: 100%; min-height: 48px; } }
  /* Trade's head: the count line wraps between its parts, never inside one. */

  /* Journal: the bar (Show ▾ | ‹ month ›), then one card of weeks. */
  /* Round P1b: one P&L edge for the header, every day's amount and every week's total.
     A day's P&L keeps an 84px slot after its amount for the "fees not set" chip (there or not;
     52px for "fees?" before round W1 §6);
     the rows' tail after that — the › (14px and its 12px gap) and the ⋯ (--jl-menu) — the
     week rows and the header leave empty too: --jl-tail. */
  /* The ⋯ is a 44px target on touch (its 24px padding drops to 12px at ≤ 720px, back to 56). */
  @media (pointer: coarse) and (min-width: 721px) { .journal-card { --jl-menu: 68px; } }
  .day-row-line-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  /* Round R8: Your review — Review → in the accent (a link inside the row), Reviewed / Not reviewed / Sat out muted. */
  @media (hover: hover) { .day-row:hover .day-row-review.is-due { text-decoration: underline; text-underline-offset: 3px; } }
  .chip.day-status.is-named { white-space: nowrap; }
  .day-row-nums { display: contents; } /* the Trades and Your review cells' line on phones, below */
  @container (max-width: 971px) { /* round P1: was 859 (see .day-row-open); round W1: 971 */
    .journal-card .jweek-head { padding-right: calc(var(--jl-fees) + var(--jl-menu)); } /* round P1b: no › here — the tail is the fees slot and the ⋯ */
    /* Round U1b: the Disciplined / Crossed chip never narrower than itself
       (it ran under the trade count at ~500px, a touch tablet's 820); the
       date's spare width goes first. */
    .day-row-open { grid-template-columns: minmax(min-content, 132px) minmax(min-content, 1fr) auto auto minmax(164px, 274px); grid-template-areas: "date status trades review pnl" "line line line line line"; } /* round W1 §6: +32px for "fees not set" */ /* round P1: up to 190px holds "Live futures +$247.50 fees?"; a tight row gives it back (it ran under the ⋯). Round P1b: + the 52px "fees?" slot every amount keeps */
  }
  /* Round R8: the named Crossed chip and Your review are wider than the cells
     they replaced — between 560 and 659px (a tablet held upright, 820px) the
     row didn't fit one line and the P&L ran under the ⋯. The count and the
     review go to a second line there, as on a phone. */
  @container (max-width: 659px) {
    .day-row-open { grid-template-columns: minmax(min-content, 132px) minmax(min-content, 1fr) minmax(164px, 274px); grid-template-areas: "date status pnl" "line line line" "nums nums nums"; } /* round P1b: 190px + the "fees?" slot; round W1 §6: +32px for "fees not set" */
  }
  @container (max-width: 559px) {
    /* Round U1b: the date keeps its width; a P&L split by account shrinks
       beside it (the names cut to "Liv…") instead of running over it. */
    /* Round P1b: one amount (not split) keeps its width and its "fees?" slot; today's date
       wraps its Today tag instead (at 360 the amount ran under the chip). */
    /* Round W1 §6: a P&L split by account takes the row's width under the date — beside it, the
       wider "fees not set" slot cut the names to "Live …". Its amounts keep the one edge. */
    /* Trades and Your review share one line under the chip (build 3c fix 3,
       L10; round R8, board jl2): the count on the left, the review on the
       right; when both don't fit (320, a split P&L) the review wraps below —
       never over its neighbour. */
    .journal-card .jweek-head { padding: 10px calc(var(--jl-fees) + var(--jl-menu)) 10px 16px; } /* round P1b: the totals end at the day rows' P&L edge */
  }
  /* ============================================================
     LAUNCH POLISH
  ============================================================ */
  /* Insights head: Customize view is an icon beside the title (44px), so
     the section tabs sit right under the title and subtitle. */

  /* "Show P&L for" inside P&L over time (2+ accounts only). */

  /* "Why this card" (js/why.js, round R7): the trader's own numbers under
     a title, where they say it — data, never closeable. */

  /* Once × (js/info-tip.js, OnceTip; round 4c): a short explainer with a
     small × — a 44px target that overlaps the card's padding rather than
     adding height. Closed, a "Why this card" piece's words sit behind the
     ring by its title (round R7). */
  .once-tip { display: flex; align-items: flex-start; gap: 4px; margin: 6px 0 2px; color: var(--muted); font-size: 13px; line-height: 1.5; }
  .once-tip-text { flex: 1; min-width: 0; }
  .once-tip.footnote { justify-content: center; align-items: center; margin-top: 20px; }
  .once-tip.footnote .once-tip-text { flex: 0 1 auto; }
  .once-x { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -12px -12px -12px 0; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
  .once-x .icon { width: 14px; height: 14px; }
  @media (hover: hover) { .once-x:hover { background: var(--raised); color: var(--text); } }
  .once-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* The limit picker's "More limits (N)" disclosure. */
  .limit-picker .cat-more { display: flex; flex-direction: column; gap: 6px; }
  .limit-picker .cat-more-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: transparent; color: var(--text); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
  .limit-picker .cat-more-btn:hover { border-color: var(--muted); }
  .limit-picker .cat-more-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .limit-picker .cat-more-btn .rh-chevron { width: 16px; height: 16px; transition: transform var(--dur-base) var(--ease-out); }
  .limit-picker .cat-more.is-open .cat-more-btn .rh-chevron { transform: rotate(180deg); }
  .limit-picker .cat-more-list { display: flex; flex-direction: column; gap: 10px; }
  .limit-picker .cat-more-list[hidden] { display: none; }

  /* Settings → Subscription: what each plan includes. */
  .tier-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 6px; }
  .tier-plan { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-card, 14px); background: var(--raised); }
  .tier-plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
  .tier-plan-head b { color: var(--text); font-size: 16px; font-weight: 600; }
  .tier-price { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
  .tier-plan-list { margin: 0; padding-left: 18px; color: var(--text); font-size: 13px; line-height: 1.55; }
  @media (max-width: 720px) { .tier-compare { grid-template-columns: 1fr; } }

  /* "A new version of Patienza is ready." — fixed above the tab bar on phones. */
  .version-notice { position: fixed; left: 50%; top: 12px; z-index: 210; display: flex; align-items: center; gap: 10px; max-width: min(92vw, 460px); padding: 8px 8px 8px 16px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--card); color: var(--text); box-shadow: var(--shadow); font-size: 14px; }
  .version-notice-btn { min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-ctl); background: var(--accent); color: var(--page); font: inherit; font-weight: 600; cursor: pointer; }
  .version-notice-close { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--muted); cursor: pointer; }
  .version-notice-btn:focus-visible, .version-notice-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* #75: the predictor tabs wrap on a phone (never a clipped "Beha…"); the
     rate never wraps at 1440; the 14-day trend is shorter; Discipline's one
     real side reads alone. */

  #insTrendChart { height: 120px; }

  /* ============================================================
     ACCOUNTS + SYNC (round 1): the invite-only gate, Settings → Account,
     the first-sync choice and Delete my account (js/account.js).
  ============================================================ */
  /* Until js/account.js decides, and while the gate is up, the app shell
     keeps its layout (boot measures it) but isn't seen; only the gate
     scrolls. */
  html[data-gate] .app-shell { visibility: hidden; }
  html[data-gate] body { overflow: hidden; }
  /* The gate is always dark, whatever the app's theme: the approved
     SignIn design (waitlist round), the same look as the front door
     (site/site.css). A full page — header, a centred column, footer. */
  .gate { position: fixed; inset: 0; z-index: 40; overflow-y: auto; display: flex; flex-direction: column; background: #0f1115; color: #eef0f4; color-scheme: dark;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; font-size: 16px; line-height: 1.55; }
  .gate[hidden] { display: none; }
  .gate a { color: #aab2ff; }
  .gate a:hover { color: #ccd1ff; }
  .gate :focus-visible { outline: 2px solid #aab2ff; outline-offset: 2px; }
  .gate-title:focus { outline: none; } /* takes focus only for screen readers */
  .gate-head { width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .gate a.gate-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #eef0f4; }
  .gate-mark { width: 26px; height: 26px; flex: none; }
  .gate-brand span { font-family: var(--font-display); font-optical-sizing: auto; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
  .gate a.gate-back { font-size: 15px; text-decoration: none; color: #c3c8d1; padding: 8px 0; margin: -8px 0; } /* a taller tap area, the header no taller */
  .gate a.gate-back:hover { color: #eef0f4; }
  .gate-main { flex: 1; width: 100%; max-width: 460px; margin: 0 auto; padding: 56px 24px; box-sizing: border-box; display: flex; flex-direction: column; gap: 20px; }
  .gate-title { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 40px; line-height: 1.1; color: #eef0f4; overflow-wrap: anywhere; }
  .gate-title b { font-weight: 500; }
  .gate-sub { margin: 0; color: #c3c8d1; }
  .gate-sub strong, .gate-sub b { color: #eef0f4; font-weight: 600; overflow-wrap: anywhere; }
  .gate-form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
  .gate-form label { font-size: 14px; color: #c3c8d1; }
  .gate-input { min-height: 50px; box-sizing: border-box; padding: 0 16px; font: inherit; color: #eef0f4; background: #171a20; border: 1px solid #353b46; border-radius: 12px; width: 100%; }
  .gate-input::placeholder { color: #7d8491; }
  .gate-input:focus { outline: none; border-color: #8e98ff; }
  .gate-input[aria-invalid="true"] { border: 1.5px solid #f2856e; padding: 0 15.5px; }
  .gate-code { min-height: 56px; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 26px; letter-spacing: 0.3em; }
  .gate-btn { min-height: 50px; padding: 0 22px; font: inherit; font-weight: 600; color: #0f1115; background: #8e98ff; border: 0; border-radius: 12px; cursor: pointer; width: 100%; }
  .gate-btn:hover { background: #a1aaff; }
  .gate-btn:disabled { opacity: 0.7; cursor: progress; }
  /* Save password waits for the two passwords to match (fixes 12 Oct): clearly off, as /register's Start is. */
  #gateResetBtn:disabled { opacity: 1; background: #2a2f38; color: #6b7280; cursor: not-allowed; }
  .gate-google { min-height: 50px; padding: 0 22px; font: inherit; font-weight: 600; color: #eef0f4; background: transparent; border: 1px solid #353b46; border-radius: 12px; cursor: pointer; width: 100%; }
  .gate-or { display: flex; align-items: center; gap: 12px; margin: 0; color: #a2a8b3; font-size: 13px; }
  .gate-or::before, .gate-or::after { content: ""; flex: 1; border-top: 1px solid #2a2f38; }
  .gate-note { margin: -10px 0 0; font-size: 14px; line-height: 1.5; color: #c3c8d1; }
  .gate-note:empty { display: none; }
  .gate-note.is-error { color: #f2a08e; }
  .gate .link-btn { font: inherit; color: #aab2ff; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
  .gate .link-btn:hover { color: #ccd1ff; }
  .gate .link-btn:disabled { color: #7d8491; cursor: default; }
  .gate-note .link-btn { display: inline; min-height: 0; padding: 0; font-size: inherit; line-height: inherit; vertical-align: baseline; }
  .gate-alt { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 15px; margin: -6px 0 0; }
  .gate-alt .link-btn { padding: 8px 0; }
  .gate-local { padding: 12px 14px; border-radius: 12px; background: #171a20; border: 1px solid #2a2f38; color: #c3c8d1; font-size: 14px; line-height: 1.5; }
  .gate-local p { margin: 0 0 4px; }
  .gate-rule { border-top: 1px solid #2a2f38; padding-top: 18px; margin: 0; color: #a2a8b3; font-size: 15px; }
  .gate-rule.is-small { font-size: 14px; }
  .gate-foot { width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px; box-sizing: border-box; font-size: 13px; color: #7d8491; display: flex; gap: 20px; flex-wrap: wrap; }
  .gate-foot a { color: #a2a8b3; }
  @media (max-width: 720px) {
    .gate-head { padding: 20px 20px 0; }
    .gate-main { padding: 40px 20px 32px; }
    .gate-title { font-size: 36px; }
    .gate-foot { padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
  }

  /* Account: this browser's sync row, Your data. */
  .cloud-status { overflow-wrap: anywhere; }
  .cloud-missing { margin: 4px 0 14px; padding: 14px 16px; border-radius: 12px; background: var(--close-soft); box-shadow: inset 3px 0 0 var(--close); color: var(--text); }
  .cloud-missing p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; }
  .cloud-missing b { font-weight: 600; }
  .cloud-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .cloud-copies { padding: 14px 0; border-top: 1px solid var(--line); }
  .cloud-copies-head { margin: 0 0 8px; }
  .cloud-copies-head b { display: block; color: var(--text); font-size: 15px; font-weight: 500; }
  .cloud-copies-head span { display: block; color: var(--muted); font-size: 13px; }
  .cloud-copy-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
  .cloud-copy { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
  .cloud-copy-what b { color: var(--text); font-weight: 500; }
  .cloud-copy-get { white-space: nowrap; }
  .cloud-copy-get .link-btn { font-size: 13px; }

  .delete-account-modal { max-width: 400px; }

  /* Sign out with changes not in the account yet (one place for data):
     three full-width choices, Stay signed in first. */
  .signout-modal { max-width: 400px; }
  .signout-modal .modal-sub b { color: var(--text); font-weight: 600; }
  .signout-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
  .signout-actions .btn { width: 100%; justify-content: center; }
  .browser-copy-more { margin: 14px 0 0; text-align: center; font-size: 13px; }
  /* Another account's unsynced changes: the version notice's bar. The
     sentence takes the room, the button keeps its words on one line, and
     on phones the bar spans the screen's gutters. */
  .leftover-notice { z-index: 209; }
  .leftover-notice span { flex: 1 1 auto; min-width: 0; line-height: 1.4; }
  .leftover-notice .version-notice-btn { flex: none; white-space: nowrap; }
  @media (max-width: 720px) {
    .leftover-notice { left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); max-width: none; transform: none; }
  }

  /* ============================================================
     ACCOUNT ROUND 2: three ways to sign in, the profile row and menu,
     the name question, the Account page, the security code, Help &
     feedback (js/account.js, js/account-page.js). Built to the approved
     designs (design-reference/account-2026-10-08) with the app's tokens.
  ============================================================ */
  /* The gate's views (always dark, like the rest of the gate). */
  .gate-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .gate-field label { font-size: 14px; color: #c3c8d1; }
  .gate-form[data-gate-form="password"], .gate-form[data-gate-form="email"], .gate-form[data-gate-form="forgot"], .gate-form[data-gate-form="reset"] { gap: 16px; }
  .gate-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .gate .gate-label-row .link-btn { font-size: 14px; padding: 4px 0; margin: -4px 0; }
  .gate .link-btn.gate-switch { align-self: center; padding: 6px 0; font-size: 15px; }
  .gate-google { display: flex; align-items: center; justify-content: center; gap: 10px; background: #171a20; font-weight: 500; }
  .gate-google:hover { border-color: #4a5160; }
  .gate-google:disabled { opacity: 0.7; cursor: progress; }
  .gate-google-g { width: 18px; height: 18px; flex: none; }
  /* The welcome view's choices (fixes round 1): the primary button, then
     outlined ones the same size as Google's. */
  .gate-choices { display: flex; flex-direction: column; gap: 10px; }
  .gate-choice { min-height: 50px; padding: 0 22px; font: inherit; font-weight: 500; color: #eef0f4; background: #171a20; border: 1px solid #353b46; border-radius: 12px; cursor: pointer; width: 100%; }
  .gate-choice:hover { border-color: #4a5160; }
  .gate-choice:disabled { opacity: 0.7; cursor: progress; }
  .gate-pw-hint { margin: 0; font-size: 13px; line-height: 1.45; color: #a2a8b3; }
  .gate-pw-hint.is-strong { color: #8fd9b0; }
  .gate-pw-hint.is-weak { color: #f2c27b; }
  /* A new password's Show / Hide, inside its field (the gate's and Account's). */
  .pw-field { position: relative; }
  .pw-field input { width: 100%; padding-right: 76px; }
  .pw-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
  .gate .pw-toggle { color: #aab2ff; }
  .pw-toggle:hover { background: var(--raised); }
  .gate .pw-toggle:hover { background: #1d2128; }
  .field .pw-field input { padding-right: 76px; }
  .pw-hint.is-strong { color: var(--gain); }
  .pw-hint.is-weak { color: var(--close); }
  /* "The passwords don't match." under Confirm password (fixes 12 Oct). */
  .pw-hint.is-mismatch { color: var(--breach); }
  .gate-pw-hint.is-mismatch { color: #f2a08e; }

  /* Signed in (html[data-account]): the rail's profile row replaces its
     Settings + theme foot; the phone bar's initials replace its theme and
     Settings buttons (the profile menu holds both). */
  .rail-profile-foot, .app-bar .app-bar-avatar { display: none; } /* .app-bar: outweighs .avatar's own display, which comes later */
  html[data-account] .rail-foot-plain { display: none; }
  html[data-account] .rail-profile-foot { display: flex; }
  .rail-profile-foot { gap: 6px; }
  /* The rail is 200px inside: one profile button (account-plan round) —
     the initials, the name (a long one ends in "…", its whole on the
     button's label) and a small ⌃⌄ mark; it opens the profile menu. */
  .rail-profile { display: flex; align-items: center; gap: 0; padding-top: 12px; border-top: 1px solid var(--line); }
  .avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--text); font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: 0.02em; }
  .avatar-lg { width: 44px; height: 44px; font-size: 15px; }
  .rail-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--text); font: inherit; font-size: 15px; font-weight: 500; text-align: left; cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out); }
  .rail-who:hover, .rail-who.active { background: var(--raised); }
  .rail-who-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-who .avatar { width: 30px; height: 30px; font-size: 12px; }
  .rail-icon { flex: none; display: inline-grid; place-items: center; width: 30px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
  .rail-icon svg { width: 18px; height: 18px; }
  .rail-icon:hover, .rail-icon.active { background: var(--raised); color: var(--text); }
  /* Tooltips: the button's name on hover and keyboard focus (above, since
     the row sits at the foot of the rail; right-aligned so none spills out
     of the rail's scroll box). */
  .tip { position: relative; }
  .tip::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 5; padding: 4px 8px; border-radius: 6px; background: var(--text); color: var(--page); font-size: 12px; font-weight: 500; line-height: 1.3; white-space: nowrap; pointer-events: none; opacity: 0; transform: translateY(2px); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
  .theme-flip.tip::after { content: "Light theme"; }
  html[data-theme="light"] .theme-flip.tip::after { content: "Dark theme"; }
  .tip:focus-visible::after { opacity: 1; transform: none; }
  @media (hover: hover) { .tip:hover::after { opacity: 1; transform: none; transition-delay: 300ms; } }

  /* The phone's profile menu: a bottom sheet of rows. */
  .modal.profile-sheet { max-width: 420px; padding: 10px 20px 28px; }
  .profile-sheet::before { content: ""; display: block; width: 40px; height: 4px; margin: 0 auto 14px; border-radius: 4px; background: var(--line); }
  .profile-sheet-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; }
  .profile-sheet-who { display: flex; flex-direction: column; min-width: 0; }
  /* Name and email on one line each, a long one ending in "…" — never broken mid-word (account-plan round); the email's title holds it whole. */
  .profile-sheet-who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .profile-sheet-who span { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sheet-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 10px 4px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
  button.sheet-row:hover { color: var(--accent); }
  .sheet-theme { justify-content: space-between; cursor: default; }
  .sheet-signout { color: var(--loss); }
  button.sheet-signout:hover { color: var(--loss); text-decoration: underline; }
  @media (max-width: 720px) {
    html[data-account] .app-bar .theme-flip, html[data-account] .app-bar [data-nav="settings"] { display: none; }
    html[data-account] .app-bar .app-bar-avatar { display: inline-grid; }
    .app-bar-avatar { width: 44px; height: 44px; padding: 0; border: 0; cursor: pointer; }
    .app-bar-avatar[aria-expanded="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
    .modal.profile-sheet { padding: 10px 20px calc(28px + env(safe-area-inset-bottom, 0px)); }
  }

  /* The name question. */
  .modal.name-modal { max-width: 440px; }
  .name-input { width: 100%; min-height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--page); color: var(--text); font: inherit; font-size: 16px; }
  .name-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  .name-actions { justify-content: flex-end; }
  .name-actions .btn { flex: 0 0 auto; min-width: 88px; }

  /* The Account page: the Settings layout, its sections stacked. */
  .account-sections { display: flex; flex-direction: column; gap: 20px; min-width: 0; max-width: 760px; }
  .account-section { display: flex; flex-direction: column; gap: 20px; min-width: 0; scroll-margin-top: 24px; }
  .account-card { gap: 0; padding-top: 18px; padding-bottom: 8px; }
  .account-card > .card-label { margin-bottom: 4px; }
  .account-card .card-label + .acct-rows > .set-row:first-child, .account-card .card-label + .acct-rows > .cloud-copies:first-child { border-top: 0; }
  /* Your data: "Where your data lives ?" under the title, then the rows. */
  .account-card .set-row { padding: 16px 0; }
  .account-card .set-row-label b { font-weight: 600; }
  .account-card .set-row-label span { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
  .account-card .set-row-label { flex: 1 1 260px; }
  .billing-plans { flex-direction: column; align-items: stretch; }
  .account-card .billing-plans .set-row-label { flex: none; }
  .billing-plans .tier-compare { margin: 0; }
  a.btn { text-decoration: none; }
  .acct-card-lead { margin: 4px 0 4px; }
  .acct-edit { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 2px 0; }
  .acct-edit-label { color: var(--text); font-size: 15px; font-weight: 600; }
  .acct-edit-line { display: flex; flex-wrap: wrap; gap: 8px; }
  .acct-input { flex: 1 1 220px; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--page); color: var(--text); font: inherit; font-size: 15px; }
  .acct-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  /* Invite a tester's optional first name (fixes 12 Oct): a full-width line above the email. */
  .acct-edit > .acct-input { flex: none; }
  .acct-invite-name { margin-bottom: 6px; }
  .acct-optional { color: var(--muted); font-weight: 400; }
  .acct-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
  .acct-note:empty { display: none; }
  /* The admin's AI cost table (round AI1): one small table a month; it
     scrolls inside its card on a phone, never the page. */
  .acct-costs-title { margin-top: 22px; }
  .acct-costs-btn { align-self: flex-start; margin: 6px 0 8px; }
  .acct-costs-month { margin-top: 14px; }
  .acct-costs-head { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
  .acct-costs-scroll { overflow-x: auto; max-width: 100%; }
  .acct-costs-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
  .acct-costs-table th, .acct-costs-table td { padding: 6px 8px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
  .acct-costs-table thead th { border-top: 0; color: var(--muted); font-weight: 500; }
  .acct-costs-table th:first-child { text-align: left; padding-left: 0; }
  .acct-costs-users { color: var(--muted); }
  .account-card .cloud-copies { padding: 16px 0; }

  /* The security code and Help & feedback. */
  .modal.security-modal, .modal.feedback-modal { max-width: 440px; }
  .security-form .field:last-of-type { margin-bottom: 4px; }
  .security-resend { margin: 6px 0 0; }
  .welcome-note.is-error { color: var(--breach); }
  .feedback-modal textarea { min-height: 140px; font-family: inherit; }
  .feedback-mail { margin: 14px 0 0; }
  .feedback-thanks { margin: 8px 0 0; color: var(--text); font-size: 16px; line-height: 1.5; }
  @media (max-width: 720px) {
    .account-card { padding-top: 16px; padding-bottom: 6px; }
    .account-card .set-row-actions { width: 100%; }
    .modal.name-modal, .modal.security-modal, .modal.feedback-modal { width: 100%; max-width: none !important; }
  }

  /* ============================================================
     CORE LOOP ROUND 3 (Oct 11) — the AI coaching consent, Account → AI
     coaching, the ✦ AI mark, the new Insights cards and the new-data dot
  ============================================================ */
  /* The consent step (#aiConsentOverlay, js/ai-consent.js): the modal
     shape at 560px — an eyebrow, the title, the lead, the "What the AI
     reads" box on --raised, a real checkbox in its own box (ticked: the
     --accent line on --accent-soft), the withdraw line, Sign out and the
     one primary. The same modal shows the stored wording. */
  .modal.consent-modal { max-width: 560px; padding: 30px 32px; }
  .consent-eyebrow { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
  .consent-modal h2 { margin-bottom: 10px; font-size: 30px; line-height: 1.15; }
  .consent-lead { margin: 0 0 16px; color: var(--text); font-size: 15px; line-height: 1.5; }
  .consent-reads { padding: 14px 16px; border-radius: 14px; background: var(--raised); }
  .consent-reads-title { margin: 0 0 8px; color: var(--text); font-size: 14px; font-weight: 600; }
  .consent-reads ul { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
  .consent-reads li { position: relative; padding-left: 16px; color: var(--text); font-size: 15px; line-height: 1.45; }
  .consent-reads li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
  .consent-never { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
  .consent-check { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--page); }
  .consent-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
  .consent-check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
  .consent-check input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
  .consent-check label { color: var(--text); font-size: 15px; line-height: 1.45; cursor: pointer; }
  .consent-under { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
  .consent-under a { color: var(--accent); }
  .consent-note { margin-top: 10px; }
  .consent-note.is-error { color: var(--breach); }
  .consent-note .link-btn { font-size: inherit; }
  .consent-actions { justify-content: flex-end; align-items: center; margin-top: 16px; }
  .consent-actions .btn { flex: 0 0 auto; min-width: 96px; }
  .consent-text-title { margin: 0 0 12px; color: var(--text); font-family: var(--font-heading); font-weight: 500; font-size: 22px; line-height: 1.2; }
  .consent-text-agree { margin: 14px 0 0; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.45; }
  @media (max-width: 720px) {
    .modal.consent-modal { width: 100%; max-width: none !important; padding: 22px 18px; }
    .consent-modal h2 { font-size: 26px; }
    .consent-actions .btn { flex: 1 1 auto; }
  }
  @media (forced-colors: active) {
    .consent-check:has(input:checked) { outline: 2px solid Highlight; }
    .consent-reads li::before { background: CanvasText; }
  }
  /* Settings → Privacy & legal, the AI: the Agreed chip beside "On" and the
     what-it-reads chips. */
  .set-row-label b .consent-chip { display: inline-flex; width: auto; margin-left: 8px; vertical-align: middle; font-weight: 500; } /* inline after "On" (the label's b is a block, and its spans are blocks too) */
  #aiConsentTitle:focus { outline: none; } /* takes focus for screen readers only, as the gate's title */
  .set-row-label .consent-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
  /* The ✦ AI mark: on every block the coach wrote (its container also
     carries data-ai-generated="true" — EU AI Act Art. 50). */
  .ins-ai { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; }

  /* The new-data dot (SPEC §8): the --accent dot with a soft 3px halo at
     18%, on a section tab and on Insights in the rail and the phone bar. */

  .nav-new-dot { display: none; flex: none; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

  .tab-item { position: relative; }
  .tab-item .nav-new-dot { position: absolute; top: 8px; left: calc(50% + 10px); margin: 0; }

  @media (forced-colors: active) { .nav-new-dot { forced-color-adjust: none; background: CanvasText; } }
  /* This week at a glance: five stats in one slim row (two then three on
     phones), the value in Newsreader. */

  /* Two cards side by side in a section's stack (the trade-count coach
     and the feelings); one column when the stack is narrow, and a lone
     card spans. */

  /* Your criteria pay: two bar rows (met in --accent, missed in --breach,
     the longer bar full), each with its count and "each" amount. */
  .ins-pay { border-color: var(--accent-line); }

  .ins-pay-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
  .ins-pay-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 96px; align-items: center; gap: 12px; font-size: 14px; color: var(--text); }
  .ins-pay-row .ins-bar-fill.is-met { background: var(--accent); }
  .ins-pay-row .ins-bar-fill.is-missed { background: var(--breach); }
  .ins-pay-each { text-align: right; font-variant-numeric: tabular-nums; }
  .ins-pay-each.pos { color: var(--gain); }
  .ins-pay-each.neg { color: var(--loss); }
  @container (max-width: 480px) { .ins-pay-row { grid-template-columns: 1fr auto; } .ins-pay-row .ins-bar-track { grid-column: 1 / -1; grid-row: 2; } }
  /* Best number of trades a day: eight bars from the baseline — earning
     in --accent, costing in --breach (never --gain / --loss: it's the
     coach's read, not a P&L colour) — then the 1st … 8th+ labels. */

  /* How you felt before the trade: feeling · met-criteria bar · trades · average. */
  .ins-feel-rows { display: flex; flex-direction: column; margin-top: 12px; }
  .ins-feel-row { display: grid; grid-template-columns: minmax(0, 110px) minmax(0, 1fr) 56px 76px; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--text); }
  .ins-feel-row.is-head { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; border-top: 0; padding-top: 0; }
  .ins-feel-row .ins-bar-fill.is-met { background: var(--accent); }
  .ins-feel-row .ins-bar-fill.is-missed { background: var(--breach); }
  .ins-feel-key { display: none; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
  .ins-feel-bar { display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: center; gap: 8px; }
  .ins-feel-pct { text-align: right; font-variant-numeric: tabular-nums; }
  .ins-feel-pct.is-zero { color: var(--breach); font-weight: 600; }
  .ins-feel-row .ins-bar-fill.is-stub { width: 8px !important; }
  .ins-feel-barhead { min-width: 0; } /* round U1b: wraps when its column narrows (62px at 1100; it ran into "Trades") */
  .ins-feel-n { font-variant-numeric: tabular-nums; }
  .ins-feel-avg { text-align: right; font-variant-numeric: tabular-nums; }
  .ins-feel-avg.pos { color: var(--gain); }
  .ins-feel-avg.neg { color: var(--loss); }
  @container (max-width: 480px) { .ins-feel-row { grid-template-columns: 1fr 56px 76px; } .ins-feel-row .ins-feel-bar { grid-column: 1 / -1; grid-row: 2; } .ins-feel-row.is-head .ins-feel-barhead { display: none; } .ins-feel-key { display: block; } }
  /* The overtrading note on Trade (the fl-coach-slot the round-1 flow kept). */

  /* ============================================================
     PAYMENTS ROUND (js/billing.js; design-reference/payments-2026-10-11)
     The access banner, Account → Billing's live card, the trial step, the
     withdrawal dialog, the Pro-only locked cards, the quiet cap line and
     the read-only mode.
  ============================================================ */
  .access-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 18px; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; color: var(--text); }
  /* Round S12e §3: read-only or a failed payment — the one thing on the Dashboard not to miss (the accent, never red). */
  .access-banner.is-ended, .access-banner.is-failed { border: 1px solid var(--accent-line); background: var(--emph-bg); box-shadow: inset 3px 0 0 var(--accent); }
  .access-banner[hidden] { display: none; }
  .money-line-text { flex: 1 1 260px; min-width: 0; }
  /* Round S13: on the Dashboard the same line is the page's notice (js/home.js, .hm-money); the banner is for the other pages. */
  html[data-page="home"] #accessBanner { display: none; }
  .hm-money { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 18px; border: 1px solid var(--accent-line); background: var(--emph-bg); box-shadow: inset 3px 0 0 var(--accent); font-size: 15px; line-height: 1.5; }
  .hm-money.is-trial-ending { border-color: var(--line); background: var(--card); box-shadow: inset 3px 0 0 var(--accent-line); }
  /* Round S13: the sign-up's three steps (Account · About you · Trial) on the welcome step and the trial step. */
  .signup-steps { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 14px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
  .signup-step { display: inline-flex; align-items: center; gap: 6px; }
  .signup-step b { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; font-size: 11px; font-weight: 600; }
  .signup-step.is-on { color: var(--text); font-weight: 600; }
  .signup-step.is-on b { border-color: var(--accent); background: var(--accent); color: var(--accent-ink, #fff); }
  .signup-step.is-done b { border-color: var(--accent-line); color: var(--accent); }
  .trial-modal .trial-numbers { display: flex; flex-direction: column; gap: 0; margin: 14px 0 0; padding: 4px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); }
  .trial-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; color: var(--text); }
  .trial-row:first-child { border-top: 0; }
  .trial-row dt { flex: 1 1 auto; min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
  .trial-row.is-plan dt { color: var(--text); font-weight: 600; }
  .trial-row dd { flex: none; margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
  .trial-founding { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
  .trial-modal .trial-then { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--text); }
  .trial-modal .trial-change { margin: 6px 0 0; font-size: 14px; }
  .trial-modal .trial-remind { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
  .trial-modal .trial-free { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; line-height: 1.5; color: var(--text); } /* round S12f */
  .set-row-label b .billing-chip, .billing-chip { display: inline-flex; width: auto; margin-left: 8px; color: var(--text); font-size: 12px; vertical-align: middle; }
  .billing-chip.is-trial { background: var(--accent-soft); color: var(--text); }
  .billing-chip.is-active { background: var(--gain-soft, var(--accent-soft)); color: var(--text); }
  .billing-chip.is-failed { background: var(--close-soft); color: var(--text); }
  .billing-chip.is-ended { background: var(--raised); color: var(--muted); }
  .billing-withdraw-card { border-color: var(--accent-line); }
  .trial-modal h2[tabindex="-1"]:focus, .trial-modal h2[tabindex="-1"]:focus-visible { outline: none; }
  .trial-modal .trial-choose { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
  .trial-modal .trial-choose .seg { align-self: flex-start; }
  .trial-modal .trial-terms { margin-top: 12px; }
  .trial-modal .trial-small { margin-top: 12px; }
  .trial-modal .trial-foot { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
  .trial-modal .trial-foot .link-btn { font-size: inherit; }
  .modal.withdraw-modal { max-width: 520px; }
  .withdraw-facts { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--raised); font-size: 14px; color: var(--text); }

  .cap-line { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
  .cap-line a { color: var(--accent); }
  /* Read-only (js/billing.js markReadOnlyControls): the controls that would log or edit carry aria-disabled="true" and .btn:disabled's look. */
  html[data-access="read-only"] [data-ro-disabled][aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
  html[data-access="read-only"] [data-ro-disabled][aria-disabled="true"]:hover { border-color: var(--line); filter: none; }
  @media (max-width: 720px) {
    .access-banner { margin: 0 0 14px; }
  }

  /* ============================================================
     ACCOUNT-PLAN ROUND (Oct 13; design-reference/account-plan-2026-10-13)
     Account one section at a time (board AccountSections) with the
     phone's list, Change plan as a page (board ChangePlan), and the
     desktop profile menu.
  ============================================================ */
  /* Account: the chosen section under its name; the menu says which. */
  .account-section-title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.25; color: var(--text); }
  .account-section-title[hidden] { display: none; }
  /* Headings take focus on a switch (so a screen reader starts there); no ring, as the trial step's title. */
  .account-section-title:focus, .account-section-title:focus-visible, #settingsPageTitle:focus, #settingsPageTitle:focus-visible, #changePlanTitle:focus, #changePlanTitle:focus-visible { outline: none; }
  #settingsSubnav button[aria-current="page"] { background: var(--raised); color: var(--text); font-weight: 600; }
  /* Settings (build 3a, board SettingsOne): the menu's two groups, You and App. */
  #settingsSubnav button[hidden] { display: none; }
  .subnav-group { margin: 14px 0 2px; padding: 0 12px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
  .subnav-group:first-child { margin-top: 0; }
  .account-list-group { margin: 18px 4px 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
  .account-list-group:first-child { margin-top: 0; }
  /* Profile: the initials, the first name and its line, Edit. */
  .avatar-xl { width: 52px; height: 52px; font-size: 19px; }
  .acct-profile-who { display: flex; align-items: center; gap: 16px; min-width: 0; }
  /* The profile menus' name and email: a button that opens Settings → Profile. */
  button.profile-sheet-head { width: 100%; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
  @media (hover: hover) { button.profile-sheet-head:hover { background: var(--raised); } }
  button.profile-sheet-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* Display's time zone: a searchable field (a datalist of the browser's zones). */
  .tz-field { display: flex; flex-direction: column; gap: 4px; width: min(100%, 300px); }
  .tz-input { width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--page); color: var(--text); font: inherit; font-size: 15px; }
  .tz-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .tz-note:empty { display: none; }
  .account-main[hidden], .account-list[hidden], .account-back[hidden] { display: none; }
  .account-back { display: inline-flex; align-items: center; min-height: 36px; margin: 0 0 6px; font-size: 15px; }
  /* Phones: #settings is the list of sections; a section opens under "← Settings". */
  .account-list ul { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); overflow: hidden; }
  .account-list li[hidden] { display: none; }
  .account-list li + li:not([hidden]), .account-list li:not([hidden]) ~ li:not([hidden]) { border-top: 1px solid var(--line); }
  .account-list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 64px; padding: 12px 16px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
  .account-list-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .account-list-row b { font-size: 16px; font-weight: 600; }
  .account-list-row > span > span { color: var(--muted); font-size: 14px; line-height: 1.4; }
  .account-list-row svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
  @media (hover: hover) { .account-list-row:hover { background: var(--raised); } }
  @media (max-width: 720px) {
    #settingsSubnav { display: none; }
    #settingsPage[data-settings-view="section"] .account-head .page-title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    #settingsPage[data-settings-view="section"] .account-head { margin-bottom: 4px; }
    .tz-row { flex-direction: column; align-items: stretch; }
    .tz-row .set-row-label { flex: none; } /* round F3: in a column the card's 260px basis was a 260px-tall gap */
    .tz-field { width: 100%; }
    .account-section-title { font-family: var(--font-heading); font-weight: 500; font-size: 30px; line-height: 1.15; }
  }

  /* What stays on Basic (build 3a, board DowngradePick): pick lists on the
     confirm step (beside the change's summary) and in the app's own dialog. */
  .cp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 28px; align-items: start; }
  .cp-picks { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .cp-picks-lead { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
  .cp-aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
  .cp-also { padding: 16px 22px; }
  .cp-also .card-label { margin-bottom: 8px; }
  .cp-also-text { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
  .cp-pick-hint { margin: 0; color: var(--muted); font-size: 14px; }
  .cp-pick-hint:empty { display: none; }
  .dp-list { display: flex; flex-direction: column; gap: 10px; padding: 18px 22px; }
  .dp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .dp-head .card-label { margin: 0; }
  .dp-count { color: var(--muted); font-size: 14px; white-space: nowrap; }
  .dp-count.is-over { color: var(--close); }
  .dp-items { display: flex; flex-direction: column; gap: 8px; }
  .dp-pick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
  .dp-pick.is-on { background: var(--raised); color: var(--text); }
  .dp-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .dp-box { flex: none; display: grid; place-items: center; width: 18px; height: 18px; box-sizing: border-box; border: 1.5px solid var(--muted); border-radius: 5px; font-size: 12px; font-weight: 700; line-height: 1; }
  .dp-pick.is-on .dp-box { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
  .dp-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .tier-modal .dp-list { padding: 0; border: 0; background: transparent; box-shadow: none; }
  .tier-modal .tier-choices { display: flex; flex-direction: column; gap: 18px; max-height: 56vh; overflow-y: auto; }
  @media (max-width: 900px) { .cp-split { grid-template-columns: minmax(0, 1fr); } .cp-aside { position: static; } }

  /* Change plan (#changePlanView): the plans side by side as /pricing shows
     them, then the confirm step. */
  .change-plan { display: flex; flex-direction: column; gap: 22px; }
  .change-plan[hidden] { display: none; }
  .cp-back { align-self: flex-start; display: inline-flex; align-items: center; min-height: 36px; font-size: 15px; }
  .cp-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 20px; flex-wrap: wrap; max-width: 900px; }
  .cp-head > div:first-child { min-width: 0; }
  .cp-head .page-title { margin-top: 0; }
  .cp-head .page-sub b { color: var(--text); font-weight: 600; }
  .cp-interval { flex: none; }
  .cp-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 900px; }
  .cp-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
  .cp-card.is-current { border-color: var(--muted); }
  .cp-card.is-pick { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
  .cp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .cp-name { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 28px; line-height: 1.1; color: var(--text); }
  .cp-card-head .billing-chip { margin-left: 0; }
  .cp-tag, .cp-sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
  .cp-sub { margin-top: -6px; }
  .cp-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 2px 0 0; }
  .cp-amount { font-size: 34px; font-weight: 600; line-height: 1.1; color: var(--text); }
  .cp-per { color: var(--muted); font-size: 14px; }
  .cp-btn { flex: none; width: 100%; margin: 4px 0 2px; } /* .btn grows (flex: 1) in a row; in the card's column it keeps its height */
  .cp-btn:disabled { opacity: 1; background: var(--raised); color: var(--muted); border-color: var(--line); cursor: default; filter: none; }
  .cp-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
  .cp-list li { display: flex; gap: 10px; color: var(--text); font-size: 14px; line-height: 1.45; }
  .cp-tick { flex: none; color: var(--accent); }
  .cp-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; max-width: 900px; margin: 0; color: var(--muted); font-size: 14px; }
  .cp-foot a { color: var(--accent); }
  /* Confirm: the rows, the fine print, the button and Back. */
  .change-plan .cp-confirm { max-width: 560px; gap: 0; padding: 6px 24px; }
  .cp-rows { margin: 0; }
  .cp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 15px; }
  .cp-row:first-child { border-top: 0; }
  .cp-row dt { color: var(--muted); }
  .cp-row dd { margin: 0; min-width: 0; text-align: right; color: var(--text); }
  .cp-row dd b { font-weight: 600; }
  .cp-fine { max-width: 560px; margin: -4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
  .cp-fine:empty { display: none; }
  .change-plan .consent-note { max-width: 560px; margin: -8px 0 0; }
  .change-plan .consent-note:empty { display: none; }
  .change-plan .consent-note:focus { outline: none; }
  .cp-actions { display: flex; gap: 10px; max-width: 560px; }
  .cp-actions .btn-primary { flex: 1; }
  .cp-actions .btn:not(.btn-primary) { flex: none; min-width: 120px; }
  @media (max-width: 720px) {
    .change-plan { gap: 18px; }
    .cp-cards { grid-template-columns: minmax(0, 1fr); }
    .cp-card { padding: 20px 18px; }
    .cp-interval { flex: 1 1 100%; display: flex; }
    .cp-interval button { flex: 1; white-space: nowrap; }
    .change-plan .cp-confirm { padding: 4px 18px; }
    .cp-row { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 0; }
    .cp-row dd { text-align: left; }
    .cp-actions .btn:not(.btn-primary) { min-width: 96px; }
  }

  /* The desktop profile menu (#profileMenu) and the rail's one profile
     button; the phone sheet's email on one line too. */
  .rail-who-more { flex: none; width: 16px; height: 16px; margin-left: auto; color: var(--muted); }
  .rail-who[aria-expanded="true"] { background: var(--raised); }
  .profile-menu { position: fixed; z-index: 45; display: flex; flex-direction: column; width: 320px; max-width: calc(100vw - 16px); padding: 10px 16px 8px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow); }
  .profile-menu[hidden] { display: none; }
  .profile-menu .profile-sheet-head { padding: 4px 0 12px; }
  .profile-menu .sheet-row { min-height: 44px; padding: 8px 2px; font-size: 15px; }
  .profile-menu .sheet-theme { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 2px; }
  .profile-menu .sheet-theme .seg { align-self: stretch; display: flex; }
  .profile-menu .sheet-theme .seg button { flex: 1 1 auto; padding: 6px 10px; white-space: nowrap; }
  .profile-sheet .sheet-theme { flex-wrap: wrap; gap: 8px 12px; }
  @media (max-width: 720px) { .profile-menu { display: none; } }

  /* ============================================================
     BUILD 3b (Oct 13) — the first five minutes (boards TodaySetup and
     TodayTour), planned sessions, session groups, "⋯" menus on top
  ============================================================ */
  /* "⋯" menus, lifted onto their page (js/float-menu.js): fixed at their
     button, above every card, never clipped. */
  .fl-menu.float-menu, .day-row-menu.float-menu { position: fixed; top: 0; right: auto; left: 0; z-index: 70; max-width: calc(100vw - 16px); }

  /* Planned sessions (js/flow.js PLANNED SESSIONS). */
  /* Build 3c: a session's ending on Trade, the planned-end question, what
     you wrote last time on Prepare, the session's quick note on Review. */
  .fl-intention { display: flex; align-items: flex-start; gap: 10px; padding: 12px 8px 12px 16px; border-radius: 12px; background: var(--raised); color: var(--text); }
  .fl-intention-text { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
  .fl-intention-when { color: var(--muted); }
  .fl-intention-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -4px 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
  .fl-intention-x:hover { color: var(--text); background: var(--card); }
  .fl-intention-x svg { width: 16px; height: 16px; }

  /* Trade: each session is a group — its divider, its own headers, its trades (L2). */

  /* The import confirm's details. */
  .import-details { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.5; }
  .import-details summary { color: var(--accent); cursor: pointer; }
  .import-details p { margin: 8px 0 0; }

  /* ============================================================
     ROUND A3 — SPOTTED MOMENTS AND THE TILT DAY (19 Oct; boards R2Flags,
     R4Tilt, R4List's "Spotted:" line in design-reference/
     trade-redesign-2026-10-18). A spotted trade wears --close (needs
     attention, never a verdict: no breach colour), its one question's
     chips the app's chip look; the tilt day's chart keeps round 5a's
     rules (a zero line, the part under it tinted, the values as tags over
     the SVG) and money's colours only; "Make tomorrow smaller" sits on an
     --accent tint, the trader's process.
  ============================================================ */
  /* A spotted trade (board R4List). */

  /* The tilt day (board R4Tilt). */

  /* One column in the Trade card (its width beside the guardrails is the
     board's half): the blocks stack, the answers flow across. */

  /* The day chart (R4Tilt; Review's "Where the day turned"): the day
     page's component since round A7 — THE DAY CHART at the end of this file. */

  /* Review: kept moments. */

  /* Prepare: today's smaller plan; Today's guardrails card marks its rows. */
  .fl-smaller-row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .fl-smaller-text { margin: 0; color: var(--text); font-size: 14.5px; line-height: 1.5; }
  .fl-smaller-text .fl-rule-label { margin-right: 8px; }

  /* Insights: Spotted moments. */

  /* ============================================================
     THE DAY CHART (round A7; js/day-chart.js) — the day page, Review's
     "Where the day turned" and the tilt day on Trade. Drawn at its box's
     own width (no stretched words); colours are the theme's.
  ============================================================ */
  .dc { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .dc-head { display: flex; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; padding: 0 22px; color: var(--muted); font-size: 13px; line-height: 1.45; }
  .dc-when { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .dc-plot { position: relative; min-width: 0; touch-action: pan-y; cursor: crosshair; }
  .dc-plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
  .dc-svg { display: block; max-width: 100%; overflow: visible; font-family: var(--font-body); }
  .dc-win { fill: color-mix(in srgb, var(--accent) 7%, transparent); }
  .dc-win-label { fill: color-mix(in srgb, var(--accent) 55%, var(--muted)); font-size: 11px; }
  .dc-zero { stroke: color-mix(in srgb, var(--line), var(--text) 10%); stroke-width: 1; }
  .dc-base { stroke: var(--line); stroke-width: 1; }
  .dc-axis-label { fill: var(--muted); font-size: 11px; }
  .dc-mdl { stroke: var(--loss); stroke-opacity: 0.55; stroke-width: 1; stroke-dasharray: 3 4; }
  .dc-mdl-label { fill: var(--loss); fill-opacity: 0.85; font-size: 11px; }
  .dc-fill { fill: color-mix(in srgb, var(--loss) 10%, transparent); }
  .dc-line { fill: none; stroke: color-mix(in srgb, var(--accent) 78%, var(--text)); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .dc-line.is-loss { stroke: var(--loss); }
  .dc-turn { stroke: var(--close); stroke-width: 1.5; stroke-dasharray: 4 4; }
  .dc-turn-label { fill: var(--close); font-size: 11.5px; font-weight: 600; }
  .dc-pt { stroke: var(--card); stroke-width: 1.5; }
  .dc-pt.is-gain, .dc-bar.is-gain { fill: var(--gain); }
  .dc-pt.is-loss, .dc-bar.is-loss { fill: var(--loss); }
  .dc-pt.is-flat, .dc-bar.is-flat { fill: var(--muted); }
  .dc-end-label { font-size: 12px; font-weight: 600; }
  .dc-end-label.is-gain { fill: var(--gain); }
  .dc-end-label.is-loss { fill: var(--loss); }
  .dc-end-label.is-flat, .dc-peak-label { fill: var(--muted); }
  .dc-peak-label { font-size: 11px; }
  .dc-spot { fill: var(--close); }
  .dc-legend { display: flex; flex-direction: column; gap: 10px; padding: 0 22px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
  .dc-legend-line { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; }

  .dc-key-bar { display: inline-block; width: 5px; height: 11px; margin-right: 2px; border-radius: 1px; vertical-align: -1px; background: var(--gain); }
  .dc-key-bar.is-loss { height: 7px; margin-right: 7px; background: var(--loss); }
  /* The read-out: a guide, a dot on the line, a card beside it. */
  .dc-scrub { position: absolute; inset: 0; pointer-events: none; }
  .dc-scrub[hidden] { display: none; }
  .dc-guide { position: absolute; top: 20px; bottom: 26px; width: 1px; margin-left: -0.5px; background: color-mix(in srgb, var(--text) 35%, transparent); }
  .dc-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 2px solid var(--text); border-radius: 50%; background: var(--card); box-sizing: border-box; }
  .dc-card { position: absolute; min-width: 168px; max-width: 240px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); box-shadow: var(--shadow-sm); color: var(--text); font-size: 12.5px; line-height: 1.4; }
  .dc-card p { margin: 0; }
  .dc-card-when { font-weight: 600; font-variant-numeric: tabular-nums; }
  .dc-card-what { color: var(--muted); }
  .dc-card-row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
  .dc-card-row .pos { color: var(--gain); }
  .dc-card-row .neg { color: var(--loss); }
  .dc-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px !important; }

  @media (forced-colors: active) { .dc-line, .dc-turn, .dc-zero, .dc-base { stroke: CanvasText; } .dc-pt, .dc-bar, .dc-spot { fill: CanvasText; } }

  /* ============================================================
     THE DAY PAGE (round A7; js/day-page.js — boards R5Final at 1280,
     R5FinalPhone at 390)
  ============================================================ */
  #dayPage { --dp-soft: color-mix(in srgb, var(--text) 82%, var(--muted)); --dp-row-line: color-mix(in srgb, var(--line) 70%, var(--card)); }
  #dayPage .pos { color: var(--gain); }
  #dayPage .neg { color: var(--loss); }
  #dayPage .is-quiet { color: var(--muted); }
  .dp-top { margin-bottom: 18px; align-items: center; }
  .dp-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
  .dp-back { font-size: 13.5px; }
  .dp-step { min-width: 28px; min-height: 28px; padding: 0 4px; border: 0; border-radius: 8px; background: none; color: var(--dp-soft); font-size: 15px; cursor: pointer; }
  .dp-step:hover:not(:disabled) { background: var(--raised); color: var(--text); }
  .dp-step:disabled { opacity: 0.35; cursor: default; }
  .dp-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
  .dp-card { gap: 0; padding: 8px 12px; border-radius: 20px; }
  .dp-chart-card { padding: 18px 0 14px; }
  .dp-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; padding: 12px 10px 4px; }
  .dp-h { margin: 0; font-size: 17px; font-weight: 600; color: var(--text); }
  .dp-quiet { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
  .dp-empty { padding: 4px 10px 14px; font-size: 14px; }
  .dp-chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; line-height: 1.35; white-space: nowrap; }
  .dp-chip.is-spot { background: color-mix(in srgb, var(--close) 13%, transparent); color: var(--close); }
  .dp-chip.is-kept { background: color-mix(in srgb, var(--gain) 13%, transparent); color: var(--gain); }
  .dp-chip.is-crossed { background: color-mix(in srgb, var(--loss) 13%, transparent); color: var(--loss); }
  .dp-chip.is-none { border: 1px solid var(--line); background: var(--raised); color: var(--muted); }
  .dp-phone-only { display: none; }

  /* Your part and the day's note. */
  .dp-note-label { color: var(--muted); font-size: 13px; }
  .dp-note { min-height: 76px; margin-top: -6px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--line), var(--text) 8%); border-radius: 12px; background: var(--page); color: var(--text); font: inherit; font-size: 14.5px; line-height: 1.5; resize: vertical; }
  .dp-note:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

  /* The trades. */
  .dp-trades { padding: 8px 12px 10px; }
  .dp-thead { display: grid; grid-template-columns: 26px 112px 128px 168px 92px minmax(0, 1fr) 96px; column-gap: 12px; align-items: center; padding: 9px 10px; }
  .dp-thead { padding: 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 500; letter-spacing: 0.07em; text-transform: uppercase; }
  .dp-thead .is-num, .dp-c-pnl, .dp-c-act { text-align: right; justify-self: end; }
  .dp-c-act { display: inline-flex; align-items: center; gap: 4px; }
  .dp-more { flex: 0 0 auto; align-self: flex-start; margin: 10px 10px 2px; min-height: 42px; padding: 0 16px; border-radius: 12px; }

  /* This day against your normal. */
  .dp-normal { padding: 8px 14px 6px; }
  .dp-normal .dp-card-head { padding: 14px 8px 6px; }
  /* Round U1b: this day's column fits its widest line ("16:00–16:30 · −$192.50", 166px; it ran into "usual"), the same in the head and every row. */
  .dp-nhead, .dp-nrow { display: grid; grid-template-columns: minmax(120px, 1.15fr) minmax(170px, 1.1fr) minmax(110px, 1.1fr) 200px 132px; column-gap: 10px; align-items: center; padding: 12px 10px; } /* round P1b: a fixed last column — "different from usual" no longer widens its own row's grid */
  .dp-nkey-usual { color: color-mix(in srgb, var(--muted) 70%, var(--card)); }
  .dp-n-what, .dp-n-day, .dp-n-usual { text-wrap: balance; } /* round P1b: a wrapped name or value never leaves one word ("(MNQ)", "days") alone */

  /* What happened, and the coach's read. */
  .dp-what { gap: 8px; padding: 20px 22px; }
  .dp-what .dp-card-head { padding: 0; }
  .dp-what .dp-h { font-size: 15px; }
  .dp-what-text { margin: 0; color: var(--dp-soft); font-size: 14.5px; line-height: 1.6; text-wrap: pretty; }
  /* Round R9 §2: the read's Tomorrow line; the daily coach note under the strip. */

  /* ---------- Every width (round A7b): by the page's own width ----------
     The rail takes part of the window, so between 721 and 900px of window
     the page is narrower than on a 720px phone — every rule below reads
     the day page's box (#dayPage, a size container), never the window.
       ≥ 900   the board's 7-column trade table
       560–899 each trade on two lines: # · time · trade · P&L, then
               entry → exit · chips · + note · pencil
       < 560   the phone board's stacked rows (R5FinalPhone)
     The normal table drops its bars under 800 and goes to two lines under
     560; What happened and the coach's read sit side by side from 760. */
  #dayPage { container: daypage / inline-size; }
  .dc { container: dchart / inline-size; }
  .dp-c-what .fl-gap { position: static; display: inline-block; margin: 0 7px 2px 0; vertical-align: middle; } /* round OD: a value a guardrail needs is missing */
  @container daypage (max-width: 899px) {
    .dp-thead { display: none; }
  }
  @container daypage (max-width: 799px) {
    .dp-nhead, .dp-nrow { grid-template-columns: minmax(144px, 1.2fr) minmax(90px, 1fr) minmax(90px, 1fr) 132px; } /* round P1b: one grid for every row; the name on one line ("Time between trades", 142px), the values wrap */
  }
  /* The phone board (R5FinalPhone, 390): a page under 560px wide. */
  @container daypage (max-width: 559px) {
    .dp-top { margin-bottom: 10px; }
    .dp-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; width: 100%; }
    /* Round P1b: "Today" at the "← Dashboard" row's right end — the page's end, not the nav's
       (the account filter takes the nav's right side, and beside the date's › it had no room at 360). */
    .dp-top { position: relative; }
    .dp-step { color: color-mix(in srgb, var(--accent) 78%, var(--text)); }
    .dp-back { justify-self: start; }
    .dp-main { gap: 14px; }
    .dp-desk-only { display: none !important; }
    .dp-phone-only { display: inline; }
    .dp-card { border-radius: 16px; }
    .dp-chart-card { padding: 12px 0 10px; overflow: hidden; }
    p.dc-legend-line.dp-phone-only { display: flex; }
    .dp-trades { padding: 6px 14px 10px; }
    .dp-card-head { padding: 10px 0 4px; }
    .dp-trow { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "io what pnl" "chips chips act"; row-gap: 6px; column-gap: 8px; padding: 10px 0; font-size: 14.5px; } /* round P1: "NQ Long · 1" whole — + note and the pencil on the second line */
    .dp-out { display: none; }
    .dp-more { align-self: stretch; margin: 12px 0 2px; min-height: 46px; }
    .dp-normal { padding: 6px 14px 8px; }
    .dp-normal .dp-card-head { padding: 10px 0 4px; }
    /* Two lines: what · verdict, then this day · usual — the second line spans the row, so a long "usual" never narrows the first. */
    .dp-what { padding: 14px; border-radius: 16px; }
    .dp-what-text { font-size: 14px; line-height: 1.55; }
  }
  /* A chart in a narrow box (the day page on a phone, Review and Trade on one). */
  @container dchart (max-width: 559px) {
    .dc-head { padding: 0 14px; font-size: 12px; }
    .dc-legend { padding: 0 14px; font-size: 11.5px; gap: 6px; }
    .dc-legend-line { gap: 2px 12px; }
  }

  /* ============================================================
     Round A9 — P&L after fees, commissions that work, split exits
     ============================================================ */
  /* "fees?" beside a P&L whose fees aren't known (after fees): small, muted, never wraps. */
  .fees-unknown { display: inline-block; margin-left: 5px; padding: 0 5px; border: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); border-radius: var(--r-pill); color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.5; letter-spacing: 0; vertical-align: 1px; white-space: nowrap; cursor: help; }
  .dp-c-pnl .fees-unknown{ margin-left: 4px; }
  /* "est." — fees from the account's commission. */

  /* A split entry or exit: "exit in 2 parts: 2 @ 5,801.25 · 1 @ 5,800.75". */

  .dc-card-parts { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  /* Today's one-time note, and the add form's Fees. */
  .fees-note { margin: 0 0 12px; }

  .fl-fees-hint { margin: 0; }
  /* Round P1: "Fees for NQ aren't set → Settings → Fees" under the day's trades (was round A9's commission card). */
  .fees-missing { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; }
  .fees-missing-line { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
  .fees-missing-line .link-btn { font-size: inherit; white-space: nowrap; } /* round P1b: "Settings → Fees" in one piece */
  /* The import's "before or after commission?" — its own step, or under the matching. */
  .imp-basis { display: flex; flex-direction: column; gap: 10px; }
  .imp-basis.is-inline { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
  .imp-basis-q { margin: 0; font-size: 14px; line-height: 1.5; }
  .imp-basis .imp-choice { min-height: 64px; padding: 12px 16px; }
  .imp-basis .imp-choice b { font-size: 15px; }
  .imp-basis .imp-choice span { font-size: 13px; }
  .imp-choice.is-on { border-color: var(--accent); background: var(--accent-soft); }
  /* Settings → Trading accounts → Show P&L. */
  .pnl-basis-row { margin-top: 8px; }

  /* ============================================================
     THE ACCOUNTS PAGES (round A10; js/accounts-page.js — boards R6Accounts,
     R6AccountsPhone, R6AccountLive, R6AccountProp, R6AttemptStart,
     R6AttemptEnded). Laid out by the page's own width (a size container),
     like the day page: the rail takes room between 721 and 900px.
  ============================================================ */
  #accountsPage { container: accpage / inline-size; --ac-row-line: color-mix(in srgb, var(--line) 70%, var(--card)); --ac-soft: color-mix(in srgb, var(--text) 82%, var(--muted)); }
  #accountsPage .pos { color: var(--gain); }
  #accountsPage .neg { color: var(--loss); }
  .ac-top { margin-bottom: 14px; align-items: center; }
  .ac-top > div:first-child { min-width: 0; }
  .ac-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .ac-crumbs { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
  /* Round R6 (board ac2-prop-v2): the prop page's title with its Prop and Pro chips, one line under it. */
  .ac-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
  .ac-title { margin: 0; overflow-wrap: anywhere; }
  .ac-main > .ac-title + .ac-lead { margin-top: -12px; }
  .ac-lead { margin: 0; max-width: 980px; color: var(--ac-soft); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
  .ac-quiet { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
  .ac-meta { margin: 0; color: var(--muted); font-size: 13px; font-weight: 400; }
  .ac-sub { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; font-weight: 400; }
  .ac-of { color: var(--muted); font-size: 0.62em; font-family: var(--font-heading); }
  .ac-dash { color: var(--muted); }
  .ac-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; white-space: nowrap; vertical-align: 1px; background: var(--raised); color: var(--muted); border: 1px solid var(--line); }
  .ac-chip.is-ok { background: var(--gain-soft); color: var(--gain); border-color: transparent; }
  .ac-chip.is-bad { background: color-mix(in srgb, var(--loss) 14%, transparent); color: var(--loss); border-color: transparent; }
  .ac-chip.is-amber, .ac-chip.is-pro { background: var(--close-soft); color: var(--close); border-color: transparent; }
  .ac-chip.is-pro { font-size: 11.5px; padding: 1px 8px; }
  .ac-chip.is-live { background: color-mix(in srgb, var(--type-live) 14%, transparent); color: var(--type-live); border-color: transparent; }
  .ac-chip.is-prop { background: color-mix(in srgb, var(--type-prop) 14%, transparent); color: var(--type-prop); border-color: transparent; }
  .ac-chip.is-sim { background: color-mix(in srgb, var(--type-sim) 14%, transparent); color: var(--type-sim); border-color: transparent; }
  .ac-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); min-width: 0; }
  .ac-card > p { margin: 0; line-height: 1.55; }
  .ac-card > * + * { margin-top: 12px; }
  .ac-card h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
  .ac-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
  .ac-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
  .ac-card ul { margin: 12px 0 0; padding-left: 18px; line-height: 1.6; }
  .ac-card li + li { margin-top: 6px; }
  .ac-card b { font-weight: 600; }
  .ac-input { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--page); color: var(--text); font: inherit; font-size: 14px; width: 100%; min-width: 0; box-sizing: border-box; }
  .ac-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .ac-day-link { font-size: 13.5px; white-space: nowrap; }

  /* The tables: one grid per row, the same columns as the head. */
  .ac-table { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); overflow: hidden; min-width: 0; }
  /* Status holds "Between attempts" (129px) on one line wherever the table has the room; just above
     the stacked layout (901–940px) the table is at its minimum, so the column stays 96px and the chip wraps. */
  .ac-c-name { min-width: 0; overflow-wrap: anywhere; }
  .ac-name { padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
  .ac-name:hover { color: var(--accent); }
  .ac-row.is-archived { color: var(--muted); }
  .ac-row.is-archived .ac-name, .ac-row.is-archived .ac-chip { color: var(--muted); opacity: 0.85; }
  .ac-c-status { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
  .ac-chev { color: var(--muted); }
  /* Round R6 (board ac1-accounts-v2): one card per type — a heading row
     with its count (Prop's Pro chip and "simulated money" on the right),
     the columns, the rows; a firm with 2+ accounts has a quiet label row. */
  .ac-card.ac-type { padding: 0; overflow: hidden; }
  .ac-card.ac-type > * + * { margin-top: 0; }
  .ac-type-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 18px 22px 12px; }
  .ac-card .ac-type-head h2 { font-size: 18px; font-weight: 600; }
  .ac-type-note { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 13px; }
  .ac-type .ac-table { border: 0; border-radius: 0; background: transparent; }
  .ac-spark { display: block; width: 100%; max-width: 100px; height: 30px; overflow: visible; }
  .ac-spark path { fill: none; stroke-width: 1.6; }
  .ac-spark.is-up path:last-child { stroke: var(--gain); }
  .ac-spark.is-down path:last-child { stroke: var(--loss); }
  .ac-spark .ac-spark-zero { stroke: var(--line); stroke-width: 1; }

  /* The ask, the money row, the chart. */
  .ac-ask { border-color: var(--accent-line); }
  .ac-ask-x { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
  .ac-ask-x:hover { background: var(--raised); color: var(--text); }
  .ac-outs { display: flex; flex-wrap: wrap; gap: 8px; }
  .ac-outs .btn, .ac-pat-act .btn, .ac-pause .btn, .ac-head-actions .btn { flex: 0 0 auto; width: auto; white-space: nowrap; }
  .ac-out.is-on { border-color: var(--accent); background: var(--accent-soft); }
  .ac-chart { position: relative; height: 240px; margin-top: 10px; container: acchart / inline-size; }
  /* Round P1: on a chart under 600px wide the first bar sat on "Trades" — the label goes (the card's title says "bars: trades that day"). */
  @container acchart (max-width: 599px) { .ac-tlab { display: none; } }
  .ac-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .ac-chart .ac-zero { stroke: var(--line); stroke-width: 1; fill: none; }
  .ac-chart .ac-line { stroke: color-mix(in srgb, var(--accent) 75%, var(--text)); stroke-width: 2; fill: none; }
  .ac-chart rect.is-up { fill: var(--gain); opacity: 0.85; }
  .ac-chart rect.is-down { fill: var(--loss); opacity: 0.85; }
  .ac-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; }
  .ac-dot.is-up { background: var(--gain); }
  .ac-dot.is-down { background: var(--loss); }
  .ac-zl, .ac-tlab, .ac-nl, .ac-xl { position: absolute; color: var(--muted); font-size: 11px; line-height: 1; white-space: nowrap; }
  .ac-zl { left: 0; }
  .ac-tlab { left: 0; }
  .ac-nl { transform: translateX(-50%); color: var(--text); }
  .ac-xls { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; }
  .ac-xl { bottom: 0; transform: translateX(-50%); }
  .ac-xr { position: absolute; left: 0; right: 0; bottom: -18px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
  .ac-chart-card .ac-chart { margin-bottom: 26px; }
  .ac-chart-foot, .ac-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; font-size: 14px; }
  .ac-line { padding-top: 12px; border-top: 1px solid var(--ac-row-line); }

  /* The prop page. */
  .ac-stages { padding-top: 14px; border-top: 1px solid var(--ac-row-line); }
  .ac-stage { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(130px, 1.3fr) minmax(70px, 0.7fr) minmax(80px, 0.8fr) minmax(90px, 0.9fr) minmax(130px, 1.3fr); gap: 4px 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--ac-row-line); font-size: 14px; font-variant-numeric: tabular-nums; }
  .ac-stage .link-btn { font-size: inherit; }
  .ac-stage-note { padding: 0 0 10px; }
  /* Round R8b: "This isn't a funded stage →" under every later stage, and its two answers. */
  .ac-stage-fix { padding: 0 0 10px; font-size: 13.5px; }
  .ac-stage-fix .link-btn { font-size: inherit; }
  .ac-stage-fix-acts { display: flex; flex-wrap: wrap; gap: 8px 10px; padding-top: 8px; }
  .ac-stage-k::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 1.5px solid var(--accent); border-radius: 3px; vertical-align: -1px; }
  .ac-stage-k.is-funded::before { border-color: var(--type-live); }
  /* Round F2: corrections — each payout with its remove ×, remove a stage or the attempt. */
  .ac-pays { list-style: none; margin: 0; padding: 8px 0 4px; border-top: 1px solid var(--ac-row-line); display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
  .ac-pays li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
  .ac-att-remove { margin: 14px 0 0; text-align: right; }
  .ac-remove { color: var(--muted); }
  .ac-a-n { font-family: var(--font-heading); font-size: 18px; color: var(--ac-soft); }

  /* Start an attempt; an attempt ended. */
  .ac-start { display: flex; flex-direction: column; gap: 20px; }
  .ac-start-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .ac-start-fields > * + * { margin-top: 0; }
  .ac-field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
  .ac-guard-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--raised) 55%, var(--card)); }
  .ac-guard-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
  .ac-guard-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
  .ac-guard-n { width: 64px; }
  .ac-why { flex: 1 1 260px; color: var(--muted); font-size: 13.5px; }
  .ac-guards .link-btn { margin-top: 12px; }
  .ac-start-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .ac-start-actions .btn { flex: 0 0 auto; width: auto; min-height: 44px; padding: 0 18px; }
  .ac-pause { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px 20px; border-color: var(--accent-line); }
  .ac-pause > * + * { margin-top: 0; }
  .ac-pause p { margin: 6px 0 0; line-height: 1.55; color: var(--ac-soft); }
  .ac-pause .btn { flex: 0 0 auto; }

  /* Narrower than the board's desktop: the rows become small cards. */
  @container accpage (max-width: 900px) {
    .ac-stage { grid-template-columns: minmax(0, 1fr) auto; }
    .ac-stage > span:nth-child(2n) { text-align: right; }
    .ac-start-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @container accpage (max-width: 560px) {
    .ac-card { padding: 16px; }
    .ac-type-head, .ac-firm, .ac-type-foot { padding-left: 16px; padding-right: 16px; }
    .ac-start-fields { grid-template-columns: minmax(0, 1fr); }
    .ac-pause { flex-direction: column; }
    .ac-chart { height: 200px; }
    .ac-stage { font-size: 13px; }
    .ac-head-actions { width: 100%; }
    .ac-input { font-size: 16px; min-height: 44px; }
  }
  /* Six tabs since Accounts (round A10): a little smaller words, so "Accounts" fits at 360px. */
  @media (max-width: 720px) { .tab-item { font-size: 11px; } }
  /* Today's Prepare: a running attempt's "This time I will…" (round A10). */
  .fl-commit { margin: 0 0 14px; padding: 12px 16px; border: 1px solid var(--accent-line); border-radius: 14px; background: color-mix(in srgb, var(--accent) 5%, var(--card)); font-size: 14.5px; line-height: 1.5; }
  .fl-commit-k { color: var(--accent); font-weight: 600; margin-right: 4px; }
  .fl-commit-who { color: var(--muted); font-size: 13px; }
  /* Round R9 §3: the clock-change reminder (the Dashboard and Plan). */
  .clock-card { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; padding: 16px 20px; }
  .clock-card .card-label { margin: 0; }
  .clock-text { margin: 0; font-size: 14.5px; line-height: 1.55; text-wrap: pretty; }
  .clock-card .hm-actions { margin: 0; }
  /* Round R9 §2: yesterday's coach note on Prepare — one quiet line. */
  .trade-style-pick { display: flex; flex-wrap: wrap; gap: 8px; }
  .trade-style-pick .btn.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

  /* ============================================================
     ROUND D1 — the Dashboard, the rail's Trading day, the Journal's views
     (boards in design-reference/design-round-1)
  ============================================================ */
  /* The rail: Import trades and Add a trade stacked; the Trading day as a
     sub-item under Dashboard (indented, no icon) with its status chip —
     one line, never wrapped. */
  .rail-actions { display: flex; flex-direction: column; gap: 8px; margin-top: -6px; }
  .sidebar .rail-actions .rail-log-btn { margin-top: 0; }
  /* Round R6: the menu's Import trades, and the phone bar's Log trades, in the accent (the primary style) on every page. */
  .sidebar .rail-import-btn, .app-bar .app-bar-log { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .sidebar .rail-import-btn:hover, .app-bar .app-bar-log:hover { border-color: var(--accent); filter: brightness(1.06); }
  .nav-item.nav-sub { gap: 5px; padding-left: 24px; padding-right: 8px; font-size: 14px; white-space: nowrap; } /* round P1b: the same width as every rail item (it ran 10px into the rail's padding); the chip fits inside, "Not started" too */
  .nav-sub-label { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .nav-day-chip { display: inline-flex; align-items: center; gap: 5px; flex: none; margin-left: auto; padding: 2px 6px; border-radius: var(--r-pill); background: var(--raised); color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
  .nav-day-chip.is-on { color: var(--text); }
  .nav-day-chip .status-dot { width: 6px; height: 6px; }
  .nav-item.nav-sub.active .nav-day-chip { background: var(--page); }
  @media (hover: hover) { .nav-item.nav-sub:hover .nav-day-chip { background: var(--page); } }
  @media (max-width: 900px) and (min-width: 721px) {
    .nav-item.nav-sub { gap: 4px; padding-left: 10px; padding-right: 6px; font-size: 13px; }
    .nav-day-chip .status-dot { display: none; } /* round P1b: the narrow rail — the words fit without the dot */
  }

  /* The Dashboard (js/home.js): the head as the Trading day's (no day
     arrows), two columns as its body, one below 1041px in the phone
     board's order. */
  #homePage .hm-head { align-items: flex-end; }
  .hm-head-main { display: flex; flex-direction: column; min-width: 0; }
  .hm-head .page-title { overflow-wrap: anywhere; }
  .hm-tip { margin: -12px 0 18px; }
  .hm-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; min-width: 0; }
  .hm-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
  .hm-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .hm-aside .card { padding: 20px; gap: 14px; }
  .hm-body .pos { color: var(--gain); }
  .hm-body .neg { color: var(--loss); }
  .hm-body .is-quiet { color: var(--muted); font-weight: 400; }
  .hm-quiet { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

  /* Today's trading day. */

  .hm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
  .hm-actions .btn { flex: 0 0 auto; min-height: 36px; white-space: nowrap; }

  /* The guardrail grid: kept faint (≈38%), crossed full, so the eye goes
     to the crosses; today outlined, its date in accent. */

  /* Your progress, compact. */

  @media (max-width: 1040px) {
    /* One column (round S1: last day, Guardrail, the week, the cost — in the page's order). */
    .hm-body { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
    .hm-main, .hm-aside { display: contents; }
    .hm-aside .card { padding: 24px; }
  }
  @media (max-width: 720px) {
    #homePage .hm-head { flex-wrap: nowrap; gap: 12px; } /* round R8: the filter stays on the title row */
    .hm-tip { margin-top: -4px; } /* round P1: clear of the filter's 44px button */

    .hm-aside .card { padding: 18px; }

  }
  /* Round P1: on a narrow card (a phone, a tablet, the 1100 two-column
     Dashboard) a guardrail's name was cut ("Max daily l…") — it takes its
     own line over its cells, whole. */

  /* The Journal's bar: the view switch and Customize view / Show on the
     left, the month on the right (one month for both views). */
  .journal-cal[hidden], #journalList[hidden] { display: none; }
  .journal-cal { min-width: 0; }

  /* ============================================================
     ROUND D1b — the trade form (its Table went in round OD)
  ============================================================ */
  /* The form's rows (boards day-trade-add / -edit): Account · Time in ·
     Time out · Size; Entry · Exit · Fees; Felt · Setup · Note. */

   /* no Felt asked: Setup · Note fill the row */

  /* Round D1b: the setup guide on the Dashboard, first in the main column. */
  .hm-guide[hidden] { display: none; }
  .hm-guide:empty { display: none; }

  /* Round D1b: the guide's "Five steps…" once-tip — its × keeps its 44px target inside the line, clear of the fold / close buttons at 360px. */

  /* ============================================================
     ROUND F4 — NinjaTrader fees: the Trades export, the Executions warning, the file's fees
  ============================================================ */
  .imp-warn { display: grid; gap: 12px; margin: 0 0 14px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--close) 55%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--close) 9%, var(--card)); }
  .imp-warn p { margin: 0; color: var(--text); font-size: 14.5px; line-height: 1.55; }
  .imp-warn-acts { display: flex; flex-wrap: wrap; gap: 8px; }
  .imp-warn .imp-how-steps { margin: 0; }
  .imp-warn-acts .btn { flex: 0 1 auto; }

  /* ============================================================
     ROUND D2a — the import-first day: morning and evening
     (boards in design-reference/design-round-2)
  ============================================================ */
  /* The Dashboard's trading-day card: Your trades are in, Sitting out today, "I'm sitting out today". */

  .hm-week { gap: 14px; }

  /* Prepare: yesterday's promise and today's if-then. */
  .fl-promise, .fl-ifthen { gap: 12px; }
  .fl-promise-line { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 22px; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; text-wrap: pretty; }
  .fl-promise-when { margin: -2px 0 0; color: var(--text); font-size: 15px; }
  .fl-ifthen-from { color: var(--text); font-size: 15px; }
  .fl-ifthen-from[hidden] { display: none; }
  .fl-ifthen-rows { display: grid; gap: 10px; min-width: 0; }
  .fl-ifthen-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 0 12px; min-width: 0; }
  .fl-ifthen-k { color: var(--text); font-size: 15px; font-weight: 600; }
  .fl-ifthen-in { background: var(--raised); }
  .fl-ifthen-foot { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
  .fl-ifthen-note { margin: 0; color: var(--text); font-size: 15px; line-height: 1.5; }

  /* Review: where it went wrong, today's if-then, the line's "where it shows". */
  .fl-line-where { margin: 8px 0 0; color: var(--text); font-size: 15px; }
  @media (max-width: 720px) {
    .fl-promise-line { font-size: 20px; }
    .fl-ifthen-row { grid-template-columns: 38px minmax(0, 1fr); gap: 0 8px; }
  }

  /* The day page: Review's answers, shown back. */

  /* The import's summary card: the sit-out note. */

  /* ============================================================
     ROUND D2b — trading mode: a check before each trade, lined up with the import
     (boards d2-trading-mode-desk/-phone, d2-review-checks-ask, d2-review-checks)
  ============================================================ */
  /* Trading mode: Before you click. */

  /* Round G1: a rest day after a max-loss day — the Dashboard's trading-day card and Prepare open with it. */
  .rest-card { display: grid; justify-items: start; gap: 10px; min-width: 0; margin: 0 0 14px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--close) 55%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--close) 7%, var(--card)); }
  .fl-rest .rest-card { margin: 0; border: 0; padding: 0; background: none; }
  .fl-rest { border-color: color-mix(in srgb, var(--close) 55%, var(--line)); background: color-mix(in srgb, var(--close) 7%, var(--card)); }
  .rest-card-line { display: flex; gap: 10px; align-items: flex-start; margin: 0; color: var(--text); font-size: 16px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; min-width: 0; }
  .rest-card-line .icon { flex: none; width: 18px; height: 18px; margin-top: 3px; color: var(--close); }
  .rest-card-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
  @media (max-width: 720px) { .rest-card-btn { width: 100%; } }

  /* Today's checks. */

  /* Review (and the day page): Before each trade. */
  .ck-card { gap: 12px; }
  .ck-card.is-asking { border: 1px solid var(--accent); }
  .dp-card.ck-card { gap: 12px; padding: 22px 24px; }
  .ck-quiet { color: var(--text); font-size: 15px; }
  .ck-big { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 24px; line-height: 1.3; color: var(--text); text-wrap: pretty; }
  .ck-lead { margin: -4px 0 0; color: var(--text); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
  .ck-scroll { min-width: 0; overflow-x: auto; } /* a safety net: long labels never push the card wider than the page */
  .ck-table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; color: var(--text); }
  .ck-table th { padding: 6px 8px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; text-align: left; white-space: nowrap; }
  .ck-table td { padding: 7px 8px; vertical-align: middle; }

  .ck-table .ck-time { width: 4.2em; }
  .ck-table .ck-what { overflow-wrap: anywhere; }
  .ck-table .ck-chk { width: 1%; white-space: nowrap; }
  .ck-table .ck-pnl { width: 1%; text-align: right; white-space: nowrap; }

  .ck-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 11px; border: 1px solid transparent; border-radius: var(--r-pill); background: var(--raised); color: var(--text); font: inherit; font-size: 13px; white-space: nowrap; }
  button.ck-chip { cursor: pointer; border-color: var(--line); transition: border-color var(--dur-fast) var(--ease-out); }
  @media (hover: hover) { button.ck-chip:hover { border-color: var(--muted); } }
  button.ck-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  .ck-chip.is-checked { background: var(--accent-soft); }
  .ck-chip.is-checked .status-dot { width: 7px; height: 7px; }
  .ck-chip.is-none { border-color: color-mix(in srgb, var(--close) 70%, transparent); background: var(--close-soft); color: var(--close); }
  .ck-chip.is-open { border-style: dashed; color: var(--muted); }
  .ck-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
  .ck-foot .link-btn { font-size: 15px; }
  @media (pointer: coarse) { button.ck-chip { min-height: 44px; } } /* round F5: a full touch target */
  @media (max-width: 720px) {
    .ck-big { font-size: 20px; }
    .dp-card.ck-card { padding: 18px; }
    .ck-table { font-size: 14px; }
    .ck-table th, .ck-table td { padding-left: 4px; padding-right: 4px; }

    .ck-chip { padding: 2px 8px; font-size: 12px; }
  }
  .ck-what-at { display: none; }
  @media (max-width: 560px) {
    .ck-table .ck-time { display: none; }
    .ck-what-at { display: block; color: var(--muted); font-size: 12.5px; }
  }
 /* a link inside the sentence: it keeps to the line */

  /* ============================================================
     PLAN (round R3, boards design-round-3): one desktop screen, every
     piece edited where it is. Two columns from 1041px (left 1.15fr:
     Your trading day, Guardrails; right 1fr: Entry rules, Prepare), one
     column below in that order. Fields are typed in place (.plan-input);
     the switches are .seg; a quiet count after each title (.plan-count).
  ============================================================ */
  #planPage #planSetupCard { margin-bottom: 24px; }
  .plan-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; min-width: 0; }
  .plan-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
  #planPage .rule-history-card { margin-top: 24px; }
  .plan-card { gap: 14px; }
  .plan-card-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
  .plan-count { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; text-transform: none; font-variant-numeric: tabular-nums; }

  .plan-head-note { color: var(--text); font-size: 14.5px; }
  .plan-quiet { margin: 0; color: var(--text); font-size: 15px; line-height: 1.5; }
  .plan-quiet-right { margin-left: auto; color: var(--text); font-size: 14.5px; text-align: right; }
  .plan-seg { display: flex; flex-wrap: wrap; align-self: flex-start; max-width: 100%; }

  .plan-seg button { white-space: nowrap; }
  .plan-input { min-width: 0; height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: var(--r-ctl); background: var(--raised); color: var(--text); font: inherit; font-size: 15px; }
  .plan-input::placeholder { color: var(--muted); }
  .plan-input:focus-visible, .plan-input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
  .plan-input[aria-invalid="true"] { border-color: var(--breach); }
  .plan-x { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
  .plan-x .icon { width: 13px; height: 13px; }
  @media (hover: hover) { .plan-x:hover { background: var(--raised); } }
  .plan-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  .plan-fields { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .plan-fields:empty { display: none; }
  .plan-field-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .plan-field-row .plan-input { flex: 1 1 auto; }
  .plan-field-row .cat-tag { margin-left: 0; }
  .plan-rate { flex: none; min-width: 3.2em; color: var(--text); font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
  .plan-rate.is-none { color: var(--muted); }
  .plan-fields-foot { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
  .plan-fields-foot:empty { display: none; }
  .plan-ask { display: flex; flex-direction: column; gap: 8px; }
  .plan-ask[hidden] { display: none; }
  .plan-ask-title { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; }
  #planRulesCard .plan-ask { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
  .plan-rules-archived[hidden] { display: none; }
  .plan-archived-toggle { align-self: flex-start; color: var(--muted); font-size: 14px; }
  .plan-archived-list { display: flex; flex-direction: column; margin: 8px 0 0; padding: 0; list-style: none; }
  .plan-archived-list[hidden] { display: none; }
  .plan-archived-list li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
  .plan-archived-text { flex: 1 1 160px; min-width: 0; color: var(--text); overflow-wrap: anywhere; }
  .plan-archived-list .plan-quiet { color: var(--muted); font-size: 13px; }

  /* Your trading day. */

  /* Guardrails. */

   /* round P1b: the same plain × as every once-tip (was a boxed button); on the note's first line */

  /* "Trade only inside my sessions" has no value (round R3b): "on" in the value column. */

  .pg-cur { color: var(--muted); font-size: 15px; }

  /* The add list: under the link, the card's width, over what's below. */

  @media (max-width: 1040px) {
    .plan-grid { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 720px) {
    .plan-card-head { flex-wrap: wrap; }
    .plan-quiet-right { margin-left: 0; text-align: left; flex-basis: 100%; }

    /* A row: the name and × on top, its opened description right under the name (round R3b), then the value. */

    /* The add list is a bottom sheet with a grab handle, title and count. */

  }
  #limitsSettingsCard .limits-pause:empty { display: none; }

  /* ============================================================
     ROUND OD — one day view (25 Oct; boards od-1 … od-7 in
     design-reference/design-round-4). The Trading day is for doing:
     today only, Prepare folded to one line once done, Trade's plain list
     and its foot. The day page holds the review: Your part, the inline
     trade form, the fees question under the table.
  ============================================================ */
  /* The Trading day's head: today's date, no arrows; no step tabs. */
  #dashHeadAction[hidden] { display: none; }

  /* Prepare, folded (od-1, od-5): ✓ Prepared · Ready, the if-then, Open Prepare. */
  .fl-card.fl-fold { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px 18px; padding: 18px 24px; }
  .fl-fold-line { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: var(--text); font-size: 15.5px; line-height: 1.35; }
  .fl-fold-line b { font-weight: 600; }
  .fl-fold-tick { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
  .fl-fold-tick .icon { width: 12px; height: 12px; }
  .fl-fold-quiet { color: var(--muted); font-weight: 400; }

  .fl-fold-act { margin-left: auto; font-size: 14.5px; white-space: nowrap; }
  .fl-fold.is-open .fl-fold-line { color: var(--muted); }
  .fl-fold.is-open .fl-fold-line b { color: var(--text); }

  /* Trade (od-1): "Your part · on the day page" on the count's right; the foot. */

  /* Round B1 §2: "Stop for today" — quiet, beside Your review in the Trade step's head, under trading mode's
     two buttons, on the Dashboard's card; the sheet's reasons; "Stopped for today · 14:32 · Resume". */

  .stop-why { margin: 4px 0 8px; color: var(--text); font-size: 14.5px; font-weight: 600; }
  .stop-why .is-quiet { color: var(--muted); font-weight: 400; }
  .stop-chips { margin-bottom: 4px; }

  @media (max-width: 720px) {
    .fl-card.fl-fold { flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 18px; }

    .fl-fold-act { margin-left: 0; }

  }

  /* The day page's head on today's page: "· Today" (no link). */

  /* Your part (od-2, od-3): the head, then blocks divided by a line. */

  /* Each trade: a row per decision — the trade, then its questions. */
  .dp-each { gap: 0; }
  .dp-checks-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 4px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
  .dp-checks { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 8px; padding: 16px 18px; border: 1px solid var(--accent); border-radius: 14px; }
  .dp-each-more { margin: 10px 0 0; }

  /* The day's note and the sessions' notes; the foot. */
  .dp-note-block .dp-note-label { color: var(--text); }
  .dp-note-block .dp-note { margin-top: 0; }
  .dp-session-notes { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 6px; margin: 0; color: var(--muted); font-size: 13.5px; }
  .dp-session-notes .link-btn { font-size: inherit; }

  /* Folded (od-4): ✓ Your part · all answered, the summary, Edit. */
  .dp-part-fold-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; flex: 1 1 0; min-width: 0; margin: 0; color: var(--text); font-size: 15px; line-height: 1.45; } /* round P1b: never pushes Edit off its line */
  .dp-part-fold-sum { margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; } /* round P1: its own line under the title row */

  /* The trade form, inline on the day page: in a row's place, or under the table. */

  /* The phone boards (od-6, od-7): a page under 560px wide — the rows stack. */
  @container daypage (max-width: 559px) {
    .dp-checks { padding: 14px; }
  }

  /* ============================================================
     ROUND R8 — Settings → Fees (boards fe1 / fe3; js/settings.js FEES)
  ============================================================ */
  .fees-lead { max-width: 640px; margin: 0 0 8px; } /* round P1: its words are a once-tip (SETTINGS_ONCE), then the ring by "Fees" */
  .fees-lead:is([hidden], :empty), #displayOnce:is([hidden], :empty), .acct-list-note:is([hidden], :empty) { display: none; } /* after ×, the slot takes no room */
  .once-tip.set-once { margin: 0 0 8px; text-wrap: pretty; }
  .once-tip.set-once .once-tip-text { white-space: pre-line; } /* round P1b: one sentence a line */
  .fees-basis-row { margin: 0 0 20px; border-top: 0; }
  .fees-cards { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
  .fees-card { gap: 0; padding: 20px 24px 8px; }
  .fees-card-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
  .fees-acct { margin: 0; color: var(--text); font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
  .fees-acct-sub { color: var(--muted); font-size: 13px; }
  .fees-row { display: grid; grid-template-columns: minmax(84px, 110px) auto auto minmax(0, 1fr) auto; grid-template-areas: "name val unit src x"; align-items: center; gap: 8px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); min-width: 0; }
  .fees-name { grid-area: name; color: var(--text); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
  .fees-row.is-other .fees-name { font-weight: 500; }
  .fees-val { grid-area: val; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--raised); }
  .fees-val:focus-within { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 1px var(--accent); }
  .fees-sym { color: var(--muted); font-size: 15px; }
  .fees-input { width: 52px; min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; font-variant-numeric: tabular-nums; }
  .fees-input:focus { outline: none; }
  .fees-input[aria-invalid="true"] { color: var(--breach); }
  .fees-unit { grid-area: unit; color: var(--muted); font-size: 13.5px; white-space: nowrap; }
  .fees-src { grid-area: src; min-width: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
  .fees-src.is-files .icon { width: 13px; height: 13px; margin-right: 6px; color: var(--accent); vertical-align: -1px; }
  .fees-wide { color: var(--text); }
  .fees-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
  .fees-chip { min-height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--raised); color: var(--text); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; }
  .fees-chip:first-child { border-color: var(--accent-line); background: var(--accent-soft); }
  @media (hover: hover) { .fees-chip:hover { border-color: var(--accent); } }
  .fees-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .fees-x { grid-area: x; width: 32px; height: 32px; color: var(--muted); }
  .fees-x .icon { width: 14px; height: 14px; }
  .fees-add-line, .fees-none { margin: 0; padding: 14px 0 12px; color: var(--text); font-size: 15px; line-height: 1.55; }
  .fees-add-link { font-size: 15px; }
  .fees-add { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 14px 0 12px; min-width: 0; }
  .fees-add-k { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
  .fees-add-sym { width: 88px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--raised); text-transform: uppercase; }
  .fees-add-sym:focus { border-color: var(--accent); background: var(--card); }
  .fees-unit-pick { min-height: 40px; min-width: 136px; }
  .fees-cancel { font-size: 15px; }
  .fees-error { flex-basis: 100%; margin: 0; color: var(--breach); font-size: 13.5px; }
  .fees-error:empty { display: none; }
  .fees-arch { display: flex; flex-direction: column; gap: 16px; }
  .fees-arch-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; }
  .fees-arch-btn[aria-expanded="true"] .mf-arch-icon { transform: rotate(90deg); }
  @media (max-width: 720px) {
    .fees-card { padding: 16px 16px 4px; }
    .fees-row { grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "name val unit x" "src src src src"; gap: 8px 8px; }
    .fees-row:not(:has(.fees-x)) { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name val unit" "src src src"; }
    .fees-x { width: 44px; height: 44px; }
    .fees-add { gap: 10px; }
    .fees-add-sym { width: 90px; }
    .fees-unit-pick { flex: 1 1 140px; min-height: 44px; }
    .fees-add .btn { min-height: 44px; }
    .fees-chip { min-height: 36px; }
  }

  /* ROUND R8 — the import's fees question (boards fe2 / fe4; js/import/ui.js impBasisHtml). */
  .imp-choices.imp-fees-choices { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .imp-fees-choices .imp-choice { min-height: 0; padding: 14px 16px; }
  .imp-fees-choices .imp-choice b { font-size: 16px; }
  .imp-fees-choices .imp-choice.is-on span { color: var(--text); }
  .imp-fee-val { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--raised); color: var(--muted); }
  .imp-fee-val:focus-within { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 1px var(--accent); }
  .imp-fee-input { width: 60px; min-height: 36px; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; font-variant-numeric: tabular-nums; }
  .imp-fee-input:focus { outline: none; }
  .imp-fee-input[aria-invalid="true"] { color: var(--breach); }
  .imp-basis-ex { margin: 12px 0 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 14.5px; line-height: 1.5; }
  .imp-basis-foot .btn-primary { flex: 1 1 auto; }
  @media (max-width: 720px) {
  }

  /* ROUND A4 §1 — Hide amounts (js/core.js HIDE AMOUNTS; boards a0 / a9).
     The rail item above the theme and the phone bar's eye; pressed: the
     accent. While html[data-amounts="hidden"], a masked amount ("$•••")
     has no gain or loss colour (a count beside one keeps its: .not-money),
     a money field shows dots until it's being edited, and a chart with a
     money axis is replaced by one quiet line. */
  .amounts-hidden-icon { display: none; }
  html[data-amounts="hidden"] .amounts-hidden-icon { display: inline-block; }
  html[data-amounts="hidden"] .amounts-shown-icon { display: none; }
  .amounts-flip[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
  html[data-amounts="hidden"] :is(.pos, .neg, .is-gain, .is-loss):not(.not-money):not(.not-money *),
  html[data-amounts="hidden"] :is(.ac-dot, .dv-pick-dot, .cal-item-value, .ins-amount, .ins-pay-each, .ins-feel-avg, .day-row-pnl, .dv-cell, .amt) { color: inherit !important; }
  html[data-amounts="hidden"] :is(.ac-dot.is-up, .ac-dot.is-down, .dv-pick-dot.pos, .dv-pick-dot.neg) { background: var(--muted); }
  html[data-amounts="hidden"] :is(.money-input, .fees-input, .imp-fee-input, #twFees, #twPnl, .ac-cost-in, #accStartCost, [data-acc-pay-amt], [data-imp-pv]):not(:focus) { -webkit-text-security: disc; }
  @supports not (-webkit-text-security: disc) {
    html[data-amounts="hidden"] :is(.money-input, .fees-input, .imp-fee-input, #twFees, #twPnl, .ac-cost-in, #accStartCost, [data-acc-pay-amt], [data-imp-pv]):not(:focus) { color: transparent; }
  }

  .money-chart-hidden { margin: 12px 0; padding: 28px 16px; border: 1px dashed var(--line); border-radius: var(--r-ctl); color: var(--muted); font-size: 14px; text-align: center; }

  /* ROUND A4 §2 — the monthly report card (js/rewards.js; boards a1 / a7).
     The headline in the serif, four stats, Stayed within / Work on, and the
     foot: the P&L hidden until Show, Past months. Two stat columns when
     the card is narrow (container query: the card's own width). */

   /* round B1 §2: "Stopped early on N days" */

  /* The Dashboard's line once a month's card is ready. */
  .hm-report { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--accent-line); border-radius: var(--r-ctl); background: var(--accent-soft); }
  .hm-report .link-btn { font-weight: 600; }

  /* ROUND A4 §3 — sharing (boards a2 / a8): the preview beside the
     choices; on a phone a sheet, the preview on top. */
  .share-modal { position: relative; display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 320px); gap: 28px; max-width: 780px; align-items: start; }
  .share-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); font-size: 20px; }
  .share-preview { display: flex; justify-content: center; align-items: center; min-height: 0; }
  .share-preview canvas { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); }
  .share-preview[data-size="story"] canvas { width: auto; max-width: 100%; max-height: min(64vh, 560px); }
  .share-side h2 { padding-right: 32px; }
  .share-side h2:focus { outline: none; } /* focused on open, so a screen reader starts at the title */
  .share-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text); font-size: 15px; }
  .share-sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
  .share-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
  .share-actions .btn { flex: 1 1 140px; }
  @media (max-width: 720px) {
    .share-modal { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .share-preview { padding-top: 34px; } /* room for the × */
    .share-preview canvas { max-width: min(100%, 300px); }
    .share-preview[data-size="story"] canvas { max-height: 46vh; }
    .share-x { width: 44px; height: 44px; top: 6px; right: 6px; }
    .share-sizes .mood-pill, .share-actions .btn { min-height: 44px; }
  }

  /* ROUND A4 §4 — Your best days (board a3; js/rewards.js): a row per
     leading habit, two bars — best days in the accent, crossed days in a
     muted loss tint — each "69% · 24 of 35". */

  /* ROUND A4 §5 — the long view (board a4; js/rewards.js): the line over
     13 weeks with gaps, the focus bands, the metric switch. Its labels are
     HTML (never stretched); the line an SVG stretched to the plot. */

  .lv-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--card); }
  .lv-dot.is-partial { background: var(--card); box-shadow: inset 0 0 0 2px var(--accent); }
   /* round P1: the focus's words, whole */

  /* ROUND A4 §7 — chart labels kept apart (chartLabelsFit, core.js): one
     that couldn't fit anywhere is dropped (the legend or the read-out says
     it). The day page's note under "No questions for days older than 7
     days" in plain flow: its own spacing, the label above its field. */
  .is-fit-dropped { display: none !important; }

  /* ROUND A4 §7 — the day page's date picker (js/day-page.js dayPickHtml):
     the Journal Calendar's tints, small; a sheet on a phone. */

  .dpk-day.is-disc { background: var(--accent-soft); } /* the Journal's .day.clean */
  .dpk-day.is-crossed { background: var(--breach-soft); } /* the Journal's .day.breach */

/* ============================================================
   ROUND B2 §1: "Send this file to Patienza?" (js/import/ui.js) — the
   offer under "This file can’t be read", or as its own step.
   ============================================================ */
.imp-send { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border-radius: 16px; background: color-mix(in srgb, var(--page) 70%, var(--card)); box-shadow: inset 0 0 0 1px var(--line); }
.imp-send-text { margin: 0; color: color-mix(in srgb, var(--text) 82%, var(--muted)); font-size: 15px; line-height: 1.55; }
.imp-send-text b { color: var(--text); font-weight: 600; }
.imp-send-plat { display: flex; flex-direction: column; gap: 6px; max-width: 420px; color: var(--muted); font-size: 13.5px; }
.imp-send-plat input { width: 100%; min-height: 44px; }
.imp-send-acts { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.imp-send-acts .btn { flex: 0 0 auto; min-height: 48px; padding: 0 22px; font-size: 15px; white-space: nowrap; }
.imp-send-link { font-size: 14px; }
.imp-foot .imp-send-link { margin-left: auto; }
.imp-error .imp-send-link, .imp-foot-note .imp-send-link { font-size: inherit; }
@media (max-width: 640px) {
  .imp-send { padding: 16px; }
  .imp-send-acts .btn { flex: 1 1 auto; min-height: 52px; }
  .imp-foot .imp-send-link { margin-left: 0; flex-basis: 100%; text-align: left; }
}

/* ============================================================
   ROUND B2 §2: the phone app (manifest.webmanifest; viewport-fit=cover).
   Full screen from the Home Screen, the page runs under the status bar
   and the home indicator: the top bar and the tab bar already keep clear
   of them (env(safe-area-inset-top / -bottom), above); here the sides too
   (a phone turned on its side, the notch on the left or right), and the
   import sheet, which fills a phone's screen.
   ============================================================ */
@media (max-width: 720px) {
  .app-bar { padding-left: calc(16px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px)); }
  .tabbar { padding-left: calc(4px + env(safe-area-inset-left, 0px)); padding-right: calc(4px + env(safe-area-inset-right, 0px)); }
  .wrap { padding-left: calc(16px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px)); }
  .import-modal { padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
  .gate-head { padding-top: calc(20px + env(safe-area-inset-top, 0px)); }
}
.phone-app-tip b { color: var(--text); font-weight: 600; }
.phone-app-tip .link-btn { font-size: inherit; }

/* ============================================================
   ROUND B2 §3: example data's banner (js/example.js), at the top of
   every page — above the access banner's place, in the page's flow.
   ============================================================ */
.example-banner { display: flex; align-items: center; box-sizing: border-box; width: calc(100% - 80px); max-width: 1000px; margin: 24px auto 0; padding: 10px 16px; border-radius: 12px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); color: var(--text); font-size: 14px; line-height: 1.5; }
.example-banner[hidden] { display: none; }
.example-banner-text { margin: 0; }
.example-banner b { font-weight: 600; }
.example-banner a { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.example-banner a:hover { text-decoration: underline; }
.example-banner a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.example-banner .example-exit { font-weight: 500; color: var(--muted); }
.example-dot { color: var(--muted); }
@media (max-width: 900px) and (min-width: 721px) { .example-banner { width: calc(100% - 56px); } }
@media (max-width: 720px) {
  .example-banner { width: auto; max-width: none; margin: 12px 16px 0; margin-left: calc(16px + env(safe-area-inset-left, 0px)); margin-right: calc(16px + env(safe-area-inset-right, 0px)); font-size: 13.5px; }
}

/* Round B2 §2 (code review): with viewport-fit=cover, the phone's fixed bars and messages keep clear of a side notch too. */
@media (max-width: 720px) {
   .messages { left: calc(16px + env(safe-area-inset-left, 0px)); right: calc(16px + env(safe-area-inset-right, 0px)); }
}
/* Round B2 §2: a phone turned on its side runs the wide layout — the rail and the page keep clear of its notch. */
@media (min-width: 721px) {
  .app-shell { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
}
.example-tail { white-space: nowrap; }
/* Round B2 §3: example data's scripts load after the app (js/app.js); the shell waits for the example to be drawn. */
html[data-example]:not([data-example-ready]) .app-shell { visibility: hidden; }

/* ============================================================
   ROUND S1 (3 Nov 2026; boards in design-reference/redesign-2026-11-03):
   the first run as a focused page, the Dashboard and Plan on the loop's
   engines, the Choose window and the sessions panel. Guardrail names in
   running text stand out (.gr-name); a dollar loss is red, a gain green.
   ============================================================ */
.gr-name { color: var(--accent); font-weight: 600; }

/* ---------- The first run: a focused page (js/guide.js) ----------
   html.is-firstrun: no rail, no phone bars, no menu — the page alone. */
html.is-firstrun .app-shell { grid-template-columns: minmax(0, 1fr); }
html.is-firstrun .sidebar, html.is-firstrun .app-bar, html.is-firstrun .tabbar, html.is-firstrun .example-banner { display: none !important; }
html.is-firstrun body { padding-bottom: 0; }
#homePage.hm-firstrun > :not(#homeGuide):not(#homeStatus) { display: none !important; }
/* --fr-pad: the page's own side padding (the rail is hidden here, so 721–900px's 28px doesn't apply); the header bleeds by exactly that much. */
#homePage.hm-firstrun { --fr-pad-l: calc(40px + env(safe-area-inset-left, 0px)); --fr-pad-r: calc(40px + env(safe-area-inset-right, 0px)); max-width: none; padding-top: 0; padding-left: var(--fr-pad-l); padding-right: var(--fr-pad-r); }
.fr-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 calc(-1 * var(--fr-pad-r, 40px)) 32px calc(-1 * var(--fr-pad-l, 40px)); padding: 20px var(--fr-pad-r, 40px) 20px var(--fr-pad-l, 40px); border-bottom: 1px solid var(--line); }
.fr-brand { padding: 0; cursor: default; }
.fr-count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.fr-card { box-sizing: border-box; width: 100%; max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.fr-segs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fr-seg { height: 3px; border-radius: 2px; background: var(--line); }
.fr-seg.is-on { background: var(--accent); }
.fr-eyebrow { margin-top: 4px; }
.fr-title { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 38px; line-height: 1.12; letter-spacing: -0.01em; color: var(--text); text-wrap: balance; }
.fr-title:focus { outline: none; }
.fr-sub { margin: -4px 0 0; color: var(--text); font-size: 16px; line-height: 1.55; max-width: 64ch; }
.fr-drops { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.fr-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 160px; padding: 20px; border: 1.5px dashed var(--line); border-radius: var(--r-card); text-align: center; }
.fr-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.fr-drop.is-plain { border-style: solid; min-height: 0; }
.fr-drop .imp-drop-icon { width: 22px; height: 22px; color: var(--muted); }
.fr-drop-title { font-size: 16px; color: var(--text); }
.fr-drop-sub { color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 34ch; }
.fr-drop-sub .link-btn { font-size: inherit; font-weight: 600; }
.fr-in { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0; font-size: 14px; color: var(--text); }
.fr-in-tick { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gain-soft); color: var(--gain); }
.fr-in-tick svg { width: 12px; height: 12px; }
.fr-how { padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
.fr-how-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.fr-how-title { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.fr-from { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.fr-how-from { margin: 12px 0 6px; font-weight: 600; font-size: 14px; }
.fr-how-steps { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.fr-how-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.fr-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 4px; }
.fr-foot .fr-skip:last-of-type, .fr-foot .fr-back { margin-left: auto; }
.fr-foot .fr-skip.is-quiet { margin-left: 0; color: var(--muted); }
.fr-foot-note { flex: 1 1 240px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: right; }
.fr-main { gap: 14px; }
.fr-main-line { margin: 0; font-family: var(--font-heading); font-size: 26px; line-height: 1.3; color: var(--text); }
.fr-main-line b { font-weight: 600; }
.fr-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.fr-small { gap: 10px; padding: 20px 24px; }
.fr-small-line { margin: 0; font-size: 15px; line-height: 1.5; }
.fr-rows { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.fr-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.fr-row dt { min-width: 0; font-size: 15px; }
.fr-row dd { margin: 0; flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.fr-works { gap: 10px; border-color: color-mix(in srgb, var(--gain) 35%, var(--line)); background: color-mix(in srgb, var(--gain) 5%, var(--card)); }
.fr-works .card-label { color: var(--gain); }
.fr-works-note, .fr-note, .fr-quiet { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.fr-card .pos, .hm-body .pos, #planPage .pos { color: var(--gain); }
.fr-card .neg, .hm-body .neg, #planPage .neg, .messages .neg { color: var(--loss); }
/* The bars by trade number: green up, red down, the zero line between. */
.fr-bars { display: flex; flex-direction: column; gap: 10px; }
.fr-cols { --fr-up: 1; --fr-down: 1; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.fr-col { display: grid; grid-template-rows: calc(16px + 150px * var(--fr-up) / (var(--fr-up) + var(--fr-down))) calc(16px + 150px * var(--fr-down) / (var(--fr-up) + var(--fr-down))) auto; min-width: 0; }
.fr-col-up { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; border-bottom: 1px solid var(--line); }
.fr-col-down { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
.fr-bar { display: block; height: var(--fr-h, 0%); min-height: 3px; border-radius: 4px 4px 0 0; }
.fr-col-down .fr-bar { border-radius: 0 0 4px 4px; }
.fr-bar.pos { background: var(--gain); }
.fr-bar.neg { background: var(--loss); }
.fr-bar-val { padding: 2px 0; color: var(--muted); font-size: 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.fr-bar-val.is-none { opacity: 0.6; }
.fr-col-n { padding-top: 6px; color: var(--muted); font-size: 12px; text-align: center; }
.fr-bars-note { margin: 0; color: var(--muted); font-size: 13px; }
/* Step 3: the Guardrail with its number in the line. */
.fr-guard { border-color: var(--accent-line); }
.fr-guard-head { color: var(--accent); }
.fr-rule { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0; font-family: var(--font-heading); font-size: 30px; line-height: 1.2; color: var(--text); }
.fr-rule-num { display: inline-flex; align-items: center; gap: 6px; }
.fr-rule-cur { font-size: 26px; }
.fr-rule .fr-rule-input { width: 4.6em; height: 52px; padding: 0 12px; font-family: var(--font-body); font-size: 22px; text-align: center; }
.fr-guard-why { margin: 0; font-size: 15px; line-height: 1.55; }
.fr-ifthen { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.fr-if-label { margin: 0; font-weight: 600; font-size: 15px; }
.fr-if-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.fr-if-fields .plan-input { width: 100%; box-sizing: border-box; }
.fr-if-ex { margin: 0; color: var(--muted); font-size: 13px; }
.fr-next-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 1.5; }
.fr-next-cost { color: var(--muted); }
.fr-error { margin: 0; color: var(--loss); font-size: 14px; }
.fr-error:empty { display: none; }
@media (max-width: 720px) {
  #homePage.hm-firstrun { --fr-pad-l: calc(16px + env(safe-area-inset-left, 0px)); --fr-pad-r: calc(16px + env(safe-area-inset-right, 0px)); }
  .fr-top { margin-bottom: 20px; padding-top: 14px; padding-bottom: 14px; }
  .fr-title { font-size: 30px; }
  .fr-main-line { font-size: 22px; }
  .fr-rule { font-size: 24px; }
  .fr-foot { flex-direction: column; align-items: stretch; }
  .fr-foot .btn { width: 100%; min-height: 48px; }
  .fr-foot .fr-skip:last-of-type, .fr-foot .fr-back { margin-left: 0; text-align: center; min-height: 44px; }
  .fr-foot .fr-skip.is-quiet { text-align: center; min-height: 44px; }
  .fr-foot-note { text-align: left; }
  .fr-cols { gap: 4px; }
  .fr-rule, .pl-rule-edit { flex-direction: column; align-items: flex-start; } /* the words, the field, the words: stacked, not wrapped round the field */
  .fr-bar-val { font-size: 10.5px; }
  .fr-drop { min-height: 120px; }
}

/* ---------- The Dashboard (js/home.js) ---------- */
.hm-last { margin: 0 0 4px auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
#homePage .hm-head { flex-wrap: wrap; gap: 8px 16px; }
.hm-notice { position: relative; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 20px; padding: 16px 56px 16px 20px; } /* a link beside a wrapped line sits on its first line */
.hm-notice-k { margin: 0; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.hm-notice-text { flex: 1 1 280px; min-width: 0; margin: 0; font-size: 15px; line-height: 1.5; }
.hm-notice-go { white-space: nowrap; }
.hm-notice-x { position: absolute; top: 4px; right: 6px; margin: 0; } /* on the first line, never on a line of its own */
#homePage .hm-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
#homePage .hm-aside .card { padding: 24px; gap: 16px; }
.hm-big { margin: 0; font-family: var(--font-heading); font-size: 24px; line-height: 1.3; color: var(--text); }
.hm-big b { font-weight: 600; }
.hm-rule { margin: 0; font-family: var(--font-heading); font-size: 28px; line-height: 1.2; color: var(--text); }
.hm-ifthen { margin: -6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.hm-quiet { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.hm-credit { margin: 0; color: var(--gain); font-size: 14px; }
.hm-foot { margin: 0; }
.hm-guard { border-color: var(--accent-line); }
.hm-ld-rows, .hm-cost-rows { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.hm-ld-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 15px; }
.hm-ld-row dt { min-width: 0; }
.hm-ld-row dd { margin: 0; flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.hm-ld-row.is-total { padding-top: 10px; border-top: 1px solid var(--line); }
.hm-done { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; } /* the note under the button: a wrapped note beside it sat off its centre */
.hm-done-btn { flex: none; }
p.hm-done { margin: 0; color: var(--text); font-size: 15px; }
.hm-done-tick { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: var(--gain-soft); color: var(--gain); vertical-align: -4px; }
.hm-done-tick svg { width: 12px; height: 12px; }
.hm-leak-soon { display: flex; flex-direction: column; gap: 8px; }
.hm-segs { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.hm-seg { height: 6px; border-radius: 3px; background: var(--raised); }
.hm-seg.is-on { background: var(--accent); }
.hm-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.hm-tiles li { min-width: 0; display: flex; }
.hm-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; box-sizing: border-box; width: 100%; min-width: 0; padding: 12px 4px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--text); font: inherit; text-align: center; }
button.hm-tile { cursor: pointer; }
@media (hover: hover) { button.hm-tile:hover { border-color: var(--muted); } }
.hm-tile.is-today { border-color: var(--accent-line); }
.hm-tile-day { color: var(--muted); font-size: 13px; }
.hm-tile-mark { display: grid; place-items: center; height: 20px; }
.hm-tile-mark svg { width: 16px; height: 16px; }
.hm-tile.is-kept .hm-tile-mark { color: var(--gain); }
.hm-tile.is-broke .hm-tile-mark { color: var(--loss); }
.hm-tile-dot { color: var(--muted); }
.hm-tile-pnl { min-height: 18px; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 100%; overflow: hidden; }
/* The day's P&L is never cut (round S12e: to the cent, no short form): the week a size smaller where one doesn't fit
   (two columns at 1041–1200px, phones), then broken after the currency sign (fitAmounts, core.js), else hidden. */
.hm-tile-pnl.is-clipped { visibility: hidden; }
.hm-tile-pnl.is-today { color: var(--muted); }
.hm-week-cost { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; font-size: 15px; }
.hm-sug { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--line); }
.hm-sug-text { margin: 0; font-size: 15px; line-height: 1.5; }
.hm-sug .hm-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.hm-cost-row { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr); align-items: center; gap: 12px; }
.hm-cost-row dt { color: var(--text); font-size: 15px; }
.hm-cost-row dd { display: flex; align-items: center; gap: 12px; margin: 0; min-width: 0; }
.hm-cost-track { flex: 1 1 auto; min-width: 40px; height: 8px; border-radius: 4px; background: var(--raised); overflow: hidden; }
.hm-cost-fill { display: block; height: 100%; width: var(--hm-w, 0%); border-radius: 4px; background: var(--loss); }
.hm-cost-n { flex: none; min-width: 5.5em; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 1040px) {
  #homePage .hm-body { grid-template-columns: minmax(0, 1fr); }
}
/* The notice line stacks (its label over the text) where the text would wrap under it (768: the rail and a long line). */
@media (max-width: 900px) {
  .hm-notice { flex-direction: column; align-items: flex-start; gap: 6px; }
}
@media (max-width: 720px) {
  #homePage .hm-head { flex-direction: column; align-items: flex-start; }
  .hm-last { margin: 0; }
  .hm-done { align-items: stretch; }
  .hm-done-btn { min-height: 48px; }
  .hm-tiles { gap: 4px; }
  .hm-tile { padding: 10px 2px; }
  .hm-tile-pnl { font-size: 11px; }
  .hm-cost-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .hm-notice-go { white-space: normal; }
}
#homePage .hm-guide { display: block; min-width: 0; }
#homePage .hm-guide[hidden] { display: none; }
.fr-foot .btn { flex: none; min-width: 140px; }

/* ---------- Plan: your Guardrail, habits, the ladder (js/plan.js) ---------- */
.pl-grid { margin-top: 4px; }
.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; min-width: 0; }
.pl-head .card-label { min-width: 0; }
.pl-label:focus { outline: none; }
.pl-focus { border-color: var(--accent-line); }
.pl-focus .pl-label { color: var(--accent); }
.pl-label.is-gain { color: var(--gain); }
.pl-rule-row { display: flex; flex-direction: column; gap: 4px; } /* the count under the rule: beside a wrapped rule it dropped under it */
.pl-rule { margin: 0; font-family: var(--font-heading); font-size: 30px; line-height: 1.2; color: var(--text); min-width: 0; }
.pl-count { margin: 0; color: var(--muted); font-size: 15px; }
.pl-quiet { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.pl-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pl-ifthen { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--page); }
.pl-ifthen-text { margin: 0; min-width: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.pl-ifthen.is-empty { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 0; border: 0; background: none; font-size: 15px; }
.pl-ifthen-edit { display: flex; flex-direction: column; gap: 10px; }
.pl-if-label { margin: 0; font-weight: 600; font-size: 15px; }
.pl-num-edit { display: flex; flex-direction: column; gap: 10px; }
.pl-rule-edit { font-size: 26px; }
.pl-num-input { width: 5em; height: 46px; padding: 0 10px; font-family: var(--font-body); font-size: 20px; text-align: center; }
.pl-judge { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--line); }
.pl-judge-k { margin: 0; color: var(--gain); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.pl-judge-k.is-easier { color: var(--close); }
.pl-judge-why, .pl-evidence { margin: 0; font-size: 15px; line-height: 1.55; }
.pl-step { margin: 0; font-family: var(--font-heading); font-size: 24px; line-height: 1.25; }
.pl-folded { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.pl-paused { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--close) 45%, var(--line)); border-radius: var(--r-ctl); background: var(--close-soft); }
.pl-paused p { margin: 0; font-size: 15px; line-height: 1.5; }
.pl-paused-head { color: var(--close); font-size: 12px !important; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.pl-paused-head .link-btn { text-transform: none; letter-spacing: 0; font-size: 14px; }
.pl-paused-why { color: var(--muted); }
.limits-pause:empty { display: none; }
.pl-menu { min-width: 260px; }
.pl-menu-item { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; }
.pl-mi-title { color: var(--text); font-size: 14px; }
.pl-mi-sub { color: var(--muted); font-size: 12.5px; }
.pl-habits-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pl-habit { display: flex; flex-direction: column; gap: 2px; font-size: 15px; } /* the name, then its days under it (a meta line beside a wrapped name dropped under it) */
.pl-habit-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pl-habit-tick { display: inline-grid; place-items: center; color: var(--gain); }
.pl-habit-tick svg { width: 14px; height: 14px; }
.pl-habit-meta { color: var(--muted); font-size: 14px; }
.pl-slipping { color: var(--close); font-size: 14px; }
.pl-habit-meta { padding-left: 22px; }
.pl-steps { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.pl-step-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.pl-step-n { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 13px; font-weight: 600; }
.pl-step-n svg { width: 14px; height: 14px; }
.pl-step-row.is-habit .pl-step-n { border-color: var(--gain); background: var(--gain); color: var(--page); }
.pl-step-row.is-focus .pl-step-n { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.pl-step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 15px; }
.pl-step-text b { font-weight: 600; }
.pl-step-sub { color: var(--muted); font-size: 14px; line-height: 1.5; }
.pl-ladder-foot { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.pl-how-text { margin: 0; font-size: 15px; line-height: 1.55; }
.pl-wins-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pl-wins-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 15px; }
.pl-win-name { min-width: 0; overflow-wrap: anywhere; }
.pl-win-time { flex: none; color: var(--muted); white-space: nowrap; }
/* The Choose window and the sessions panel. */
.pl-choose { max-width: 920px; display: flex; flex-direction: column; gap: 14px; }
.pl-choose .modal-sub { margin: 0; }
.pl-choose-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pl-choose-head h2 { margin: 0; }
.pl-choose h2:focus { outline: none; }
.pl-x { flex: none; }
.pl-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px 20px; }
.pl-group { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pl-group-k { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.pl-kinds { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pl-kind { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
@media (hover: hover) { .pl-kind:hover:not(:disabled) { border-color: var(--muted); } }
.pl-kind:disabled { color: var(--muted); cursor: default; }
.pl-kind-name { min-width: 0; }
.pl-tag { flex: none; padding: 3px 8px; border-radius: 6px; background: var(--raised); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pl-tag.is-cost { background: color-mix(in srgb, var(--loss) 14%, transparent); color: var(--loss); }
.pl-tag.is-none { background: none; }
.pl-warn { padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--close) 45%, var(--line)); border-radius: 12px; background: var(--close-soft); }
.pl-warn p { margin: 0; font-size: 15px; line-height: 1.5; }
.pl-warn-k { color: var(--close); font-size: 12px !important; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px !important; }
.pl-field { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--text); font-size: 15px; }
.pl-sheet-overlay { justify-content: flex-end; align-items: stretch; padding: 0; }
.pl-sheet { max-width: 480px; max-height: none; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 14px; border-radius: 0; border-width: 0 0 0 1px; transform: translateX(24px); }
.pl-sheet .modal-sub { margin: 0; }
.pl-window { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--gain) 35%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--gain) 5%, var(--card)); }
.pl-window-k { margin: 0; color: var(--gain); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.pl-window-span, .pl-window-line { margin: 0; font-size: 15px; line-height: 1.5; }
.pl-window .btn { align-self: flex-start; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-wins { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pl-win-row { display: grid; grid-template-columns: minmax(0, 1fr) 82px auto 82px 32px; align-items: center; gap: 8px; }
.pl-win-row .plan-input { width: 100%; box-sizing: border-box; min-width: 0; }
.pl-win-to { color: var(--muted); font-size: 14px; }
.pl-sheet-foot { margin-top: auto; }
@media (max-width: 720px) {
  .pl-rule { font-size: 26px; }
  .pl-acts .btn { flex: 1 1 auto; min-height: 48px; }
  .pl-sheet { height: auto; max-height: 92vh; max-height: 92dvh; border-width: 1px 0 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
  .pl-sheet-overlay { align-items: flex-end; }
  .pl-win-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; }
  .pl-win-row .pl-win-name { grid-column: 1 / -1; }
  .pl-win-to { display: none; }
  .pl-groups { grid-template-columns: minmax(0, 1fr); }
}
.pl-choose .pos, .pl-sheet .pos { color: var(--gain); }
.pl-choose .neg, .pl-sheet .neg { color: var(--loss); }
.pl-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--raised); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
@media (hover: hover) { .pl-chip:hover:not(:disabled) { border-color: var(--muted); } }
.pl-chip:disabled { color: var(--muted); cursor: default; }
.page-title[tabindex="-1"]:focus, .pl-choose h2[tabindex="-1"]:focus, .pl-sheet h2[tabindex="-1"]:focus { outline: none; }
@media (max-width: 720px), (pointer: coarse) { .pl-chip { min-height: 44px; } }

/* ============================================================
   ROUND S2 — THE JOURNAL (js/trades.js; boards RD4NewCal and
   RD4NewCalFilter): the head, four tiles, the calendar
   (js/engines/performance.js) and the list.
   ============================================================ */
.jn-head { display: block; }
.jn-head-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; min-width: 0; }
.jn-head-title { min-width: 0; }
.jn-title { margin-top: 4px; }
.jn-title:focus { outline: none; }
.jn-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 0; }
.jn-months { display: flex; align-items: center; gap: 4px; }
.jn-step { min-height: 32px; padding: 0 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.jn-step:hover { color: var(--text); }
/* Round S12f: both arrows on every month at a fixed width, so nothing moves; Today beside them. */
.jn-months-row { display: flex; align-items: center; justify-content: flex-end; gap: 4px 10px; flex-wrap: wrap; }
.jn-step { display: inline-flex; align-items: center; justify-content: center; min-width: 4.4em; }
.jn-step.is-off, .jn-step.is-off:hover { color: var(--muted); opacity: 0.45; cursor: default; }
.jn-today { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.jn-dot { color: var(--muted); }
.jn-head-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 4px 14px; margin: 0; font-size: 14px; }
.jn-filter-on { color: var(--muted); }
.jn-all-trades { font-size: 14px; }
.jn-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 16px; }
.jn-tile { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
.jn-tile-label { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.jn-tiles { container-type: inline-size; }
.jn-tile-value { margin: 8px 0 0; font-family: var(--font-heading); font-size: 26px; line-height: 1.15; color: var(--text); overflow-wrap: anywhere; }
@container (max-width: 760px) { .jn-tile-value { font-size: 21px; } .jn-tile { padding: 12px 14px; } }
.jn-tile-value.pos { color: var(--gain); }
.jn-tile-value.neg { color: var(--loss); }
.jn-tile-value.is-quiet { color: var(--muted); }
.jn-cal { padding: 20px 24px; }
.jn-cal .weekdays div { text-transform: none; letter-spacing: 0; font-size: 13px; }
.jn-cal-foot { margin-top: 14px; }
.jn-legend, .jn-asif { margin: 0; color: var(--muted); font-size: 13px; }
.jn-asif { margin-top: 6px; }
/* The week column from 721px (a phone keeps the seven days). */
@media (min-width: 721px) {
  .jn-cal .weekdays, .jn-cal .grid { grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.1fr); }
  .jn-cal .wk-head { display: block; }
  .jn-cal .wk-sum { display: flex; }
  .jn-cal .grid.no-weekends, .jn-cal .weekdays.no-weekends { grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.1fr); }
  .jn-cal .grid.no-weekends > .is-weekend, .jn-cal .weekdays.no-weekends > .is-weekend { display: flex; }
  .jn-cal .weekdays.no-weekends > .is-weekend { display: block; }
}
.jn-cal .day { min-height: 74px; justify-content: space-between; border-radius: 10px; background: transparent; }
.jn-cal .day.is-empty { border-color: var(--line); background: transparent; }
.jn-cal .day.is-plain { border-color: var(--line); background: var(--raised); }
.jn-cal .day.is-disc { border-color: color-mix(in srgb, var(--gain) 35%, transparent); background: var(--gain-soft); }
.jn-cal .day.is-undisc { border-color: color-mix(in srgb, var(--loss) 45%, transparent); background: var(--breach-soft); }
.jn-cal .day.future { opacity: 0.35; }
.jn-cal .day.is-faded, .jn-cal .wk-sum.is-faded { opacity: 0.3; }
.jn-cal a.day.is-faded:hover, .jn-cal a.day.is-faded:focus-visible { opacity: 0.7; }
.jn-cal .day .num { font-size: 13px; font-weight: 500; color: var(--muted); }
.jn-cal .day.is-disc .num, .jn-cal .day.is-undisc .num, .jn-cal .day.is-plain .num { color: var(--text); }
.day-mark { display: inline-flex; width: 12px; height: 12px; flex: 0 0 auto; }
.day-mark svg { width: 12px; height: 12px; }
.day.is-disc .day-mark { color: var(--gain); }
.day.is-undisc .day-mark { color: var(--loss); }
.jn-cal .day .amt { font-size: 14px; }
.jn-cal .day.is-imported { box-shadow: inset 0 0 0 2px var(--accent); }
.jn-cal .wk-sum { justify-content: space-between; min-height: 74px; border: 1px solid var(--line); border-radius: 10px; background: transparent; }
.jn-cal .wk-sum.is-empty { border-color: transparent; }
.jn-cal .wk-disc { color: var(--muted); font-size: 13px; }
.jn-list { margin-top: 16px; padding: 20px 24px; }
.jn-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.jn-list-label { margin: 0; }
.jn-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.jn-chip { min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.jn-chip.is-on { border-color: var(--accent-line); background: var(--accent-soft); }
.jn-rows { display: flex; flex-direction: column; }
.jn-row { display: grid; grid-template-columns: minmax(96px, 130px) minmax(120px, 150px) minmax(70px, 100px) minmax(70px, 96px) minmax(0, 1fr); align-items: baseline; gap: 12px; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.jn-row:hover .jn-row-date { color: var(--accent); }
.jn-row-date { white-space: nowrap; }
.jn-status { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.jn-status.is-disc { color: var(--gain); }
.jn-status.is-undisc { color: var(--loss); }
.jn-status.is-quiet { color: var(--muted); font-weight: 400; }
.jn-status-icon { display: inline-flex; width: 12px; height: 12px; }
.jn-status-icon svg { width: 12px; height: 12px; }
.jn-asif-tag { color: var(--muted); font-weight: 400; }
.jn-row-trades { color: var(--muted); font-size: 14px; white-space: nowrap; }
.jn-row-pnl { font-weight: 600; text-align: right; white-space: nowrap; }
.jn-row-pnl.pos { color: var(--gain); }
.jn-row-pnl.neg { color: var(--loss); }
.jn-row-pnl.is-quiet { color: var(--muted); font-weight: 400; }
.jn-row-note { min-width: 0; overflow: hidden; color: var(--muted); font-size: 14px; font-style: italic; text-overflow: ellipsis; white-space: nowrap; }
.jn-more { margin-top: 14px; font-size: 14px; font-weight: 600; }
.jn-empty { margin: 16px 0 4px; color: var(--muted); font-size: 15px; }
@media (max-width: 1040px) {
  .jn-row { grid-template-columns: minmax(90px, 110px) minmax(110px, 140px) minmax(64px, 84px) minmax(64px, 90px) minmax(0, 1fr); gap: 10px; }
}
@media (max-width: 720px) {
  .jn-head-main { align-items: flex-start; }
  .jn-head-side { align-items: flex-start; }
  .jn-months-row { justify-content: flex-start; }
  .jn-months-row .jn-today { order: 2; }
  .jn-head-line { justify-content: flex-start; }
  .jn-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .jn-tile { padding: 12px; }
  .jn-tile-value { font-size: 22px; }
  .jn-cal, .jn-list { padding: 14px 12px; }
  .jn-cal .day { min-height: 60px; padding: 5px 4px; }
  .jn-cal .day .num { font-size: 12px; }
  .day-mark, .day-mark svg { width: 10px; height: 10px; }
  .jn-cal .day .amt { font-size: 12px; }
  .jn-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date pnl" "status trades" "note note"; gap: 4px 12px; padding: 12px 0; }
  .jn-row-date { grid-area: date; }
  .jn-status { grid-area: status; }
  .jn-row-trades { grid-area: trades; text-align: right; }
  .jn-row-pnl { grid-area: pnl; }
  .jn-row-note { grid-area: note; }
  .jn-row-note:empty { display: none; }
  .jn-step, .jn-today, .jn-chip, .jn-all-trades, .jn-more { min-height: 44px; }
}

/* ============================================================
   ROUND S2 — THE DAY PAGE (js/day-page.js; boards RD4NewDayUndisc,
   RD4NewDayDisc, RD6NewDayTools for the full-width table)
   ============================================================ */
.dp-top .dp-nav { flex: 1 1 auto; justify-content: space-between; min-width: fit-content; }
.page-head.dp-top:has(> .money-scope) > :first-child { flex: 1 1 auto; min-width: fit-content; }
.dp-back { font-size: 14px; font-weight: 600; }
.dp-steps { display: inline-flex; align-items: center; gap: 4px; }
.dp-steps .dp-step { min-width: 0; padding: 0 6px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.dp-dot { color: var(--muted); }
.dp-main { gap: 16px; }
.dp-main > .dp-head { display: block; min-width: 0; }
.dp-eyebrow { margin: 0; }
.dp-h1 { margin: 6px 0 0; font-family: var(--font-heading); font-weight: 500; font-size: 36px; line-height: 1.12; color: var(--text); overflow-wrap: anywhere; }
.dp-h1 .pos, .dp-st.is-disc { color: var(--gain); }
.dp-h1 .neg, .dp-st.is-undisc { color: var(--loss); }
.dp-st.is-undisc { color: var(--text); }
.dp-sep { color: var(--muted); }
.dp-label { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.dp-label label { cursor: pointer; }
.dp-main .dp-chart-card .dc-head { padding: 0 0 10px; }
.dc-head .dp-label { flex: 1 1 auto; }
.dp-guard { padding: 22px 24px; border-radius: var(--r-card); }
.dp-guard.is-undisc { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.dp-guard.is-undisc .dp-label { color: var(--accent); }
.dp-guard.is-disc { border-color: color-mix(in srgb, var(--gain) 35%, transparent); background: color-mix(in srgb, var(--gain) 7%, var(--card)); }
.dp-guard.is-disc .dp-label { color: var(--gain); }
.dp-gsent { margin: 12px 0 0; font-family: var(--font-heading); font-size: 23px; line-height: 1.35; color: var(--text); }
.dp-gsent b { font-weight: 500; }
.dp-gtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.dp-gtile { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.dp-gtile-label { margin: 0; color: var(--muted); font-size: 13px; }
.dp-gtile-value { margin: 4px 0 0; font-size: 16px; font-weight: 600; white-space: nowrap; }
.dp-gtile-value .pos, .dp-what-text .pos, .dp-c-pnl.pos { color: var(--gain); }
.dp-gtile-value .neg, .dp-c-pnl.neg { color: var(--loss); }
.dp-habit { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.dp-done { display: flex; align-items: center; gap: 6px; margin: 14px 0 0; font-size: 15px; color: var(--text); flex-wrap: wrap; }
.dp-done-tick { display: inline-flex; width: 14px; height: 14px; color: var(--gain); }
.dp-done-tick svg { width: 14px; height: 14px; }
.dp-done-credit { margin-left: auto; color: var(--muted); font-size: 14px; }
.dp-ungraded { margin: 0; color: var(--muted); font-size: 14px; }
.dp-cols { display: grid; grid-template-columns: minmax(0, 56fr) minmax(0, 44fr); gap: 16px; align-items: start; }
.dp-col-left, .dp-col-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dp-main .dp-card { padding: 20px 24px; gap: 0; border-radius: var(--r-card); }
.dp-main .dp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 0 0 10px; }
.dp-main .dp-thead, .dp-main .dp-tr { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(84px, auto) 36px; column-gap: 12px; align-items: start; padding: 11px 0; }
.dp-main .dp-thead { padding: 6px 0 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
.dp-main .dp-thead .is-num { text-align: right; }
.dp-main .dp-tr { border-bottom: 1px solid var(--line); }
.dp-main .dp-tr.is-lit { background: color-mix(in srgb, var(--close) 8%, transparent); box-shadow: inset 3px 0 0 var(--close); }
.dp-c-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.dp-c-trade { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dp-trade-what { overflow-wrap: anywhere; }
.dp-tag { margin-left: 8px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 11px; vertical-align: 1px; }
.dp-flag-line { display: flex; align-items: baseline; gap: 6px; color: var(--close); font-size: 13px; }
.dp-flag-dot { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--close); }
.dp-trade-note { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.dp-trade-sub { display: contents; }
.dp-sub-only { display: none; }
.dp-trade-what .fl-gap { margin-right: 6px; }
.dp-main .dp-c-pnl { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-weight: 600; text-align: right; white-space: nowrap; }
.dp-main .dp-c-act { position: relative; text-align: right; }
.dp-kebab { min-width: 32px; min-height: 28px; }
.dp-divider { padding: 10px 0 8px; border-bottom: 1px dashed var(--accent); color: var(--accent); font-size: 11.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
/* Round S3 §6b: Entry rules and Felt, answers or one-tap chips, on the row's second line. */
.dp-answers { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; }
.dp-answers .dp-ask { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.dp-answers .dp-ask-chip, .dp-answers .dp-felt-chip { min-height: 26px; padding: 2px 8px; font-size: 12px; }
.dp-more { margin-top: 12px; font-size: 14px; font-weight: 600; }
.dp-add { font-size: 14px; font-weight: 600; }
.dp-total { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; }
.dp-total:first-of-type { margin-top: 0; }
.dp-total-line { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.dp-total-del { min-height: 44px; font-size: 14px; color: var(--muted); }
.dp-asks { margin: 0 0 0 auto; color: var(--muted); font-size: 13px; }
.dp-main .dp-empty { padding: 6px 0 4px; color: var(--muted); }
.dp-menu, .dp-pop, .dp-move { position: absolute; z-index: 40; right: 0; top: calc(100% + 4px); display: flex; flex-direction: column; min-width: 200px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); box-shadow: var(--shadow-sm); text-align: left; }
.dp-pop { left: 0; right: auto; }
.dp-menu.float-menu, .dp-pop.float-menu, .tt-menu.float-menu { position: fixed; top: 0; left: 0; right: auto; z-index: 70; max-width: calc(100vw - 16px); }
.dp-menu-item, .dp-pop-item { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.dp-menu-item:hover, .dp-menu-item:focus-visible, .dp-pop-item:hover, .dp-pop-item:focus-visible { background: var(--raised-hover); }
.dp-menu-item.is-danger { color: var(--loss); }
.dp-move { gap: 8px; padding: 12px; min-width: 240px; }
.dp-move-label { color: var(--muted); font-size: 13px; }
.dp-move-acts { display: flex; gap: 10px; align-items: center; }
.dp-move-error { color: var(--loss); font-size: 13px; }
.dp-move-error:empty { display: none; }
.dp-c-rules, .dp-c-felt { position: relative; min-width: 0; font-size: 13px; }
.dp-met, .dp-missed { display: inline-flex; align-items: flex-start; gap: 4px; font-weight: 600; line-height: 18px; }
.dp-met { color: var(--gain); }
.dp-missed { color: var(--loss); }
.dp-met svg, .dp-missed svg { width: 12px; height: 12px; flex: 0 0 auto; margin-top: 3px; }
.dp-ask { position: relative; display: inline-flex; flex-wrap: wrap; gap: 6px; }
.dp-ask-chip, .dp-felt-chip { min-height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.dp-felt-chip { color: var(--muted); white-space: nowrap; }
.dp-felt-chip.is-set { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.dp-flag-steps { display: inline-flex; gap: 6px; }
.dp-round { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.dp-round:disabled { opacity: 0.35; cursor: default; }
.dp-flag-text { margin: 0; font-size: 15px; line-height: 1.5; }
.dp-why { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dp-why-chip { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.dp-why-chip.is-on { border-color: var(--accent-line); background: var(--accent-soft); }
.dp-main .dp-note { box-sizing: border-box; width: 100%; height: 44px; min-height: 44px; margin-top: 10px; padding-top: 0; padding-bottom: 0; }
.dp-note-hint { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.dp-usual { container-type: inline-size; }
.dp-ubar { margin-top: 12px; }
@container (max-width: 345px) { .dp-ubar-head { display: block; } .dp-ubar-head .dp-quiet { display: block; } }
.dp-ubar-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 0 0 6px; font-size: 14px; }
.dp-ubar-head .dp-quiet { font-size: 13px; }
.dp-ubar-track { position: relative; display: block; height: 6px; border-radius: 3px; background: var(--raised); overflow: visible; }
.dp-ubar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--gain); }
.dp-ubar-over { position: absolute; top: 0; bottom: 0; border-radius: 0 3px 3px 0; background: repeating-linear-gradient(135deg, var(--loss) 0 3px, color-mix(in srgb, var(--loss) 45%, transparent) 3px 6px); }
.dp-ubar-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.dp-what-text { margin: 10px 0 0; font-size: 15px; line-height: 1.55; }
.dp-what.is-well .dp-label, .dp-well-label { color: var(--gain); }
.dp-well-label { margin: 14px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
/* The chart's marks (js/day-chart.js): the Guardrail's dashed line, a flagged trade's amber ring. */
.dc-guard { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 3 4; }
.dc-guard-label { fill: var(--accent); font-size: 11.5px; font-weight: 600; }
.dc-flag { fill: none; stroke: var(--close); stroke-width: 2; }
.dc-flag.is-lit { stroke-width: 3; }
.dc-key-flag { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border: 2px solid var(--close); border-radius: 50%; vertical-align: -1px; }
.dc-legend-line > span + span { margin-left: 14px; }
@media (forced-colors: active) { .dc-guard, .dc-flag { stroke: CanvasText; } }
@media (max-width: 1040px) {
  .dp-cols { grid-template-columns: minmax(0, 1fr); }
}
/* Round S2c, a trade row on a phone: line 1 time · trade · P&L · ⋯, line 2 flags, the note, the fees pill. */
@container daypage (max-width: 559px) {
  .dp-main .dp-tr { grid-template-columns: 48px minmax(0, 1fr) auto 36px; column-gap: 8px; row-gap: 4px; align-items: center; }
  .dp-main .dp-tr .dp-c-trade { display: contents; }
  .dp-main .dp-tr .dp-c-time { grid-area: 1 / 1; }
  .dp-main .dp-tr .dp-trade-what { grid-area: 1 / 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dp-main .dp-tr .dp-c-pnl { grid-area: 1 / 3; }
  .dp-main .dp-tr .dp-c-act { grid-area: 1 / 4; }
  .dp-main .dp-tr .dp-trade-sub { display: block; grid-area: 2 / 2 / auto / -1; min-width: 0; line-height: 1.6; }
  .dp-main .dp-tr .dp-trade-sub > * { display: inline; margin-right: 8px; } /* one run of text: the pill wraps as a word */
  .dp-trade-sub .dp-flag-dot { margin-right: 6px; }
  .dp-main .dp-tr .dp-trade-sub > .dp-answers { display: inline-flex; vertical-align: top; }
  .dp-what-unit, .dp-trade-what .dp-tag, .dp-c-pnl .fees-unknown { display: none; }
  .dp-sub-only .dp-tag { margin: 0 6px 0 0; }
  .dp-sub-only .fees-unknown { margin-left: 0; }
  .dp-main .dp-card-head .dp-label { flex: 0 0 auto; }
}
@media (max-width: 720px) {
  .dp-h1 { font-size: 28px; }
  .dp-gsent { font-size: 20px; }
  .dp-guard, .dp-main .dp-card { padding: 16px; }
  .dp-done { display: block; }
  .dp-done-tick { margin-right: 6px; vertical-align: -2px; }
  .dp-done-credit { display: block; margin: 2px 0 0; }
  .dp-main .dp-thead { display: none; }
  .dp-main .dp-tr { grid-template-columns: 48px minmax(0, 1fr) auto 36px; }
  .dp-steps .dp-step, .dp-kebab, .dp-round, .dp-why-chip, .dp-ask-chip, .dp-felt-chip, .dp-menu-item, .dp-pop-item, .dp-add, .dp-more { min-height: 44px; }
  .dp-round { width: 44px; height: 44px; }
}

/* ============================================================
   ROUND S2 — THE ADD / EDIT TRADE WINDOW (js/trade-window.js; RD7NewAdd)
   ============================================================ */
.tw-modal { max-width: 760px; padding: 28px 30px; }
.tw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.tw-title { margin: 0; font-family: var(--font-heading); font-weight: 500; font-size: 30px; }
.tw-close svg { width: 18px; height: 18px; }
.tw-form { display: flex; flex-direction: column; gap: 16px; }
.tw-row { display: grid; gap: 12px; }
.tw-row-3 { grid-template-columns: 1.2fr 1fr 1fr; }
.tw-row-4 { grid-template-columns: 0.7fr 1fr 1fr 1fr; }
.tw-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tw-label { color: var(--muted); font-size: 13px; }
.tw-input { width: 100%; min-width: 0; }
.tw-input[aria-invalid="true"] { border-color: var(--loss); }
.tw-err { margin: 0; color: var(--loss); font-size: 13px; }
.tw-sec { display: flex; flex-direction: column; gap: 8px; }
.tw-pick { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.tw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tw-chip { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.tw-chip.is-on { border-color: var(--accent-line); background: var(--accent-soft); }
.tw-other { max-width: 240px; }
.tw-select { box-sizing: border-box; width: 100%; padding-right: 32px; -webkit-appearance: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%); background-position: right 17px center, right 13px center; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.tw-select option { background: var(--raised); color: var(--text); }
.tw-pnl { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); }
.tw-pnl-label { color: var(--muted); font-size: 14px; }
.tw-pnl-value { font-family: var(--font-heading); font-size: 28px; }
.tw-pnl-value.pos { color: var(--gain); }
.tw-pnl-value.neg { color: var(--loss); }
.tw-pnl-how { margin-left: auto; color: var(--muted); font-size: 13px; }
.tw-pnl.is-typed .tw-pnl-field { flex: 1 1 200px; }
.tw-file { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tw-foot { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 720px) {
  .tw-overlay { padding: 0; align-items: stretch; }
  .tw-modal { max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .tw-row-3, .tw-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tw-row-3 > :first-child { grid-column: 1 / -1; }
  .tw-pnl-how { margin-left: 0; }
  .tw-chip, .tw-foot .btn { min-height: 44px; }
  .tw-foot .btn { flex: 1 1 100%; }
}

/* ============================================================
   ROUND S2 — THE TRADES TABLE (js/trades-table.js; RD8NewTrades)
   ============================================================ */
.tt-head { display: block; }
.tt-top .tt-csv { flex: 0 0 auto; width: auto; }
.tt-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; width: 100%; }
.tt-back, .tt-crumbs { font-size: 14px; }
.tt-crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; color: var(--muted); }
.tt-crumbs .link-btn { font-weight: 600; }
.tt-title { margin-top: 4px; }
.tt-title:focus { outline: none; }
.tt-sum { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.tt-sum .pos { color: var(--gain); font-weight: 600; }
.tt-sum .neg { color: var(--loss); font-weight: 600; }
.tt-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; }
.tt-drop { position: relative; }
.tt-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.tt-chip.is-on { border-color: var(--accent-line); background: var(--accent-soft); cursor: default; }
.tt-x { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 2px; }
.tt-clear { font-size: 14px; font-weight: 600; }
.tt-menu { position: absolute; z-index: 40; left: 0; top: calc(100% + 4px); display: flex; flex-direction: column; min-width: 220px; max-height: 60vh; overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); box-shadow: var(--shadow-sm); }
.tt-menu-item { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.tt-menu-item.is-on { color: var(--accent); font-weight: 600; }
/* Round S12f: the Account menu's "Archived" divider; the Flags chip with nothing to pick. */
.tt-menu-div { display: block; margin: 6px 0 2px; padding: 6px 12px 2px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.tt-chip.is-off { color: var(--muted); opacity: 0.6; cursor: default; }
.tt-menu-item:hover, .tt-menu-item:focus-visible { background: var(--raised-hover); }
.tt-custom { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: center; padding: 8px 6px 4px; border-top: 1px solid var(--line); margin-top: 4px; font-size: 13px; color: var(--muted); }
.tt-custom .btn { grid-column: 1 / -1; }
.tt-card { padding: 16px 24px; }
.tt-thead, .tt-row { display: grid; grid-template-columns: minmax(84px, 110px) 60px 52px minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(70px, 90px); gap: 12px; align-items: center; }
.tt-thead { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
.tt-thead .is-num { text-align: right; }
.tt-row { width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.tt-row:hover .tt-c-trade { color: var(--accent); }
.tt-c-day, .tt-c-time, .tt-c-n { color: var(--muted); white-space: nowrap; }
.tt-c-trade { min-width: 0; overflow-wrap: anywhere; }
.tt-copied { display: block; color: var(--muted); font-size: 13px; }
.tt-flag { display: inline-flex; align-items: baseline; gap: 6px; color: var(--close); font-size: 13px; }
.tt-more { color: var(--muted); }
.tt-c-pnl { font-weight: 600; text-align: right; white-space: nowrap; }
.tt-c-pnl.pos { color: var(--gain); }
.tt-c-pnl.neg { color: var(--loss); }
.tt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0 4px; }
.tt-foot-line { margin: 0; color: var(--muted); font-size: 13px; }
.tt-more-btn { font-size: 14px; font-weight: 600; }
.tt-empty { padding: 12px 0; color: var(--muted); }
.tt-totals { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.tt-empty p { margin: 0 0 8px; }
@media (max-width: 720px) {
  .tt-card { padding: 8px 14px; }
  .tt-thead { display: none; }
  .tt-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "day time" "trade pnl" "flag flag"; gap: 4px 12px; }
  .tt-c-day { grid-area: day; }
  .tt-c-time { grid-area: time; text-align: right; }
  .tt-c-n { display: none; }
  .tt-c-trade { grid-area: trade; }
  .tt-c-pnl { grid-area: pnl; }
  .tt-c-flag { grid-area: flag; }
  .tt-c-flag:empty { display: none; }
  .tt-chip, .tt-menu-item, .tt-clear, .tt-more-btn, .tt-back, .tt-crumbs .link-btn { min-height: 44px; }
  .tt-top .tt-csv { width: 100%; }
}

/* ---------- Insights (round S3; boards RD5New*): Week · Month · Numbers ---------- */
.ins-head { align-items: flex-end; }
.ins-head-side { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-left: auto; }
.page-head.ins-head > :first-child { flex: 1 1 auto; min-width: max-content; }
@media (max-width: 720px) { .page-head.ins-head > :first-child { flex: 1 1 100%; } .ins-head-side { order: 3; width: 100%; margin-left: 0; justify-content: space-between; } }
.ins-card2 .link-btn { display: inline-flex; align-items: baseline; gap: 4px; }
.ins-steps { display: inline-flex; align-items: center; gap: 10px; }
.ins-step { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
@media (hover: hover) { .ins-step:hover:not(:disabled), button.nb-chip:hover, .mo-week:hover { color: var(--text); border-color: var(--muted); } }
.ins-step:disabled { opacity: 0.4; cursor: default; }
.ins-step-range { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ins-range select { min-height: 34px; padding: 6px 28px 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.ins-sections { margin-bottom: 16px; padding: 4px; border: 1px solid var(--line); background: transparent; }
.ins-section[hidden] { display: none; }
.ins-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#notesSlot:empty { display: none; }
.ins-card2 { gap: 12px; }
.ins-serif { margin: 0; font-family: var(--font-heading); font-size: 24px; line-height: 1.25; letter-spacing: -0.005em; color: var(--text); }
.ins-serif.is-big { font-size: 32px; }
.ins-serif .gr-name { font-weight: 600; }
.ins-serif-n { font-family: var(--font-heading); font-size: 26px; color: var(--text); }
.ins-line { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text); }
.ins-line.is-quiet, .ins-note { color: var(--muted); }
.ins-note { margin: 0; font-size: 13px; line-height: 1.5; }
.ins-rule { height: 1px; background: var(--line); }
#insightsPage .pos { color: var(--gain); }
#insightsPage .neg { color: var(--loss); }
.ins-stats3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px 24px; }
.ins-stat3 { min-width: 0; }
.ins-stat3 p { margin: 0; }
.ins-stat3-k { color: var(--muted); font-size: 13px; }
.ins-stat3-v { margin-top: 2px !important; font-family: var(--font-heading); font-size: 26px; line-height: 1.3; }
.ins-stat3-v b { font-weight: 500; }
.ins-stat3-sub { margin-top: 4px !important; color: var(--muted); font-size: 12.5px; }
.ins-pnl-line { display: inline-flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 14px; }
.ins-pnl-line b { color: var(--text); font-weight: 600; }
.ins-pnl-line b.pos { color: var(--gain); }
.ins-pnl-line b.neg { color: var(--loss); }
.ins-pill { min-height: 34px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.ins-pill[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* Week */
.wv-chart { position: relative; min-width: 0; }
.wv-svg, .lv-svg { display: block; max-width: 100%; }
.wv-band { fill: transparent; stroke: var(--line); stroke-width: 0.5; }
.wv-band.is-undisc { fill: color-mix(in srgb, var(--loss) 8%, transparent); }
.wv-zero, .lv-guide { stroke: color-mix(in srgb, var(--line), var(--text) 10%); stroke-width: 1; }
.wv-past-band { fill: none; stroke: color-mix(in srgb, var(--close) 55%, transparent); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.wv-past-label { fill: var(--close); font-size: 12px; font-weight: 600; }
.wv-days { display: grid; grid-template-columns: repeat(var(--wv-n, 5), minmax(0, 1fr)); margin: 0 12px 0 52px; padding: 0; list-style: none; }
.wv-days[data-n="1"] { --wv-n: 1; } .wv-days[data-n="2"] { --wv-n: 2; } .wv-days[data-n="3"] { --wv-n: 3; } .wv-days[data-n="4"] { --wv-n: 4; } .wv-days[data-n="5"] { --wv-n: 5; } .wv-days[data-n="6"] { --wv-n: 6; } .wv-days[data-n="7"] { --wv-n: 7; }
.wv-day { min-width: 0; padding: 0 4px; text-align: center; }
.wv-day p { margin: 0; }
.wv-day-name { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text); }
.wv-day-sub { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wv-day-go { font-size: 12.5px; margin-top: 2px !important; }
.wv-day-go .link-btn { font-size: inherit; }
.wv-day-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; }
.wv-day-mark .icon, .wv-day-mark svg { width: 13px; height: 13px; }
.wv-day-mark.is-disc { color: var(--gain); }
.wv-day-mark.is-undisc { color: var(--loss); }
.wv-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 12.5px; }
.wv-legend li { display: inline-flex; align-items: center; gap: 8px; }
.wv-key { display: inline-block; flex: none; }
.wv-key.is-line { width: 18px; height: 2px; background: var(--accent); }
.wv-key.is-ring { width: 10px; height: 10px; border: 2px solid var(--close); border-radius: 50%; }
.wv-key.is-band { width: 18px; height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--close) 55%, transparent); }
.wv-key.is-guard { height: 14px; border-left: 2px dashed var(--accent); }
.wv-sug { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: var(--r-card); background: var(--raised); }
.wv-sug-text { margin: 0; font-size: 15px; }
.wv-habits { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.wv-habits li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.wv-habits li:first-child { border-top: 0; }
@container (max-width: 400px) { .wv-habits li { flex-direction: column; } }
.wv-habit-status { color: var(--muted); }
.wv-habit-status.is-bad { color: var(--close); }
.wv-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.wv-slot { display: flex; flex-direction: column; gap: 4px; min-height: 96px; min-width: 0; padding: 12px; border: 1px dashed var(--line); border-radius: var(--r-ctl); color: var(--muted); font-size: 13px; }
.wv-slot.is-today { border: 1px solid var(--accent); color: var(--text); }
.wv-bbars { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.wv-bbar { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; text-align: center; }
.wv-bbar-track { display: flex; align-items: flex-end; height: 44px; }
.wv-bbar-fill { display: block; width: 100%; border-radius: 3px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
.wv-bbar-n { color: var(--muted); font-size: 12px; white-space: nowrap; }
.wv-bbars-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin: 0; color: var(--muted); font-size: 12.5px; }
@container (max-width: 559px) {
  .wv-days { display: flex; flex-direction: column; margin: 0; }
  .wv-day { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; align-items: baseline; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); text-align: left; }
  .wv-day-go .link-btn { white-space: nowrap; }
  .wv-slots { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
  .wv-bbars { gap: 4px; }
  .wv-bbar-n { font-size: 10.5px; white-space: normal; }
}
#insightsPage .ins-stack > .card, #insightsPage .nb-pair > .card, #notesSlot > .card { container-type: inline-size; }
@media (max-width: 480px) { .wv-bbars { grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 12px; } }

/* Month */
.mo-weeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.mo-week { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.mo-week-k { color: var(--muted); font-size: 12.5px; }
.mo-week-v { font-weight: 600; font-size: 15px; }
.mo-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; }
.mo-months { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.lv-toggle { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-chart { min-width: 0; }
.lv-band { fill: color-mix(in srgb, var(--accent) 9%, transparent); }
.lv-band.is-alt { fill: color-mix(in srgb, var(--accent) 15%, transparent); }
.lv-band-label { fill: var(--accent); font-size: 12px; }
.lv-before { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 4; }
.lv-before-label { fill: var(--muted); font-size: 12px; }
.lv-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.lv-line.is-before { stroke: var(--muted); stroke-dasharray: 5 5; stroke-width: 1.6; }
.lv-pt { fill: var(--accent); }
.lv-pt.is-before { fill: var(--muted); }
.mo-steps { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.mo-step { display: flex; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.mo-step-n { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--bg, #0e1016); font-weight: 600; font-size: 14px; }
.mo-step-n.is-done { background: var(--gain); }
.mo-step-n.is-next { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.mo-step-n .icon, .mo-step-n svg { width: 14px; height: 14px; }
.mo-step-text { min-width: 0; }
.mo-step-name { margin: 0; font-weight: 600; font-size: 15px; }
.mo-step-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* Numbers */
.nb-leaks { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.nb-leak { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto minmax(0, max-content); align-items: center; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.nb-rank { color: var(--muted); font-size: 14px; }
.nb-leak-text { min-width: 0; }
.nb-leak-name { margin: 0; font-weight: 600; font-size: 15px; }
.nb-leak-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.nb-leak-go { font-size: 13px; }
.nb-cost { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nb-chip { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
button.nb-chip { cursor: pointer; }
.nb-chip.is-focus { border-color: color-mix(in srgb, var(--gain) 45%, var(--line)); color: var(--gain); }
.nb-chip.is-next, .nb-chip.is-ladder { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text); }
.nb-works { border-color: color-mix(in srgb, var(--gain) 35%, var(--line)); background: color-mix(in srgb, var(--gain) 6%, var(--card)); }
.nb-works .card-label { color: var(--gain); }
.nb-work-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.nb-work { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--gain) 20%, var(--line)); font-size: 15px; }
.nb-work .pos { font-weight: 600; white-space: nowrap; }
.nb-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; min-width: 0; }
.nb-bars { display: flex; gap: 6px; height: 190px; margin: 0; padding: 0; list-style: none; }
.nb-col { display: flex; flex: 1 1 0; flex-direction: column; min-width: 0; container-type: inline-size; }
/* Many half hours in one card: the bars keep their place, every other time label, no value (the chart's label reads them all). */
@container (max-width: 31px) { .nb-bar-v { display: none; } .nb-bar-x { font-size: 10px; } }
@container (max-width: 31px) { .nb-col:nth-child(even) .nb-bar-x { visibility: hidden; } }
.nb-plot { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; padding: 14px 0; }
.nb-up, .nb-down { display: flex; flex-direction: column; align-items: stretch; min-height: 0; }
.nb-up { justify-content: flex-end; border-bottom: 1px solid color-mix(in srgb, var(--line), var(--text) 10%); }
.nb-bar { display: block; flex: none; min-height: 2px; border-radius: 3px; }
.nb-bar.is-gain { background: var(--gain); }
.nb-bar.is-loss { background: var(--loss); }
.nb-bar.is-grey { background: color-mix(in srgb, var(--muted) 35%, transparent); }
.nb-bar-v { position: relative; overflow: hidden; color: var(--text); font-size: 11px; line-height: 14px; text-align: center; white-space: nowrap; }
/* Round S12e: values to the cent — a chart whose values don't all fit steps down together, then lists them under the bars (nbFitBars). */
.nb-chart { min-width: 0; }
.nb-chart.is-amt-1 .nb-bar-v { font-size: 10px; letter-spacing: -0.02em; }
.nb-chart.is-amt-2 .nb-bar-v { font-size: 9px; letter-spacing: -0.03em; }
.nb-chart.is-vals-list .nb-bar-v { visibility: hidden; }
.nb-vals { display: none; margin: 10px 0 0; padding: 0; }
.nb-chart.is-vals-list .nb-vals { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px 16px; }
.nb-vals-row { display: flex; justify-content: space-between; gap: 8px; min-width: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.nb-vals-row dt { color: var(--muted); }
.nb-vals-row dd { margin: 0; white-space: nowrap; }
.nb-vals-row dd.pos { color: var(--gain); }
.nb-vals-row dd.neg { color: var(--loss); }
.nb-up .nb-bar-v { margin-top: -14px; }
.nb-down .nb-bar-v { margin-bottom: -14px; }
.nb-bar-x { flex: none; color: var(--muted); font-size: 11px; line-height: 16px; text-align: center; white-space: nowrap; }
/* Round S13: the axis line (nbFitAxis) — first, middle and last label inside the card, the column labels hidden. */
.nb-axis { display: none; justify-content: space-between; gap: 8px; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 16px; white-space: nowrap; }
.nb-chart.is-axis .nb-axis { display: flex; }
.nb-chart.is-axis .nb-bar-x { visibility: hidden; height: 0; }
.nb-fees { margin: 0; font-family: var(--font-heading); font-size: 32px; }
.nb-fees b { font-weight: 500; }
.nb-segs { display: flex; gap: 6px; }
.nb-segs .hm-seg { flex: 1 1 0; height: 8px; border-radius: 4px; }
.nb-faint { opacity: 0.55; }
.nb-faint-box { height: 120px; border-radius: var(--r-ctl); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 9%, transparent) 0 8px, transparent 8px 22px); }
@container (max-width: 559px) {
  .nb-leak { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .nb-leak .nb-chip { grid-column: 2 / -1; justify-self: start; }
}

/* What we see so far (round S11, boards RD11*): plain sums, labelled as
   not a pattern. Numbers' card (.seen-card), the Dashboard's compact block
   (.hm-seen, two lines) and the trades a line names. The pill is --close:
   it needs attention, it isn't a verdict. */
.seen-k { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.seen-pill { display: inline-block; padding: 1px 7px; border-radius: var(--r-pill); background: var(--close-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--close) 45%, transparent); color: var(--close); font-size: 10.5px; font-weight: 600; line-height: 1.5; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.seen-lines { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.seen-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 24px; padding: 12px 0; border-top: 1px solid var(--line); }
.seen-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px 12px; min-width: 0; }
.seen-name { min-width: 0; margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.seen-money { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seen-track { grid-column: 1 / -1; display: block; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.seen-fill { display: block; height: 100%; border-radius: 3px; background: var(--loss); }
.seen-fill.is-gain { background: var(--gain); }
.seen-sub { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.seen-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 0; }
.seen-go { font-size: 13px; white-space: nowrap; }
.seen-guard { white-space: nowrap; }
.seen-soon { display: flex; flex-direction: column; gap: 8px; }
.seen-lines.is-compact .seen-line { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px 0; }
.seen-lines.is-compact .seen-acts { align-items: flex-start; }
.hm-seen { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.hm-seen-k { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.hm-seen .seen-lines .seen-line:first-child { border-top: 0; padding-top: 4px; }
.pl-seen .pl-warn-k { color: var(--close); }
@container (max-width: 340px) {
  .seen-k { gap: 6px; letter-spacing: 0.04em; } /* "Also in your trades" and its pill on one line at 360 */
}
@container (max-width: 559px) {
  .seen-line { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .seen-acts { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 16px; }
}

/* The Journal's way into Insights (round S3) */
.jn-title-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
@media (hover: hover) { .jn-title-link:hover { color: var(--accent); } }
.jn-hint { display: none; margin: 4px 0 0; color: var(--muted); font-size: 13px; }
@media (min-width: 1280px) { .jn-hint { display: block; } }
button.wk-sum { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: inherit; cursor: pointer; }
@media (hover: hover) { button.wk-sum:hover .wk-disc { color: var(--accent); } }

/* Your coach reads your notes */
.nr-quotes { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); list-style: none; font-size: 14.5px; }
.nr-quotes b { font-weight: 600; }

/* ============================================================
   Round S4: the Tools page (js/tools.js; boards RD6NewTools, RD6NewToolsOn,
   RD6NewToolPanels), the Weekly review (js/weekly-review.js; RD6NewReviewCard,
   RD6NewWeeklyReview2 and 3), the day page's Tool cards (RD6NewDayTools).
   ============================================================ */
:root { --turned: var(--type-prop); --turned-soft: color-mix(in srgb, var(--type-prop) 16%, transparent); }
.nav-tools-chip { flex: none; margin-left: auto; padding: 1px 8px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.rail-profile-foot .nav-tools { margin-bottom: 2px; }
.mini-switch[disabled] { cursor: default; opacity: 0.45; }

/* The Tools page */
#toolsPage { container-type: inline-size; container-name: toolspage; }
.tl-head { margin-bottom: 20px; }
.tl-lead { max-width: 720px; margin: 14px 0 0; color: var(--text); font-size: 16px; line-height: 1.55; }
.tl-sug { gap: 8px; margin-bottom: 16px; border-color: var(--accent-line); }
.tl-sug-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tl-sug-most { color: var(--muted); font-size: 13px; }
.tl-sug-text { margin: 0; font-size: 15px; line-height: 1.55; }
.tl-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 390px); gap: 20px; align-items: start; }
.tl-list { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tl-group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tl-group-name { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.tl-row { display: flex; align-items: center; gap: 12px; padding: 0 16px 0 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; }
.tl-row.is-sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.tl-row-main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-width: 0; padding: 14px 0 14px 16px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.tl-row-name { display: flex; align-items: flex-start; gap: 6px 8px; min-width: 0; }
.tl-name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.tl-row-desc { color: var(--muted); font-size: 14px; line-height: 1.4; }
.tl-row-side { display: inline-flex; align-items: center; flex: none; gap: 12px; }
.tl-see { font-size: 14px; white-space: nowrap; text-decoration: none; }
.tl-chip { display: inline-flex; align-items: center; flex: none; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.tl-chip.is-new { background: var(--turned-soft); color: var(--turned); }
.tl-chip.is-later { background: var(--accent-soft); color: var(--accent); }
.tl-chip.is-pro { background: var(--accent-soft); color: var(--accent); }
.tl-side { position: sticky; top: 24px; gap: 0; padding: 22px 24px; min-width: 0; }
.tl-panel { display: flex; flex-direction: column; min-width: 0; }
.tl-row + .tl-panel { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.tl-pic { padding: 12px 12px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--page); }
.tl-pic-svg { display: block; width: 100%; height: auto; }
.tl-pic-cap { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.tl-p-bar { fill: var(--line); }
.tl-p-side { fill: none; }
.tl-p-box { fill: none; stroke: var(--line); stroke-width: 1; }
.tl-p-focus { fill: var(--card); stroke: var(--accent); stroke-width: 1.5; }
.tl-p-accent { fill: var(--accent); }
.tl-p-pill { fill: none; stroke: var(--line); stroke-width: 1; }
.tl-p-pill.is-open { stroke: var(--accent); }
.tl-p-gain { fill: var(--gain); }
.tl-p-loss { fill: var(--loss); }
.tl-p-gain-soft { fill: var(--gain-soft); }
.tl-p-loss-soft { fill: var(--breach-soft); }
.tl-p-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.tl-p-turn { stroke: var(--turned); stroke-width: 1.5; stroke-dasharray: 4 4; }
.tl-p-ring { fill: none; stroke: var(--turned); stroke-width: 2; }
.tl-p-tag { fill: var(--turned-soft); }
.tl-panel-head { display: flex; align-items: flex-start; gap: 6px 10px; margin-top: 16px; }
.tl-panel-head .tl-chip { margin-top: 3px; }
.tl-panel-name { flex: 0 1 auto; min-width: 0; margin: 0; font-size: 19px; font-weight: 600; overflow-wrap: anywhere; }
.tl-state { flex: none; margin-left: auto; padding: 2px 11px; border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--muted); font-size: 13px; }
.tl-state.is-on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.tl-does { margin: 12px 0 0; font-size: 15px; line-height: 1.55; }
.tl-more { margin: 10px 0 0; }
.tl-k { margin: 16px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.tl-v { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tl-foot { margin: 20px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
@media (max-width: 960px) { .tl-cols { grid-template-columns: minmax(0, 1fr); } }
/* Narrow: See Pro says it; the chip would only drop to a line of its own. */
@media (max-width: 560px) { .tl-row:has(.tl-see) .tl-chip.is-pro { display: none; } }

/* The Dashboard's card and line */
#homeReview { margin-bottom: 16px; }
.wr-card { gap: 8px; border-color: var(--accent-line); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.wr-card-title { margin: 0; font-family: var(--font-heading); font-size: 24px; font-weight: 500; line-height: 1.2; }
.wr-line { margin: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.wr-line .link-btn { font-size: inherit; }
.hm-trading { display: none; margin: 0 0 12px; }
@media (max-width: 720px) { .hm-trading { display: block; } }

/* The focused page */
html.is-review .app-shell { grid-template-columns: minmax(0, 1fr); }
html.is-review .sidebar, html.is-review .app-bar, html.is-review .tabbar, html.is-review .example-banner { display: none !important; }
html.is-review body { padding-bottom: 0; }
.wr-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0 20px; border-bottom: 1px solid var(--line); }
.wr-count { flex: 1 1 auto; min-width: 0; color: var(--muted); font-size: 14px; text-align: center; }
.wr-close { flex: none; font-weight: 600; }
.wr-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; }
.wr-seg { height: 4px; border-radius: var(--r-pill); background: var(--line); }
.wr-seg.is-on { background: var(--accent); }
.wr-main { display: flex; flex-direction: column; gap: 16px; width: min(840px, 100%); margin: 36px auto 40px; }
.wr-eyebrow { margin-bottom: -10px; }
.wr-h1 { margin: 0; font-family: var(--font-heading); font-size: 34px; font-weight: 500; line-height: 1.15; outline: none; overflow-wrap: anywhere; }
.wr-lead { margin: 0; font-size: 15px; line-height: 1.55; }
.wr-box { gap: 14px; padding: 22px 24px; }
.wr-from { gap: 6px; padding: 18px 24px; border-color: var(--accent-line); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.wr-from-k { color: var(--accent); }
.wr-from-text { margin: 0; font-size: 15px; line-height: 1.5; }
.wr-days { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.wr-day { display: flex; flex-direction: column; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.wr-day:last-child { padding-bottom: 0; border-bottom: 0; }
.wr-day-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 0; font-size: 15px; }
.wr-day-name { font-weight: 600; }
.wr-day-facts { margin-left: auto; color: var(--muted); }
.wr-quote { margin: 0; color: var(--muted); font-size: 14px; font-style: italic; line-height: 1.45; overflow-wrap: anywhere; }
.wr-cost { margin: 0; font-size: 15px; }
.wr-held-line { margin: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.wr-ask { margin: 0; color: var(--muted); font-size: 14px; }
.wr-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.wr-chip { max-width: 100%; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.wr-chip[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
.wr-block { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.wr-block:first-child { padding-top: 0; border-top: 0; }
.wr-block-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
.wr-block-day { margin: 0; font-size: 15px; font-weight: 600; }
.wr-block-head .wr-quote { flex: 1 1 240px; min-width: 0; text-align: right; }
.wr-other input { width: 100%; }
.wr-under { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.wr-foot { display: flex; flex-wrap: wrap; gap: 10px; }
.wr-foot .btn { flex: 0 0 auto; width: auto; min-width: 84px; padding-inline: 22px; }
.wr-field-label { color: var(--muted); font-size: 14px; }
.wr-it { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 8px; }
.wr-it-label { font-size: 15px; font-weight: 600; }
.wr-it input { width: 100%; }
@media (max-width: 720px) {
  .wr-main { margin-top: 24px; }
  .wr-h1 { font-size: 28px; }
  .wr-box, .wr-from { padding: 16px; }
  .wr-count { font-size: 13px; }
  .wr-top .wordmark { display: none; }
  .wr-block-head .wr-quote { flex-basis: 100%; text-align: left; }
}

/* The day page's Tool cards */
.dp-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.dp-tools[data-n="1"] { grid-template-columns: minmax(0, 1fr); }
.dp-tools[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dp-tool-card { gap: 10px; padding: 18px 20px; }
.dp-tool-text { margin: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.dp-tool-sub { margin: 0; color: var(--muted); font-size: 14px; }
.dp-tool-link { margin: 0; }
.dp-turned-chip { align-self: flex-start; display: inline-flex; gap: 4px; margin-right: 6px; padding: 1px 7px; border-radius: 6px; background: var(--turned-soft); color: var(--turned); font-size: 12px; font-weight: 600; white-space: nowrap; }
@container daypage (max-width: 799px) { .dp-tools, .dp-tools[data-n="2"] { grid-template-columns: minmax(0, 1fr); } }
.dc-turned { stroke: var(--turned); stroke-width: 1.5; stroke-dasharray: 4 4; }
.dc-turned-label { fill: var(--turned); font-size: 11.5px; font-weight: 600; }

/* ============================================================
   THE TRADING DAY AND THE COMPANION (round S5, 4 Nov 2026; boards
   RD6NewTradingDay, RD6NewTradingDayComp, RD6NewCompanion). Prepare and the
   companion side by side from 1041px, one column under it; the companion
   alone keeps the board's width. .tc is one component: inside the Trading
   day's card and in the pop-out window (body.tc-window, js/companion.js).
============================================================ */
.fl-cols { display: grid; grid-template-columns: minmax(0, 560px); gap: 16px; align-items: start; min-width: 0; }
.fl-cols.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fl-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1040px) { .fl-cols.is-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .fl-cols { grid-template-columns: minmax(0, 1fr); } }
.fl-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; }
.fl-prepare .fl-q { font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: 1.4; }
.fl-prepare .fl-answers { gap: 8px; }
.fl-prepare .fl-answer { flex: 0 0 auto; min-width: 0; min-height: 38px; padding: 0 16px; border-radius: var(--r-pill); font-size: 14px; }
.fl-sec { display: grid; gap: 6px; min-width: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.fl-sec-k { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.fl-sec-line { margin: 0; color: var(--text); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.fl-sec-quiet { margin: 0; color: var(--muted); font-size: 14px; }
.fl-more { margin: 0; }
.dp-taps { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.wr-also { gap: 10px; }
.wr-also-text { margin: 0; font-size: 15px; line-height: 1.5; }
.wr-also .hm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fl-foot-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
/* Round S12h §2: Size (100 / 125 / 150 / 175 / 200 %, this device's choice) — one scale for
   text, buttons and spacing together: every length above is calc(N px × --tc-s), set from
   data-tc-size on the root (#cpCard, #cpRoot: js/companion.js cpPaint). Borders stay 1px. */
.tc { --tc-s: 1; }
.tc[data-tc-size="125"] { --tc-s: 1.25; }
.tc[data-tc-size="150"] { --tc-s: 1.5; }
.tc[data-tc-size="175"] { --tc-s: 1.75; }
.tc[data-tc-size="200"] { --tc-s: 2; }
:where(.tc) .btn { gap: calc(8px * var(--tc-s)); min-height: calc(44px * var(--tc-s)); padding: 0 calc(18px * var(--tc-s)); border-radius: calc(var(--r-ctl) * var(--tc-s)); font-size: calc(14px * var(--tc-s)); }
:where(.tc) .link-btn { font-size: calc(14px * var(--tc-s)); }
:where(.tc) .card-label { font-size: calc(12px * var(--tc-s)); }
.fl-card.tc { padding: calc(28px * var(--tc-s)); }
@media (max-width: 720px) { .fl-card.tc { padding: calc(18px * var(--tc-s)); } }
.tc-head-end { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: calc(8px * var(--tc-s)); max-width: 100%; margin-left: auto; } /* round S12i: in a narrow window at a large Size the controls wrap, never pushed off the left edge */
.tc-size { display: inline-flex; align-items: center; gap: calc(2px * var(--tc-s)); }
.tc-size-k { margin-right: calc(4px * var(--tc-s)); color: var(--muted); font-size: calc(11px * var(--tc-s)); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.tc-size-btn { display: inline-grid; place-items: center; width: calc(26px * var(--tc-s)); height: calc(24px * var(--tc-s)); padding: 0; border: 0; border-radius: calc(6px * var(--tc-s)); background: transparent; color: var(--muted); font: inherit; font-size: calc(16px * var(--tc-s)); font-weight: 600; line-height: 1; cursor: pointer; }
.tc-size-btn:hover { background: var(--raised); color: var(--text); }
.tc-size-btn[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.tc-size-btn[aria-disabled="true"]:hover { background: transparent; color: var(--muted); }
.tc-size-v { min-width: 3.4em; color: var(--text); font-size: calc(13px * var(--tc-s)); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.tc { display: flex; flex-direction: column; gap: calc(12px * var(--tc-s)); min-width: 0; }
.fl-card.tc { gap: calc(12px * var(--tc-s)); }
.tc p { margin: 0; }
.tc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: calc(8px * var(--tc-s)); min-height: calc(24px * var(--tc-s)); } /* round S12h: Size goes under the title when there's no room beside it */
.tc-pop .tc-head { justify-content: flex-end; } /* round S12h: a row of its own in the window (Size beside the one-line button), no longer laid over the Guardrail */
.tc-compact-btn { display: inline-grid; place-items: center; flex: none; width: calc(28px * var(--tc-s)); height: calc(24px * var(--tc-s)); padding: 0; border: 0; border-radius: calc(6px * var(--tc-s)); background: transparent; color: var(--muted); cursor: pointer; }
.tc-compact-btn:hover { background: var(--raised); color: var(--text); }
.tc-compact-btn svg { width: calc(16px * var(--tc-s)); height: calc(16px * var(--tc-s)); }
.tc-k { color: var(--muted); font-size: calc(12px * var(--tc-s)); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.tc-name { color: var(--accent); font-size: calc(17px * var(--tc-s)); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.tc-count { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: calc(6px * var(--tc-s)) calc(12px * var(--tc-s)); min-width: 0; }
.tc-count-text { flex: none; color: var(--text); font-size: calc(16px * var(--tc-s)); }
.tc-count-text b { font-weight: 700; }
.tc-count-text.is-past b, .tc-c-n.is-past { color: var(--close); }
.tc-dots { display: flex; justify-content: flex-end; flex-wrap: wrap; flex: 1 1 auto; gap: calc(5px * var(--tc-s)); min-width: 0; }
.tc-dot { flex: 0 1 calc(24px * var(--tc-s)); min-width: calc(8px * var(--tc-s)); height: calc(6px * var(--tc-s)); border-radius: calc(3px * var(--tc-s)); background: var(--line); }
.tc-dot.is-on { background: var(--accent); }
.tc-dot.is-past { background: var(--close); }
.tc-kind { color: var(--muted); font-size: calc(14px * var(--tc-s)); line-height: 1.45; }
.tc-rules { display: grid; gap: calc(6px * var(--tc-s)); padding: calc(10px * var(--tc-s)) calc(12px * var(--tc-s)); border-radius: calc(var(--r-ctl) * var(--tc-s)); background: var(--raised); }
.tc-rule-list { display: grid; gap: calc(4px * var(--tc-s)); margin: 0; padding: 0; list-style: none; }
.tc-rule-list li { position: relative; padding-left: calc(13px * var(--tc-s)); color: var(--text); font-size: calc(14px * var(--tc-s)); line-height: 1.4; overflow-wrap: anywhere; }
.tc-rule-list li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: calc(5px * var(--tc-s)); height: calc(5px * var(--tc-s)); border-radius: 50%; background: var(--accent); }
.tc-q { color: var(--muted); font-size: calc(14px * var(--tc-s)); }
.tc-taps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(8px * var(--tc-s)); }
.tc-tap { min-height: calc(42px * var(--tc-s)); font-weight: 600; white-space: nowrap; }
.tc-undo { font-size: calc(14px * var(--tc-s)); }
.tc-cool-row { display: flex; flex-wrap: wrap; align-items: center; gap: calc(8px * var(--tc-s)); min-width: 0; }
.tc .tc-cool { flex: 1 1 auto; max-width: 100%; min-height: calc(40px * var(--tc-s)); font-weight: 600; white-space: nowrap; } /* round S12h: one line; the minutes go under it when the row is too narrow */
.tc-mins { display: inline-flex; flex: none; gap: calc(2px * var(--tc-s)); padding: calc(2px * var(--tc-s)); border: 1px solid var(--line); border-radius: calc(var(--r-ctl) * var(--tc-s)); }
.tc-min { min-width: calc(28px * var(--tc-s)); height: calc(32px * var(--tc-s)); padding: 0 calc(4px * var(--tc-s)); border: 0; border-radius: calc(7px * var(--tc-s)); background: transparent; color: var(--muted); font: inherit; font-size: calc(13px * var(--tc-s)); font-weight: 600; cursor: pointer; }
.tc-min.is-on { background: var(--accent-soft); color: var(--text); }
.tc-hint, .tc-foot { color: var(--muted); font-size: calc(13px * var(--tc-s)); line-height: 1.45; }
.tc-done, .tc-pop-btn { width: 100%; min-height: calc(42px * var(--tc-s)); font-weight: 600; }
.tc-box { display: grid; gap: calc(4px * var(--tc-s)); padding: calc(12px * var(--tc-s)) calc(14px * var(--tc-s)); border: 1px solid var(--accent-line); border-radius: calc(12px * var(--tc-s)); background: var(--accent-soft); }
.tc-box.is-amber { border-color: color-mix(in srgb, var(--close) 55%, var(--line)); background: var(--close-soft); }
.tc-box-title { color: var(--text); font-size: calc(15px * var(--tc-s)); font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.tc-box.is-amber .tc-box-title { color: var(--close); }
.tc-box-text { color: var(--text); font-size: calc(14px * var(--tc-s)); line-height: 1.45; overflow-wrap: anywhere; }
.tc-cool-box { display: flex; flex-wrap: wrap; align-items: center; gap: calc(14px * var(--tc-s)); min-width: 0; } /* round S12i: in a window narrowed by hand at a large Size, the words go under the ring */
.tc-ring { position: relative; flex: none; width: calc(92px * var(--tc-s)); height: calc(92px * var(--tc-s)); }
.tc-ring svg { display: block; width: 100%; height: 100%; }
.tc-ring-track, .tc-ring-arc { fill: none; stroke-width: 6; }
.tc-ring-track { stroke: var(--line); }
.tc-ring-arc { stroke: var(--close); stroke-linecap: round; transition: stroke-dashoffset var(--dur-slow) linear; }
.tc-ring-time { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text); font-size: calc(19px * var(--tc-s)); font-weight: 700; font-variant-numeric: tabular-nums; }
.tc-ring.is-flash { animation: tc-flash var(--dur-slow) var(--ease-move) 2 alternate; }
@keyframes tc-flash { from { opacity: 1; } to { opacity: 0.2; } }
.tc-cool-text { display: grid; flex: 1 1 calc(160px * var(--tc-s)); gap: calc(4px * var(--tc-s)); min-width: 0; }
.tc-cool-title { color: var(--text); font-size: calc(15px * var(--tc-s)); font-weight: 600; }
.tc-cool-if { color: var(--muted); font-size: calc(14px * var(--tc-s)); line-height: 1.45; overflow-wrap: anywhere; }
.tc-over { color: var(--text); font-size: calc(14px * var(--tc-s)); font-weight: 600; }
.tc-stopped { display: flex; align-items: flex-start; gap: calc(8px * var(--tc-s)); color: var(--text); font-size: calc(15px * var(--tc-s)); line-height: 1.45; }
.tc-stopped-tick { display: grid; place-items: center; flex: none; width: calc(20px * var(--tc-s)); height: calc(20px * var(--tc-s)); border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.tc-stopped-tick svg { width: calc(12px * var(--tc-s)); height: calc(12px * var(--tc-s)); }
.tc-compact { display: flex; flex-wrap: wrap; align-items: center; gap: calc(6px * var(--tc-s)) calc(10px * var(--tc-s)); min-width: 0; min-height: calc(32px * var(--tc-s)); white-space: nowrap; font-size: calc(14px * var(--tc-s)); } /* round S12h: at a large Size the line wraps instead of squeezing the name */
.tc-c-name { min-width: min-content; color: var(--accent); font-weight: 600; white-space: normal; line-height: 1.2; }
.tc-c-n { flex: none; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.tc-c-time { flex: none; color: var(--close); font-weight: 700; font-variant-numeric: tabular-nums; }
.tc-c-undo { flex: none; margin-left: auto; font-size: calc(13px * var(--tc-s)); }
.tc-c-plus, .tc-c-choice { flex: none; margin-left: auto; }
.tc-c-undo + .tc-c-plus, .tc-c-undo + .tc-c-choice { margin-left: 0; }
.tc-c-choice { display: inline-flex; gap: calc(4px * var(--tc-s)); }
.tc .tc-c-plus, .tc .tc-c-tap { min-height: calc(30px * var(--tc-s)); padding: 0 calc(9px * var(--tc-s)); font-size: calc(13px * var(--tc-s)); font-weight: 600; }
.fl-card.tc.is-compact { padding: calc(12px * var(--tc-s)) calc(16px * var(--tc-s)); }
.tc-compact .tc-compact-btn { margin-left: 0; }
.tc-compact > .tc-compact-btn:nth-child(3) { margin-left: auto; }
.rail-companion { width: 100%; min-height: 42px; margin-bottom: 12px; justify-content: center; font-weight: 600; }
.rail-companion[hidden] { display: none; }
body.tc-window { margin: 0; padding: 0; min-height: 0; overflow-x: hidden; background: var(--card); color: var(--text); font-family: var(--font-body); }
.tc-pop { position: relative; box-sizing: border-box; max-width: calc(460px * var(--tc-s)); margin: 0 auto; padding: calc(16px * var(--tc-s)); } /* the board's width, however wide the window is */
.tc-pop.is-compact { justify-content: center; min-height: 100vh; padding: calc(6px * var(--tc-s)) calc(12px * var(--tc-s)); box-sizing: border-box; }
/* Round S12i §3: measured at its own height (js/companion.js cpPopNeed), for a moment */
.tc-pop.is-fitting { min-height: 0; }
.tc-fit-btn { flex: none; font-size: calc(13px * var(--tc-s)); font-weight: 600; white-space: nowrap; }
/* Round S12i §2: the Trading day while the pop-out is open: one quiet card */
.tc-away { color: var(--muted); font-size: calc(15px * var(--tc-s)); line-height: 1.5; }
.tc-away-acts { display: flex; flex-wrap: wrap; align-items: center; gap: calc(8px * var(--tc-s)) calc(20px * var(--tc-s)); }
.tc-away-acts .btn, .tc-more .link-btn { text-wrap: balance; } /* round S12i: a narrow window never leaves one word alone on a line */
@media (prefers-reduced-motion: reduce) {
  .tc-ring.is-flash { animation: none; }
  .tc-ring-arc { transition: none; }
}

/* ============================================================
   ROUND S6 — The Import window (boards RD7NewImport, RD7NewPreview,
   RD7NewAfter, RD9NewFeesAsk, RD9NewManageOff; js/import/ui.js)
   ============================================================ */
.import-modal[data-step="mapping"] { max-width: 1000px; }
.imp-plat-warn { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid var(--close); border-radius: 0 10px 10px 0; background: color-mix(in srgb, var(--close) 9%, transparent); color: color-mix(in srgb, var(--text) 86%, var(--muted)); font-size: 13.5px; line-height: 1.5; }
.imp-plat-warn b { font-weight: 600; }
.imp-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; padding: 20px 16px; border: 2px dashed var(--accent-line); border-radius: 14px; background: color-mix(in srgb, var(--accent) 4%, transparent); text-align: center; }
.imp-zone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.imp-zone-big { margin: 0; color: var(--text); font-size: 16px; font-weight: 600; }
.imp-zone-sub { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.imp-zone .link-btn { font-size: inherit; font-weight: 600; min-height: 0; }
.imp-how { display: flex; flex-direction: column; gap: 12px; }
.imp-how-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.imp-how-title { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.imp-how-from { margin: 0; color: var(--muted); font-size: 13.5px; }
.imp-from-row { display: flex; flex-wrap: wrap; gap: 8px; }
.imp-from { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: color-mix(in srgb, var(--text) 86%, var(--muted)); font: inherit; font-size: 14px; cursor: pointer; }
.imp-from.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.imp-from:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.imp-how .imp-how-steps ol { display: block; counter-reset: imp-step; }
.imp-how .imp-how-steps li { padding: 3px 0; border: 0; color: color-mix(in srgb, var(--text) 86%, var(--muted)); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.imp-how .imp-how-steps li::before { content: counter(imp-step) ". "; font-weight: 500; }
.imp-how-plain { margin: 0; color: color-mix(in srgb, var(--text) 86%, var(--muted)); font-size: 14.5px; line-height: 1.5; }
.imp-start-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.imp-start-foot .imp-note { flex: 1 1 280px; min-width: 0; padding: 0; background: none; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.imp-foot-undo { display: block; margin-top: 6px; font-size: 13.5px; min-height: 0; text-align: left; }
.imp-by-hand { flex: 0 0 auto; font-size: 14.5px; font-weight: 600; min-height: 44px; }
.imp-sum { display: flex; flex-direction: column; gap: 6px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); }
.imp-sum-title { margin: 0; color: var(--text); font-family: var(--font-heading); font-size: 24px; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; }
.imp-sum-sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.imp-looks .link-btn { min-height: 0; font-size: inherit; font-weight: 400; color: var(--muted); text-decoration: underline; vertical-align: baseline; }
.imp-sum-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 16px; margin: 10px 0 0; }
.imp-sum-figs dt { color: var(--muted); font-size: 13px; }
.imp-sum-figs dd { margin: 2px 0 0; color: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.imp-fig-link { display: inline; font-size: 13px; font-weight: 500; min-height: 0; }
.imp-notes { display: flex; flex-direction: column; gap: 3px; margin: -8px 0 0; padding: 0 4px; list-style: none; color: var(--muted); font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.imp-weeks { display: flex; flex-direction: column; }
.imp-weeks-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.imp-weeks-head .link-btn { font-size: 13.5px; font-weight: 600; min-height: 32px; }
.imp-week { border-bottom: 1px solid var(--line); }
.imp-week-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; width: 100%; min-height: 44px; padding: 8px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 14.5px; text-align: left; cursor: pointer; }
.imp-week-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.imp-week-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.imp-week-chev { display: inline-grid; place-items: center; flex: none; color: var(--muted); transition: transform var(--dur-fast) var(--ease-out); }
.imp-week-chev .icon { width: 12px; height: 12px; }
.imp-week-row[aria-expanded="true"] .imp-week-chev { transform: rotate(90deg); }
.imp-week-count { color: var(--muted); font-size: 14px; text-align: center; }
.imp-week-chip { justify-self: end; padding: 2px 10px; border: 1px solid var(--accent-line); border-radius: var(--r-pill); color: var(--text); font-size: 12.5px; white-space: nowrap; }
.imp-week-days { display: flex; flex-direction: column; padding: 0 0 8px 18px; }
.imp-day-line { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; margin: 0; padding: 5px 0; font-size: 14px; }
.imp-tr { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) 84px; align-items: baseline; gap: 2px 10px; padding: 4px 0 4px 12px; color: var(--text); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.imp-tr.is-dup { color: var(--muted); }
.imp-tr-when, .imp-tr-prices { color: var(--muted); }
.imp-tr-what, .imp-tr-prices { min-width: 0; overflow-wrap: anywhere; }
.imp-tr-pnl { text-align: right; }
.imp-tr-status { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.imp-weeks-more { align-self: flex-start; margin-top: 8px; color: var(--muted); font-size: 13.5px; font-weight: 500; min-height: 32px; }
.imp-tz-line { margin: -8px 0 0; color: var(--muted); font-size: 13px; }
.imp-tz-line .link-btn { font-size: inherit; min-height: 0; }
.imp-q { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 20px 24px; border: 1px solid var(--accent-line); border-radius: 16px; background: var(--raised); }
.imp-q-eyebrow { margin: 0; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.modal .imp-q-title { margin: 0; color: var(--text); font-family: inherit; font-size: 16.5px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.imp-q-title:focus { outline: none; }
.imp-q-title b { font-weight: 600; }
.imp-q-sub, .imp-q-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.imp-q-acts { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.imp-q-acts .btn { flex: 0 1 auto; min-height: 44px; padding: 0 18px; font-size: 14.5px; }
.imp-q-acts .link-btn { font-size: 14.5px; font-weight: 600; min-height: 44px; }
.imp-q-count { color: var(--muted); font-size: 13px; }
.imp-acct-pick { width: 100%; max-width: 340px; min-height: 44px; }
.imp-q .imp-table { margin: 0; border-top: 0; }
.imp-q .imp-table > div, .imp-q .imp-table > .imp-acct-why { padding-left: 0; padding-right: 0; }
.imp-q .imp-new-acct, .imp-q .imp-acct-why { padding: 0; }
.imp-fee-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.imp-fee-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--muted); font-size: 13px; }
.imp-fee-root { overflow-wrap: anywhere; }
.imp-fee-field .imp-fee-val { display: flex; min-height: 44px; }
.imp-fee-field .imp-fee-input { flex: 1 1 auto; width: 100%; min-width: 0; }
.imp-foot-end { padding-top: 14px; border-top: 1px solid var(--line); }
.imp-foot-end .imp-foot-note { max-width: 300px; text-align: right; }
.imp-just-in { display: inline-block; flex: none; padding: 2px 10px; border: 1px solid var(--accent-line); border-radius: var(--r-pill); background: var(--accent-soft); color: var(--text); font-size: 12.5px; font-weight: 500; letter-spacing: 0; line-height: 1.5; text-transform: none; white-space: nowrap; vertical-align: 1px; }
.dp-eyebrow .imp-just-in { margin-left: 10px; }
.day-just-in { display: block; margin-top: auto; font-size: 11px; line-height: 1.3; padding: 0; border: 0; background: none; color: var(--accent); }
/* The phone bar's + (its small menu: Import trades · Add a trade by hand). */
.app-bar-plus-wrap { position: relative; display: inline-flex; }
.app-bar-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; display: flex; flex-direction: column; min-width: 210px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 12px 32px rgb(0 0 0 / 0.28); }
.app-bar-menu[hidden] { display: none; }
.app-bar-menu button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.app-bar-menu button:hover, .app-bar-menu button:focus-visible { background: var(--raised); }
/* The day page's "Add them" box (fees for a day's symbols). */
.fees-box { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; padding: 16px; border: 1px solid var(--accent-line); border-radius: 14px; background: var(--raised); }
.fees-box-q { margin: 0; color: var(--text); font-size: 15px; }
.fees-box-note { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
@media (max-width: 720px) {
  .import-modal, .import-modal[data-step="mapping"] { max-width: none; }
  .imp-q, .imp-sum { padding: 16px; }
  .imp-sum-title { font-size: 21px; }
  .imp-week-row { grid-template-columns: minmax(0, 1fr) auto; }
  .imp-week-count { grid-column: 1; grid-row: 2; text-align: left; padding-left: 18px; font-size: 13px; }
  .imp-week-chip { grid-column: 2; grid-row: 1 / span 2; }
  .imp-day-line { grid-template-columns: minmax(0, 1fr) auto auto; }
  .imp-tr { grid-template-columns: minmax(0, 1fr) auto; }
  .imp-tr-when { grid-column: 1; }
  .imp-tr-pnl { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .imp-tr-prices { grid-column: 1 / -1; }
  .imp-foot-end .imp-foot-note { max-width: none; text-align: left; }
  .imp-q-acts .btn { flex: 1 1 auto; }
}

/* ============================================================
   ROUND S7 — The Accounts Tool (boards RD8NewAccounts, RD8NewGroup,
   RD8NewProp, RD8NewPropSel, RD8NewEnded, RD8NewAddAccount, RD9NewManage;
   js/accounts-page.js, js/accounts-manage.js)
   ============================================================ */
.ac-crumbs { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; min-width: 0; font-size: 14px; }
.ac-crumb { font-size: inherit; font-weight: 600; min-height: 32px; }
.ac-crumb-sep { color: var(--muted); }
.ac-crumb-now { color: var(--ac-soft); overflow-wrap: anywhere; }
.ac-head-actions .btn { min-height: 40px; padding: 0 16px; font-size: 14px; }
.ac-main > .eyebrow { margin: 0 0 -16px; }
.ac-label { margin: 0; color: var(--muted); font-size: 12px !important; font-weight: 600 !important; letter-spacing: 0.08em; text-transform: uppercase; }
.ac-label.is-accent { color: var(--accent); }
.ac-accent { color: var(--accent); font-weight: 600; }
.ac-foot { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.ac-big-line { margin: 0; font-size: 16px; line-height: 1.5; }
.ac-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 24px; margin: 0; }
.ac-figs.is-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); }
.ac-fig { min-width: 0; }
.ac-fig dt { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.ac-fig dd { margin: 4px 0 0; color: var(--text); font-family: var(--font-heading); font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ac-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-pick { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: color-mix(in srgb, var(--text) 86%, var(--muted)); font: inherit; font-size: 13.5px; cursor: pointer; }
.ac-pick.is-n { min-width: 32px; padding: 0 6px; }
.ac-pick.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.ac-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ac-card .ac-card-head { align-items: center; }
.ac-jchart { position: relative; height: 240px; margin-top: 14px; container: acchart / inline-size; }
.ac-jchart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ac-jchart .ac-zero { stroke: var(--line); stroke-width: 1; fill: none; }
.ac-jline { fill: none; stroke-width: 2; stroke: var(--accent); }
.ac-jline.is-prop { stroke: var(--type-prop); }
.ac-jline.is-sim { stroke: var(--muted); stroke-dasharray: 6 5; }
.ac-jline.is-dim { opacity: 0.3; }
.ac-jline.is-on { stroke-width: 3; }
.ac-jhit { fill: none; stroke: transparent; stroke-width: 16; pointer-events: stroke; cursor: pointer; }
.ac-jlabel { position: absolute; right: 0; min-height: 20px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap; cursor: pointer; }
.ac-xl.is-now { transform: translateX(-100%); }
.ac-fig-link { display: block; font-family: var(--font-body); font-size: 13px; font-weight: 500; min-height: 0; margin-top: 2px; }
.ac-fix:not([open]) > :not(summary) { display: none; }
.am-menu.float-menu { position: fixed; top: 0; left: 0; right: auto; z-index: 70; }
.am-menu .day-row-menu-item { white-space: nowrap; }
.ac-jlabel.is-prop { color: var(--type-prop); }
.ac-jlabel.is-sim { color: var(--muted); }
.ac-ring { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border: 2px solid var(--loss); border-radius: 50%; background: var(--card); pointer-events: none; }
.ac-ring.is-funded { border-color: var(--gain); }
.ac-ring.is-dim { opacity: 0.35; }
.ac-band { fill: var(--raised); opacity: 0.5; cursor: pointer; }
.ac-band.is-blown { fill: var(--loss); opacity: 0.1; }
.ac-band.is-funded { fill: var(--gain); opacity: 0.1; }
.ac-band.is-running { fill: var(--accent); opacity: 0.1; }
.ac-band.is-on { fill: var(--accent); opacity: 0.2; }
.ac-band.is-dim { opacity: 0.04; }
.ac-band-n { position: absolute; top: 0; min-width: 24px; min-height: 22px; padding: 0 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; transform: translateX(-50%); cursor: pointer; }
.ac-band-n.is-blown { color: var(--loss); }
.ac-band-n.is-funded { color: var(--gain); }
.ac-band-n.is-running { color: var(--accent); }
.ac-band-n.is-dim { opacity: 0.45; }
.ac-end { position: absolute; transform: translateX(-100%); font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ac-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.ac-key { display: inline-flex; align-items: center; gap: 6px; }
.ac-ring-key { width: 10px; height: 10px; border: 2px solid var(--loss); border-radius: 50%; }
.ac-ring-key.is-funded { border-color: var(--gain); }
.ac-journey .ac-xls { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; }
.ac-xls.ac-xls-flow { position: relative; margin-top: 8px; height: 14px; }
.ac-journey.is-open { border-color: var(--accent-line); }
.ac-fstrips { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ac-fstrip { display: grid; grid-template-columns: 14% 85%; align-items: center; column-gap: 0; }
.ac-fname { padding-right: 10px; color: var(--ac-soft); font-size: 13px; text-align: right; overflow-wrap: anywhere; }
.ac-ftrack { position: relative; height: 22px; border-bottom: 1px solid var(--ac-row-line); }
.ac-fbar { position: absolute; top: 2px; height: 18px; min-width: 6px; padding: 0; border: 1px solid transparent; border-radius: 5px; background: var(--raised); color: var(--text); font: inherit; font-size: 11.5px; font-weight: 600; line-height: 16px; cursor: pointer; overflow: hidden; }
.ac-fbar.is-blown { background: color-mix(in srgb, var(--loss) 30%, var(--card)); color: var(--loss); }
.ac-fbar.is-funded { background: color-mix(in srgb, var(--gain) 26%, var(--card)); color: var(--gain); }
.ac-fbar.is-running { background: color-mix(in srgb, var(--accent) 24%, var(--card)); color: var(--accent); }
.ac-fbar:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ac-grow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.2fr); align-items: baseline; gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--ac-row-line); font-size: 14.5px; }
.ac-grow-name { min-width: 0; overflow-wrap: anywhere; }
.ac-grow-name .ac-of { font-family: inherit; font-size: 13px; }
.ac-grow-disc { color: var(--muted); }
.ac-grow-cost { text-align: right; }
.ac-guard-lead { font-size: 15px; }
.ac-card.ac-type .ac-type-head { align-items: center; }
.ac-type-head .link-btn { margin-left: auto; font-size: 13.5px; font-weight: 600; min-height: 32px; }
.ac-type-note + .link-btn { margin-left: 0; }
.ac-row { display: grid; grid-template-columns: minmax(150px, 1.5fr) minmax(70px, 100px) minmax(90px, 0.7fr) minmax(120px, 1fr) minmax(90px, auto) 14px; align-items: center; gap: 4px 14px; padding: 14px 22px; border-top: 1px solid var(--ac-row-line); font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; }
.ac-row:hover { background: color-mix(in srgb, var(--raised) 50%, var(--card)); }
.ac-row .ac-c-pnl { text-align: right; font-weight: 600; }
.ac-mth { display: grid; grid-template-columns: minmax(150px, 1.5fr) minmax(90px, 0.7fr) minmax(90px, 0.7fr) minmax(120px, 1fr); align-items: center; gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--ac-row-line); font-size: 14px; font-variant-numeric: tabular-nums; }
.ac-mth .ac-c-pnl, .ac-mth .ac-c-fees { text-align: right; }
.ac-mth .ac-c-fees .ac-sub { display: inline; }
.ac-card .ac-table { border: 0; border-radius: 0; background: transparent; }
.ac-copied { border-color: color-mix(in srgb, var(--close) 45%, var(--line)); background: color-mix(in srgb, var(--close) 7%, var(--card)); }
.ac-copied .ac-label { color: var(--close); }
.ac-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; align-items: start; }
.ac-pair:empty { display: none; }
.ac-mrows { margin: 12px 0 0; }
.ac-mrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 15px; }
.ac-mrow dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.ac-mrow.is-sub { color: var(--muted); font-size: 13.5px; }
.ac-mrow.is-sub dd { font-weight: 400; }
.ac-mrow.is-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--ac-row-line); font-weight: 600; }
.ac-money-add { margin: 0; }
.ac-money-add .link-btn { font-size: 13.5px; font-weight: 600; }
.ac-now { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
.ac-now .ac-label { color: var(--accent); }
.ac-now .ac-big-line { font-family: var(--font-heading); font-size: 22px; line-height: 1.25; }
.ac-erow { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--ac-row-line); font-size: 14.5px; line-height: 1.5; }
.ac-arow { display: grid; grid-template-columns: 26px minmax(130px, 1.5fr) minmax(90px, 0.8fr) minmax(110px, 0.9fr) minmax(110px, auto) 56px; align-items: center; gap: 4px 12px; width: 100%; padding: 12px 0; border: 0; border-top: 1px solid var(--ac-row-line); background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; font-variant-numeric: tabular-nums; cursor: pointer; }
.ac-arow:hover { background: color-mix(in srgb, var(--raised) 40%, transparent); }
.ac-arow:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ac-a-n { font-size: 15px; font-weight: 600; font-family: inherit; }
/* Round S12f: a row's name is its open button; the status is a pill with a menu ("Running ▾"). */
.ac-a-open { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ac-arow:focus-within { background: color-mix(in srgb, var(--raised) 40%, transparent); }
.ac-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--raised); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.ac-pill.is-ok { background: var(--gain-soft); color: var(--gain); border-color: transparent; }
.ac-pill.is-bad { background: color-mix(in srgb, var(--loss) 14%, transparent); color: var(--loss); border-color: transparent; }
.ac-pill.is-quiet { color: var(--muted); }
.ac-pill-menu { min-width: 180px; }
@media (hover: hover) { .ac-pill:hover { border-color: var(--muted); } .jn-today:hover { border-color: var(--muted); } .ac-a-open:hover b { text-decoration: underline; text-underline-offset: 3px; } }
.ac-now.is-idle { border-color: var(--line); background: var(--card); }
.ac-now.is-idle .ac-label { color: var(--muted); }
@media (max-width: 720px) { .ac-pill { min-height: 40px; } .ac-pill-menu .tt-menu-item { min-height: 44px; } }
.ac-a-pace, .ac-a-disc { color: var(--ac-soft); }
.ac-a-cost { text-align: right; color: var(--ac-soft); }
.ac-next { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent) 5%, var(--card)); }
.ac-next-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.ac-next-acts .btn { flex: 0 1 auto; min-height: 44px; padding: 0 18px; font-size: 14.5px; }
.ac-open { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ac-row-line); display: flex; flex-direction: column; gap: 10px; }
.ac-open-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px 16px; margin: 0; }
.ac-open-figs dt { color: var(--muted); font-size: 13px; }
.ac-open-figs dd { margin: 2px 0 0; font-size: 15.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ac-end-blown { color: var(--loss); }
.ac-end-funded { color: var(--gain); }
.ac-end-running { color: var(--accent); }
.ac-open-line { margin: 0; font-size: 15px; line-height: 1.55; }
.ac-open-line .link-btn { font-size: 14px; font-weight: 600; min-height: 0; }
.ac-fix summary { color: var(--muted); font-size: 13.5px; cursor: pointer; }
.ac-fix .ac-stages { border-top: 0; padding-top: 8px; }
.ac-pause { display: block; border-color: var(--line); }
.ac-pause h2 { font-size: 16px; }
.ac-empty-att { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.ac-empty-att > * + * { margin-top: 0; }
.ac-c-kept { color: var(--ac-soft); }
.am-modal { max-width: 760px; }
.am-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--muted); font-size: 13.5px; }
.am-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.am-acts { display: flex; flex-wrap: wrap; gap: 10px; }
.am-acts .btn { flex: 0 1 auto; min-height: 44px; padding: 0 18px; font-size: 14.5px; }
.am-add-line { margin: 0; }
.am-add-line .btn { flex: 0 0 auto; width: auto; min-height: 40px; padding: 0 16px; font-size: 14px; }
.am-rows { display: flex; flex-direction: column; }
.am-row { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-top: 1px solid var(--ac-row-line); }
.am-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.am-row-name { min-width: 0; overflow-wrap: anywhere; }
.am-menu-wrap { position: relative; flex: none; }
.am-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 3; min-width: 250px; }
.am-edit { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--raised); }
.am-foot { margin-top: auto; padding: 16px; border-radius: 14px; background: var(--raised); }
.am-foot p { margin: 4px 0 0; }
.am-att { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--ac-row-line); }
.am-att legend { padding: 0; font-size: 14.5px; font-weight: 600; float: left; width: 100%; }
.am-pay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px 12px; align-items: end; }
.am-pay .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
#accCostsModal { max-height: calc(100vh - 48px); overflow: auto; }
.hm-ld-split dd { color: var(--muted); font-weight: 400; }
.mf-group-row { margin-top: 2px; }
.mf-group-rows .mf-row-wrap { padding-left: 18px; }
@container accpage (max-width: 760px) {
  .ac-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name pnl" "shape kept" "status status"; }
  .ac-row .ac-c-name { grid-area: name; } .ac-row .ac-c-pnl { grid-area: pnl; } .ac-row .ac-c-shape { grid-area: shape; } .ac-row .ac-c-kept { grid-area: kept; text-align: right; } .ac-row .ac-c-status { grid-area: status; }
  .ac-row .ac-chev { display: none; }
  .ac-arow { grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "n name cost" "n pace pace" "n disc end"; }
  .ac-arow .ac-a-n { grid-area: n; align-self: start; } .ac-arow .ac-c-name { grid-area: name; } .ac-arow .ac-a-cost { grid-area: cost; } .ac-arow .ac-a-pace { grid-area: pace; } .ac-arow .ac-a-disc { grid-area: disc; } .ac-arow .ac-a-end { grid-area: end; text-align: right; }
  .ac-grow { grid-template-columns: minmax(0, 1fr) auto; }
  .ac-grow-cost { grid-column: 1 / -1; text-align: left; }
  .ac-mth { grid-template-columns: minmax(0, 1fr) auto; }
  .ac-mth .ac-c-fees { text-align: left; }
  .ac-mth .ac-c-kept { text-align: right; }
  .ac-fstrip { grid-template-columns: minmax(0, 1fr); }
  .ac-fname { padding: 0 0 2px 14%; text-align: left; }
  .ac-ftrack { margin-left: 14%; width: 85%; }
}
@media (max-width: 720px) {
  .ac-fig dd { font-size: 22px; }
  .ac-row, .ac-type-head { padding-left: 16px; padding-right: 16px; }
  .ac-figs.is-card { padding: 16px; }
  .ac-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-jchart { height: 210px; }
  .ac-erow { grid-template-columns: minmax(0, 1fr); }
  .am-grid, .am-pay { grid-template-columns: minmax(0, 1fr); }
  .am-menu { min-width: 220px; }
  .ac-head-actions .btn { flex: 1 1 auto; }
}
.ac-stages-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 4px; }
.ac-end-words { margin-left: auto; color: var(--muted); font-size: 13.5px; }
.ac-end-words b { color: var(--text); }
.ac-cmp { padding-top: 14px; border-top: 1px solid var(--ac-row-line); }
.ac-cmp-row { display: grid; grid-template-columns: minmax(70px, 1fr) repeat(4, minmax(48px, 1fr)); gap: 8px; padding: 8px 0; border-top: 1px solid var(--ac-row-line); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.ac-cmp-row.is-head { border-top: 0; color: var(--muted); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; }
@media (max-width: 720px) { .ac-cmp-row { font-size: 12.5px; gap: 6px; } .ac-cmp-row.is-head { letter-spacing: 0; text-transform: none; } }

/* ============================================================
   ROUND S8 — Settings, the feedback offer, Admin (boards RD9New*, RD10New*)
   ============================================================ */
/* The rail's foot: Settings and the eye, or the profile row and the eye. */
.rail-eye-row { display: flex; align-items: center; gap: 8px; }
.rail-eye-row .nav-item { flex: 1 1 auto; min-width: 0; }
.rail-profile { gap: 8px; }
.rail-profile .rail-who { flex: 1 1 auto; min-width: 0; }
.rail-eye { flex: 0 0 auto; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); }
.rail-eye svg { width: 18px; height: 18px; }
.sheet-amounts[aria-pressed="true"] { color: var(--accent); }
/* Settings' cards. */
.account-sections > .bl-lead, .account-section > .bl-lead { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
#accountBillingCard, #accountBillingLive, #accountDataCard { display: flex; flex-direction: column; gap: 16px; }
#settingsSec-billing, #settingsSec-data, #settingsSec-privacy, #settingsSec-profile, #settingsSec-admin { display: flex; flex-direction: column; gap: 16px; }
#settingsSec-billing[hidden], #settingsSec-data[hidden], #settingsSec-privacy[hidden], #settingsSec-profile[hidden], #settingsSec-admin[hidden] { display: none; }
#accountBillingLive[hidden], #accountBillingStatic[hidden] { display: none; }
.account-section > .bl-lead { margin-bottom: -4px; }
.bl-card { padding-bottom: 18px; }
.bl-card.is-accent { border-color: var(--accent-line); background: var(--accent-soft); }
.bl-card.is-accent .card-label { color: var(--accent); }
.bl-title { margin: 6px 0 8px; color: var(--text); font-family: var(--font-serif, Georgia, serif); font-size: 28px; line-height: 1.2; overflow-wrap: anywhere; }
.bl-text { margin: 0 0 8px; color: var(--text); font-size: 15px; line-height: 1.5; }
.bl-card.is-accent .bl-text, #settingsSec-billing .bl-text { color: var(--muted); }
.fb-declined .bl-text { color: var(--text) !important; }
.bl-sub { margin: 0 0 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.bl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 10px; }
.bl-cancel { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.bl-cancel .link-btn { font-weight: 600; }
.bl-chip { display: inline-flex; width: auto; margin-left: 8px; vertical-align: middle; font-weight: 500; }
.bl-danger { border-color: var(--breach); }
.bl-danger .card-label { color: var(--breach); }
.bl-fold { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.bl-fold > summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.acct-value { align-self: center; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.acct-on { align-self: center; color: var(--gain); font-size: 14px; font-weight: 600; }
.acct-name-row .acct-input { width: 200px; max-width: 100%; }
.acct-name-row .acct-note { flex: 1 1 100%; margin: 0; }
.acct-name-row .acct-note:empty { display: none; }
.account-card .set-row-label span .link-btn { display: inline; min-height: 0; padding: 0; font-size: inherit; white-space: nowrap; }
.account-card .set-row-label span .link-btn span { display: inline; }
@media (max-width: 720px) { .bl-title { font-size: 24px; } .acct-name-row .acct-input { flex: 1 1 auto; width: auto; } }
/* The offer. */
.hm-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; border-color: var(--accent-line); background: var(--accent-soft); }
.hm-offer .hm-notice-text { flex: 1 1 260px; min-width: 0; margin: 0; }
.hm-offer .hm-notice-text b { color: var(--text); }
.hm-offer-mark { color: var(--text); }
.hm-offer .hm-notice-x { position: static; }
.fb-status { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 14px; line-height: 1.45; }
.fb-status svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
.fb-status.is-done { color: var(--gain); }
/* The window. */
.fb-modal { max-width: 800px; }
.fb-modal .imp-title, .adm-modal .imp-title { padding-right: 36px; }
.fb-lead { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.fb-q { margin-bottom: 14px; }
.fb-q label, .fb-q-label { display: block; margin: 0 0 6px; color: var(--text); font-size: 15px; }
.fb-input { width: 100%; box-sizing: border-box; resize: vertical; }
.fb-hint { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.fb-feels { margin-bottom: 8px; }
.fb-shots { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; }
.fb-thumbs { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.fb-thumb { position: relative; display: block; width: 88px; height: 58px; }
.fb-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.fb-thumb-x { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--text); cursor: pointer; }
.fb-thumb-x svg { width: 12px; height: 12px; }
.fb-shot-note { flex: 1 1 100%; min-width: 0; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.fb-shot-add { display: inline-flex; align-items: center; flex: 0 0 auto; font-weight: 600; }
#feedbackShotInput { display: none; }
.fb-shot-error { flex: 1 1 100%; margin: 0; color: var(--breach); font-size: 13px; }
.fb-shot-error:empty { display: none; }
.fb-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; }
.fb-foot-note { flex: 1 1 220px; min-width: 0; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.fb-foot-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
/* Admin. */
.adm-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.adm-fig { min-width: 0; padding: 16px 18px; }
.adm-big { margin: 6px 0; color: var(--text); font-family: var(--font-serif, Georgia, serif); font-size: 30px; line-height: 1.1; overflow-wrap: anywhere; }
.adm-sub { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
/* Round S13: Admin's Sign-ups card — a small table that scrolls inside itself on a phone. */
.adm-signups { display: flex; flex-direction: column; gap: 10px; }
.adm-signups-wrap { overflow-x: auto; min-width: 0; }
.adm-signups-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.adm-signups-table th, .adm-signups-table td { padding: 6px 8px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.adm-signups-table th:first-child { text-align: left; overflow-wrap: anywhere; white-space: normal; }
.adm-signups-table thead th { border-top: 0; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.adm-signups-table .is-total th, .adm-signups-table .is-total td { font-weight: 600; }
.adm-card .card-row { justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.adm-note { margin: 0; color: var(--breach); font-size: 14px; }
.adm-note:empty { display: none; }
.adm-list { margin: 0; padding: 0; list-style: none; }
.adm-req, .adm-done { padding: 14px 0; border-top: 1px solid var(--line); }
.adm-list > :first-child { border-top: 0; }
.adm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.adm-row svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--muted); }
.adm-who { display: block; min-width: 0; }
.adm-who b { display: block; color: var(--text); font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.adm-who span { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.adm-who .adm-next { color: var(--text); } /* round S12f: what they did next */
.adm-q { margin: 12px 0 2px; color: var(--muted); font-size: 13px; }
.adm-a { margin: 0; color: var(--text); font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.adm-shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.adm-shot { display: block; width: 120px; height: 72px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.adm-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.adm-shot.is-gone { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.adm-mail { font-weight: 600; }
.adm-done { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.adm-verdict { flex: 0 0 auto; color: var(--muted); font-size: 14px; }
.adm-verdict.is-yes { color: var(--gain); font-weight: 600; }
/* Round S10c: the compact row under the numbers; Show older; the Ended fold. */
.adm-strip-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.adm-strip-row.is-one { grid-template-columns: minmax(0, 1fr); }
.adm-strip-item { min-width: 0; }
.adm-strip-big { margin: 2px 0; color: var(--text); font-family: var(--font-serif, Georgia, serif); font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.adm-strip .adm-details { font-size: 13px; }
.adm-more { margin-top: 12px; }
.adm-fold { margin-top: 4px; border-top: 1px solid var(--line); }
.adm-fold-head { min-height: 44px; color: var(--muted); font-size: 14px; }
.adm-fold-head[aria-expanded="true"] svg { transform: rotate(90deg); }
@container (max-width: 560px) { .adm-strip-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .adm-strip-row { grid-template-columns: minmax(0, 1fr); } }
.acct-costs[hidden] { display: none; }
.adm-modal { max-width: 640px; }
.adm-opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.adm-opt { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.adm-opt.is-on { border-color: var(--accent-line); background: var(--accent-soft); }
.adm-opt input[type="radio"] { flex: 0 0 auto; margin-top: 3px; }
.adm-opt > span { flex: 1 1 auto; min-width: 0; }
.adm-opt b { display: block; color: var(--text); font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.adm-opt > span > span { display: block; color: var(--muted); font-size: 13px; }
.adm-opt .fl-input { width: 100%; box-sizing: border-box; margin-top: 8px; }
.adm-preview { margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.adm-preview p:last-child { margin: 4px 0 0; color: var(--text); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
@container (max-width: 560px) { .adm-figs { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .adm-figs { grid-template-columns: minmax(0, 1fr); } }

/* ============================================================
   ROUND S8b
   ============================================================ */
/* The remembered fees in the Import window's foot, and their box. */
.imp-memory { flex: 1 1 100%; margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.imp-memory .link-btn { min-height: 0; font-size: 13.5px; }
.imp-memory-fields { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.imp-memory-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.imp-memory-row .imp-fee-val { display: flex; flex: 1 1 auto; min-width: 0; min-height: 44px; }
.imp-memory-row .imp-fee-input { flex: 1 1 auto; width: 100%; min-width: 0; }
.imp-memory-x { flex: 0 0 auto; width: 44px; height: 44px; }
/* Practice accounts stopped counting: the Dashboard's one-time notice. */
.hm-practice { align-items: center; padding-right: 20px; }
.hm-practice-ok { flex: 0 0 auto; }

/* ============================================================
   ROUND S9
   ============================================================ */
/* F11: "+$722 this time" in a stat; the Journal tile's sub line ("those trades made +$722"). */
.ins-stat3-tail { font-family: var(--font-body); font-size: 14px; color: var(--muted); }
.jn-tile-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.jn-tile-sub .pos { color: var(--gain); }
/* F12: "click" on a computer, "tap" on a phone or touch screen (clickWordHtml). */
.w-tap { display: none; }
@media (max-width: 720px), (pointer: coarse) { .w-click { display: none; } .w-tap { display: inline; } }
/* The account rules (round S9): a copy group's copies, named read-only on the lead's page. */
.ac-copies-list { margin: 8px 0 0; padding-left: 18px; color: var(--text); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
/* The copier card: a column per account, headed with its name; no "Together" column. */
.imp-copy .imp-copy-row.is-names { grid-template-columns: 64px minmax(110px, 1fr) repeat(var(--imp-n, 2), minmax(80px, 1fr)); }
@media (max-width: 720px) { .imp-copy .imp-copy-row.is-names { grid-template-columns: 40px minmax(0, 1.3fr) repeat(var(--imp-n, 2), minmax(0, 1fr)); } }
/* F06: Make room — Manage accounts opens over the Import window, which stays put underneath. */
.import-overlay.open.is-under { z-index: 54; }
#accManageOverlay.open { z-index: 57; }

/* ROUND S10 · consent and free access */
/* The welcome step: the name, then the optional AI box and its fold. */
.modal.welcome-step { max-width: 480px; }
.welcome-step .name-input { width: 100%; }
.ai-box { margin-top: 16px; }
.ai-box label { font-size: 14px; }
.ai-box-pro { color: var(--muted); font-weight: 600; white-space: nowrap; }
.ai-box-what { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.ai-box-what summary { display: inline-flex; align-items: center; min-height: 32px; color: var(--accent); font-weight: 600; cursor: pointer; }
.ai-box-what summary:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
.ai-box-what p { margin: 4px 0 0; }
/* Folded, its words take no box at all (Chrome's closed details still reports one). */
.ai-box-what:not([open]) p { display: none; }
.welcome-step .name-actions { justify-content: flex-end; }
.welcome-step .name-actions .btn { min-width: 120px; }
@media (max-width: 720px) { .welcome-step .name-actions .btn { flex: 1 1 auto; } }
/* Admin → Invite someone: the plan, the date with No end date, the note. */
.adm-invite .adm-plan { margin: 4px 0 0; padding: 0; border: 0; min-width: 0; }
.adm-invite .adm-plan legend { padding: 0; margin-bottom: 6px; }
.adm-plan-opt { position: relative; display: inline-flex; }
.adm-plan-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.adm-plan-opt span { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 16px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.adm-plan-opt input:checked + span { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.adm-plan-opt input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.adm-until { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.adm-until .acct-input { flex: 0 1 200px; }
.adm-until .acct-input:disabled { opacity: 0.5; }
.adm-noend { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; color: var(--text); font-size: 14px; cursor: pointer; }
.adm-noend input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
/* Admin → Free access: a row, its two buttons under it; an ended row is quiet. */
.adm-free .bl-actions { margin-top: 10px; }
.adm-free .adm-until { margin-top: 10px; }
.adm-free.is-ended .adm-who b { color: var(--muted); }

/* ROUND S10 · leaks and walkthrough */
/* 4.2: "in Plan, in the menu on the left" — the phone has no rail, so "on the left" goes. */
.fr-plan-word { color: var(--text); font-weight: 600; }
@media (max-width: 720px) { .w-rail { display: none; } }
/* 4.3: "+ Choose a Guardrail yourself" is as wide as its words (a column card stretched it). */
.card > .fr-choose, .fr-next > .fr-choose { align-self: flex-start; width: auto; max-width: 100%; }
/* 4.6: Numbers' dates select — a visible label, and the app's pill with its ▾. */
.ins-range { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.ins-range-k { white-space: nowrap; }
.ins-range select.cal-select { min-height: 36px; padding: 0 32px 0 16px; border-radius: var(--r-pill); background-color: var(--raised); font-size: 14px; font-weight: 500;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
  background-position: right 17px center, right 13px center; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
/* 4.9: more accounts than Pro shows. */
.ac-over { margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--card); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.ac-over .link-btn { font-size: inherit; min-height: 0; vertical-align: baseline; }

/* ============================================================
   Round S12d — YOUR STATEMENT (js/engines/statement.js, js/import/statement-ui.js;
   boards RD14NewTotals, RD14NewWhich, RD14NewFees, RD14NewTrades, RD14NewValue, RD14NewChecked)
   ============================================================ */
.stmt-block { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 18px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--raised); }
.stmt-title { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.stmt-read, .stmt-ok { display: flex; align-items: flex-start; gap: 6px; margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.stmt-ok { color: var(--text); font-size: 15px; font-weight: 600; flex-wrap: wrap; }
.stmt-tick { display: inline-flex; flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; color: var(--gain); }
.stmt-tick svg { width: 20px; height: 20px; }
.stmt-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px 16px; margin: 4px 0 0; }
.stmt-figs dt { color: var(--muted); font-size: 13px; }
.stmt-figs dd { margin: 2px 0 0; color: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stmt-figs dd .pos { color: var(--gain); }
.stmt-figs dd .neg { color: var(--loss); }
.stmt-fig-note { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.stmt-notes, .stmt-why, .stmt-later, .stmt-where { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.stmt-why { color: var(--text); }
.stmt-ask-why { margin: -2px 0 2px; color: var(--muted); font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; } /* round S12h §1 */
.stmt-open-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin: 0; }
.stmt-open-row .tip-term { font-size: 13.5px; }
.stmt-answer { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.stmt-q { color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.stmt-ask { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.stmt-ask .stmt-net { display: flex; flex: 0 1 180px; min-width: 0; min-height: 44px; }
.stmt-ask .imp-fee-input { flex: 1 1 auto; width: 100%; min-width: 0; }
.stmt-ask .btn { min-height: 44px; padding: 0 18px; }
.stmt-ask .link-btn, .stmt-where-btn, .stmt-open { min-height: 44px; font-size: 14px; }
.stmt-where-btn, .stmt-open { align-self: flex-start; }
.stmt-diff { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--close) 55%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--close) 10%, var(--card)); color: var(--text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.stmt-diff-text { margin: 0; font-size: 15px; font-weight: 600; }
.stmt-diff-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.stmt-diff .stmt-why-btn { min-height: 44px; padding: 0 18px; font-weight: 600; }
.stmt-diff-or { margin: 0; color: var(--muted); font-size: 13.5px; }
.stmt-diff .link-btn, .stmt-ok .link-btn, .stmt-later .link-btn { min-height: 0; font-size: inherit; font-weight: 600; vertical-align: baseline; }
.stmt-bug ul, .stmt-rows ul { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0 0 0 18px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.stmt-bug p { margin: 0; }
.stmt-rows { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--muted); }
.stmt-rows.is-emph { padding: 12px 14px; border: 1px solid var(--accent-line); border-radius: 12px; color: var(--text); }
.imp-warn.stmt-bug.is-emph { border-color: var(--accent-line); }
/* What does your statement say? — label, file, statement, mark. */
.stmt-w { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stmt-w-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 28px; align-items: center; gap: 10px; min-width: 0; margin: 0 -8px; padding: 4px 8px; border-radius: 10px; }
/* Round S12e §3: a line that differs is the row tinted amber, not only its ≠. */
.stmt-w-row.is-no { background: color-mix(in srgb, var(--close) 14%, transparent); box-shadow: inset 3px 0 0 var(--close); }
.stmt-w-head { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.stmt-w-label { color: var(--text); font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.stmt-w-ours { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stmt-w-input { width: 100%; min-width: 0; min-height: 44px; font-variant-numeric: tabular-nums; }
.stmt-w-mark { display: inline-flex; justify-content: center; }
.stmt-yes { display: inline-flex; width: 18px; height: 18px; color: var(--gain); }
.stmt-yes svg { width: 18px; height: 18px; }
.stmt-no { color: var(--loss); font-size: 18px; font-weight: 700; }
.stmt-cause { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: var(--text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
/* The fees fix. */
.stmt-fee-fields { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stmt-oneday, .stmt-past { display: flex; flex-direction: column; gap: 8px; grid-column: 1 / -1; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.stmt-oneday .imp-fee-val { display: flex; min-height: 44px; }
.stmt-oneday .imp-fee-input { flex: 1 1 auto; width: 100%; min-width: 0; }
.stmt-oneday .btn { align-self: flex-start; min-height: 44px; }
.stmt-tickbox { display: flex; align-items: flex-start; gap: 8px; grid-column: 1 / -1; color: var(--text); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.stmt-tickbox input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; }
.stmt-past-q { margin: 0; color: var(--text); font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.stmt-from { max-width: 220px; }
.stmt-from input { min-height: 44px; }
.stmt-grades { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0 0 0 18px; color: var(--text); font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
/* The contracts fix — day, contracts, before fees, statement. */
.stmt-d { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stmt-d-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; gap: 10px; min-width: 0; padding: 4px 8px; border-radius: 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.stmt-d-row > * { min-width: 0; overflow-wrap: anywhere; }
.stmt-d-head { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.stmt-d-row.is-likely { background: color-mix(in srgb, var(--close) 10%, transparent); }
.stmt-likely { display: inline-block; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--close) 22%, transparent); color: var(--text); font-size: 11.5px; font-weight: 600; }
.stmt-d-input { width: 100%; min-width: 0; min-height: 40px; }
.stmt-d-acts { display: flex; gap: 8px 12px; flex-wrap: wrap; }
.stmt-d-acts .btn { min-height: 44px; }
.stmt-twice { display: flex; flex-direction: column; gap: 6px; }
.stmt-twice-row { margin: 0; color: var(--text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
/* The value fix — contract, contracts, points, a point, before fees. */
.stmt-v { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stmt-v-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1fr); gap: 8px; min-width: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.stmt-v-row > * { min-width: 0; overflow-wrap: anywhere; }
.stmt-v-head { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.3; }
/* The fixes each account keeps. */
.stmt-fx-acct { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.stmt-fx-name { margin: 0; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.stmt-fx-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; min-width: 0; }
.stmt-fx-row p { margin: 0; flex: 1 1 220px; min-width: 0; color: var(--text); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.stmt-fx-src { display: block; color: var(--muted); font-size: 12.5px; }
.stmt-fx-acts { display: inline-flex; gap: 14px; }
.stmt-fx-acts .link-btn { min-height: 44px; font-size: 14px; }
.stmt-fixes-line .link-btn { min-height: 0; font-size: 13.5px; }
/* Round S13: a checked day on the Journal — a small, quiet receipt in the tile's bottom-right corner, apart from the grade's ✓ / ×. */
.stmt-mark { position: absolute; right: 6px; bottom: 6px; display: inline-flex; width: 12px; height: 12px; color: var(--muted); opacity: 0.8; pointer-events: auto; }
.stmt-mark svg { width: 100%; height: 100%; }
.stmt-mark.is-legend { position: static; vertical-align: -2px; opacity: 1; }
.day.has-stmt .amt { padding-right: 14px; } /* the corner is the receipt's: the amount never runs under it */
.stmt-legend { margin-top: 4px; }
@media (max-width: 720px) { .stmt-mark { right: 3px; bottom: 3px; width: 10px; height: 10px; } .stmt-mark.is-legend { width: 12px; height: 12px; } .day.has-stmt .amt { padding-right: 11px; } }
.stmt-line { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.stmt-line .link-btn { min-height: 0; font-size: inherit; font-weight: 600; vertical-align: baseline; }
.tw-fee-src { margin: -4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .stmt-block { padding: 16px; }
  .stmt-w-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 24px; }
  .stmt-w-row .stmt-w-label { grid-column: 1 / -1; }
  .stmt-w-head span:first-child { display: none; }
  .stmt-v-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; padding: 8px 0; border-top: 1px solid var(--line); }
  .stmt-v-row .stmt-v-name { grid-column: 1 / -1; }
  .stmt-v-row.stmt-v-head { display: none; }
  .stmt-d-acts .btn { flex: 1 1 100%; }
  .stmt-v-row .stmt-v-name { color: var(--text); font-weight: 600; }
  .stmt-v-row > [data-k]::before { content: attr(data-k) " "; color: var(--muted); }
}
.stmt-nowrap { white-space: nowrap; }

/* ============================================================
   WHAT MUST NOT BE MISSED (round S12e §3, Chris 15 Nov)
   At most one element per screen: the one the trader must act on or
   must not miss — the accent (the primary buttons' and the selected
   nav's), a 3px bar on the left and a ground a touch lighter than the
   cards around it. Never red (only a loss amount or a real error is),
   and one subtle highlight the first time it's drawn (.is-emph-new,
   once per window; nothing under reduced motion). Where it's used:
   the statement check's question, check A's box, the access banner.
============================================================ */
.is-emph { border-color: var(--accent-line); background: var(--emph-bg); box-shadow: inset 3px 0 0 var(--accent); }
@keyframes emphIn { from { outline-color: var(--accent-line); } to { outline-color: transparent; } }
@media (prefers-reduced-motion: no-preference) {
  .is-emph-new { outline: 3px solid transparent; outline-offset: 2px; animation: emphIn var(--dur-slow) var(--ease-out) 1; }
}
/* The statement check's question: the field the size of the figures, its accent edge while empty. */
.stmt-block.is-emph .stmt-figs dd { font-size: 18px; }
.stmt-block.is-emph .stmt-ask .stmt-net { flex-basis: 220px; min-height: 52px; }
.stmt-block.is-emph .stmt-net .imp-fee-input { min-height: 48px; font-size: 18px; font-weight: 600; }
.stmt-block.is-emph .stmt-net > span[aria-hidden] { font-size: 18px; font-weight: 600; }
.stmt-net.is-empty { border-color: var(--accent); }
/* The fix pages' main button. */
.btn.btn-main { min-height: 48px; padding: 0 22px; font-size: 15px; font-weight: 600; }
/* After an import or a fix: Undo as a clear button. */
.msg-undo-clear .msg-action { align-self: flex-start; min-height: 36px; margin-top: -6px; padding: 0 14px; border: 1px solid var(--msg-action); border-radius: 10px; } /* centred on the text's first line */
@media (max-width: 720px), (pointer: coarse) { .msg-undo-clear .msg-action { min-height: 44px; margin-top: -10px; } } /* a 44px target there, as launch polish set */

/* Round S13b: Cloudflare Turnstile's box (js/turnstile.js) — empty and gone unless Cloudflare asks
   for a click; then a small box above the bottom edge, inside the screen at any width. */
.ts-box { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2000; max-width: calc(100vw - 32px); }
.ts-box:empty { display: none; }
