/* SizeGuard: phone-first, one column. Colors are tokens: neutrals follow light/dark mode,
   each market has its own color: Futures gold, Stocks emerald, Crypto blue, Forex purple sets each asset's card color, its text color and outlines. */
:root {
  color-scheme: dark;
  /* Dark mode is true black (Nov 29 2026, the owner's second calendar picture): the page #000000, cards a shade above
     it, white text. Before: page #121418, cards #1a1d23, raised #22262e, lines #2e333c, boxes #14171c, text #f4f6f9.
     Measured: grey text (--muted) 8.46 : 1 on a card, 9.07 on the page, 7.75 on --surface-2; white text 21 : 1. */
  --bg: #000000; --surface: #0b0c0e; --surface-2: #15171b; --line: #1d2026; --field: #050506; --text: #ffffff; --muted: #a3abb8; --error: #ffb4a2;
  --c-futures: #e9a917; --g-futures: #f7cf5a; --o-futures: #1a1206; --l-futures: #f7c948; --c-stocks: #065f46; --g-stocks: #047857; --o-stocks: #ffffff; --l-stocks: #4ade9b; --c-crypto: #1e40af; --g-crypto: #2f5fe0; --o-crypto: #ffffff; --l-crypto: #7aa2ff; --c-forex: #6b21a8; --g-forex: #9333ea; --o-forex: #ffffff; --l-forex: #c49bff;
  --accent: var(--c-futures); --accent-2: var(--g-futures); --on-accent: var(--o-futures); --accent-line: var(--l-futures);
  --hi: #f5c04a;
  --radius: 18px; --gap: 12px;
  /* The air between the top row (shield, screen name, Light / Dark) and the first thing of every screen: the same on
     all of them, locked or not (the owner, Nov 29 2026: the lane the title rows left is kept empty, so the top is not
     cluttered; the Calculator, where it was 12 px, gets the same). .top below adds what --gap does not give. */
  --top-gap: 28px;
  --tap: 48px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Roboto", "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
  background: var(--bg); color: var(--text);
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
/* Let iOS Dynamic Type drive the base size inside the app's web view. (iOS only: -webkit-touch-callout is iOS's.
   Safari on a Mac knows -apple-system-body too, as 13 px, which made the browser version a size smaller there.) */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) { :root { font: -apple-system-body; font-family: -apple-system, system-ui, sans-serif; } }

body[data-asset="stocks"] { --accent: var(--c-stocks); --accent-2: var(--g-stocks); --on-accent: var(--o-stocks); --accent-line: var(--l-stocks); }
body[data-asset="crypto"] { --accent: var(--c-crypto); --accent-2: var(--g-crypto); --on-accent: var(--o-crypto); --accent-line: var(--l-crypto); }
body[data-asset="forex"] { --accent: var(--c-forex); --accent-2: var(--g-forex); --on-accent: var(--o-forex); --accent-line: var(--l-forex); }

/* Light mode: follows the system, or an explicit data-theme on the root. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { color-scheme: light; --bg: #f3f4f6; --surface: #ffffff; --surface-2: #eef0f3; --line: #dde1e7; --field: #f8f9fb; --text: #0f172a; --muted: #5b6472; --error: #b42318; --c-futures: #e9a917; --g-futures: #f7cf5a; --o-futures: #1a1206; --l-futures: #8a5a00; --c-stocks: #065f46; --g-stocks: #047857; --o-stocks: #ffffff; --l-stocks: #047857; --c-crypto: #1e40af; --g-crypto: #2f5fe0; --o-crypto: #ffffff; --l-crypto: #1e40af; --c-forex: #6b21a8; --g-forex: #9333ea; --o-forex: #ffffff; --l-forex: #6b21a8; --hi: #9a6a00; }
}
:root[data-theme="light"] { color-scheme: light; --bg: #f3f4f6; --surface: #ffffff; --surface-2: #eef0f3; --line: #dde1e7; --field: #f8f9fb; --text: #0f172a; --muted: #5b6472; --error: #b42318; --c-futures: #e9a917; --g-futures: #f7cf5a; --o-futures: #1a1206; --l-futures: #8a5a00; --c-stocks: #065f46; --g-stocks: #047857; --o-stocks: #ffffff; --l-stocks: #047857; --c-crypto: #1e40af; --g-crypto: #2f5fe0; --o-crypto: #ffffff; --l-crypto: #1e40af; --c-forex: #6b21a8; --g-forex: #9333ea; --o-forex: #ffffff; --l-forex: #6b21a8; --hi: #9a6a00; }

* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); }
/* --nav-room: the room kept free at the bottom of the screen for the bar of tabs (see "Bottom navigation"). */
html { --nav-room: max(96px, calc(57px + 2.6 * var(--nav-font))); --nav-font: min(0.66rem, 3.1vw); scroll-padding-bottom: calc(var(--nav-room) + env(safe-area-inset-bottom, 0px)); scroll-padding-top: 12px; }
/* Phone apps: a jump to a card (scrollIntoView from "Daily loss limit", "Back up", the account card, the Prop Firms
   form, an open trade) and a field scrolled into view by the keyboard stop below the clock and below the fade drawn
   under it (see the strip and the fade just below): the clock's own height, the fade's 16 px, then the same 12 px.
   Without this the card's heading landed behind the clock on a phone with a notch (found in review, Nov 21 2026).
   The browser version has no strip and keeps its 12 px. */
html[data-platform] { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 28px); }
body { margin: 0; overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
/* Phone apps: the page scrolls under the clock and battery at the top. This strip, as tall as that area, keeps
   scrolled text from showing through behind them. In a browser the area is 0 tall, so nothing is drawn. */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 25; height: env(safe-area-inset-top, 0px); background: var(--bg); pointer-events: none; }
/* Under that strip, once the page has been scrolled, a short fade in the page's colour (4 px solid, then 12 px of
   fade): text on its way up fades out a little before it reaches the clock, instead of being cut off in a hard
   line right beneath it. (On an iPhone SE the clock fills its whole 20 px strip, so that cut line, with half
   letters right under the time, looked like text sliding behind it.) At the top of a page it is not there, so the first line is never covered; nor when a page is too
   short to scroll (it is see-through until the page moves). Phone apps only (data-platform, set by os.js): the
   browser version has no clock to clear. It needs a browser that can tie an animation to scrolling (iPhones from
   iOS 26, Android's Chrome 115 and later); others keep the plain strip. The browser draws it by itself as the page
   moves: no scroll listener, nothing that slows scrolling. */
@supports (animation-timeline: scroll()) {
  html[data-platform] body::after { content: ""; position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 25; height: 16px; background: linear-gradient(var(--bg) 4px, transparent); pointer-events: none;
    opacity: 0; animation-name: edge-fade; animation-timing-function: linear; animation-fill-mode: both; animation-timeline: scroll(root); animation-range: 0 24px; }
  @keyframes edge-fade { from { opacity: 0; } to { opacity: 1; } }
}

main {
  max-width: 560px; margin: 0 auto;
  /* --win-top: set by the iPhone/iPad app (MainViewController.swift). On an iPad it is how far down the window's
     own buttons reach, so the logo starts below them. Everywhere else it is missing or equals the safe area. */
  padding: max(12px, env(safe-area-inset-top), var(--win-top, 0px)) max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: var(--gap);
}

/* Header */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-bottom: calc(var(--top-gap) - var(--gap)); } /* wraps with very large text; it used to make every tab scroll sideways */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.04em; }
.brand b { font-weight: inherit; }
.brand span { color: var(--l-futures); }
/* The shield is as tall as the Light / Dark button beside it (44 px), so the row reads as one line of two equals. */
.brand-mark { width: 39px; height: 44px; flex: none; }
/* The name of the screen the person is on (app.js, "the screen's name in the top row"): the screen's title, so a
   size above the cards' titles, but calm: a medium weight, not the heavy word "SizeGuard" it replaces. With very
   large text, or on the narrowest phone, the Light / Dark button goes to the next line first (.top wraps), and the
   name only then breaks between its words: it is never cut, and never runs under the button. Its longest word,
   "Calculator", is about 4.5 times its size wide: with the largest text on the narrowest phone (300% at 320 px) that
   word alone was wider than the room beside the shield and was cut, so the size stops where the word still fits
   (the screen less the side margins, the shield and its gap: 88 px). Below that the size is the plain 1.375rem. */
.screen-name { margin: 0; min-width: 0; font-size: min(1.375rem, calc((100vw - 88px) / 4.6)); font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; overflow-wrap: break-word; }
.hero-mark { display: block; width: 64px; height: 72px; margin-bottom: 4px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font-weight: 650; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 6px; }
/* The sun or the moon on the Light / Dark button is drawn in the app's gold (the same in every market), so the
   button belongs to the top bar beside the logo and does not look like a plain grey control. The word beside it
   stays in the normal ink. */
.theme-toggle .ic { color: var(--hi); }
.saved { font-size: 0.8rem; color: var(--muted); text-align: right; }
.saved::before { content: "✓ "; color: var(--hi); }
.saved.off::before { content: "! "; color: var(--error); }


/* Cards and fields */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
h2 { font-size: 1rem; margin: 0; letter-spacing: -0.01em; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
label { font-size: 0.8rem; font-weight: 650; color: var(--muted); letter-spacing: 0.02em; }
.optional { font-weight: 500; opacity: 0.85; }

input, select, button { font: inherit; color: inherit; }
/* The typing cursor (the thin blinking line that shows where the next letter goes) takes the colour of the text,
   so it is always as easy to see as the words. Left to the browser, newer iPhones, iPads and Safari paint it in the
   accent colour of the app the page is shown in. That colour is white when the phone is in dark mode, so on
   SizeGuard's light theme the cursor all but vanished. */
input, textarea { caret-color: currentColor; }
input, select {
  width: 100%; min-width: 0; min-height: var(--tap); font-size: max(1rem, 16px);
  background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font-variant-numeric: tabular-nums; appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 32px; text-overflow: ellipsis; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; } /* hints in empty boxes: 4.5:1 or better */
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
input:focus, select:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-line) 30%, transparent); }
input[aria-invalid="true"] { border-color: var(--error); }
button { border: 0; background: transparent; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; }

.hint { margin: 0; font-size: 0.8rem; line-height: 1.45; color: var(--muted); }
.field-error { margin: 0; font-size: 0.85rem; line-height: 1.4; color: var(--error); font-weight: 600; }
.field-error:empty { display: none; }

/* Risk band: three boxes in a row while there is room. With large text the third box drops under the first two.
   A long amount does the same on a narrow phone. Every box is given room for the longest amount typed in any of
   the three: --amount is that amount's number of characters, set by app.js when the focus leaves a box (0.66 of
   the text size is a little more than one digit is wide; the rest is the room for the "$" and the box's edges).
   So 250000 or 1500.50 on a 320px phone puts the boxes two to a row, and 9999999.99 one to a row, and the whole
   amount can be read. Short amounts (up to five characters there) keep the three boxes side by side as before.
   A box is never asked to be wider than the card (the "100%"), however long the amount and however large the text. */
.risk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(4.8rem, calc(var(--amount, 0) * 0.66 * max(1rem, 16px) + 0.62rem + 19px))), 1fr)); gap: 8px; }
/* The hint in an empty risk box (the word "optional") is never cut off, at any phone width and any text size.
   Its size is the smallest of three things:
   - 1em, the box's own text size, so the hint is never bigger than what you type;
   - 46px, a ceiling that only matters on a wide screen with very large text;
   - the size that fits the box the hint is in. While three boxes share the row, each box is about a third of the
     screen, and the hint may be 7% of the screen's width less 9.8px (29px at most). When the text is so large
     that only two boxes fit in a row, or one, each box is wider and the hint may be 10.4% of the width less 11.5px.
   A stylesheet cannot ask "how many boxes are in this row?", so the last part works it out from the numbers:
   (1rem - 6.95vw + 5.1px) is above zero exactly when three boxes of 4.8rem no longer fit across the card. Times
   999 it is then a huge number, and the two-box size is used. Otherwise it is zero or less, and the three-box
   size wins.
   The box also gives up most of its right-hand padding, so the hint and a typed amount get that room. */
.risk-grid input { padding-right: 4px; }
.risk-grid input::placeholder { font-size: min(1em, 46px, max(min(29px, 7vw - 9.8px), min(10.4vw - 11.5px, (1rem - 6.95vw + 5.1px) * 999))); }
.money-input { position: relative; }
.money-input span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
/* The room for the "$" grows with the text, so it never sits on the first digit. */
.money-input input { padding-left: calc(12px + 0.62rem); font-weight: 650; }
.pref { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pref > span { font-size: 0.85rem; color: var(--muted); }

/* Segmented controls. The market colour fills only a screen's main button (and the chosen market on Markets),
   so a chosen toggle is a quiet raised tile with dark, bold words. tests/colours.test.mjs keeps it that way.
   (On the Calculator, the Journals, Markets, Prop Firms and the Add trade sheet its words are a little thinner, and in
   dark mode the chosen one has no shadow; in light mode it keeps its lift and gets a thin grey ring: see "The calmer
   Calculator" and "The chosen switch on the calmer screens".) */
.segmented { display: flex; gap: 4px; padding: 4px; background: var(--field); border: 1px solid var(--line); border-radius: 14px; }
.segmented button { flex: 1; min-height: 44px; border-radius: 10px; font-weight: 650; color: var(--muted); padding: 6px 8px; font-size: 0.95rem; }
.segmented button[aria-pressed="true"], .tp-mode button[aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: var(--seg-shadow); font-weight: 750; }
.segmented.small button { min-height: 44px; padding: 4px 12px; font-size: 0.9rem; flex: none; }

/* Trade inputs */
.pair-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }
#priceFields.pair-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pair-row .span { grid-column: 1 / -1; }
.pair-row.single { grid-template-columns: minmax(0, 1fr); }
.ghost { flex: none; min-height: var(--tap); padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); color: var(--text); font-weight: 600; font-size: 0.9rem; }
/* The big stop box carries the outline and the focus ring. It is a label, so a tap anywhere in it starts typing. */
.big-input { display: flex; align-items: center; background: var(--field); border: 1.5px solid var(--line); border-radius: 14px; color: var(--text); letter-spacing: 0; }
.big-input:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-line) 30%, transparent); }
.big-input:has([aria-invalid="true"]) { border-color: var(--error); }
.big-input input { flex: 1; font-size: 2.2rem; font-weight: 750; letter-spacing: -0.02em; min-height: 49px; padding: 6px 4px 6px 14px; border: 0; background: none; box-shadow: none; }
/* The right side of the stop box: the unit word ("ticks", "points", "pips") and, under it while you type, the size.
   It never takes more than 62% of the box, so there is always room for the number being typed, and its words
   wrap inside that width when the text is very large. */
.suffix { flex: none; max-width: 62%; margin-right: 12.5px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; color: var(--muted); font-weight: 650; text-align: right; line-height: 1.1; font-size: 0.9rem; }
/* The size, where the typing happens ("= 2 ES"; the keypad covers the answer card, and app.js has the rule for what
   it shows): in the stop box only while typing there, in Entry / Stop always, so nothing moves when the keypad closes. */
.live { display: none; font-variant-numeric: tabular-nums; }
.big-input:focus-within .live:not(:empty), #priceFields:not([hidden]) ~ .summary .live:not(:empty) { display: block; margin-left: auto; }
/* In Entry / Stop the size sits at the right end of the Long / Short line, and the sentence that follows
   ("$2.00 risk per share ...") takes the whole line under it, so the two never squeeze each other. */
.live:not(:empty) + #summary { flex-basis: 100%; }
.summary { margin: 0; font-size: 0.9rem; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-variant-numeric: tabular-nums; min-height: 1.4em; }
.direction { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.direction.long { background: #1f6b3a; color: #e6ffee; }
.direction.short { background: #8a2b1e; color: #ffece8; }

/* The answer. The pick is the normal dark card with a thin ring in the market's colour and its size number in the
   market's ink (the owner, Nov 30 2026: "B, Risk box unchanged"; it was a card filled with the market's colour).
   Any other size is the same quiet tile without the ring. tests/colours.test.mjs keeps it that way. */
.results { display: flex; flex-direction: column; gap: 8px; }
/* One card. --cap is the colour of the small words on it (the name on top, the unit word, the labels and the small
   print): the quiet grey, on the pick too.
   container-type lets a rule further down ask how wide this card is (not how wide the screen is): it is the card's
   own width that decides whether the Log button fits beside the size, on a phone and in the browser alike. */
.result { container-type: inline-size; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px 12px;
  border-radius: var(--radius); background: var(--surface); color: var(--text); border: 1px solid var(--line); --cap: var(--muted); }
/* Nothing to size yet: a dashed outline, the app's sign for "nothing here yet" (the empty Journal uses it too). */
.result:has(> .empty) { border: 1.5px dashed var(--line); }
/* Every part takes a whole line; the size and the Log button share one when both fit. */
.result > * { flex: 1 1 100%; min-width: 0; }
/* A card that is still waiting for a number is one slim line: its name on the left, what is missing on the right
   in the quiet grey. Each result the trader will get has its own waiting card (two in Futures, three in Forex), so
   they are kept short: together they take about the room one full card does. When the name and the words do not
   fit side by side (a small phone, large text), the words drop under the name. */
.result.slim { justify-content: space-between; padding: 9px 14px; }
.result.slim > * { flex: 0 1 auto; }
.result.slim > .empty { font-size: 0.92rem; font-weight: 600; color: var(--muted); }
/* The waiting cards on one screen must always come out the same shape: all on one line, or all with the words
   under the name. Left alone they did not. Whether the words fit beside the name depends on how long the name is,
   so on some phones "Standard lots" put its words on a second line while "Mini lots" kept them beside the name:
   one tall card above two short ones (seen on 360 px wide phones with "Enter entry and stop prices").
   So every waiting card's name takes the width of the LONGEST name on the screen. app.js writes all the names
   into data-names, one per line; the ::after below lays them out with no height and never shows them, and its
   widest line sets the width of the name's box. Now every card has the same room left for the same words, so
   every card decides the same way, at any screen width, text size or font. Nothing here is a measured number.
   Hidden with "visibility", the list is not read out by a screen reader and is not part of the page's text. */
.result.slim > .eyebrow { display: block; }
.result.slim > .eyebrow::after { content: attr(data-names); display: block; height: 0; overflow: hidden; visibility: hidden; white-space: pre; }
/* A solid plate, not a flat block of colour: a soft light from the top left corner, a bright top edge and a darker
   foot. It is used by the chosen market card on Markets. (The calculator's answer card wore it too until Nov 30 2026;
   it is now a dark card with a thin ring, just below.)
   The light is kept gentle on purpose (14% white at the very corner, fading to nothing). The words on the plate
   are white on the green, blue and purple markets, and a stronger light made the corner so pale that the words
   over it were hard to read (4.5:1). With this light, and with every word on the plate in the full "on the fill"
   colour (not a see-through shade of it), each word is 5:1 or better against the plate right behind it.
   pnpm test:ui measures that on the real screen, in all four markets, light and dark (and the words on the answer card too). */
:root { --shine: radial-gradient(120% 90% at 0 0, rgba(255, 255, 255, 0.14), transparent 56%); --plate: inset 0 1px 0 rgba(255, 255, 255, 0.42), inset 0 -1px 0 rgba(0, 0, 0, 0.14), 0 1px 2px rgba(0, 0, 0, 0.22); }
/* The pick: the card's own dark (or white) surface, its words in the usual colours, and a 1 px ring in the market's
   line colour. No fill and no glow under it: the size number in the market's ink (".result.pick .count" below) is
   what marks the answer, so the card no longer shouts. */
.result.pick { border-color: var(--accent-line); }
.result.warn { box-shadow: inset 0 0 0 2px var(--error); }
.eyebrow { font-size: 0.78rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.8; }
/* The top line of a card: its name on the left ("STANDARD · ES") and, on the pick, the "Best pick" tag on the
   right. With large text the tag drops under the name. The tag is a soft wash of the market's colour with its words
   in the market's ink. The name is a little thinner (600) than other small capitals in the app. */
.result > .eyebrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; opacity: 1; color: var(--cap); font-weight: 600; }
/* The star at the left of a card's name (app.js nameLine): as tall as the name, and it grows with it. Its button is a
   full 44 px square around it, pulled into the line by its margins (half the square less half the star), so the card
   is no taller and the star sits where the name begins. Empty, an outline in the grey (on the pick too); the person's
   pick, solid in the market's ink, like a Discipline star. It is drawn over the words under it (z-index), so all of the square takes a tap. A waiting card's hidden list of names makes room for it too (1.6em: the star
   and the gap after it). */
.named { display: inline-flex; align-items: center; vertical-align: top; }
.fav { position: relative; z-index: 1; display: inline-flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px;
  margin: calc(.5em - 22px) calc(1em - 22px) calc(.5em - 22px) calc(.6em - 22px); color: var(--muted); }
.named .fav .ic { width: 1.2em; height: 1.2em; margin: 0; stroke-width: 2; vertical-align: 0; }
.fav[aria-pressed="true"] { color: var(--accent-ink); } .fav[aria-pressed="true"] .ic { fill: currentColor; }
.result.slim > .eyebrow:has(.fav)::after { padding-left: 1.6em; }
.pick-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; color: var(--accent-ink); font-weight: 600; letter-spacing: 0; text-transform: none; }
/* Its wash: 14% of the market's line colour (older iPhones: see "color-mix" at the end of the book's styles). */
@supports (color: color-mix(in srgb, red, blue)) { .pick-badge { background: color-mix(in srgb, var(--accent-line) 14%, transparent); } }
/* The number and its unit word sit on one line. With very large text on a narrow phone the word drops under the number, close to it. */
.count { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.16em; font-size: 3.5rem; font-weight: 600; letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Longer numbers step down, so the size and its unit stay on one line. */
.count.m { font-size: 2.9rem; } .count.l { font-size: 2.3rem; } .count.xl { font-size: 1.8rem; }
.result > .count { flex: 1 1 auto; }
.count span { font-size: 1rem; font-weight: 500; letter-spacing: 0; white-space: nowrap; color: var(--cap); }
/* On a plain tile the number is half the size: the pick is the answer, the other card is the alternative.
   The pick's number is in the market's ink (gold, green, blue or purple; a shade darker in light mode), its unit word stays grey. */
.result:not(.pick) .count { font-size: 1.75rem; letter-spacing: -0.03em; }
.result.pick .count { color: var(--accent-ink); }
.result > .log-btn { flex: none; }
/* "Log this trade": a quiet button with a thin grey outline, the same on the pick and on a plain tile, so the size
   stays the loudest thing on the card. It is 44px tall, so it is easy to tap. */
.log-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; font-weight: 600; font-size: 0.9rem;
  color: inherit; background: transparent; border: 1px solid var(--line); }
/* A line icon inside a line of words (the star, the pen, the warning sign) is as tall as the words and grows with
   them when the text is made larger. */
.pick-badge .ic, .log-btn .ic, .nofit-note .ic, .limit-warn .ic, .day-limit .ic { width: 1.05em; height: 1.05em; vertical-align: -.15em; margin-right: 5px; }
/* The facts (risk, take profit, take-profit price) and any warning come before the Log button in the page, which is
   the order a screen reader reads them in, and are drawn after it: the button shares the first line with the size
   when both fit, and drops under the size by itself when they do not (at any text size, because that is plain
   wrapping). On a narrow card the button goes to the foot of the card instead, under the facts, and the Forex
   "units" column steps aside so the other facts are not squeezed. */
.facts, .limit-warn { order: 1; }
@container (max-width: 19.5em) { .result > .log-btn { order: 2; } .result .facts > .per-unit { display: none; } }
.facts { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 6px 14px; margin-top: 4px; padding-top: 8px; border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  font-size: 0.75rem; font-weight: 500; color: var(--cap); font-variant-numeric: tabular-nums; }
/* Each fact is a small column: its label ("Risk"), its number ("$500.00"), its small print ("$250.00 per contract"). */
.risk-line, .reward-line, .tp-price, .facts > .per-unit { display: flex; flex-direction: column; gap: 1px; }
/* app.js writes the label and its number inside one span. This lets each of them take its own line of the column. */
.risk-line > span:first-child, .reward-line > span:first-child { display: contents; }
/* Forex units: the number is written before the word "units". The word is the label here, so it goes on top. */
.facts > .per-unit { flex-direction: column-reverse; }
/* The numbers are larger and in the full ink. The small print under them keeps its small size, also in the full ink. */
.facts strong, .facts > .per-unit { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.risk-line .per-unit, .reward-line > span + span strong { font-size: inherit; color: var(--text); font-weight: 600; }
.per-unit span { font-size: 0.75rem; font-weight: 500; color: var(--cap); }
/* Green for a profit and red for a loss, on every card (the pick too, now that it is no longer a filled plate: on
   the green Stocks plate a green number could not be read). The number also carries its plus or minus sign, so a
   profit and a loss are never told apart by colour alone. */
.reward-line .win { color: var(--win); }
.reward-line .loss { color: var(--error); }
/* "incl. $2.48 fees" is the same size as the other small print (it used to be smaller, 10px, and hard to read). */
.fee-note { font-size: inherit; }
/* The sentence on a card with nothing to size yet: what is missing, said once ("Enter your risk above"). */
.empty { font-size: 1.05rem; font-weight: 650; line-height: 1.35; }

/* Footer */
footer { margin-top: 6px; font-size: 0.8rem; line-height: 1.5; color: var(--muted); }
footer p { margin: 0 0 8px; }
footer a { color: var(--text); display: inline-block; min-width: 44px; min-height: 44px; line-height: 44px; } /* easy to tap */
details { margin-bottom: 8px; }
summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--text); }
.links { margin: 0; padding-left: 18px; }

@media (min-width: 400px) { main { --gap: 14px; } .card { padding: 16px; } }
@media (max-width: 350px) {
  .segmented button { font-size: 0.85rem; padding: 6px 4px; }
}

/* Privacy / info page */
.doc { gap: 0; line-height: 1.55; overflow-wrap: break-word; }
.doc h1 { font-size: 1.8rem; letter-spacing: -0.02em; margin: 8px 0 4px; }
.doc h2 { margin: 22px 0 6px; }
.doc p, .doc li { color: var(--text); }
.doc ul { padding-left: 20px; margin: 0; }
.doc a { color: var(--accent-line); }
.back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; }

/* Bottom navigation */
/* The room under every page for the bar of tabs, so that the last line of a page can always be scrolled clear of
   the bar. It used to be 96px whatever the text size, while the bar grows with the text: with text at 200% on a
   screen 600px wide or more (a phone on its side, a tablet) "Prop Firms" takes two lines and the bar is 101px
   tall, so the last line of every page ended under it.
   Now the room is worked out from the same letter size the tabs use (--nav-font, at the top of this file: the
   smaller of 0.72rem and 3.4vw on a phone, and of 0.72rem and 17px on a screen 600px wide or more), for the
   tallest the bar can be. Since the five tabs (Nov 28 2026) that is the bar every time: three names stand on two
   rows ("Prop" over "Firms", "Trade" over "Journal", "Daily" over "Journal"). Since the floating bar (Nov 29 2026,
   below) it is counted as: 16px (the bar's two hairlines, its 3px of padding above and below, and the tab's own 5px
   above and 4px below the icon and names) + 22px (the icon and the gap under it) + two rows of letters (drawn at
   1.15 times the letter size, counted here at 1.3) = the bar; then 8px for the lift under the bar (on a phone with a
   home line the lift sits inside the safe area, which is added on top of the room) and 11px of air (more in
   truth: the rows of letters are drawn shorter than counted, and scripts/qa.mjs measures 12px or more). That is
   57px + 2.6 times the letter size. Never less than the old 96px, which is what it still comes to at normal text
   size and on every phone held upright (the bar itself is about 63px tall there, 67px with text at 200%, and floats
   8px up), so nothing moves there.
   The same room keeps a box that takes the focus clear of the bar (html, at the top of this file) and lifts the
   Undo message above it (.toast). */
/* --kb-room: page added under the last card while an iPhone's keyboard is up over the calculator's trade card (app.js
   liftField). An iPhone lays its keyboard over the page without making the page's window shorter, so the page ended
   too soon for the box being typed in to reach the top. Only then is html.kb-room set; never on Android (the window
   itself gets shorter) or anywhere else. Its rule comes after the page's own, below. */
main { padding-bottom: calc(var(--nav-room) + env(safe-area-inset-bottom, 0px)); }
html.kb-room main { padding-bottom: calc(var(--nav-room) + env(safe-area-inset-bottom, 0px) + var(--kb-room, 0px)); }
/* The bottom bar: Markets, Prop Firms, Trade Journal, Daily Journal, Calculator (the owner's five tabs, Nov 28 2026:
   the Journal's two halves, the trades and the daily card, are two tabs of their own, with no switch at the top of
   the Journal any more). Its tabs share the width equally, however many are showing (Prop Firms can be switched off,
   and Markets is hidden while there is only one market): five, four or three.
   Since Nov 29 2026 the bar floats (the owner: "like a floating thing", that "reacts on the touch", where the chosen
   tab is seen "not just the letter"): a rounded bar lifted a little off the bottom edge, with room left and right,
   filled a shade lighter than the page (the surface colour; in light mode white on the grey page) and edged with a
   hairline. Its lift (--nav-lift) is 8px on a screen with no home line; on a phone with one it is the safe area less
   10px (24px on an iPhone with a 34px home-line area): the bar stays clear of the home line and of the swipe up from
   the bottom edge, and does not stand higher than it needs to. Left and right it keeps 10px from the edge, more with
   the phone on its side (the rounded corners and the camera notch). From 600px wide it is at most 560px wide, in the
   middle. The page scrolls on under it and shows around it; the room under every page (--nav-room above) keeps the
   last line clear of it. A sheet (Add trade, the Trading Book's room, a picture) covers it: the bar is inside
   main, and on a phone, or with the keyboard up, main's other children are not drawn while a sheet is up. */
html { --nav-lift: max(8px, calc(env(safe-area-inset-bottom, 0px) - 10px)); }
.bottom-nav { position: fixed; left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: var(--nav-lift); z-index: 20;
  max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 3px; padding: 3px;
  background: var(--surface); border: 0.5px solid var(--nav-edge); border-radius: 22px; box-shadow: inset 0 1px 0 var(--nav-gloss), var(--nav-shadow); }
/* Under the bar and a little up its sides, the page fades into the background colour (solid under the bar, then a
   28px fade), so the lines scrolling past below and beside it do not show as a busy strip: the bar stands on a calm
   ground. A fixed picture drawn once (no blur, nothing that follows the scrolling), not drawn in the browser's side menu. */
main::after { content: ''; position: fixed; left: 0; right: 0; bottom: 0; z-index: 19; height: calc(var(--nav-lift) + 28px); background: linear-gradient(to top, var(--bg) var(--nav-lift), transparent); pointer-events: none; }
body.welcoming main::after { display: none; }
/* The hairline: a little of the text colour over the bar's own, so it is seen on true black as on the grey page (the
   line colour is nearly black there); written as a see-through white or ink (rgba), which every phone reads, iOS 15
   too. Along the top edge, inside the hairline, a fine lighter line (--nav-gloss) catches the light, so the bar reads
   like a pane lying on the page. The shadow and that line are drawn once, never moved or changed: they cost nothing
   when tapping. The tile behind the chosen tab (--nav-tile) is the same see-through white or ink. */
:root { --nav-edge: rgba(255, 255, 255, 0.13); --nav-gloss: rgba(255, 255, 255, 0.09); --nav-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.7); --nav-tile: rgba(255, 255, 255, 0.09); --nav-tint-share: 12%; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --nav-edge: rgba(15, 23, 42, 0.11); --nav-gloss: rgba(255, 255, 255, 0.85); --nav-shadow: 0 6px 20px -8px rgba(15, 23, 42, 0.16), 0 1px 2px rgba(15, 23, 42, 0.05); --nav-tile: rgba(15, 23, 42, 0.07); --nav-tint-share: 10%; } }
:root[data-theme="light"] { --nav-edge: rgba(15, 23, 42, 0.11); --nav-gloss: rgba(255, 255, 255, 0.85); --nav-shadow: 0 6px 20px -8px rgba(15, 23, 42, 0.16), 0 1px 2px rgba(15, 23, 42, 0.05); --nav-tile: rgba(15, 23, 42, 0.07); --nav-tint-share: 10%; }
/* A tab is a line icon over its name. The names always fit, even with big text on a small phone: their size is
   capped by the screen's width (--nav-font), so five names never push the bar wider than the phone. "Prop Firms",
   "Trade Journal" and "Daily Journal" stand on two rows (.nm, one word a row); "Markets" and "Calculator" are one
   word, on the level of the others' first row: every tab's icon and first row start at the top of the tab, and the
   tabs are all as tall as the tallest. The names are in a medium weight, in the quiet grey (6:1 and more on the bar),
   the chosen one in semibold and the text colour. Since the owner chose the finer look (Nov 30 2026) the letters are
   about 1px smaller than before (--nav-font, 0.66rem at most) and the icons' lines thinner (1.5px), so the bar is a
   little slimmer. */
.bottom-nav button { position: relative; isolation: isolate; min-height: 46px; padding: 5px 1px 4px; border-radius: 19px; color: var(--muted); font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; font-size: var(--nav-font); }
.bottom-nav .nm { line-height: 1.15; text-align: center; letter-spacing: 0.005em; }
.bottom-nav .nm > span { display: block; }
.bottom-nav .ic { width: 20px; height: 20px; stroke-width: 1.5; }
/* The chosen tab: a soft rounded tile behind its icon and name (a little of the text colour: lighter than the bar in
   dark mode, a light grey on the white bar in light mode), its name in the text colour, and its icon in the chosen
   market's own colour (--nav-mark, below). The bar is the one place outside the Calculator that tells the market.
   The tile is there on every tab, unseen: it shows by its opacity alone, so nothing is laid out again when a tab is
   chosen; a tab being pressed shows it at half. It lies under the icon and the name (z-index -1, inside the tab's own
   layer: isolation). */
.bottom-nav button::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--nav-tile); opacity: 0; pointer-events: none; }
.bottom-nav button[aria-pressed="true"] { color: var(--text); font-weight: 600; }
.bottom-nav button[aria-pressed="true"]::after { opacity: 1; }
/* The chosen tab's tile takes a faint tint of the market's colour (12% in dark mode, 10% in light), mixed over the grey
   tile laid on the bar, so it is solid and its words keep their contrast. Only where color-mix() is known: an older
   phone (iOS 15, iOS 16.0 and 16.1, an old Android WebView) keeps the plain grey tile above. */
@supports (color: color-mix(in srgb, red, blue)) {
  .bottom-nav button[aria-pressed="true"]::after { background: color-mix(in srgb, var(--nav-mark) var(--nav-tint-share), color-mix(in srgb, var(--nav-tile-ink) var(--nav-tile-share), var(--surface))); }
}
:root { --nav-tile-ink: #ffffff; --nav-tile-share: 9%; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --nav-tile-ink: #0f172a; --nav-tile-share: 7%; } }
:root[data-theme="light"] { --nav-tile-ink: #0f172a; --nav-tile-share: 7%; }
.bottom-nav button[aria-pressed="true"] .ic { color: var(--nav-mark); }
.bottom-nav button:active::after { opacity: 0.55; }
.bottom-nav button[aria-pressed="true"]:active::after { opacity: 1; }
/* The ring of a tab reached with the keyboard is drawn just inside the tab, so it is not cut by the bar's edge or
   run into the next tab. */
.bottom-nav button:focus-visible { outline-offset: -3px; }
/* The press: at once, as the finger lands, the tab dips a little (to 94%), and when it lifts it comes back with a
   small settle. Only its size changes (a transform) and the tile's opacity: nothing is laid out or painted again, and
   nothing is measured. With less motion asked for, there is no dip; the tile still shows. */
@media (prefers-reduced-motion: no-preference) {
  .bottom-nav button { transition: transform 0.34s cubic-bezier(0.3, 1.45, 0.5, 1); }
  .bottom-nav button::after { transition: opacity 0.16s ease; }
  .bottom-nav button:active { transform: scale(0.94); transition: transform 0.06s ease-out; }
  .bottom-nav button:active::after { transition-duration: 0.06s; }
}
/* The market colours of the chosen tab's icon: brighter and purer than the colours the cards use, so a 20px line icon
   reads crisp, and still four clearly different colours: Futures yellow, Stocks green, Crypto blue, Forex purple.
   Each stands out at 6:1 or more against the bar in dark mode (true black too) and 3:1 or more on the light tile, tinted
   or not (Futures is a deeper gold in light mode for that: #a87000, 3.26:1 on its tinted tile).
   Only the bar uses them. */
:root { --n-futures: #ffc531; --n-stocks: #34e0a1; --n-crypto: #5ea1ff; --n-forex: #b98cff; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --n-futures: #a87000; --n-stocks: #008f5d; --n-crypto: #1f66f2; --n-forex: #8b3dff; } }
:root[data-theme="light"] { --n-futures: #a87000; --n-stocks: #008f5d; --n-crypto: #1f66f2; --n-forex: #8b3dff; }
body { --nav-mark: var(--n-futures); }
body[data-asset="stocks"] { --nav-mark: var(--n-stocks); } body[data-asset="crypto"] { --nav-mark: var(--n-crypto); } body[data-asset="forex"] { --nav-mark: var(--n-forex); }
:root[data-prop-tab="off"] #navProp { display: none; } /* set before the first frame by os.js, kept in step by app.js */
/* The app has just loaded again by itself after a sync. os.js sets data-coming-back before the first frame and the
   page stays out of sight until the person is back where they were (comeBack in account-ui.js takes the mark off,
   and puts everything that would fade or slide in straight at its end): the Calculator and a half-drawn card never
   show for a moment in between. What shows instead is a short blank moment in the plain background colour. */
:root[data-coming-back] body { opacity: 0; }
/* 600px wide or more (a phone on its side, a tablet): the bar stays in the middle, 560px wide at most, and the letter
   size is capped at 16px there (3.1vw would grow with the screen, not with the tabs): "Calculator" at 16px still
   fits a fifth of the bar. */
@media (min-width: 600px) { html { --nav-font: min(0.66rem, 16px); } }
.view { display: flex; flex-direction: column; gap: var(--gap); }


/* Journal */
/* (The top of both journal tabs had a title row with the market chip until Nov 29 2026: the name is now in the top
   row of the app, and the chip is only on the calculator.) */
/* + ADD TRADE FLOATS (the owner's pick from pictures, Dec 2 2026: "A6 crystal pill"). Until then "+ Add trade" stood
   alone in a row at the top of the Trade Journal: the left of that row was empty and it pushed the whole page down.
   Now it is a pill that floats in the middle, 14px above the floating bar of tabs, on the Trade Journal only (the
   button hides on the Daily Journal: journal-ui.js showPane; after the trial the locked screen hides it with every
   other part of the Journal: .view.locked). So Week / Month / All time (or the Pending orders and Open trades cards)
   start right under the top row, with the same gap as on every other screen.
   The look: clear glass with a fine edge. The page shows through it, blurred a little and brightened (backdrop-filter),
   so it reads as a pane lying over the page; the words are white with a soft dark shadow, so they stay readable over
   a green or red calendar day or white words scrolling behind. The edge, the faint tint at its top and bottom and the
   "+" take the market's colour of the bar (--nav-mark: the chosen tab's icon), so the pill and the bar read as one
   piece (the shield in the top row stays gold in every market; the bar's mark does not, and the pill follows the bar).
   No glow. In light mode the glass is whiter (the page is light) and the words dark: the tokens below.
   Where it stands: the bar's lift (--nav-lift), then the bar's own height, then 14px. The bar is always 38px + two
   rows of its letters tall (3px padding and the hairline above and below, the tab's 5px and 4px, the 20px icon and
   its 2px gap; "Trade Journal" and "Daily Journal" always stand on two rows, at 1.15 times --nav-font): see "Bottom
   navigation" above. Worked out by the browser from the same numbers the bar uses, so nothing is measured and it
   follows the bar on every phone, with the home line, sideways and with large text. (38.5px, not 38: an iPhone draws
   the bar's 0.5px hairline as it is, Chrome and Android draw it 1px wide, so the bar is 1px taller there; the half
   pixel splits that, and the gap is 14px within half a pixel on both, measured in Chrome at 13.5px.)
   In the middle of the SCREEN (50vw, then back by half its own width), not of the page: with very large text on a
   small phone (300% at 320px) the page is wider than the screen, and a phone then spreads fixed things over the wider
   page (the bar too); the pill stayed whole on the screen only this way (scripts/qa.mjs checks it).
   It is part of main like the bar, so it goes wherever the bar goes: under a sheet (Add trade, the Trading Book's
   room, a picture: html.sheet-open hides main's other parts on a phone, and on a wider screen the sheet, z-index 40,
   lies over both); off with the Journal itself. (The Trade Journal has no typing box of its own: every one of them is in a sheet, and a sheet covers the pill.) */
:root { --pill-ink: #ffffff; --pill-ink-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); --pill-base: rgba(255, 255, 255, 0.03); --pill-tint-top: 16%; --pill-tint-end: 8%; --pill-edge: 55%;
  --pill-gloss: rgba(255, 240, 190, 0.5); --pill-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.8); --pill-glass: blur(5px) saturate(1.7) brightness(1.15); }
/* Light mode: whiter glass over the grey page and the white cards, the words in the text colour (near-black) with a
   faint white shadow, a softer shadow under it (as the bar's), the same fine edge in the market's deeper light colour. */
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --pill-ink: var(--text); --pill-ink-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); --pill-base: rgba(255, 255, 255, 0.6); --pill-tint-top: 12%; --pill-tint-end: 6%; --pill-edge: 50%;
  --pill-gloss: rgba(255, 255, 255, 0.95); --pill-shadow: 0 8px 22px -8px rgba(15, 23, 42, 0.28), 0 1px 2px rgba(15, 23, 42, 0.06); --pill-glass: blur(8px) saturate(1.5); } }
:root[data-theme="light"] { --pill-ink: var(--text); --pill-ink-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); --pill-base: rgba(255, 255, 255, 0.6); --pill-tint-top: 12%; --pill-tint-end: 6%; --pill-edge: 50%;
  --pill-gloss: rgba(255, 255, 255, 0.95); --pill-shadow: 0 8px 22px -8px rgba(15, 23, 42, 0.28), 0 1px 2px rgba(15, 23, 42, 0.06); --pill-glass: blur(8px) saturate(1.5); }
.add-pill { position: fixed; z-index: 20; left: 50vw; bottom: calc(var(--nav-lift) + 38.5px + 2.3 * var(--nav-font) + 14px); translate: -50% 0; width: max-content; max-width: calc(100vw - 2 * max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)));
  isolation: isolate; display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 0 24px 0 20px; border-radius: 999px;
  color: var(--pill-ink); font-weight: 650; font-size: 1rem; text-shadow: var(--pill-ink-shadow);
  background: linear-gradient(180deg, rgba(255, 215, 106, 0.16), transparent 45%, rgba(255, 215, 106, 0.08)), var(--pill-base);
  -webkit-backdrop-filter: var(--pill-glass); backdrop-filter: var(--pill-glass);
  border: 1px solid rgba(255, 215, 106, 0.55); box-shadow: inset 0 1px 0 var(--pill-gloss), var(--pill-shadow);
  transition: opacity 0.22s ease, transform 0.22s ease; }
.add-pill .plus { color: var(--nav-mark); font-size: 23px; font-weight: 500; line-height: 1; margin-top: -2px; text-shadow: none; }
/* The market's colour in the edge and the tint, where color-mix() is known (an older browser keeps the gold above,
   at the dark mode's strength). */
@supports (color: color-mix(in srgb, red, blue)) {
  .add-pill { border-color: color-mix(in srgb, var(--nav-mark) var(--pill-edge), transparent);
    background: linear-gradient(180deg, color-mix(in srgb, var(--nav-mark) var(--pill-tint-top), transparent), transparent 45%, color-mix(in srgb, var(--nav-mark) var(--pill-tint-end), transparent)), var(--pill-base); }
}
/* The press, as on the bar's tabs: a faint tile shows at once (the bar's --nav-tile), and the pill dips a little (to
   96%) and settles back. Only opacity and size change: nothing is laid out again. No dip with less motion asked for. */
.add-pill::after { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--nav-tile); opacity: 0; pointer-events: none; }
.add-pill:active::after { opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .add-pill:active { transform: scale(0.96); transition-duration: 0.06s; } }
/* While the page scrolls the pill steps aside: it fades out and slides 8px down, and about 300 ms after the page stops
   (an iPhone's glide too) it comes back (journal-ui.js, "the pill steps aside"). Only its opacity and its transform
   change, so the phone draws it without laying out or painting the page again. While away it takes no taps (a tap
   there lands on the page under it); it is still there for the keyboard and a screen reader (no display: none), and
   it shows at once when the keyboard reaches it. With less motion asked for it only fades. */
.add-pill.scrolling { opacity: 0; transform: translateY(8px); pointer-events: none; }
.add-pill.scrolling:focus-visible { opacity: 1; transform: none; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .add-pill.scrolling { transform: none; } }
/* Room under the page for the pill (its 50px and the 14px under it), so the last line of the Trade Journal can be
   scrolled clear of it, as every page's last line clears the bar; a box that takes the focus stops above it too; and
   the "Trade deleted · Undo" message stands above it instead of on it. Only while the pill shows. */
#journalView:not(.locked):has(> .add-pill:not([hidden])) { padding-bottom: 64px; }
html:has(> body > main > #journalView:not([hidden]):not(.locked) > .add-pill:not([hidden])) { scroll-padding-bottom: calc(var(--nav-room) + 64px + env(safe-area-inset-bottom, 0px)); }
#journalView:not([hidden]):not(.locked):has(> .add-pill:not([hidden])) ~ .toast { bottom: calc(var(--nav-room) + 56px + env(safe-area-inset-bottom)); }
.primary-btn { min-height: 48px; padding: 0 18px; border-radius: 14px; font-weight: 750; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat span { font-size: 0.75rem; color: var(--muted); font-weight: 650; }
.stat strong { font-size: clamp(0.95rem, 4.2vw, 1.15rem); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win { color: var(--win); } .loss { color: var(--loss); }
.trade-form textarea { width: 100%; min-height: 88px; font: inherit; font-size: max(1rem, 16px); color: inherit; background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: vertical; }
.trade-form textarea:focus { outline: none; border-color: var(--accent-line); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-actions .primary-btn { flex: 1; }
.danger { color: var(--error); border-color: var(--error); }
.trade-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.trade { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-height: 44px; }
.trade-top, .trade-mid { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.trade-top { justify-content: flex-start; }
.trade-sym { font-weight: 800; font-size: 1.05rem; }
.trade-mid { font-variant-numeric: tabular-nums; color: var(--muted); }
.trade-result { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 8px; align-items: baseline; min-width: 0; } /* (with the amount in one piece, below: an R with no room left beside it goes under it, at the right, never off the card) */
.trade-result strong { font-size: 1.1rem; white-space: nowrap; } /* the amount in one piece: "−" never left alone above "$124,970.00" (320 px from 150% text; the small look list before launch), as the day's total (.day-head strong) */
#dDays .trade-result strong { font-size: min(1.1rem, calc((var(--rmw, 100vw) - 66px) / (var(--c, 12) * .62))); } /* Contents of the Trading Book: a day's result stays whole (see "Money in one piece" in the book's styles) */
.r { font-size: 0.85rem; color: var(--muted); }
.open { color: var(--accent-line); font-weight: 700; }
.trade-notes { color: var(--text); font-size: 0.9rem; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.empty-state { margin: 0; padding: 20px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 14px; }

/* Market chip (calculator) and Markets screen */
/* The market chip is a button (it opens Markets). Its pill is drawn 6px inside the 44px tap area. Calm since Nov 29
   2026 (the owner chose it from pictures): a hairline edge in the line colour instead of the thick ring in the market's
   colour, the name in a medium weight, and only the small dot in the market's colour (its line colour, which reads
   on the page in light and dark). */
/* (Its corners are round too, so the keyboard's focus ring follows the pill instead of drawing a square box.) */
.market-chip { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin: -6px 0; padding: 12px 12px 12px 11px; font-size: 0.9rem; font-weight: 500; color: var(--text); border-radius: 999px; }
.market-chip::before { content: ''; position: absolute; z-index: -1; inset: 6px 0; border-radius: 999px; border: 1px solid var(--line); }
.market-chip .ic { margin: 0 -4px 0 -2px; color: var(--muted); }
.market-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-line); }
.market-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
/* A market card. A thick stripe of the market's own colour runs down its left edge, so the four markets can be told
   apart before one is chosen. The room on the right is for the tick. */
.market-card { position: relative; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 18px 54px 18px 18px; min-height: 84px; border-radius: 18px;
  background: var(--surface); border: 1.5px solid var(--line); border-left: 8px solid var(--m); color: var(--text); }
.market-card strong { font-size: 1.25rem; letter-spacing: -0.01em; }
.market-card span { color: var(--muted); font-size: 0.9rem; }
.market-card.futures { --m: var(--c-futures); --m2: var(--g-futures); --mo: var(--o-futures); }
.market-card.stocks { --m: var(--c-stocks); --m2: var(--g-stocks); --mo: var(--o-stocks); }
.market-card.crypto { --m: var(--c-crypto); --m2: var(--g-crypto); --mo: var(--o-crypto); }
.market-card.forex { --m: var(--c-forex); --m2: var(--g-forex); --mo: var(--o-forex); }
/* The chosen market: the filled plate (see --shine) and a tick (never colour alone). It is the one filled thing on Markets. */
.market-card[aria-pressed="true"] { background: var(--shine), linear-gradient(135deg, var(--m), var(--m2)); color: var(--mo); border-color: transparent; box-shadow: var(--plate), 0 16px 30px -18px var(--m); }
/* The tick. There is one in the page; app.js moves it onto the card of the chosen market. It sits in the middle of
   the card's right side and takes the colour of the words on the plate. */
.market-card .ic { position: absolute; right: 20px; top: 50%; width: 24px; height: 24px; margin-top: -12px; }
/* The chosen market is the one filled thing on Markets (tests/colours.test.mjs checks it). So the main buttons in the
   cards under the market list ("Email me a code", "Back up" and the like) are outlined here, not filled:
   two filled things on one screen would compete, and the eye would not know which one is "where I am". */
.market-grid ~ * .primary-btn { background: none; border: 1.5px solid var(--accent-line); color: var(--accent-ink); }
/* And only one of them is in the market colour: the Account card's ("Email me a code", "Sign in"), as signing in is
   how a purchase and the trades reach this device. "Back up" is the same plain button as Restore beside it (.ghost,
   below), and so is the Restore question's "Restore", with a plain border round the question. (The fresh reviews of
   39ce13c and cf23ec7: two buttons in the market colour on one screen, and a market-coloured border, while a Restore
   question was open.) */
.market-grid ~ .data-card #restoreYes { border-color: var(--line); color: var(--text); }
.market-card[aria-pressed="true"] span { color: inherit; } /* full strength: easy to read on the plate */


/* Journal dashboard */
.period button { font-size: 0.9rem; }
.dashboard { display: flex; flex-direction: column; gap: 8px; }
.hero-pnl { gap: 4px; overflow: hidden; }
.hero-pnl .eyebrow { color: var(--muted); }
.hero-pnl > strong { font-size: clamp(1.9rem, 9vw, 2.6rem); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; }
.hero-sub { color: var(--muted); font-size: 0.9rem; }
.equity { width: 100%; height: 64px; margin-top: 6px; color: var(--muted); }
.equity.win { color: var(--win); } .equity.loss { color: var(--loss); }
.equity .line { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.equity .area { fill: currentColor; opacity: 0.14; }
.equity .zero { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat small { color: var(--muted); font-size: 0.75rem; overflow-wrap: anywhere; }
/* INSIGHTS (insights-ui.js; the look the owner picked from pictures, Dec 3 2026). The entry in the Trade Journal: one
   button of at most two lines, a small gold label over one sentence, a gold chevron at the right; a faint gold glow in its
   top left corner and a thin gold-tinted line round it. Gold is kept for what matters most: no other colour here. */
.insights { position: relative; display: block; width: 100%; margin: 0; padding: 13px 40px 14px 16px; border-radius: 16px; text-align: start; color: var(--text);
  border: 1px solid var(--line); border-color: color-mix(in srgb, var(--hi) 38%, var(--line));
  background: radial-gradient(120% 120% at 0 0, color-mix(in srgb, var(--hi) 10%, transparent), transparent 60%), var(--surface); }
.insights[hidden] { display: none; }
.ins-label { display: block; margin-bottom: 4px; font-size: 0.68rem; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hi); }
/* (Always two lines high, also for a short sentence: the sentence may change a moment after a save, journal-ui.js paintEntry,
   and nothing under the entry may move then.) */
.ins-text { min-height: 2.7em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: 0.92rem; font-weight: 600; line-height: 1.35; }
.ins-go { position: absolute; right: 16px; top: 50%; width: 8px; height: 14px; margin-top: -7px; fill: none; stroke: var(--hi); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* The Insights window: the sheet of the Trading Book's room (.sheet, .tf), true black like the page, its cards as the mock
   draws them: 20px corners, 18px inside, 12px apart. Its own few shades: --faint (small print), --track (the empty part
   of a ring or bar), --ink (a neutral bar or ring: never red, the owner's "no thick red bars"). */
.ins { --faint: #6b7380; --track: rgba(255, 255, 255, 0.07); --ink: rgba(255, 255, 255, 0.78); font-size: 1rem; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .ins { --faint: #8a93a1; --track: rgba(15, 23, 42, 0.07); --ink: rgba(15, 23, 42, 0.72); } }
:root[data-theme="light"] .ins { --faint: #8a93a1; --track: rgba(15, 23, 42, 0.07); --ink: rgba(15, 23, 42, 0.72); }
.ins .num { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; } /* (a "−" never parts from its amount) */ .ins .win { color: var(--win-ink); } .ins .loss { color: var(--loss-ink); }
.ins-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
.ins-head h2 { margin: 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; }
.ins-close { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); }
.ins-close .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.ins-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 2px max(16px, env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
/* (The panel and its scrolling part take the focus only from code, when the window opens or a row is gone: no ring, they
   are no controls (as #importTitle above). The buttons inside keep theirs. The ids outweigh web.css's :focus-visible.) */
#insPanel:focus, #insBody:focus { outline: none; }
.ins-seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; margin-bottom: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
/* (44 px tall, a full finger's target, as the Trade Journal's own Week / Month / All time (.segmented button): it drew
   40 px before the fourth hunt.) */
.ins-seg button { min-height: 44px; padding: 0 4px; border-radius: 10px; font-size: 0.86rem; font-weight: 650; color: var(--muted); }
.ins-seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.ins-card { margin: 0 0 12px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.ins-eye { margin: 0 0 12px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.ins-eye small { flex: none; font-size: 0.72rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--faint); }
/* The one thing to know: the only card with the gold line and glow. */
.ins-lead { border-color: color-mix(in srgb, var(--hi) 38%, var(--line)); background: radial-gradient(120% 80% at 0 0, color-mix(in srgb, var(--hi) 10%, transparent), transparent 60%), var(--surface); }
.ins-lead .ins-eye { color: var(--hi); }
.ins-big { margin: 0; font-size: 1.28rem; line-height: 1.32; font-weight: 700; letter-spacing: -0.02em; text-wrap: pretty; }
.ins-sub { margin: 10px 0 0; font-size: 0.82rem; line-height: 1.4; color: var(--muted); text-wrap: pretty; }
.ins-sub .num { font-weight: 650; }
/* Clean trades against mistakes */
.ins-duo { display: flex; align-items: center; gap: 12px; }
.ins-donut { flex: none; position: relative; width: 72px; height: 72px; }
.ins svg circle { fill: none; } .ins-donut svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.ins-donut circle { stroke-width: 9; } .ins-trk { stroke: var(--track); }
.ins-arc-win { stroke: var(--win); stroke-linecap: round; } .ins-arc-loss { stroke: var(--loss); stroke-opacity: 0.75; stroke-linecap: round; }
.ins-arc-gold { stroke: var(--hi); stroke-linecap: round; } .ins-arc-ink { stroke: var(--ink); stroke-linecap: round; }
.ins-mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
/* (The ring stays 96px; its words stop growing at the size that still fits inside it, so at 160% text "74%" never runs
   over the arc.) */
.ins-mid strong { font-size: min(1.05rem, 16px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; } .ins-mid span { margin-top: 2px; font-size: min(0.6rem, 10px); color: var(--muted); }
/* The two rows are always laid out alike (fix round 2, the iPhone's own text runs a touch wider than Chrome's): name and
   amount on one line while the legend is wide enough for BOTH rows, else the amount under the name in BOTH. How wide is
   enough depends on how long the amounts are: insights-ui.js marks the legend l7 (up to "−$3,450"), l9 (up to "−$123,456",
   at a slightly smaller size) or stack (longer); the widths below are those rows measured in Chrome (200 and 207 px) plus
   about 11 px of room, in em so that they grow with the text size (130% and 160% stack). The ring is 72 px and its gap
   12 px so that both fit on one line on a 375 px phone (room left there: 19 px, and 12 px with "−$103,500"; on a 402 px
   phone 46 and 39). */
.ins-legend { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; container: ins-legend / inline-size; }
.ins-legend > div { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; column-gap: 8px; align-items: baseline; }
.ins-legend.l9 .ins-v { font-size: 0.92rem; }
@container ins-legend (width < 13.2em) { .ins-legend.l7 > div { grid-template-columns: 8px minmax(0, 1fr); } .ins-legend.l7 .ins-v { grid-column: 2; justify-self: end; } }
@container ins-legend (width < 13.6em) { .ins-legend.l9 > div { grid-template-columns: 8px minmax(0, 1fr); } .ins-legend.l9 .ins-v { grid-column: 2; justify-self: end; } }
.ins-legend.stack > div { grid-template-columns: 8px minmax(0, 1fr); } .ins-legend.stack .ins-v { grid-column: 2; justify-self: end; }
.ins-dot { width: 8px; height: 8px; border-radius: 50%; align-self: center; } .ins-dot.win { background: var(--win); } .ins-dot.loss { background: var(--loss); }
.ins-legend .ins-k { min-width: 0; white-space: nowrap; font-size: 0.88rem; font-weight: 650; } .ins-legend .ins-v { font-size: 1.12rem; font-weight: 750; }
.ins-legend .ins-s { grid-column: 2 / -1; margin-top: 2px; font-size: 0.78rem; color: var(--muted); }
/* Rows (a mistake, a line in the notes): name and count, the result, a chevron when the row opens the Trading Book, and a
   thin neutral line under it, as long as its result against the biggest. */
.ins-rows { margin: 0 -18px -18px; }
/* (minmax(0, 1fr): the name's column may be narrower than its longest word, which then breaks, so a long unbroken word
   in a note or a seven-figure amount never pushes the amount and the chevron out of the card: the fourth hunt.) */
.ins-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; align-items: center; column-gap: 10px; width: 100%; padding: 14px 18px; border-top: 1px solid var(--line); text-align: start; color: var(--text); }
.ins-nm, .ins-meta, .ins-k, .ins-v, .ins-s { display: block; }
.ins-nm { font-size: 0.98rem; font-weight: 650; overflow-wrap: break-word; } /* (a word breaks only when it alone is wider than the line) */ .ins-meta { margin-top: 3px; font-size: 0.78rem; color: var(--muted); }
.ins-amt { font-size: 1rem; font-weight: 700; text-align: right; white-space: nowrap; }
.ins-chev { width: 8px; height: 14px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ins-hair { grid-column: 1 / -1; height: 3px; margin-top: 10px; border-radius: 3px; background: var(--track); overflow: hidden; }
.ins-hair i { display: block; width: 0; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--ink), color-mix(in srgb, var(--ink) 45%, transparent)); }
/* Your setups: a ring each, its win rate in it; the best one in gold with a small "Best" mark. */
.ins-setup { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.ins-setup > div:nth-child(2) { flex: 1 1 8em; min-width: 0; } .ins-setup > .ins-amt { margin-left: auto; } /* (with large text the amount drops under the name) */
.ins-setup:first-of-type { border-top: 0; padding-top: 0; } .ins-setup:last-child { padding-bottom: 0; }
.ins-ring { position: relative; flex: none; width: 42px; height: 42px; } .ins-ring svg { width: 42px; height: 42px; transform: rotate(-90deg); } .ins-ring circle { stroke-width: 4; }
.ins-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.68rem; font-weight: 750; }
.ins-best { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 0.64rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 2px;
  color: var(--hi); border: 1px solid color-mix(in srgb, var(--hi) 45%, transparent); }
/* Two numbers side by side (Your hours, Your plan, After a loss), and the sentence under them. */
.ins-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .ins-pair.long, .ins-feel.long { grid-template-columns: 1fr; }
.ins-pair > div { min-width: 0; overflow-wrap: anywhere; padding: 13px 14px; border-radius: 14px; background: var(--surface-2); }
.ins-pair .ins-k { font-size: 0.74rem; font-weight: 600; color: var(--muted); } .ins-pair .ins-v { margin-top: 5px; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; }
.ins-pair .ins-v small { font-size: 0.8rem; font-weight: 600; color: var(--muted); letter-spacing: 0; } .ins-pair .ins-s { margin-top: 3px; font-size: 0.74rem; color: var(--muted); }
.ins-note { margin: 10px 0 0; font-size: 0.8rem; line-height: 1.45; color: var(--muted); } .ins-note.ins-first { margin: 0 0 12px; } .ins-note b { color: var(--hi); font-weight: 650; }
.ins-note .num { font-weight: 650; }
.ins-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: calc(100% + 36px); margin: 14px -18px -18px; padding: 14px 18px; border-top: 1px solid var(--line); text-align: start; font-size: 0.9rem; font-weight: 650; color: var(--hi); }
.ins-link .ins-chev { flex: none; stroke: var(--hi); }
/* How you felt */
.ins-feel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ins-feel > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.ins-feel .ins-k { font-size: 0.9rem; font-weight: 650; } .ins-feel .ins-k small { margin-left: 6px; font-size: 0.74rem; font-weight: 500; color: var(--muted); }
.ins-feel .ins-v { margin-top: 6px; font-size: 1.05rem; font-weight: 750; }
.ins-small { margin: 14px 0 0; font-size: 0.74rem; line-height: 1.45; color: var(--faint); }
.ins-notes .ins-rows + .ins-small { margin-top: 32px; }
/* Still learning: a small gold ring each, how far along it is. */
.ins-learn { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.ins-learn:first-of-type { border-top: 0; padding-top: 0; } .ins-learn:last-child { padding-bottom: 0; }
.ins-learn svg { width: 34px; height: 34px; transform: rotate(-90deg); } .ins-learn circle { stroke-width: 4; }
.ins-learn .ins-nm { font-size: 0.92rem; } .ins-learn .ins-meta { margin-top: 2px; }
.ins-foot { margin: 18px 12px 0; text-align: center; font-size: 0.74rem; line-height: 1.5; color: var(--faint); }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-head h2 { margin: 0; font-size: 1.05rem; }
.icon-btn { min-width: 44px; font-size: 1.4rem; line-height: 1; padding: 0; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
/* The Trades calendar has an eighth column: the total of each week, in a quiet badge (see the premium look below).
   It is a little wider than a day (1.1 of a day) and stands 3 px further off, so it reads as a sum beside the days,
   not as a day. (The month picker in the Daily Journal uses .calendar too and stays at seven columns.) The squares
   are taller than a plain calendar day (60 px since the premium look of Nov 29 2026, 48 px before), so the date and
   the amount under it have air.

   How big the amounts are. A square cannot grow sideways, so an amount must never be wider than its square.
   journal-ui.js works out how wide the widest amount of the month is, in ems (--day for the days, --week for the
   week totals; an em is the height of the letters), and the size here is "the width of the square divided by
   that number", up to 0.85rem (0.7rem before Nov 29 2026). So all the amounts of a month have one size, as large
   as the widest one allows, and none can be cut: not a loss in the millions, not on the smallest phone, not with
   very large text. The numbers on the next line are for a month with nothing closed.

   The width of the square comes from the "cqw" unit (hundredths of the square's own width). iPhones on iOS 15
   and other browsers from before 2022 do not know that unit, so the first two size rules work the width out from
   the screen instead: a phone's squares are (screen − 86px) / 8.1 wide (the page's and the card's edges take
   about 62 px, the seven 3 px gaps 21, and 3 more are kept spare; the eight columns are 7 + 1.1 squares). A week's
   badge is 1.1 squares less its 3 px margin and its two 1 px edges. So 0.1198 is 0.97 / 8.1, and the week's
   0.1317 and 4.85px are 0.97 × 1.1 / 8.1 and 0.97 × 5 px. An amount may take 97% of its square or badge: the
   widths in journal-ui.js are already counted a little wide, so even "−$458k" keeps about a pixel of air on each
   side (1.2 px on a 390 px phone, 0.6 px on a 320 px one, measured). A screen wider than a phone is counted as 430 px there,
   which keeps the amounts on the small, safe side. Browsers that do know the unit use the exact rules inside
   "@supports". They have to sit inside it: a rule that contains var() is never thrown away by a browser that
   cannot read the rest of it, so simply writing the newer rule after the older one would not work here. */
.calendar.weeks { grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.1fr); --day: 3.4; --week: 3.7; }
.calendar.weeks .cal-day { min-height: 60px; }
.calendar.weeks .cal-day i { font-size: clamp(6px, calc((min(100vw, 430px) - 86px) * 0.1198 / var(--day)), 0.85rem); }
.cal-week { display: flex; align-items: center; justify-content: center; min-width: 0; color: var(--muted); }
.cal-week i { font-style: normal; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; font-size: clamp(6px, calc(((min(100vw, 430px) - 86px) * 0.1317 - 4.85px) / var(--week)), 0.85rem); }
@supports (width: 1cqw) {
  .calendar.weeks .cal-day, .cal-week { container-type: inline-size; }
  .calendar.weeks .cal-day i { font-size: clamp(6px, calc(97cqw / var(--day)), 0.85rem); }
  .cal-week i { font-size: clamp(6px, calc(97cqw / var(--week)), 0.85rem); }
}
/* The month's name with the month's total under it: the largest number on the card, in the win or loss colour.
   Its size is capped by the screen's width as well, so a seven-figure month still fits between the two arrows on
   the smallest phone, also with very large text. A month with nothing closed keeps the total's line, empty (the
   ::before holds a letter with no width), so the month's name stays in the same place while months are turned. */
.cal-what { flex: 1 1 0; min-width: 0; text-align: center; }
.cal-total { margin: 2px 0 0; font-size: min(1.25rem, 5.6vw); font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.cal-total:empty::before { content: '\200b'; }
.cal-dow { text-align: center; font-size: 0.7rem; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
/* The word "Week" above the week totals is the one heading that is a whole word, and its column cannot grow. With
   the phone's text set large the word became wider than the column and ran into the card's edge. Its size is the
   heading size, or less when the column is too narrow for that: the word is about 2.7 times as wide as it is
   tall, the column is 1.1 squares less the badge's 3 px margin, and a square is (screen − 86px) / 8.1 (see above),
   which makes 0.0407 x (screen − 86px) − 0.9px the largest size that still leaves a little air on both sides.
   When it is smaller than the letters beside it, it stands on the same line as their feet (align-self), not up
   at their heads. */
.calendar.weeks .cal-dow:nth-child(8) { margin-left: 3px; font-size: min(0.74rem, calc((min(100vw, 430px) - 86px) * 0.0407 - 0.9px)); white-space: nowrap; align-self: end; }
.cal-day { min-height: 44px; border-radius: 8px; background: var(--field); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; overflow: hidden; min-width: 0; }
.cal-day.blank { background: transparent; }
.cal-day b { font-size: 0.72rem; font-weight: 650; color: var(--muted); }
.cal-day i { font-style: normal; font-size: 0.62rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-day.has.win { background: rgba(34, 197, 94, 0.2); } .cal-day.has.win i { color: var(--win); }
.cal-day.has.loss { background: rgba(248, 113, 113, 0.2); } .cal-day.has.loss i { color: var(--loss); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--accent-line); }
/* The day chosen with a tap (journal-ui.js, "One day"): a ring OUTSIDE the square's edge, 2 px wide in the 3 px gap
   between squares, and its number in the accent; a day with no trades also gets the light accent fill a pressed chip
   has. A ring inside the edge lay over the amount, which can be as wide as the square ("−$500": the review of pull
   request 175). A shadow takes no room, so nothing moves; the grid's gap and the card's padding keep it whole and
   clear of the next square. Today's own ring stays inside, so a day that is today and chosen shows both. */
.cal-day.chosen { box-shadow: 0 0 0 2px var(--accent-line); }
.cal-day.today.chosen { box-shadow: inset 0 0 0 1.5px var(--accent-line), 0 0 0 2px var(--accent-line); }
.cal-day.chosen b { color: var(--accent-ink); font-weight: 800; }
.cal-day.chosen:not(.has) { background: color-mix(in srgb, var(--accent-line) 12%, var(--field)); }
.cal-month { margin: 0; font-size: 0.9rem; color: var(--muted); }
/* The premium look of the Trades calendar (Nov 29 2026, approved by the owner from before / after pictures). Only the
   Trades calendar (.calendar.weeks) with its week badges: the Daily Journal's month picker keeps the plain squares.
   - A day with nothing closed is a plain number, with no box round it, so the days that traded stand out.
   - Everything is thinner than before but sharp, like a high-definition screen: lighter weights, strong colours,
     never a faint grey for what matters. Each kind of text has the size and weight of its job, and is never harder
     to read than before (the owner's first rule: clarity). The month's total is the strongest thing on the card
     (700, the largest size); the month's name 600; the weekday letters small and quiet (500, grey: 7.3 : 1 or more
     on a dark card, 6.0 on a light one).
   - The day numbers are bigger, in the page's own text colour (pure white in dark mode, 12.8 : 1 or more): regular
     (400) on an empty day, medium (500) on a tile. A number is never wider than its square: its size is 1.2rem, or
     less when the square is too narrow for that (a two-figure number is about 1.2 times as wide as it is tall, so
     75% of the square's width leaves air on both sides; the same "screen − 86px" counting as the amounts above: 0.0926
     is 0.75 / 8.1).
   - A traded day is a tall tile (60 px) that fills its whole cell, so a run of traded days reads as a row of solid
     blocks with a thin 3 px seam between them: a deep green with a bright green amount, or the matching red. The
     money is semibold (600), in figures of one width, as large as its square allows: bigger than before (the
     semibold letters are narrower than the heavy ones, a touch closer together (-0.01em), and the cap is 0.85rem):
     "−$458k" is about 9 px on a 390 px phone (it was 8.6), with about a pixel of air on each side.
   - The colours are the calendar's own (--cal-*), set for dark here and for light below, for the days and the
     week badges. Measured contrast of the amount on its tile (WCAG asks 4.5 : 1): light 4.93 green, 5.11 red; dark 7.86
     green, 7.06 red. (The light green amount is a shade darker than the owner's picture, #0f7a3a, which was 4.44.)
   - 8 px between the rows: air between the weeks. The ring of a tapped day (2 px, outside the square) sits in the
     3 px seam, as before. Today has a small dot instead of a ring (see below). Days still to come are very dim (0.25):
     their numbers are in the full text colour now, so the usual 0.35 of a switched-off button read as nearly ready.
   Plain colours and sizes only: no shadow, blur, picture or animation, so nothing costs a frame. */
.calendar.weeks { --cal-win: #0b3323; --cal-win-ink: #3ddc97; --cal-loss: #3d1417; --cal-loss-ink: #ff8a8a; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .calendar.weeks { --cal-win: #d3efdc; --cal-win-ink: #0c7236; --cal-loss: #fbdcdc; --cal-loss-ink: #b42323; } }
:root[data-theme="light"] .calendar.weeks { --cal-win: #d3efdc; --cal-win-ink: #0c7236; --cal-loss: #fbdcdc; --cal-loss-ink: #b42323; }
.calendar.weeks { gap: 8px 3px; }
.calendar.weeks .cal-dow { font-size: 0.74rem; font-weight: 500; padding-bottom: 6px; }
.cal-what h2 { font-weight: 600; } .cal-what .cal-total { font-weight: 700; }
.calendar.weeks .cal-day { border-radius: 12px; gap: 3px; background: transparent; }
.calendar.weeks .cal-day b { font-size: min(1.2rem, calc((min(100vw, 430px) - 86px) * 0.0926)); font-weight: 400; color: var(--text); }
.calendar.weeks .cal-day.has { background: var(--surface-2); }
.calendar.weeks .cal-day.has b { font-weight: 500; }
.calendar.weeks .cal-day.has i { font-weight: 600; letter-spacing: -0.01em; }
.calendar.weeks .cal-day.has.win { background: var(--cal-win); } .calendar.weeks .cal-day.has.win i { color: var(--cal-win-ink); }
.calendar.weeks .cal-day.has.loss { background: var(--cal-loss); } .calendar.weeks .cal-day.has.loss i { color: var(--cal-loss-ink); }
.calendar.weeks .cal-day.chosen b { color: var(--accent-ink); font-weight: 600; }
.calendar.weeks .cal-day.chosen:not(.has) { background: color-mix(in srgb, var(--accent-line) 12%, transparent); }
@supports (width: 1cqw) { .calendar.weeks .cal-day b { font-size: min(1.2rem, 75cqw); } }
.calendar.weeks button.cal-day:disabled { opacity: 0.25; }
/* Today, in the Trades calendar: a small dot in the accent under the day (under its amount on a tile), not a ring,
   so it never looks like the tapped day's ring (2 px, outside the square), which stays as it is. The dot is drawn
   in the tile's own corner space (absolute, 4 px across, 5 px from the bottom), so the number and the amount do not
   move. A tile is at least 60 px and its number and amount take about 32, so the dot stays clear of them, also on
   a 320 px phone and with very large text. The Daily Journal's month picker keeps its ring for today. */
.calendar.weeks .cal-day.today { box-shadow: none; }
.calendar.weeks .cal-day.today.chosen { box-shadow: 0 0 0 2px var(--accent-line); }
.calendar.weeks .cal-day.today::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent-line); pointer-events: none; }
/* The week totals (the eighth column): a soft badge per row, the same height and corners as a day's tile, a
   shade off the calendar's card (3% of the text colour mixed in) with a hairline edge, never a green or red fill,
   so a week never reads as a day. The total inside is medium (500), green or red; a week with nothing closed has
   no badge at all (no fill, no edge), only a quiet "—". The badge stands 3 px further off than the days' seam, so the column reads as a sum. */
.calendar.weeks .cal-week { margin-left: 3px; min-height: 60px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--text) 3%, var(--surface)); }
.calendar.weeks .cal-week.win i { color: var(--cal-win-ink); } .calendar.weeks .cal-week.loss i { color: var(--cal-loss-ink); } .calendar.weeks .cal-week.flat i { color: var(--text); }
.calendar.weeks .cal-week.none { background: transparent; border-color: transparent; } .calendar.weeks .cal-week.none i { opacity: 0.6; }

/* Trades grouped by day, tags, form chips */
/* The saved trades' heading over their list (the owner, Nov 30 2026: the calendar and the trades under it read as one
   dense block). More room above it than between cards, so the calendar ends and the list begins; a plain title in the
   look of the Open trades and Pending orders cards' titles (not in capitals: the day headings under it are); and one grey line saying what a tap and a swipe do. No box,
   no icon, no new colour. A touch screen reads the "Tap … swipe" words, a mouse the "Click … drag" ones (the browser
   on a computer: a row there slides with the mouse held down). */
.trades-head { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.trades-title { margin: 0; font-size: 1.05rem; }
.trades-head .by-mouse { display: none; }
@media (hover: hover) and (pointer: fine) { .trades-head .by-touch { display: none; } .trades-head .by-mouse { display: inline; } }
.trade-days { display: flex; flex-direction: column; gap: 14px; }
/* One day chosen: its line (the day heading's own look), then its two buttons side by side, or one under the other
   when they do not fit. The day's own heading inside the list says the same, so it is left out there. */
.day-pick { display: flex; flex-direction: column; gap: 10px; }
.day-pick .day-head { margin: 0; justify-content: flex-start; gap: 0 0.3em; }
.day-pick-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.day-pick-acts .ghost { flex: 1 1 auto; }
.trade-days.one-day .day-head { display: none; }
/* The chosen day's trades are laid out at once, not "when in view" (.day-group, content-visibility below): the page
   reads its own height right after a tap to keep its place (journal-ui.js choose), and a day group not yet laid out
   counts as 240 px. Its real height came one frame later, and the page slid by the difference (5 to 30 px on a
   390 px phone: the review of pull request 175). It is one day, at most 50 rows at first. */
.trade-days.one-day .day-group { content-visibility: visible; }
.day-head { margin: 0 0 6px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 8px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
/* The day's total in one piece ("−" never alone at a line's end, review 96b); when the date and "· 4 of 120" leave
   it no room, it goes to a line of its own, at the right, and the date keeps the whole width. */
.day-head strong { margin-left: auto; font-size: 0.95rem; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* "· 4 of 5" after the date of a day the fold cuts (journal-ui.js markCut): its total is the whole day's. */
.day-cut { font-size: inherit; font-weight: 600; letter-spacing: 0; text-transform: none; }
.trade-top .trade-result { margin-left: auto; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--field); border: 1px solid var(--accent-line); color: var(--text); }
.tag.bad { border-color: var(--error); color: var(--error); }
.chips-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.chips-field legend { padding: 0; margin-bottom: 6px; font-size: 0.85rem; font-weight: 650; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--field); color: var(--text); font-weight: 650; font-size: 0.9rem; }
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--accent-line) 12%, var(--field)); color: var(--accent-ink); border-color: var(--accent-line); }

/* Prop Firms: calm. Red and green are ink, a round tint behind a − or +, or one thin bar; never a solid slab. */
.prop-hero { gap: 3px; padding: 16px 16px 14px; }
.prop-hero > strong { display: flex; flex-direction: column; font-size: min(11.5vw, 3rem); /* follows the screen's width: stays on one line */ font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.prop-hero > .long { font-size: min(8.4vw, 2.2rem); }
.prop-hero > strong span { font-size: 1rem; font-weight: 700; letter-spacing: 0; line-height: 1.5; }
.prop-hero > span { color: var(--muted); font-size: 0.85rem; }
.prop-hero.up > strong { color: var(--win); } .prop-hero.down > strong { color: var(--loss); }
.prop-bar { display: flex; gap: 3px; height: 8px; margin-top: 10px; }
.prop-bar i { border-radius: 4px; background: var(--loss); } .prop-bar i + i { background: var(--win); }
.prop-split { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.prop-split span { display: flex; flex-direction: column; }
.prop-split span + span { margin-left: auto; align-items: flex-end; }
.prop-split strong { color: var(--text); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.prop-split #propEvalsWrap { flex: 1 0 100%; flex-direction: row; align-items: baseline; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--line); }
.prop-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5em, 1fr)); gap: 10px; } /* one under the other with large text */
.big-btn { min-height: 60px; padding: 8px; border-radius: 16px; font-size: 1.05rem; font-weight: 750; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text); background: var(--raised); border: 1px solid var(--line); box-shadow: var(--seg-shadow); }
@media (max-width: 350px) { .big-btn { flex-direction: column; gap: 4px; } }
/* The round − / + mark, on the two add buttons, on every row and beside the form's title. Its size is in rem
   (34 px at normal text size, with 8 px around the sign), so it grows with large text like the words beside it.
   It used to stay 34 px, which looked lost next to text at 200%. */
.ic.prop-icon { width: 2.125rem; height: 2.125rem; padding: 0.5rem; border-radius: 50%; color: var(--loss-ink); background: color-mix(in srgb, var(--loss) 15%, transparent); }
.in .ic.prop-icon { color: var(--win-ink); background: color-mix(in srgb, var(--win) 15%, transparent); }
/* The form has Add trade's parts, but opens in the page: a sheet would open slower. */
.pf-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pf-head h2 { flex: 1 0 auto; font-size: 1.25rem; }
.pf-dock { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
#pSum { color: var(--loss); } .in #pSum { color: var(--win); } #pSum.muted { color: var(--muted); }
.prop-total { margin: 0; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.money-input.big input { font-size: 1.8rem; font-weight: 800; min-height: 60px; padding-left: calc(6px + 1rem); } /* clear of the $ at any text size */
.prop-form .chips { margin-top: 8px; }
.prop-form .chips:empty { display: none; }
.prop-form .chip { border-radius: 12px; }
.prop-form .tf-step button { display: flex; width: 52px; } /* − and + stay on the narrowest phones too */
.prop-form .tf-step input { min-height: 50px; padding: 0; text-align: center; font-size: 1.3rem; font-weight: 800; }
.firm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
/* A long name wraps; the amount drops under it when they cannot share a line. */
.firm-list li { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
#pFirms .chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.firm-list li:first-child { border-top: 0; }
.firm-list span, .prop-main { min-width: 0; overflow-wrap: anywhere; }
.firm-list strong, .prop-row > strong { margin-left: auto; }
.prop-row { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-height: 56px; color: var(--text); }
.prop-main { flex: 1 1 5.5em; display: flex; flex-direction: column; gap: 2px; }
.prop-main span { color: var(--muted); font-size: 0.85rem; }
.prop-row > strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.csv-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.csv-row .ghost { width: 100%; }

/* Trial and Unlock */
/* The free trial's line, on the Calculator only (the other screens show nothing until the trial ends, then their lock
   cards). One thin, quiet line, so nobody takes it for a menu button (the owner's choice from a picture, Nov 29 2026):
   no fill, so it sits on the page's own colour whatever that is; a hairline outline; "Free trial" in the text colour,
   the days left in grey. When Unlock drops under the words (a narrow phone, large text), 12px corners keep both
   inside the outline. */
.trial-banner { display: flex; align-items: center; justify-content: space-between; column-gap: 10px; flex-wrap: wrap; padding: 0 2px 0 12px; border-radius: 12px;
  background: none; border: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); }
.trial-banner > span { padding: 9px 0; }
.trial-banner strong { color: var(--text); font-weight: 500; }
.trial-banner[hidden], .lock-card[hidden] { display: none; }
/* Unlock: plain green words, no box, so it never competes with the screen's main button (the Unlock screen keeps a
   filled one). --win-ink is the app's green for words: 4.5:1 or more on the page in light and dark. The button is
   still 44px tall to tap: 4px of it reaches past the line above and below, invisible (no fill, no outline). Its
   -10px on the left keeps its words in line with "Free trial" when it drops under them. */
.trial-banner button { min-height: 44px; margin: -4px 0 -4px -10px; padding: 0 10px; font-weight: 600; color: var(--win-ink); border-radius: 10px; }
/* A press dims its words only: the calculator's grey press fill is 44px tall and would poke out of the 38px line
   (the review of pull request 187). The 10px corners keep the keyboard's ring inside the line's own corners.
   (#calcView first: the calculator's own press rule, far below, names #calcView and a class, so it won and the grey
   fill still showed. Found on Nov 29 2026.) */
#calcView #calcTrial button:active { box-shadow: none; opacity: 0.6; }
/* Trial over: a locked screen keeps the lock card (and its name, which stands in the top row, outside the screen).
   Markets also keeps Account (signing in is how a purchase is made on the website and claimed on a new device), Back
   up / Restore (your data is always yours) and About. They are left out HERE: a separate "show it" rule would lose to
   this one. Unlock stays the one filled button on a locked screen, so the main buttons of the cards under it are
   outlined there. */
/* (On Markets: the Account group of the settings list and its foot line stay, .keep-locked, and the sheet they open,
   #setSheet: settings-ui.js. The cards themselves wait in the list's stash or stand in that sheet.) */
.view.locked > :not(.lock-card):not(.keep-locked):not(.set-sheet) { display: none !important; }
.view.locked > :not(.lock-card) .primary-btn { background: none; border: 1.5px solid var(--line); color: var(--text); }
.lock-card { align-items: center; text-align: center; padding: 24px 18px; gap: 10px; }
.lock-card h2 { margin: 0; font-size: 1.2rem; } .lock-card p { margin: 0; color: var(--muted); line-height: 1.45; }
/* The padlock on a locked screen: a line icon like every other icon (it was a colour emoji, which draws differently on
   every phone), large and in the quiet grey, so Unlock stays the one thing that stands out. Its shape is written
   once in the page, beside the logo's (#lockMark in index.html), and each of the four locked screens draws that one
   shape, so the four can never differ. */
.lock-card .lock-icon { width: 2rem; height: 2rem; stroke-width: 2; color: var(--muted); }
.unlock-card { gap: 12px; padding: 22px 18px; }
.unlock-card h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.02em; }
.unlock-card .price { margin: 0; font-size: 1.05rem; color: var(--muted); } .unlock-card .price strong { font-size: 1.6rem; color: var(--text); }
.unlock-card h1 + .summary { font-size: 1rem; color: var(--text); } /* a thank-you, or where a payment stands: not small print */
.unlock-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; line-height: 1.4; }
.unlock-list li::marker { content: '★  '; color: var(--accent-line); }
.unlock-card input[type=text] { width: 100%; min-height: var(--tap); font: inherit; font-size: max(1rem, 16px); letter-spacing: 0.08em; text-transform: uppercase; color: inherit; background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; }
.unlock-card input[type=text]:focus { outline: none; border-color: var(--accent-line); }
.primary-btn.big { min-height: 56px; font-size: 1.1rem; }
.unlock-card input[type=text]::placeholder { text-transform: none; letter-spacing: 0; }
/* The cover when the saved data cannot be opened here (app.js, shutCover): drawn like the browser version's tab cover
   (web/web.css, .tab-cover), on the phone too. It fills the window with the app's own background and holds one card in
   the middle; it scrolls with very large text, starting at its top when there is no room. (--win-buttons: an iPad's
   window buttons, set by MainViewController.swift; 0 or missing on a phone, so nothing moves there.) */
.data-cover[open] { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; overflow: auto; overscroll-behavior: contain;
  box-sizing: border-box; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0;
  padding: max(16px, env(safe-area-inset-top), var(--win-buttons, 0px)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--bg); color: var(--text); }
.data-cover::backdrop { background: transparent; }
.data-cover-card { margin: auto; width: 100%; max-width: 440px; box-sizing: border-box; align-items: center; text-align: center; gap: 14px; padding: 28px 22px 22px; }
.data-cover-card:focus { outline: none; }
.data-cover-card h1 { line-height: 1.2; text-wrap: balance; }
.data-cover-card p { margin: 0; line-height: 1.5; text-wrap: pretty; }
.data-cover-card .primary-btn { width: 100%; margin-top: 4px; padding-block: 0.45em; }
.data-cover-card .primary-btn[aria-disabled="true"] { cursor: progress; }
html.data-shut { overflow: hidden; }
.chart-card { gap: 8px; }
.prop-chart { width: 100%; height: 110px; overflow: visible; color: var(--muted); }
.prop-chart.up, .prop-chart .above { color: var(--win); } .prop-chart.down, .prop-chart .below { color: var(--loss); }
.prop-chart .line { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.prop-chart .area { fill: currentColor; opacity: 0.14; }
/* Where the line lies exactly on the even line ($0) it is drawn once, in the quiet grey of the small print and paler
   than the dashes, so the dashed even line still reads on top of it. (Drawn in green and red like the rest of the
   line, such a run came out half green and half red and covered the dashes.) */
.prop-chart .flat { stroke: var(--muted); opacity: 0.45; }
.prop-chart .even { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.prop-chart .dot { stroke: currentColor; stroke-width: 9; stroke-linecap: round; vector-effect: non-scaling-stroke; } /* a round dot at any chart width */
.chart-axis { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.even-key::before { content: ''; display: inline-block; width: 18px; margin-right: 6px; vertical-align: middle; border-top: 1.5px dashed; } /* the dashed even line, drawn */
.chart-axis span:last-child { font-weight: 800; color: var(--text); }
.import-review h2 { margin: 0; font-size: 1.1rem; }
.import-order { display: flex; flex-direction: column; gap: 6px; } .import-order .hint { color: var(--text); }
/* Each date on one line: side by side while they fit, one under the other with large text on a narrow phone. The
   box has room for the keyboard's ring below (5 px out from a date, then 3 px of the box before its edge or the other
   date; with the usual 4 px it ran into the box's edge). */
.import-order .segmented { flex-wrap: wrap; padding: 8px; gap: 8px; border-radius: 18px; } .import-order .segmented button { flex: 1 1 auto; white-space: nowrap; }
/* The keyboard's ring on this step: a line of the market's colour off the button, after a gap of the card's colour,
   as thick as the app's other buttons' ring (3 px, button:focus-visible above). No other control here wears the
   market's colour (the best guess is a raised tile with a thin grey edge), so one control looks focused, never two. */
.import-review button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px var(--accent-line); }
/* (A ring 3 px thick, 2 px out, after a gap of the card's own colour: 5.5 to 8.7 times the contrast of the card in
   light, 6.8 to 10.8 in dark, for the four markets' colours; a focus ring needs 3. The soft halo before it was about
   2 in light.) */
#importTitle:focus, #csvMsg:focus { outline: none; } /* (they take the focus so a keyboard and a screen reader follow; no ring: they are no controls) */
#tSymbol { text-transform: uppercase; padding: 0 12px; font-variant-numeric: normal; }
#tSymbol::placeholder { text-transform: none; }
/* Forex: the pair box, typed in capitals, with the list of pairs under the arrow at its right edge. The arrow is a real
   select laid over the end of the box (app.js, journal-ui.js): its own words ("Pick a pair") are never seen, only the
   arrow every select of the app draws, and its list is the phone's own. */
.pair-box { position: relative; }
#pair { text-transform: uppercase; font-variant-numeric: normal; }
#pair::placeholder { text-transform: none; }
#pair, .pair-box.pick #tSymbol { padding-right: 48px; }
#pairPick, #tPairPick { position: absolute; top: 0; right: 0; bottom: 0; width: 48px; min-height: 0; padding: 0; border-color: transparent; background-color: transparent; color: transparent; }
#pairPick option, #tPairPick option { color: var(--text); background: var(--surface); }
/* The two groups' labels (journal-ui.js FX_GROUPS): quiet, where a browser draws the list itself (not the phone's own). */
#pairPick optgroup, #tPairPick optgroup { color: var(--muted); background: var(--surface); font-weight: 600; }
#calcView #pair { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
.broker-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(5.5rem + 16px)), 1fr)); gap: 10px; }
/* (Two buttons side by side while the longest word, "Futures" (4.2rem), and the button's 16 px of edge and padding fit
   with room to spare; one under the other with large text on a narrow phone. Before, two always: at 320 px and 200%
   text "Futures · best guess" ran over the button's edges, also on main. In rem, so it follows the text size.) */
.broker-btn { min-height: 64px; border-radius: 16px; font-size: 1.1rem; font-weight: 800; background: var(--field); border: 1.5px solid var(--line); color: var(--text); }
/* The best guess: the app's look for "the one chosen already", a raised tile, as in the Add trade sheet's "Where is
   this trade?" and the day-or-month question above (not a gold one: the market's colour fills only a screen's main
   button, and marks only the keyboard's ring here). Before, a border of the market's colour, solid and then dashed: a
   reviewer saw two controls looking focused, the next a draft. */
.broker-btn[aria-pressed="true"] { background: var(--raised); box-shadow: 0 0 0 1.5px var(--muted), var(--seg-shadow); }
.broker-btn[aria-pressed="true"]::after { content: 'best guess'; display: block; font-size: 0.75rem; font-weight: 650; color: var(--muted); } /* (a line of its own, under the name) */

/* Daily Journal */
.pane { display: flex; flex-direction: column; gap: var(--gap); }
/* The date bar. One calm card: two quiet square arrows drawn as line icons and, between them, the date as one
   button that opens the month picker. Today reads "Today" over the full date; a past day reads its date once.
   How the date wraps on a narrow phone or with large text:
   - The date is written with a space that cannot break between the month and the day (see long() in daily-ui.js),
     so "November 15" never splits. The weekday goes on a line of its own instead, and the lines are kept about
     equally long (text-wrap: balance, where the browser has it). Before this, a 320 px phone showed "Sunday,
     November" on one line and a lonely "15" on the next.
   - The small calendar icon comes right after the date, in the same line of text, tied to the last word by an
     unbreakable space inside ".keep" (nothing wraps in there). So it always sits at the end of the last line,
     never on a line by itself and never floating half way up beside two lines.
   - With very large text the date stops growing where "November 15" and the icon still fit between the arrows
     (5.4% of the screen's width for today's line, 6% for a past day's bolder title). Nothing is ever cut. */
.day-bar { padding: 0 10px; gap: 0; }
.day-nav { display: flex; align-items: center; gap: 8px; min-height: 62px; }
.day-nav .icon-btn { min-height: 44px; background: var(--field); }
.day-nav-title { flex: 1; min-width: 0; min-height: var(--tap); padding: 4px; border-radius: 12px; text-align: center; text-wrap: balance; color: var(--muted); font-size: min(0.85rem, 5.4vw); line-height: 1.3; }
.day-nav-title h2 { font-size: 1.2rem; color: var(--text); }
.day-nav-title .keep { white-space: nowrap; } .day-nav-title .ic { vertical-align: -0.15em; }
.icon-btn:disabled { opacity: 0.35; }
/* A past day. The bar takes a faint tint and line in the market's colour (a tint and a line, never a fill) and
   pulses once when a past day is opened (the pulse is with the other small motions, near the end of this file,
   so it is off when the phone asks for less motion).
   The date is the one line of the button, so its heading is set inline and the calendar icon follows its last
   word.
   Under it sits a second row: how long ago the day was, in grey, and Back to today as a text button in the
   market's ink. On the narrowest phone the row's words are a touch smaller so both stay on one line; with large
   text the button drops under the words. This row replaces the separate "You're looking at a past day" banner. */
.day-bar.past { border-color: color-mix(in srgb, var(--accent-line) 55%, var(--line)); background: color-mix(in srgb, var(--accent-line) 8%, var(--surface)); }
.day-bar.past h2 { display: inline; font-size: min(1.03rem, 6vw); }
.past-day { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; padding: 0 4px 0 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: clamp(0.78rem, 3.9vw, 0.85rem); }
#dPastDate { padding: 6px 0; }
.past-back { display: flex; align-items: center; gap: 4px; min-height: 44px; margin-left: auto; padding-left: 4px; font-weight: 700; color: var(--accent-ink); }
/* The day's reminder stood here, first on the Daily Journal, from Nov 30 2026. The owner took it off this screen on
   Dec 1 2026 (the Trading Book is first now; the Calculator keeps its own patience line, below). Its caption
   colour stays for the day's result line. */
.day-result .eyebrow { color: var(--muted); opacity: 1; }
/* The day's result, the first line of the Review half (the card that listed the day's trades above Plan / Review
   was removed on Nov 28 2026: see daily-ui.js). On the left the grey caption ("TODAY · 2 TRADES"), on the right
   the day's result after fees, green or red, with a thin rule under the line.
   Both follow the phone's text size. The caption is the app's usual caption (the size of every grey capital caption,
   .eyebrow), and may wrap. The number grows too, until the widest result the line can show would no longer fit across the
   card: +$12,345,678.90 (or with a minus) is 8.68 times its font size wide in Chrome, and the card's inside is the
   screen's width less 66 px at every phone width (both measured in Chrome at 320, 360, 390 and 430 px, Nov 28 2026).
   So the number stops at (100vw - 66px) / 9.2, which keeps about 6% to spare for a slightly wider phone font: 27.6 px
   on a 320 px phone, 35.2 px at 390 px, so at 390 px it only stops above 200% text. When the two do not fit side by
   side the number goes under the caption, on the left, as the big number sat under the old card's caption.
   A money amount never breaks in two. "Open" (every trade still open) is in the market's ink: it is not a result
   yet, so it is never green or red. */
.day-result { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.day-result > :not(.eyebrow) { font-size: min(1.1rem, calc((100vw - 66px) / 9.2)); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-result .open { color: var(--accent-ink); }
/* Plan / Review: two tiles in the same pattern as "Where is this trade?" in Add trade (a bold word over a small
   grey caption; the chosen one is a quiet raised tile, never filled with the market's colour). The tile's size and
   its chosen look are shared with that control: see ".tf .kind3 button, .halves button" further down.
   Only the chosen half of the card shows.
   A small green check sits beside the word once that half has something in it. Green here means "done", as on
   the on-time note.
   The word and its caption both follow the phone's text size, and both stop growing at a share of the screen's
   width so they still fit their tile on a narrow phone with very large text. The caption's stop is lower than the
   word's, so the word is always the larger of the two. (Before, only the word had a stop: on a 320 px phone at
   200% text "Plan" came out at 17.6 px and "before the session" under it at 22.7 px.) */
.halves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.halves b { display: flex; align-items: center; gap: 5px; font-size: min(0.95rem, 5.5vw); }
.halves small { font-size: min(0.78rem, 4.3vw); font-weight: 500; color: var(--muted); }
.halves i { display: flex; color: var(--win); }
/* Inside a half: each question in strong text with its hint in grey beside it, and a little more air between the
   questions than in other cards. "How I feel": the eight feelings line up in even columns, as many as fit (three
   on most phones, two on the narrowest, one with very large text), so no word is ever cut. */
.daily-section { gap: 16px; padding: 16px; }
.daily-section label, .daily-section legend { font-size: 0.9rem; color: var(--text); }
.daily-section .optional { color: var(--muted); }
#dMoods { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); }
#dMoods .chip { border-radius: 12px; padding: 0 6px; }
/* Writing boxes grow with the writing and have no resize corner. "field-sizing: content" is the browser's own way
   to do that: no code runs and nothing is measured on a key. Browsers that do not know it (iPhones before iOS
   26.2, Firefox) skip the line, and for them a few lines in daily-ui.js (fit) set the height instead. An empty
   box is as tall as its hint, and at least 48 px so it is easy to tap. */
.daily-section textarea { width: 100%; min-height: 48px; font: inherit; font-size: max(1rem, 16px); color: inherit; background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; resize: none; field-sizing: content; }
.daily-section textarea:focus { outline: none; border-color: var(--accent-line); }
/* A box is as tall as its writing or as its hint, whichever is taller (Nov 17 2026). On a phone most hints take
   two lines (all five at 320 px, three of them at 390 px), so a box with one line of writing was 10 px shorter than
   the same box empty: deleting a card (its boxes empty and show their hints) moved everything under them down,
   Undo moved it back up, and the first letter typed into an empty box moved the page too. Now an invisible copy of the hint (data-hint, given
   by daily-ui.js from the box's own hint) stands in the same place as the box, with the box's letters, padding and
   border, and holds the room open; the box fills that room. Nothing is measured and no code runs on a key. */
.daily-section .field[data-hint] { display: grid; grid-template-columns: minmax(0, 1fr); }
.daily-section .field[data-hint] > textarea { grid-area: 2 / 1; min-height: max(48px, 100%); }
.daily-section .field[data-hint]::after { content: attr(data-hint); grid-area: 2 / 1; visibility: hidden; pointer-events: none; white-space: pre-wrap; overflow-wrap: break-word; box-sizing: border-box; min-height: 48px; font-size: max(1rem, 16px); padding: 10px 12px; border: 1.5px solid transparent; }
/* The quiet line under a writing box that says the box is full ("This box is full (2,000 letters)."). It is in the
   page all the time and empty until then; while it is empty it takes no room at all. */
.box-full:empty { display: none; }
/* Discipline: five stars with no boxes around them, each a 44 px target. A star that is off is an outline; a star
   that is on is solid, in the market's ink colour (ink, not a fill of a button). "4 of 5" sits in grey at the
   right end of the question, so the rating can be read as a number too. */
.stars { display: flex; margin-left: -8px; }
.star { width: 44px; height: 44px; color: var(--muted); }
.star .ic { width: 28px; height: 28px; stroke-width: 1.5; fill: transparent; opacity: 0.7; }
.star[aria-pressed="true"] { color: var(--accent-ink); }
.star[aria-pressed="true"] .ic { fill: currentColor; opacity: 1; }
.daily-section legend { width: 100%; } #dRatingOf { float: right; font-variant-numeric: tabular-nums; }
/* "4 of 5" keeps its room while there is no rating yet, as a writing box keeps the room of its hint: with large text
   on a narrow phone the question takes two lines with it and one without, so deleting a card (or Undo) moved
   everything under the stars by a line (a review of pull request 84 found it). An invisible "0 of 5", with figures
   of one width, holds the room. Nothing is measured and no code runs. */
#dRatingOf:empty::before { content: "0 of 5"; visibility: hidden; }
.day-stars { color: var(--accent-line); letter-spacing: 2px; }

/* No color fades anywhere: numbers and results show at full strength the moment they appear. */

/* Swipe rows: the red Delete sits behind the right edge, Edit behind the left. */
.swipe { position: relative; border-radius: 14px; overflow: hidden; }
.swipe > .prop-row, .swipe > .trade { position: relative; z-index: 1; touch-action: pan-y; }
/* The keyboard's ring on such a row is drawn just inside the row. The row's frame cuts off everything outside
   it (that keeps the two buttons behind the row out of sight), and the app's usual ring stands 2px outside a
   button: it was cut off whole, so a trade, a Prop Firms entry or a day in Contents reached with Tab showed no
   ring at all. (Found when Undo began to hand the focus to the row that came back.) */
.swipe > .prop-row:focus-visible, .swipe > .trade:focus-visible { outline-offset: -3px; }
.sw-acts { position: absolute; inset: 0; display: flex; visibility: hidden; }
.swipe.sw-left .sw-acts, .swipe.sw-right .sw-acts { visibility: visible; }
.sw-acts button { flex: 1; min-height: 44px; display: flex; align-items: center; font-weight: 800; font-size: 1rem; padding: 0 18px; }
.outside-note .ic, .bk-edit .ic, .tw-type .ic { width: 1.05em; height: 1.05em; vertical-align: -.15em; margin-right: 5px; }
.sw-edit { justify-content: flex-start; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); }
.sw-del { justify-content: flex-end; background: #dc2626; color: #ffffff; }
.swipe.sw-left .sw-edit, .swipe.sw-right .sw-del { visibility: hidden; }
/* A saved trade's Edit for the keyboard and screen readers (its line's tap opens the day: swipe.js swipeActions). The
   pair is there to be reached, but stays unseen under the line (see-through, not hidden: a hidden button cannot take
   the focus) until a swipe shows one, or Edit has the keyboard's ring: then the line slides aside as a swipe right
   would, and Edit shows in its place, with its ring just inside. No code runs and nothing is measured. */
.sw-acts.keys { visibility: visible; }
.sw-acts.keys > button { opacity: 0; }
.swipe.sw-left .sw-acts.keys > button, .swipe.sw-right .sw-acts.keys > button, .sw-acts.keys > .sw-edit:focus-visible { opacity: 1; }
/* (Its ring in the button's own ink: the app's usual ring is the accent colour, the very colour of Edit, and was all but
   invisible on it.) */
.sw-acts.keys > .sw-edit:focus-visible { outline-color: var(--on-accent); outline-offset: -4px; }
@media (prefers-reduced-motion: no-preference) { #tradeList .swipe > .trade { transition: transform 0.2s ease; } }
.swipe:has(> .sw-acts .sw-edit:focus-visible) > .trade { transform: translateX(96px); }
.swipe:has(> .sw-acts .sw-edit:focus-visible) > .shot-open { visibility: hidden; }
/* A trade with a picture (phones only, shots.js). The picture's own button sits beside the line's button, never inside
   it: a tap on it opens the picture, a tap anywhere else edits. A line without a picture is drawn exactly as before.
   In the list: the icon at the line's bottom right, 10 px in from the right edge and 8 px up, beside the last row's
   words (the owner, Nov 28 2026: 2 px from the edges and 1.125rem was too small and too close to the edge). It is
   1.375rem, 22 px at normal text, and grows with the person's text size up to 28 px: bigger than that, the room it
   needs pushed a long last part ("incl. $11.62 fees" at 320 px and 200% text) under the icon. Its button is the
   corner around it, at least 44 x 44 and growing with it, and may lie over the end of the words beside or above the
   icon (that corner belongs to the picture). Only the LAST row keeps room, and only what the icon needs beyond the
   line's own 14 px (the icon less 2 px: 20 px at normal text): the top row, with the result and its R, is laid out
   exactly as without a picture, and nothing in it moves. When the last row is too full for that room, one whole word, price or tag moves down: at most one row taller.
   (The review of pull request 174: keeping 30 px at the end of the top row put a loss's minus sign alone on a row and
   made a plain line four rows tall.) scripts/qa-shots.mjs measures it over 51 kinds of trade.
   In Open trades: the icon is drawn just before the word "Open" (the part's own 8 px gap between them), inside that
   word's own part of the row, so "Open" stays exactly where it is on every row; the button covers the icon and the word. Slid aside (the list), the line's
   Edit or Delete shows in the icon's place. */
.swipe > .shot-open, .pending-row > .shot-open { position: absolute; z-index: 2; color: var(--muted); display: flex; }
.swipe > .shot-open { --shot: min(1.375rem, 28px); right: 0; bottom: 0; width: max(44px, calc(var(--shot) + 22px)); height: max(44px, calc(var(--shot) + 22px)); align-items: flex-end; justify-content: flex-end; padding: 0 10px 8px 0; }
.swipe > .shot-open .ic { width: var(--shot); height: var(--shot); }
.swipe:has(> .shot-open) > .trade > :last-child { padding-right: calc(min(1.375rem, 28px) - 2px); }
.pending-row:has(> .shot-open) { position: relative; }
/* (Its box ends where the row's second line begins and is 44 px tall: at normal text it reaches up into the empty room
   above the row (the row's own 10 px, its 1 px line, and all but half a pixel of the 10 px between two rows; never
   further, so it never meets the row above: with 11 px it ended a quarter of a pixel inside it, the look review of pull
   request 190). Where the second line begins is worked out from the least the top row can be tall, so the box stops
   at it or a little before, never on it: 10 px of room, the top row (the market at 1.05em or the side badge at 0.75em
   plus 6 px, at a line height of 1.15 at least), 4 px between the rows. Before (Nov 29 2026, the add
   button's checks in scripts/qa-shots.mjs) the box was 44 px down from the row's top edge and lay over the right end of
   its second line ("risk $1,400.00") by up to 8 px: a tap there opened the picture instead of the trade's sheet.
   With large text the top row alone is more than 44 px: the box is the room above it and the top row.) */
.pending-row > .shot-open { --low: calc(14px + max(1.2em, calc(0.86em + 6px))); --up: max(-10.5px, min(0px, calc(var(--low) - 44px)));
  top: var(--up); right: 0; height: calc(var(--low) - var(--up)); width: calc(1.125rem + 3.4em); }
.pending-row > .shot-open .ic { display: none; }
.pending-row:has(> .shot-open) .open-badge::before { content: ""; display: inline-block; width: 1.125rem; height: 1.125rem; align-self: center; background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v14H4zM4 16l5-5 4 4 3-3 4 4M15.5 9.5h.01'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v14H4zM4 16l5-5 4 4 3-3 4 4M15.5 9.5h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
/* AN OPEN TRADE WITHOUT A PICTURE (phones only): a quiet "Add screenshot" line with its icon at the row's end
   (journal-ui.js addButton; the owner's choice, Nov 29 2026, over a lone icon by "Open"). Grey like the picture's icon,
   never the yellow of the links, 44 px tall. It stands at the right end of the line of "Type the exit price instead"
   when both fit side by side, and else on a line of its own under it, at the right; under the exit-price box and Close,
   always on its own line. The row's pieces wrap (each a whole line but the link and this one), so the link is never
   squeezed and the two never meet: the line breaks before either shrinks (a piece shrinks only alone on its line, as the
   words at 320 px with 200% text, which then wrap inside their own button). It comes after the row's last control (the
   link, or Close), so the keyboard reaches it last in every kind of row. It dips when pressed, as the R buttons do.
   Nothing is measured.
   ITS SIZE (the look round of pull request 190, Nov 30 2026): 13 px words (0.8125rem, weight 600; grey on the card:
   8.5 to 1 in dark, 6.0 to 1 in light), the icon 3 px from them, no padding of its own; the 8 px between it and the
   link is the row's own gap, so the two tap areas never come closer. Measured in Chrome at 16 px letters: the link's
   tap area is 211 px wide and this one 115.5, so the pair needs a row of 334.5 px: it shares the line at 430 px, and
   at 402 px (a row of 335.5) it still took its own line. An iPhone's letters are 17 px (index.html, -apple-system-body),
   so there it shares the line only on the widest phones. Was 0.9rem with 6 px and 8 px of padding.
   On its own line, the room above it is the row's 8 px between two tap areas, as between the R buttons and the
   link; its words sit in the middle of their 44 px, as the link's do in theirs. */
.pending-row:has(> .add-shot) { flex-flow: row wrap; }
.pending-row:has(> .add-shot) > * { flex: 1 0 100%; }
.pending-row:has(> .add-shot) > .close-more { flex: 0 1 auto; }
.pending-row:has(> .add-shot) > .add-shot { flex: 0 1 auto; min-width: 0; margin-left: auto; display: inline-flex; align-items: center; gap: 3px; min-height: 44px; padding: 0;
  color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.pending-row > .add-shot .ic { width: 1.1em; height: 1.1em; }
/* (A narrow row with large text, under 12 times its letters' size: 320 px from about 125%, 360 px from about 150%, 390 px
   from about 175%. There a market and its side can leave too little room before "Open" for the icon, which would push "Open" to
   a row of its own. So the icon goes into the card's own margin beside "Open", 10 px with 2 px on each side, where nothing else is: "Open" stays put and the row keeps its
   height. Measured Nov 28 2026: 8 to 41 px free there, against the 44 the icon needs at 200%.) */
@container (max-width: 11.99em) {
  .pending-row:has(> .shot-open) .open-badge::before { display: none; }
  .pending-row > .shot-open { right: -14px; width: calc(14px + 3em); align-items: flex-start; justify-content: flex-end; padding: calc(4px + 0.62em - var(--up)) 0 0; }
  .pending-row > .shot-open .ic { display: block; width: 10px; height: 10px; margin-right: 2px; }
}
/* (A longer market name, as a Forex pair, "EUR/USD": the same under 15.5 times the letters' size, 320 px from 125%.) */
@container (max-width: 15.49em) {
  .pending-row:has(> .shot-open.wide) .open-badge::before { display: none; }
  .pending-row > .shot-open.wide { right: -14px; width: calc(14px + 3em); align-items: flex-start; justify-content: flex-end; padding: calc(4px + 0.62em - var(--up)) 0 0; }
  .pending-row > .shot-open.wide .ic { display: block; width: 10px; height: 10px; margin-right: 2px; }
}
.swipe.sw-left > .shot-open, .swipe.sw-right > .shot-open { visibility: hidden; }
/* bottom: 8px under the top of the room kept for the bar (12px before the bar floated: it stands 8px higher now, and
   at 130% text on a phone on its side the message came within 3.5px of it). */
/* left / right: the same edges as the page (main): on the iPhone Duo's small screen the clock and battery stand in a
   column at the side, and the message ran under it. An iPhone held upright has no side inset: nothing moves there. */
.toast { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(var(--nav-room) - 8px + env(safe-area-inset-bottom)); z-index: 30; max-width: 496px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-weight: 650; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6); }
.toast button { flex-shrink: 0; margin-left: auto; min-height: 44px; padding: 0 16px; border-radius: 10px; font-weight: 800; color: var(--accent-line); background: transparent; border: 1.5px solid var(--accent-line); }
/* A long message (a long firm name, a large amount, large text on a narrow phone): when the words and Undo do not fit
   side by side, Undo goes to a line of its own, at the right, at its full size, and the words get the whole width,
   so an amount like "+$1,000.00" stays in one piece. (Before, the words pushed Undo past the screen's edge; and a
   first fix let the words break anywhere, which cut "+$1,000.0" / "0" in the Journal's message at 200% text.)
   overflow-wrap: anywhere stays only as a last backstop, for a single word longer than the whole box. */
#toastText { flex: 1 1 9em; min-width: 0; overflow-wrap: anywhere; }

/* Compact calculator: everything from the top through the second result card fits on one phone screen.
   Between its cards it has 12 px, the other screens' gap on a phone (they have 14 px from 400 px wide). It was 8 px,
   the same as inside a card, so the cards ran together. Inside a card nothing changes (8 px, 6 px on shorter phones). */
#calcView { gap: 12px; }
/* Under the Risk per trade card the space is 20 px, not 12: the risk is one thought, the trade below it another,
   and at 12 px the two still read as one block (owner, Dec 2 2026; 24 was too much, 16 too little to see). Only this
   one gap; the other cards keep 12 px. Below 960 px only: from there the browser version (web/web.css) lays the
   calculator out in two columns and gives every card its space as a bottom margin, which this rule would replace. */
@media (max-width: 959px) { #calcView > .card.risk { margin-bottom: 8px; } }
#calcView .card { padding: 8px 12px 10px; gap: 8px; }
#calcView .card-head { align-items: center; }
#calcView .segmented { padding: 3px; }
#calcView .field { gap: 4px; }
/* The calmer Calculator (the owner picked it from pictures, Nov 30 2026: "B, Risk box unchanged"). Its words and
   numbers are a little thinner, still bright and clear: card title 600, labels 500, what is typed in a box 500 (the
   big stop number too), the stop-input switch 500 with the chosen one 600 and no shadow (in dark mode; light mode
   below), the take-profit switch the same. Only the Calculator's own two cards: these controls look the same as before on every other screen, which get
   their own pass later. The Risk box keeps its 650 number: only Min risk and Max risk are thinner. Its gold ring is
   gone (the owner, Dec 1 2026: gold is for the answer only; the box has the same grey line as its neighbours). (The answer cards under them are thinner too: ".count", ".facts",
   ".log-btn", ".pick-badge", ".result > .eyebrow" above, which only the Calculator has.)
   tests/colours.test.mjs checks the list. */
#calcView .risk h2 { font-weight: 600; }
#calcView .risk label, #calcView .trade label { font-weight: 500; }
#calcView .risk .field:not(.target) input, #calcView .trade input, #calcView .trade select { font-weight: 500; }
#calcView .segmented button, #calcView .tp-mode button { font-weight: 500; }
#calcView .segmented button[aria-pressed="true"], #calcView .tp-mode button[aria-pressed="true"] { font-weight: 600; }
/* (":not(:active)": while a finger is on it, the press shade is drawn, as on every Calculator button: see "Calculator,
   Markets and the theme button ... a pressed button also turns a shade darker", near the end of this file.) */
#calcView .segmented button[aria-pressed="true"]:not(:active), #calcView .tp-mode button[aria-pressed="true"]:not(:active) { box-shadow: none; }
/* In light mode the chosen switch must be seen at a glance (the owner, Nov 30 2026, after light-mode pictures): there it
   keeps its usual lift (--seg-shadow) and gets a thin grey ring as well. Dark mode stays without a shadow, as in the
   approved pictures. Both ways the app is light: the phone's own light mode, and the Light button (data-theme).
   The ring is --muted at 55%; older iPhones without color-mix() get the same grey written out (#5b6472 at 55%). */
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) #calcView .segmented button[aria-pressed="true"]:not(:active), :root:not([data-theme="dark"]) #calcView .tp-mode button[aria-pressed="true"]:not(:active) { box-shadow: 0 0 0 1px rgba(91, 100, 114, 0.55), var(--seg-shadow); } }
:root[data-theme="light"] #calcView .segmented button[aria-pressed="true"]:not(:active), :root[data-theme="light"] #calcView .tp-mode button[aria-pressed="true"]:not(:active) { box-shadow: 0 0 0 1px rgba(91, 100, 114, 0.55), var(--seg-shadow); }
@supports (color: color-mix(in srgb, red, blue)) {
  @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) #calcView .segmented button[aria-pressed="true"]:not(:active), :root:not([data-theme="dark"]) #calcView .tp-mode button[aria-pressed="true"]:not(:active) { box-shadow: 0 0 0 1px color-mix(in srgb, var(--muted) 55%, transparent), var(--seg-shadow); } }
  :root[data-theme="light"] #calcView .segmented button[aria-pressed="true"]:not(:active), :root[data-theme="light"] #calcView .tp-mode button[aria-pressed="true"]:not(:active) { box-shadow: 0 0 0 1px color-mix(in srgb, var(--muted) 55%, transparent), var(--seg-shadow); }
}
/* The calmer screens (the owner picked them from pictures, Nov 30 2026, after the calmer Calculator above): the Trade
   Journal, the Daily Journal, Markets, Prop Firms and the Add trade sheet get the same quieter words and numbers. Titles
   600, labels 500 (the Daily Journal's labels and legends 600, their grey "optional" words 400), what is typed in a box
   500, the switches 500 with the chosen one 600, chips 500 with the chosen one 600, numbers and amounts 600, main
   buttons 650. Colours do not change: the gold Add trade button, the gold ring of the Open trades card, the calendar's
   tiles, green Long and red Short, the gold or red ring of a chosen chip, the filled plate of the chosen market.
   Every rule names its own screen (#tradesPane, #dailyPane, #marketsView, #propView, #tradeForm), so the Calculator,
   the Trading Book, the picture page, Unlock, the "free trial has ended" cards, sign-in and the browser version's own
   parts look exactly as before. tests/colours.test.mjs checks the list.
   The chosen switch: in dark mode it has no shadow and no ring (the owner: "dark is perfect"). In light mode it keeps
   its lift and gets the same thin grey ring as on the Calculator, on every screen, so the whole app feels the same:
   see "The chosen switch on the calmer screens" below. */
/* Trade Journal. (+ Add trade floats over the Journal, outside #tradesPane: see "+ Add trade floats"; the Unlock
   card's button is not that pill.) The old insights line got the plain card line instead of its gold ring, so the Open trades card kept the
   only gold ring on the screen. (The Insights entry has its own look since Dec 3 2026: see INSIGHTS.) A tag gets the plain line too; a "bad" tag (a mistake) keeps its red words and a
   softer red ring. */
#journalView > .add-pill { font-weight: 650; }
#tradesPane .open-card h2, #tradesPane .trades-title, #tradesPane .cal-head h2 { font-weight: 600; }
#tradesPane .segmented button { font-weight: 500; }
#tradesPane .segmented button[aria-pressed="true"] { font-weight: 600; }
#tradesPane .eyebrow, #tradesPane .hero-pnl > strong, #tradesPane .stat strong,
#tradesPane .cal-total, #tradesPane .day-head, #tradesPane .day-head strong, #tradesPane .trade-sym, #tradesPane .trade-result,
#tradesPane .trade-result *, #tradesPane .direction { font-weight: 600; }
#tradesPane .stat span { font-weight: 500; }
#tradesPane .tag { font-weight: 500; border-color: var(--line); }
/* (The error colour at 45%, written out for phones without color-mix(): #ffb4a2 in dark mode, #b42318 in light.) */
#tradesPane .tag.bad { border-color: rgba(255, 180, 162, 0.45); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) #tradesPane .tag.bad { border-color: rgba(180, 35, 24, 0.45); } }
:root[data-theme="light"] #tradesPane .tag.bad { border-color: rgba(180, 35, 24, 0.45); }
@supports (color: color-mix(in srgb, red, blue)) { #tradesPane .tag.bad, :root[data-theme="light"] #tradesPane .tag.bad { border-color: color-mix(in srgb, var(--error) 45%, transparent); } @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) #tradesPane .tag.bad { border-color: color-mix(in srgb, var(--error) 45%, transparent); } } }
/* Daily Journal. The date, Plan / Review, the labels and legends 600 (their grey words 400), the hours'
   Start and Stop 500, the feeling chips 500 (the chosen one 600, with a 1 px ring in place of 1.5 px), the day's result
   line 600, Save 650. The closed Trading Book at the top is not touched. (The day's reminder, 600 too, left this
   screen on Dec 1 2026.) */
#dailyPane .day-nav-title h2, #dailyPane .halves button b,
#dailyPane .daily-section label, #dailyPane .chips-field legend, #dailyPane .day-result, #dailyPane .day-result * { font-weight: 600; }
#dailyPane .chips-field legend .optional { font-weight: 400; }
#dailyPane .hours-row label, #dailyPane .chip, #dailyPane .segmented button { font-weight: 500; }
#dailyPane .chip[aria-pressed="true"], #dailyPane .segmented button[aria-pressed="true"] { font-weight: 600; }
#dailyPane .chip[aria-pressed="true"] { border-width: 1px; }
#dailyPane .primary-btn { font-weight: 650; }
/* Markets: only its own cards (not the "free trial has ended" card, not the sign-in card). The chosen market keeps its
   filled plate in its own colour, without the glow under it (and without the plate's bevel, as in the approved
   pictures). A pressed market card still shows the press shade: see "#marketsView button:active". */
#marketsView .market-card strong, #marketsView .card:not(.lock-card):not(#accountCard) h2, #marketsView .card:not(.lock-card):not(#accountCard) h3 { font-weight: 600; }
#marketsView .card:not(.lock-card):not(#accountCard) label, #marketsView .card:not(.lock-card):not(#accountCard) input,
#marketsView .card:not(.lock-card):not(#accountCard) select, #marketsView .segmented button { font-weight: 500; }
#marketsView .segmented button[aria-pressed="true"] { font-weight: 600; }
#marketsView .market-card[aria-pressed="true"]:not(:active) { box-shadow: none; }
#marketsView #dataCard .primary-btn { font-weight: 650; }
/* With the thinner labels a fee's name can take one line where its neighbour's takes two (430 px wide: "Futures, per
   micro contract" beside "Futures, per standard contract", which both took two lines before); the two boxes of a row
   then still line up, at the bottom of the row. */
#marketsView .fee-grid .field { justify-content: flex-end; }
/* Prop Firms: its own cards (not the "free trial has ended" card). The chosen filter button keeps its gold ring, 1 px in
   dark mode, 1.5 px as before in light mode, where a thinner gold line would be too faint. */
#propView .card:not(.lock-card) h2, #propView .prop-hero > strong, #propView .prop-hero > strong span, #propView .prop-split strong,
#propView .big-btn, #propView .firm-row strong, #propView .firm-row b, #propView .prop-main strong, #propView .prop-row > strong,
#propView .chip-count, #propView .prop-filters .chip[aria-pressed="true"], #propView .segmented button[aria-pressed="true"] { font-weight: 600; }
#propView .segmented button, #propView select, #propView .prop-filters .chip { font-weight: 500; }
#propView .prop-filters .chip[aria-pressed="true"] { border-width: 1px; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) #propView .prop-filters .chip[aria-pressed="true"] { border-width: 1.5px; } }
:root[data-theme="light"] #propView .prop-filters .chip[aria-pressed="true"] { border-width: 1.5px; }
/* The Add trade sheet (only #tradeForm: the Trading Book's room shares the sheet's ".tf" look and is not changed).
   Long and Short keep their green and red; the chosen one has a 1 px ring in dark mode, 1.5 px as before in light
   mode. Every chip has a 1 px ring. */
#tradeForm h2, #tradeForm h3, #tradeForm .kind3 button[aria-pressed="true"], #tradeForm .kind3 button[aria-pressed="true"] b,
#tradeForm .tf-tabs button[aria-pressed="true"], #tradeForm .tf-dir button[aria-pressed="true"], #tradeForm .chip[aria-pressed="true"],
#tradeForm .tf-date-chip, #tradeForm .tf-sum-cap { font-weight: 600; }
#tradeForm label, #tradeForm legend, #tradeForm input, #tradeForm select, #tradeForm textarea, #tradeForm .kind3 button,
#tradeForm .kind3 button b, #tradeForm .tf-tabs button, #tradeForm .tf-dir button, #tradeForm .chip { font-weight: 500; }
#tradeForm .chip, #tradeForm .tf-dir button[aria-pressed="true"] { border-width: 1px; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) #tradeForm .tf-dir button[aria-pressed="true"] { border-width: 1.5px; } }
:root[data-theme="light"] #tradeForm .tf-dir button[aria-pressed="true"] { border-width: 1.5px; }
#tradeForm .primary-btn { font-weight: 650; }
/* With the thinner labels "Stop optional" can take one line where "Take profit optional" beside it takes two (200%
   text on a 390 px phone; both took two before); the two boxes of that row then still line up, at the bottom of the
   row, as the fee boxes on Markets do. Only that row: in the first one the Contracts stepper is shorter than the Entry
   or Risk box beside it with large text, and at the bottom its label would sit lower than theirs (the review of pull
   request 198). scripts/qa-sheet-grid.mjs measures every row. */
#tradeForm #tStopField, #tradeForm #tTpField { justify-content: flex-end; }
/* The chosen switch on the calmer screens: Week / Month / All time, Plan / Review and Yes / Partly / No, Prop Firms'
   Week / Month / Year / All, Markets' On / Off, the sheet's Waiting / In trade / Finished. Dark mode: no shadow, no
   ring. Light mode (both ways: the phone's own light mode, and the Light button): its usual lift (--seg-shadow) and a
   thin grey ring, --muted at 55%, exactly the Calculator's (the owner, Nov 30 2026: every chosen grey toggle clearly
   seen, the same thin ring on every screen). Plan / Review and the sheet's three had a 1.5 px full grey ring in both
   modes until now. Older iPhones without color-mix() get the same grey written out (#5b6472 at 55%).
   (":not(:active)" only on Markets: it is the one of these screens with a press shade (see "#marketsView
   button:active"), and a box-shadow rule would hide it. The other screens have no press shade; there a pressed chosen
   switch keeps the look it has when not pressed: the Daily Journal's switches and the sheet's three still dip a little
   when pressed, the Trade Journal's and Prop Firms' do not dip, as before.) (":not(.import-review :focus-visible)" on
   the Trade Journal: the import's Day first / Month first switch draws its keyboard ring as a box-shadow, see
   ".import-review button:focus-visible", and this rule would hide it. Week / Month / All time keep this look with the
   keyboard's focus too: their ring is an outline.) */
#tradesPane .segmented button[aria-pressed="true"]:not(.import-review :focus-visible), #dailyPane .segmented button[aria-pressed="true"], #propView .segmented button[aria-pressed="true"],
#tradeForm .kind3 button[aria-pressed="true"], #marketsView .segmented button[aria-pressed="true"]:not(:active) { box-shadow: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) #tradesPane .segmented button[aria-pressed="true"]:not(.import-review :focus-visible), :root:not([data-theme="dark"]) #dailyPane .segmented button[aria-pressed="true"], :root:not([data-theme="dark"]) #propView .segmented button[aria-pressed="true"], :root:not([data-theme="dark"]) #tradeForm .kind3 button[aria-pressed="true"], :root:not([data-theme="dark"]) #marketsView .segmented button[aria-pressed="true"]:not(:active) { box-shadow: 0 0 0 1px rgba(91, 100, 114, 0.55), var(--seg-shadow); } }
:root[data-theme="light"] #tradesPane .segmented button[aria-pressed="true"]:not(.import-review :focus-visible), :root[data-theme="light"] #dailyPane .segmented button[aria-pressed="true"], :root[data-theme="light"] #propView .segmented button[aria-pressed="true"], :root[data-theme="light"] #tradeForm .kind3 button[aria-pressed="true"], :root[data-theme="light"] #marketsView .segmented button[aria-pressed="true"]:not(:active) { box-shadow: 0 0 0 1px rgba(91, 100, 114, 0.55), var(--seg-shadow); }
@supports (color: color-mix(in srgb, red, blue)) {
  @media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) #tradesPane .segmented button[aria-pressed="true"]:not(.import-review :focus-visible), :root:not([data-theme="dark"]) #dailyPane .segmented button[aria-pressed="true"], :root:not([data-theme="dark"]) #propView .segmented button[aria-pressed="true"], :root:not([data-theme="dark"]) #tradeForm .kind3 button[aria-pressed="true"], :root:not([data-theme="dark"]) #marketsView .segmented button[aria-pressed="true"]:not(:active) { box-shadow: 0 0 0 1px color-mix(in srgb, var(--muted) 55%, transparent), var(--seg-shadow); } }
  :root[data-theme="light"] #tradesPane .segmented button[aria-pressed="true"]:not(.import-review :focus-visible), :root[data-theme="light"] #dailyPane .segmented button[aria-pressed="true"], :root[data-theme="light"] #propView .segmented button[aria-pressed="true"], :root[data-theme="light"] #tradeForm .kind3 button[aria-pressed="true"], :root[data-theme="light"] #marketsView .segmented button[aria-pressed="true"]:not(:active) { box-shadow: 0 0 0 1px color-mix(in srgb, var(--muted) 55%, transparent), var(--seg-shadow); }
}
/* The contract picker and the big stop box explain themselves (the select names the contract, the box shows its unit),
   so their labels stay for screen readers only. */
/* The shapes every SizeGuard shield and padlock copies (<use href="#sgMark">, "#lockMark"), with the shield's gold
   gradient (#sgA), in a 0 x 0 drawing of their own outside the page's flow. Never display: none (nor inside anything
   that is): a gradient whose drawing is not rendered is not painted, and every shield that copies it shows blank. They
   lived in the top row's shield until Nov 30 2026; the browser version hides that shield on a wide window, which
   blanked the Unlock card's shield and the covers' (the review of pull request 188). */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main:has(#calcView:not([hidden])) { --gap: 12px; }
#calcView .trade .summary { min-height: 0; }
#calcView select { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
/* Small phones (mini, SE): the "150 ticks = 37.5 pts" line goes; the entry/stop line with Long/Short stays. */
@media (max-height: 880px) { #calcView .summary:has(#direction[hidden]) { display: none; } }
main { position: relative; }
/* Shorter phones: the stop box is a little lower and the gaps in the card a little tighter, so the answer card still
   fits above the bottom bar without scrolling. */
@media (max-height: 820px) { .big-input input { min-height: 43px; font-size: 2rem; } #calcView .card { gap: 6px; } }

/* Prop Firms filter buttons: 4 across (two rows), fewer when the text is large; name over count. */
.about-card { overflow-wrap: anywhere; } /* the support address wraps with very large text; it used to make Markets scroll sideways */
.prop-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(4.1rem, calc((100% - 18px) / 4)), 1fr)); gap: 6px; } /* four across, never more; fewer when the text is large, so the words never run into each other */
.prop-filters .chip { padding: 4px 2px; border-radius: 12px; font-size: 0.82rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; line-height: 1.1; }
/* On the narrowest phones four buttons across leave each one 68 px, and "Evaluation" and "Activation" touched the
   sides of theirs. There the words are a size smaller (12 px, still the smallest text on the screen) and a hair
   tighter, and the buttons sit 4 px apart, not 6: each word then has at least 4 px of air on both sides. Wider
   phones are not changed. The size is in rem, so it still grows with large text (where the buttons go to fewer
   columns and have room to spare). */
@media (max-width: 350px) { .prop-filters { gap: 4px; } .prop-filters .chip { font-size: 0.75rem; letter-spacing: -0.02em; } }
.chip-count { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.75rem; font-weight: 750; }
.chip[aria-pressed="true"] .chip-count { background: var(--surface); color: inherit; }
/* The Total under a picked filter button (prop-ui.js): a thin line in the picked button's gold ties it to that
   button; the amount is bold in the plain text colour, so it never reads as one more red or green entry of the list
   under it. With large text a long count and a big amount take two lines: the amount then sits at the right, in one
   piece, as in the list's rows (review 95a: "+$1,296,296." over "28" could be misread). A long amount is drawn just
   small enough to fit the screen's width: prop-ui.js gives its length as --n, and each character is about 0.6 of
   the text size wide (measured in Chrome and WebKit; 80 px is the page's and the box's sides). An ordinary amount
   keeps its full size. (Review 95b: one fixed smaller size drew a million at half size with large text.) (Its own
   class: .prop-total is the form's "3 × $59.00 = $177.00" line, and review 95a found this box's look had spread
   to that line.) */
.filter-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 12px; margin: 0; padding: 12px 14px; border: 1.5px solid var(--accent-line); border-radius: 14px; background: var(--surface); color: var(--text); font-weight: 750; font-variant-numeric: tabular-nums; }
.filter-total > span { min-width: 0; overflow-wrap: anywhere; }
.filter-total small { font-size: inherit; font-weight: 650; color: var(--muted); }
.filter-total strong { margin-left: auto; font-size: min(1.1rem, calc((100vw - 80px) / (var(--n, 10) * 0.62))); font-weight: 800; white-space: nowrap; }
.more-btn { width: 100%; }
#propView .hint .link-btn, #journalView > .hint .link-btn { min-height: 0; padding: 13px 4px; margin: -13px 0; } /* still 44px to tap, and its lines stay together (the Journal's "Saved only on this device. Back up so…" too: its 44 px button made a tall gap between the two lines; the small look list before launch) */

/* Prop Firms: one Week / Month / Year / All and one firm picker for the whole screen, near the top. The picker sits
   beside the four buttons when both fit (an iPhone's width), and under them on a narrower phone or with large text.
   The buttons are a little tighter than the Journal's so that both fit on one row there; each stays 44 px or more.
   With large text the four buttons take two rows (each one stays as wide as "Month" needs), so no word is cut and
   the page never scrolls sideways. */
.prop-scope { display: flex; flex-wrap: wrap; gap: 8px; }
.prop-scope .segmented { flex: 1 0 auto; max-width: 100%; flex-wrap: wrap; padding: 3px; gap: 3px; } /* (it never shrinks to make room for the picker: the picker goes under it instead) */
.prop-scope .segmented button { min-width: calc(3.2em + 12px); padding: 4px 6px; font-size: 0.85rem; } /* each as wide as "Month" needs */
.prop-firm { flex: 1 1 6.5rem; display: flex; min-width: 0; }
.prop-firm select { flex: 1 1 auto; border-radius: 14px; }
/* By firm: each firm is a button that shows only that firm, and the picked one wears the filter buttons' selected
   look. Each row reaches 10 px into the card's edges, so the words stay in line with the card's title while the
   picked look has room around them; the thin lines between the rows stay where a plain list has its own. */
#propFirmList li { margin: 0 -10px; padding: 2px 0; border-top: 0; }
/* By firm's head: the title and, while one firm is picked, "All firms" at the right, which goes back to every firm
   (it takes the place of the hint line under the title, so the card does not grow). With large text it may go
   under the title: it still sits at the right. */
.firm-head { align-items: center; }
.firm-all { margin-left: auto; padding: 0 14px; font-size: 0.85rem; }
#propFirmList li + li { background: linear-gradient(var(--line), var(--line)) 10px 0 / calc(100% - 20px) 1px no-repeat; }
.firm-row { width: 100%; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 8px 10px; border-radius: 12px; text-align: left; font-variant-numeric: tabular-nums; }
.firm-row[aria-pressed="true"] { background: color-mix(in srgb, var(--accent-line) 12%, transparent); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.firm-row[aria-pressed="true"] > span { color: var(--accent-ink); font-weight: 750; }

/* Nothing in range: nearest sizes under and over the target. The closest card gets the same thin gold line as an
   in-range pick, no glow (the calmer look, the owner picked it from pictures, Dec 1 2026). */
.result.closest { border-color: var(--accent-line); }
/* "Closest to your risk": the same tag as "Best pick", but in the outline colour on a pale wash of it, because
   this card is outlined and not filled. */
.pick-badge.near { padding-left: 7px; background: color-mix(in srgb, var(--accent-line) 14%, transparent); color: var(--accent-ink); } /* (a little less room on the left for its aim sign) */
.nofit-note { font-size: 0.9rem; font-weight: 600; color: var(--error); }
/* When another card of the pair does show a size, this card not fitting is only a side note: quiet grey, no warning
   sign. Red is kept for when nothing fits at all. */
.nofit-note.quiet { color: var(--muted); font-weight: 500; }
.options { display: flex; flex-direction: column; gap: 6px; }
.option { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 6px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); font-variant-numeric: tabular-nums; }
.option .opt-count { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.option .opt-unit { font-weight: 500; }
.option .opt-risk { margin-left: auto; font-size: 0.9rem; color: var(--muted); }
.option .opt-risk strong { color: var(--text); font-weight: 600; }
/* The closest size of the two: a thin gold line, and its number in the answer's gold ink. */
.result.closest .option.best { border-color: var(--accent-line); }
.result.closest .option.best .opt-count { color: var(--accent-ink); }


/* Daily card: one full-width Save button, as tall as Save in Add trade (the size is shared: see ".tf-dock
   .primary-btn, .day-save .primary-btn"). It is the one filled button on the card. Under it the saved line, then
   Delete as quiet red text (it borrows Add trade's .tf-delete), no longer a red outline right beside Save.
   Delete keeps its place while it is hidden: it is invisible and cannot be tapped or focused, but its 44 px stay.
   Without that, the first answer of a day made Delete appear and pushed the whole Trading Book down, and the
   browser laid the book out again: that one tap took two frames on a slowed phone instead of one. */
.day-save { display: flex; flex-direction: column; gap: 6px; }
#dDelete[hidden] { display: block !important; visibility: hidden; }
#dSaved.done { font-weight: 700; }
.day-row.current { border-color: var(--accent-line); }
.swipe > .prop-row, .swipe > .trade { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.nofit-note.one-line .eyebrow { margin-right: 4px; }
#calcView .result:has(> .one-line) { padding-top: 8px; padding-bottom: 8px; }

/* Back up / Restore (Markets tab). Stays usable after the trial: your data is always yours. */
.data-card { margin-top: 6px; }
/* About (Markets tab): owner, Privacy/Terms on sizeguard.com, support email. Always visible. */
.about-card p { margin: 0; }
.about-card a { color: var(--text); text-decoration: underline; display: inline-block; min-height: 44px; line-height: 44px; }
.about-card .nowrap { white-space: nowrap; }
.data-counts { margin: 0; font-weight: 650; }
.last-backup.due { font-weight: 650; } /* "No backup yet.", "Time for a new one.": grey like any hint, a little bolder (the market colour fills only a screen's main button and the chosen market on Markets; the calculator's answer card is a dark card with a thin ring since Nov 30 2026; the screens reviewer of 340e68b) */
/* "Back up" and "Restore" each stay on one line: side by side while both fit, else one under the other, each as wide
   as the card (the fresh review of 39ce13c: "Back / up" at 390 and 320 px with 200% text). They are one matched pair:
   the same button (.ghost), the same size and weight, and the same width side by side (one basis for both). (The
   fresh review of cf23ec7: "Back up" was bigger and bolder, 164 against 156 px wide.) */
.data-card .csv-row { display: flex; flex-wrap: wrap; }
.data-card .csv-row button { flex: 1 1 9em; width: auto; white-space: nowrap; padding: 0 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.restore-review { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line); }
.restore-review p { margin: 0; }
.link-btn { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 4px; color: var(--accent-line); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.more-trades { width: 100%; }

/* Pending limit orders: waiting to fill, kept out of the journal's stats. */
.pending-card { border: 1.5px dashed var(--accent-line); }
.pending-card h2 { margin: 0 0 4px; font-size: 1.05rem; }
.pending-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pending-row { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 0; border-top: 1px solid var(--line); }
.pending-info { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 0; background: none; border: 0; color: inherit; font: inherit; }
.pending-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* Under the list of pending orders: "Show all" (or "Show 50 more") when not every order is drawn, and, when some
   orders have waited more than 90 days, one quiet line that says how many, with a link under it that takes those
   off the list (Undo brings them back). The line is set apart from the list by the same thin line that parts the
   rows. The link stands on a row of its own, 44 px tall, so it is easy to tap and its tap area never lies over
   the sentence above it (an earlier version tucked the link's padding up over that sentence, and a tap on the
   lower half of the sentence took the orders off). */
#pendingMore { margin-top: 10px; }
.pending-old { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.pending-old .link-btn { display: flex; padding: 0; text-align: left; }
#pendingTitle:focus { outline: none; }
.pending-actions button { width: 100%; }
.saved-msg { color: var(--accent); font-weight: 600; }
/* Open trades: close one with a tap (R) or an exit price. */
.open-card { border: 1.5px solid var(--accent-line); }
.open-card h2 { margin: 0 0 4px; font-size: 1.05rem; }
.close-r { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 6px; }
.close-r .c-loss { white-space: nowrap; padding: 0 4px; }
.close-r button { min-height: 52px; font-size: 1rem; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 700; color: var(--text); background: var(--field); }
.close-r .c-loss { color: var(--error); border-color: var(--error); }
.close-price { display: flex; gap: 8px; }
.close-price input { flex: 1; min-width: 0; min-height: var(--tap); font: inherit; font-size: max(1rem, 16px); color: inherit; background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; }
.close-more { justify-self: start; }
.open-badge { color: var(--accent); font-weight: 750; }
/* Welcome (trial terms) and legal links */
body.welcoming .bottom-nav { display: none; }
.welcome-card h1 { line-height: 1.15; }
.legal { margin: 4px 0 0; text-align: center; font-size: 0.9rem; color: var(--muted); }
.legal a { color: inherit; text-decoration: underline; display: inline-block; min-height: 44px; line-height: 44px; padding: 0 6px; }
.lock-card .ghost { width: 100%; max-width: 280px; }
.welcome-card .form-actions .ghost { flex: 1; }

/* Trade days off screen skip layout and paint until scrolled near. */
.day-group { content-visibility: auto; contain-intrinsic-size: auto 240px; }
#backupMsg:empty { display: none; }
#backupMsg.failed { color: var(--error); font-weight: 600; } /* (what did not work: as a box's error line, .field-error) */
#accountCard p.hint.failed { color: var(--error); font-weight: 600; } /* (the same on the Account card: a wrong code, a sync that did not go through) */
/* Take profit, daily loss limit, fees */
.tp-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tp-row label { font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
/* Take profit by unit or by quick R:R: a compact two-way switch right beside the box, no extra row. */
.tp-input { position: relative; flex: 1 1 170px; min-width: 0; display: flex; align-items: center; gap: 6px; }
.tp-input input, .tp-input select { flex: 1 1 auto; width: auto; min-width: 64px; font-weight: 650; }
.tp-input select { padding-left: 10px; padding-right: 24px; background-position: calc(100% - 14px) 55%, calc(100% - 8px) 55%; }
.tp-mode { display: flex; flex: none; padding: 2px; gap: 2px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; }
.tp-mode button { min-height: 44px; min-width: 44px; padding: 0 6px; border-radius: 10px; font-size: 0.85rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.limit-warn { margin-top: 6px; padding: 6px 10px; border-radius: 10px; font-size: 0.85rem; font-weight: 700; color: var(--error); background: color-mix(in srgb, var(--error) 14%, transparent); }
/* Risk is bigger than what is left of today's daily loss limit: one red line and a one-tap fix under the risk boxes. */
/* (A warning inside the answer card is the same red line as on any card. Until Nov 30 2026 the card was filled with
   the market's colour and the warning sat on a darker band of it in the fill's own ink.) */
.room-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; padding: 8px 10px; border-radius: 12px; font-size: 0.88rem; font-weight: 650; line-height: 1.35; color: var(--error); background: color-mix(in srgb, var(--error) 14%, transparent); }
.room-warn[hidden] { display: none; }
.room-warn span { flex: 1 1 14em; }
/* "Use $X": a raised tile with red words, not a filled red button. */
.room-btn { min-height: var(--tap); padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--error); background: var(--raised); color: var(--error); box-shadow: var(--seg-shadow); font-weight: 750; font-variant-numeric: tabular-nums; }
/* "What's left today": one centred row that is also a button (it opens My rules on Markets). With large text, or
   when the daily limit is hit and a tip is shown, its parts wrap onto lines of their own. */
.day-limit { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 6px; width: 100%; min-height: var(--tap); padding: 6px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font-size: 0.9rem; text-align: center; }
.day-limit[hidden] { display: none; }
.day-limit span { color: var(--muted); }
.day-limit strong { font-variant-numeric: tabular-nums; }
.day-limit.hit { border-color: var(--error); color: var(--error); background: color-mix(in srgb, var(--error) 12%, transparent); }
.day-limit.hit span { color: inherit; }
/* Calculator patience line: one reminder a day, plain ink beside a thin line in the market's colour.
   It closes the "Risk per trade" card, under the three risk boxes (and under a risk message when one shows),
   so the top of the card is only the heading and the boxes. The small top margin adds to the card's own gap,
   so the line never sits tight against the boxes above it. Its words are medium weight (500), not bold: the calmer
   Calculator, Nov 30 2026. */
.patience-line { margin: 2px 0 0; padding-left: 10px; border-left: 2px solid var(--accent-line); font-size: 0.9rem; font-weight: 500; line-height: 1.35; }
.patience-line:empty { display: none; }
.day-tip { flex-basis: 100%; color: var(--text); font-size: 0.95rem; font-weight: 600; font-style: italic; }
.rules-card { gap: 10px; }
.rules-sub { margin: 6px 0 0; font-size: 1rem; }
.fee-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.money-input.pct input { padding-left: 12px; padding-right: 26px; }
.money-input.pct span { left: auto; right: 10px; }
/* Final polish: the header only speaks up when saving fails. */
.saved:not(.off) { display: none; }
/* Account & sync card (Markets tab; shows once accounts are switched on in src/config.js) */
.account-card .account-status { margin: 0; }
/* An email with no place to break ("Signed in as averyveryverylongname@…", "We emailed a 6-digit code to …") breaks
   anywhere rather than push the page sideways (at 150-200% text on a 375-390 px phone it did: item 317, worse than 39).
   (word-break: break-word first, for the browser version in Safari 15.0 to 15.3, which do not know "anywhere".) */
.account-card .account-status, .account-card .hint { word-break: break-word; overflow-wrap: anywhere; }
/* The question before a journal made with no account joins the account signing in (item 313, account-ui.js ask): the
   question in the card's own words, a line under it, and its two answers of the same weight: one under the other on a
   phone (the longer one, "Keep them on this phone only", whole on one line), side by side on a computer. */
.account-card .account-ask { display: flex; flex-direction: column; gap: 10px; }
.account-card .account-ask-title { font-weight: 750; font-size: 1.05rem; line-height: 1.35; }
.account-card .account-ask .account-buttons { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
/* A line of the card takes the focus only so that it is read out: no ring, whichever line it is (the fresh review of
   cf23ec7: the line just said, "Synced 11:41 PM" or "Signed out…", wore the browser's thin blue default ring). */
.account-status:focus, .account-card p[role="status"]:focus { outline: none; }
.account-card .account-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.account-card .account-buttons button { min-height: 48px; border-radius: 12px; font-weight: 750; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); }
.account-card .account-form { display: grid; gap: 8px; }
.account-card .account-form label { font-weight: 700; font-size: 0.9rem; }
.account-card .account-form input { min-height: 48px; font-size: 1.05rem; }
/* "Restore purchase" on the signed-in card (only on a phone whose own purchase is not on the account yet: account-ui.js,
   "a purchase made signed out"): its grey line, then its quiet button (.ghost) as wide as the card, as the card's other
   quiet button ("Use a different email or send a new code") is; the line and button set apart as the card's form parts
   are (8 px). Nothing new to see: the card's own sizes and colours. (Left at its own width, the button stood alone at
   the left under two buttons as wide as the card.) */
.account-card .account-restore { display: grid; gap: 8px; }
.account-card .soon { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 750; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); }
/* "Delete my account" and its "Yes, delete my account": quiet red text, as a trade's and a Prop Firms entry's Delete
   (.tf-delete). (The fresh review of cf23ec7: in muted grey under a red warning, "Yes" looked disabled.) */
.account-card .danger-link { min-height: 44px; border: none; background: none; color: var(--error); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
/* "Yes, delete" in the 0.7 s after its question (swipe.js, settled): not ready yet, in the app's disabled look (as
   .icon-btn:disabled): faded, the same size and place; then ready. A press meanwhile does nothing (the screens
   reviewer of 50b616b: nothing showed why). The Account card's, a trade's and a Prop Firms entry's. */
.account-card .danger-link[aria-disabled="true"], .tf-delete[aria-disabled="true"] { opacity: 0.35; cursor: default; }
/* Wording that depends on accounts (set by account-ui.js on <body>: data-accounts, data-signed-in). */
/* Each phone names only its own store (Apple rule 2.3.10). os.js sets data-platform on <html>; browsers have none. */
[data-os="ios"], [data-os="android"] { display: none; }
html[data-platform="ios"] [data-os="ios"], html[data-platform="android"] [data-os="android"] { display: revert; }
html[data-platform="ios"] [data-os="other"], html[data-platform="android"] [data-os="other"], html[data-platform="android"] [data-os="not-android"] { display: none; }
.when-signed-in, .when-accounts { display: none; }
body[data-signed-in] .when-signed-in, body[data-accounts] .when-accounts { display: inline; }
body[data-signed-in] .when-signed-out { display: none; }

/* Daily Journal date picker: month grid (gold dot = card saved) and a 12-month year view. Trades calendar days open that day's card. */
.cal-title { font-size: 1.05rem; text-decoration: none; }
button.cal-day { position: relative; color: inherit; padding: 0; }
button.cal-day:disabled { opacity: 0.35; cursor: default; }
.cal-day.open { box-shadow: inset 0 0 0 2px var(--accent-line); }
.cal-day .dot, .cal-month .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-line); }
.cal-day .dot { position: absolute; top: 4px; right: 4px; }
.cal-year { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cal-year .cal-day { min-height: 56px; font-weight: 700; }
.cal-year .cal-day small { font-size: 0.68rem; color: var(--muted); font-weight: 600; }

/* Trading Book: leather cover, cream paper, gold foil. One page per day; pages turn like real paper (book.js).
   The book lies closed under the daily card, a small book, and opens into a room of its own: a sheet, the same kind
   as Add trade (book-room.js). Everything the book prints is set here; no code measures the paper to make a day fit. */
/* The paper stays cream in dark mode, only a little dimmer, so it does not glare on a dark screen. These are the
   dark-mode values; the two rules after this one give the brighter paper of light mode. */
.trading-book { --ptitle: #7a5510; --pg: #ece8e0; --pg2: #e4decf; --note1: #f3efe7; --note2: #ebe5d8; --ink: #1f1a12; --pmut: #645a4c; --pline: rgba(110,80,30,.22); --pwin: #0a7a50; --pwin2: #0a6e49; --ploss: #c22e4a;
  --edge: repeating-linear-gradient(90deg, #d5cab2 0 1px, #e9e3d5 1px 2.5px); --edge2: 0 2px 0 #d4c9b0, 0 4px 0 #c7bb9f; --hide: 0 0 0 1px rgba(242,207,116,.22), 0 30px 40px -28px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.1);
  --foil: linear-gradient(135deg, #b8862b, #f2cf74 45%, #a8701c 75%, #e2b453); --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  -webkit-font-smoothing: antialiased; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .trading-book { --pg: #fbf7ee; --pg2: #f3ecdc; --note1: #fefbf4; --note2: #f8f2e4; --pmut: #6e6354; --pline: rgba(110,80,30,.2); --pwin: #0b8457;
  --edge: repeating-linear-gradient(90deg, #e8dec6 0 1px, #faf4e6 1px 2.5px); --edge2: 0 2px 0 #e6dcc3, 0 4px 0 #d9cdb0; --hide: 0 30px 40px -28px rgba(36,26,18,.75), inset 0 1px 0 rgba(255,255,255,.06); } }
:root[data-theme="light"] .trading-book { --pg: #fbf7ee; --pg2: #f3ecdc; --note1: #fefbf4; --note2: #f8f2e4; --pmut: #6e6354; --pline: rgba(110,80,30,.2); --pwin: #0b8457;
  --edge: repeating-linear-gradient(90deg, #e8dec6 0 1px, #faf4e6 1px 2.5px); --edge2: 0 2px 0 #e6dcc3, 0 4px 0 #d9cdb0; --hide: 0 30px 40px -28px rgba(36,26,18,.75), inset 0 1px 0 rgba(255,255,255,.06); }

/* The closed book, the first thing on the Daily Journal (above the date bar since Dec 1 2026). It is a small book standing upright, about three wide to four tall,
   and the whole of it is one button. From back to front it is made of plain shapes, no pictures:
   - the back cover, a dark edge that shows along the right and the bottom, with a soft shadow under it as if
     the book lay on a desk;
   - the block of pages, whose cream edges show between the two covers, along the right and the bottom;
   - the front cover: the same dark leather as the open book in the room, lit softly from the top left, with a
     stitched line near its edge and a spine down its left side (a darker strip with three raised bands);
   - on the cover, a little above the middle: the title in gold foil, a thin gold rule, the page count and
     "Press to open" in small spaced capitals;
   - the gold ribbon, hanging out of the pages at the bottom.
   --bkw is the book's width and every other measure is a share of it. On a phone it is about half the screen
   (48 of every 100 across), never under 156px or over 200px. With larger text it grows, so that the title and
   the lines still fit at their full size: it is at least 9.4 times the text size, up to 250px, and never wider
   than the screen less 64px. (With text at twice its size "Press to open" takes two lines.) The words stand a
   little above the middle of the cover: the space kept free under them is about 15 of every 100 of the book's
   width at normal text size, and less as the text grows and the words need the room (8px at twice the size). (Nothing here that an older iPhone does not know: see the note at the top of the
   room's styles.)
   With no saved card yet the book is a plain paragraph, not a button: quieter (flatter leather, no foil, no
   ribbon) and its cover says how page 1 comes to be.
   The button's box is a little taller than the book. Under the book it keeps a see-through strip as long as
   the part of the ribbon that hangs out (the ribbon starts .042 of the book's width above the book's bottom
   edge and is .15 long, which leaves .108; and 1px more, because a screen rounds the strip down to whole
   pixels). So the ring drawn around the button when it is reached with the keyboard goes around the ribbon
   too, and the ribbon does not stick out through the ring. The book itself
   keeps its size (the strip is added under it, "content-box"), and the shelf keeps the height of the book
   alone, so the strip hangs into the free space under the shelf and nothing on the page moves. (A computer
   set to "high contrast" draws a see-through border as a solid bar, so there the strip is left out.)
   Only the button has the strip. The quiet book has no ribbon, so its box is exactly the book: it takes the
   focus when the last card is deleted, and a strip there showed as an empty band under the book, inside the
   ring (a reviewer found it, Nov 2026). */
/* No room above the shelf: it is the first thing on the Daily Journal (the owner, Dec 1 2026), so its cover's top edge
   sits the same distance under the screen's top row as the first card on every other screen ("Gap A", 28px). Under it,
   22px and the pane's gap: room for the ribbon that hangs below the book, then the date bar. */
.bk-shelf { position: relative; display: flex; justify-content: center; height: calc(var(--bkw) * 4 / 3); margin: 0 0 22px; --bkw: min(max(clamp(156px, 48vw, 200px), 9.4rem), 250px, calc(100vw - 64px)); --bkt: calc(var(--bkw) * .056); --bks: calc(var(--bkw) * .1); }
.bk-closed { position: relative; z-index: 1; flex: none; display: block; width: var(--bkw); height: calc(var(--bkw) * 4 / 3); margin: 0; padding: 0; border-radius: 5px 11px 12px 6px; color: #e8dcc0; text-align: center; }
button.bk-closed { box-sizing: content-box; border-bottom: calc(var(--bkw) * .108 + 1px) solid transparent; } /* the strip for the ribbon: on the button only (see the note above) */
@media (forced-colors: active) { button.bk-closed { border-bottom: 0; } }
.bk-closed::before { content: ""; position: absolute; inset: calc(var(--bkt) * .5) 0 0 calc(var(--bkt) * .5); border-radius: 4px 10px 11px 5px; background: #1b130c; box-shadow: var(--hide); } /* the back cover and the shadow on the desk */
.bk-closed::after { content: ""; position: absolute; inset: calc(var(--bkt) * .4) calc(var(--bkt) * .36) calc(var(--bkt) * .36) var(--bkt); border-radius: 1px 3px 4px 2px; background-color: var(--pg); /* the pages: fine lines down the right edge and along the bottom edge */
  background-image: linear-gradient(90deg, rgba(60,40,10,.3), transparent 12%), repeating-linear-gradient(90deg, transparent 0 1px, rgba(110,80,30,.34) 1px 2px), repeating-linear-gradient(180deg, transparent 0 1px, rgba(110,80,30,.34) 1px 2px);
  background-size: 100% var(--bkt), var(--bkt) calc(100% - var(--bkt) * .64), 100% var(--bkt); background-position: 0 100%, 100% 0, 0 100%; background-repeat: no-repeat; }
.bk-closed-cover { position: absolute; z-index: 1; inset: 0 var(--bkt) var(--bkt) 0; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden;
  padding: 0 calc(var(--bkw) * .05) max(0px, calc(var(--bkw) * .387 - 2.775rem)) calc(var(--bks) + var(--bkw) * .05); border-radius: 4px 10px 10px 4px;
  background: radial-gradient(125% 85% at 24% 0%, #4a3622, #241a12 68%); box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset -1px -1px 0 rgba(0,0,0,.35), 1px 1px 2px rgba(0,0,0,.4); }
.bk-closed-cover::before { content: ""; position: absolute; inset: calc(var(--bkw) * .034) calc(var(--bkw) * .034) calc(var(--bkw) * .034) calc(var(--bks) + var(--bkw) * .034); border: 1px dashed rgba(242,207,116,.38); border-radius: 3px 7px 7px 3px; pointer-events: none; } /* the stitching */
/* The spine: darker than the cover, a soft light down its round back, a groove where the cover hinges, and three
   raised bands across it (each a fine gold line above and below a small swell). */
.bk-closed-cover::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--bks); pointer-events: none; --band: linear-gradient(180deg, rgba(242,207,116,.42) 0 1px, rgba(255,255,255,.12) 1px, rgba(0,0,0,.3) 5px, rgba(242,207,116,.42) 5px 6px);
  background: var(--band) 0 13% / 100% 6px no-repeat, var(--band) 0 50% / 100% 6px no-repeat, var(--band) 0 87% / 100% 6px no-repeat,
    linear-gradient(90deg, rgba(0,0,0,.5), rgba(255,255,255,.1) 32%, rgba(0,0,0,.16) 68%, rgba(0,0,0,.55) calc(100% - 2px), rgba(255,255,255,.1) calc(100% - 1px)); }
.bk-closed-name { position: relative; display: block; max-width: 5.2em; font: 400 min(1.625rem, calc(var(--bkw) * .21))/1.06 var(--serif); background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; } /* (5.2em: "Trading" and "Book" each fit, the two together do not, so the title is always two lines) */
.bk-closed-name::after { content: ""; display: block; width: calc(var(--bkw) * .29); height: 1px; margin: calc(var(--bkw) * .068) auto calc(var(--bkw) * .06); background: linear-gradient(90deg, transparent, #f2cf74 30%, #f2cf74 70%, transparent); } /* the thin gold rule */
.bk-closed-say { position: relative; display: block; font-size: min(.6875rem, calc(var(--bkw) * .09)); font-weight: 700; line-height: 1.5; letter-spacing: .12em; text-transform: uppercase; }
.bk-closed-say span { display: block; padding-left: .12em; } .bk-closed-say span + span { margin-top: .3em; color: #bfa76e; }
.bk-closed-mark { position: absolute; z-index: 1; right: 21%; top: calc(100% - var(--bkt) * .75); width: calc(var(--bkw) * .058); height: calc(var(--bkw) * .15); background: linear-gradient(90deg, #a8701c, #f2cf74 50%, #b8862b); clip-path: polygon(0 0,100% 0,100% 100%,50% 78%,0 100%); pointer-events: none; }
button.bk-closed:active .bk-closed-cover { box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset -1px -1px 0 rgba(0,0,0,.35), 1px 1px 2px rgba(0,0,0,.4), inset 0 0 0 999px rgba(0,0,0,.16); } /* pressed: the leather darkens (and the book dips: see "Small motions") */
p.bk-closed::before { box-shadow: 0 2px 5px rgba(36,26,18,.28); }
p.bk-closed .bk-closed-cover { background: radial-gradient(125% 85% at 24% 0%, #453c34, #2b2520 68%); }
p.bk-closed .bk-closed-name { background: none; color: #c8b27c; } p.bk-closed .bk-closed-name::after { background: #8d7d59; }
p.bk-closed .bk-closed-say { font-size: min(.75rem, calc(var(--bkw) * .09)); font-weight: 500; line-height: 1.4; letter-spacing: 0; text-transform: none; color: #d8ccb1; }
p.bk-closed:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; } /* the quiet book takes the focus when the last card is deleted with the keyboard: the app's ring, as on the closed book, and it hugs the book (no ribbon strip here). It had the browser's thin default ring. */
@media (max-width: 340px) { .bk-closed-name { font-size: min(1.5rem, calc(var(--bkw) * .21)); } }
/* Save: one sheet of the book's own paper (its page colours, light or dark look) rises into the closed book through
   its bottom edge, where the cream page edges show, ending behind the cover (daily-ui.js, INTO THE BOOK, moves it,
   from almost see-through over the date bar to solid paper as it goes in; the rest of the time, and when the phone
   asks for less motion, it is not to be seen). The owner, Dec 1 2026: "we are saving in the bottom", so the page goes
   in from the bottom (it came in from the top for a few hours that day). It is about three quarters of the book's
   width and 34px tall, and it lies behind the whole book, the gold ribbon too, so the ribbon hangs in front of it.
   At rest its top is tucked 10px under the book's bottom edge. A hairline edge in the pages' line colour and a soft
   still shadow keep it clear on the light page too, where cream on near-white was soft (no blur filter: only its
   place, size and opacity move). */
.bk-slip { position: absolute; z-index: 0; left: 50%; top: calc(100% - 10px); width: calc(var(--bkw) * .74); height: 34px; margin-left: calc(var(--bkw) * -.34); border-radius: 0 0 3px 3px; background: linear-gradient(180deg, var(--pg2), var(--pg)); box-shadow: 0 0 0 1px rgba(110,80,30,.24), 0 2px 6px rgba(36,26,18,.3); opacity: 0; pointer-events: none; }

/* The room. It never scrolls: the title, the filters and the row under the page keep their places, and the open
   book takes all the height that is left.
   Some of the book's rules ask how wide or tall a box is ("@container", and the "cqw" unit: hundredths of a
   box's width). iPhones on iOS 15 and other browsers from before 2022 know neither. So every such rule sits
   inside "@supports (width: 1cqw) { … }", which those browsers skip as a whole, and outside it there is always a
   plain rule that works for them. It has to be done this way: a rule that contains var() is never thrown away
   by a browser that cannot read the rest of it (it fails later, and the size then falls back to the size of
   the box around it, 16px for the day's result), so writing the newer rule after the older one does not work.
   The older browsers get two widths worked out from the screen instead, used further down:
   --pgw: the width of the page between its margins. On a phone that is the screen less 96px (the room's edges,
   the leather and the page's margins). A screen wider than a phone is counted as 430px, the small, safe side.
   --rmw: the width of the room, the same way.
   Inside "@supports" the two are the real widths. "bk-room" lets rules further down ask how tall the room is. */
.trading-book { --pgw: calc(min(100vw, 430px) - 96px); --rmw: min(100vw, 430px); }
@supports (width: 1cqw) { .br { container: bk-room / size; --rmw: 100cqw; } .bk-pg { container: bk-pg / inline-size; --pgw: 100cqw; } .bk-when { container: bk-when / inline-size; } }
/* The grab line. It looks as it did (a short line, 8px from the top of the sheet), but the place a finger can
   take hold of is 44px tall, with the line near its middle: it starts 12px above the sheet's top edge and
   reaches 12px down into the title row, which lets touches through to it everywhere except on its buttons. */
.br-grab { flex: none; display: grid; justify-items: center; align-content: start; height: 44px; margin: -12px 0; padding-top: 20px; touch-action: none; cursor: grab; } .br-grab .tf-grab { margin: 0; }
/* The title row: the title and the Contents button share it while both fit; with large text the Contents button
   drops under the title. The close button is not part of that: it keeps the top right corner at any text size. */
.br .tf-head { flex-wrap: nowrap; align-items: flex-start; padding-top: 0; padding-bottom: 8px; pointer-events: none; } .br .tf-head button { pointer-events: auto; }
.br-top { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; }
.br .tf-title { flex: 0 1 auto; }
.br .tf-title h2 { font: 400 1.75rem/1.1 var(--serif); letter-spacing: -.01em; }
.br-chip { gap: 6px; padding: 0 9px; color: var(--text); font-size: .82rem; } .br-chip .ic { color: var(--muted); }
.br-face { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 max(10px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); }
#bkBook { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; } /* it only ever scrolls when the room is cramped: see the end of this block */
/* An Undo message (a day deleted in Contents) shows over the room, low down, and can be tapped there. It is named by
   its id (#toast): on a phone (under 600 px) everything in main but the open sheet is hidden while a sheet is open
   (html.sheet-open main > :not(.sheet), further down), and with the same weight that later rule won, so a day deleted
   in Contents had no Undo on a phone (review 93g; it was so on main too). */
html.book-open main > #toast { visibility: visible; z-index: 45; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }

/* The seven filters, all in view: four across, name over count. The chosen one has a light tint and a line in the
   market's colour (never a fill). The eighth place is "See the pattern", which is there only while a filter is
   chosen and its chapter note is not showing. With large text they sit three or two across: a column is never
   narrower than six letters of the filters' own size ("em"), which is what "Broke hours" needs on one line. */
.bk-filters { flex: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(max(6em, 22%), 1fr)); gap: 6px; font-size: .82rem; }
.bk-filters button { min-width: 0; min-height: 46px; padding: 4px 1px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 1em; line-height: 1.2; letter-spacing: -.01em; text-align: center; }
.bk-filters b { font-weight: 650; } .bk-filters span { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.bk-filters button[aria-pressed="true"] { border: 1.5px solid var(--accent-line); color: var(--accent-ink); }
@supports (color: color-mix(in srgb, red, blue)) { .bk-filters button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent-line) 12%, var(--field)); } } /* (older iPhones: see "color-mix" at the end of the book's styles) */
.bk-filters button[aria-pressed="true"] b { font-weight: 700; } .bk-filters button[aria-pressed="true"] span { color: inherit; }
.bk-filters button:disabled { opacity: .45; }
.bk-filters .bk-see { border-style: dashed; background: none; color: var(--accent-ink); font-weight: 700; }

/* The open book. The leather shows round the paper; the paper is the page. */
.bk-stage { position: relative; flex: 1 1 auto; min-height: 12em; margin: 17px 16px 21px 10px; perspective: 1500px; perspective-origin: 30% 50%; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.bk-stage:active { cursor: grabbing; }
.bk-cover { position: absolute; inset: -10px -16px -14px -10px; border-radius: 10px 20px 20px 10px; background: radial-gradient(140% 90% at 20% 0%, #3a2a1b, #241a12 60%); box-shadow: var(--hide); }
.bk-cover::after { content: ""; position: absolute; inset: 4px; border-radius: 7px 17px 17px 7px; border: 1px dashed rgba(242,207,116,.35); }
.bk-mark { position: absolute; right: 38px; top: calc(100% - 4px); width: 14px; height: 24px; z-index: 1; background: linear-gradient(90deg, #a8701c, #f2cf74 50%, #b8862b); clip-path: polygon(0 0,100% 0,100% 100%,50% 78%,0 100%); pointer-events: none; }
.bk-edges { position: absolute; inset: 4px -7px -5px 6px; border-radius: 0 16px 18px 0; background: var(--edge); box-shadow: var(--edge2); }
.bk-sheet, .bk-slice { position: absolute; inset: 0; color: var(--ink); overflow: hidden; border-radius: 5px 16px 16px 5px;
  background: linear-gradient(90deg, rgba(90,60,15,.24), rgba(90,60,15,.07) 16px, transparent 44px), linear-gradient(180deg, var(--pg), var(--pg2)); }
/* The page is the one thing in the room that scrolls: up and down, inside the paper, with no bar at its side (a
   scroll bar would make it look like a web page). The browser does the scrolling by itself, so it never waits
   for the app's code. A sideways move of the finger is left to the page turn (book.js): that is what "pan-y" says.
   The open page keeps its own layer all the time, so turning a page never re-draws its letters (no flicker). */
.bk-under { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-y; transform: translateZ(0); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.bk-under::-webkit-scrollbar, .bk-months::-webkit-scrollbar, .bk-ribbon::-webkit-scrollbar { display: none; }
.bk-under:focus-visible { outline: 3px solid var(--accent-line); outline-offset: -3px; }
/* "There is more below": the last lines on the paper fade softly into it. The foot of every page is empty for as
   much as the fade is tall, so at the end of a day (and on a short day) there is nothing under the fade to see. */
.bk-fade { position: absolute; left: 20px; right: 0; bottom: 0; z-index: 2; height: 34px; border-radius: 0 0 16px 0; background: linear-gradient(180deg, transparent, var(--pg2) 88%); pointer-events: none; }
.bk-stage.noted > .bk-fade, .bk-stage.noted > .bk-curl { display: none; } /* a chapter note covers the foot of the page, its curled corner too */
/* A short line at the foot of the paper, in the book's own print: "This is your newest page.", and once after the
   app starts how to turn a page. It lies on the paper, over a soft fade of its own, so the date and the strip of
   days under the book stay in view. It is always there for screen readers and shows only while it has words (not
   over a chapter note, whose button is at the foot). */
.bk-msg { position: absolute; left: 20px; right: 0; bottom: 0; z-index: 2; margin: 0; padding: 30px 42px 11px 14px; border-radius: 0 0 16px 0; background: linear-gradient(180deg, transparent, var(--pg2) 26px); color: var(--ink);
  font: italic 1rem/1.25 var(--serif); text-align: center; text-wrap: balance; pointer-events: none; transition: opacity .25s; }
.bk-msg:empty, .bk-stage.noted > .bk-msg { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .bk-msg { transition: none; } }
.bk-spine { position: absolute; left: 0; top: 0; bottom: 0; z-index: 2; width: 4px; background: linear-gradient(90deg, rgba(60,40,10,.35), transparent); pointer-events: none; }
.bk-curl { position: absolute; right: 0; bottom: 0; z-index: 2; width: 38px; height: 38px; border-top-left-radius: 8px; background: linear-gradient(135deg, transparent 50%, #e9dfc8 50%, #fff9ec 80%); box-shadow: -3px -3px 6px -2px rgba(60,40,10,.25); pointer-events: none; }
/* The page corner turns to the next day (forward, as in a printed diary). It is a button for the keyboard and for screen readers; a finger goes
   through it to the paper, so a scroll can start on the corner too (book.js sees a tap there by its place). */
.bk-corner { position: absolute; right: 0; bottom: 0; z-index: 6; width: 56px; height: 56px; padding: 0; border-radius: 12px 0 16px 0; pointer-events: none; }
/* The turning page (book.js): strips of the page, each with its own piece of the paper's edge marks. */
.bk-slice { right: auto; border-radius: 0; }
.bk-hold { position: absolute; inset: 0; overflow: hidden; } .bk-hold > .bk-pg { transform: translateY(var(--bk-y, 0px)); } /* the part of the page that was in view */
/* A copy that holds only the part of a long day in view (book.js, inView) begins at its very top, with no room
   above its first part; the soft colour in the page's top corner is drawn where the top of the whole page would be.
   The same when the first thing in view is the divider between two devices' writings: no room above it either. */
.bk-pg.piece { padding-top: 0; } .bk-pg.piece > :first-child { margin-top: 0; } .bk-pg.piece > .piece-top { padding-top: 0; } .bk-pg.piece > .piece-top > .bk-also:first-child { margin-top: 0; } .bk-pg.piece::before { top: calc(0px - var(--bk-top, 0px)); }
.bk-castbox { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; border-radius: 5px 16px 16px 5px; }
.bk-cast { position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% + 70px); opacity: 0; will-change: transform, opacity; visibility: hidden;
  background: linear-gradient(90deg, rgba(30,20,5,.9), rgba(30,20,5,.9) calc(100% - 70px), rgba(30,20,5,0)); }
.bk-leaf { position: absolute; inset: 0; z-index: 4; transform-style: preserve-3d; visibility: hidden; pointer-events: none; }
.bk-leaf.on, .bk-cast.on { visibility: visible; }
.bk-bend { position: absolute; top: 0; bottom: 0; left: 0; transform-origin: left center; transform-style: preserve-3d; will-change: transform; }
.bk-bend .bk-bend { left: 100%; }
.bk-face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--pg); }
/* Where two strips meet, each strip reaches 1px under the next one and carries the page's own picture and shade
   there. (Before, a 1px edge in the plain paper colour closed the joins: on an iPhone it showed as seven thin
   light lines down the turning page, through the letters too. The owner saw them, Dec 1 2026.) */
.bk-bend:not(.last) > .bk-face { right: -1px; }
.bk-face.back { transform: rotateY(180deg) translateZ(.4px); background: repeating-linear-gradient(180deg, var(--pg) 0 47px, #ece3cf 47px 48px); }
.bk-lit { position: absolute; inset: 0; z-index: 3; }
.bk-bend.first > .front { border-radius: 5px 0 0 5px; } .bk-bend.first > .back { border-radius: 0 5px 5px 0; }
.bk-bend.last > .front { border-radius: 0 16px 16px 0; } .bk-bend.last > .back { border-radius: 16px 0 0 16px; }
/* Opening the room: the leather cover lies shut over the book for a moment, then swings open. */
.bk-cover-front { position: absolute; inset: -10px -16px -14px -10px; z-index: 8; border-radius: 10px 20px 20px 10px; transform-origin: left center; display: grid; place-content: center; pointer-events: none;
  background: radial-gradient(120% 80% at 30% 10%, #4a3622, #241a12 65%); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.bk-cover-front b { font: 400 2.3rem/1 var(--serif); text-align: center; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bk-cover-front.open { animation: bk-open .35s cubic-bezier(.55,.05,.3,1) .1s both; }
@keyframes bk-open { to { transform: rotateY(-178deg); visibility: hidden; } }
.bk-cover-front.gone { display: none; } /* it has swung open: put away until the room is closed (book.js) */
@media (prefers-reduced-motion: reduce) { .bk-cover-front { display: none; } }

/* One page: the whole day, printed like a page of a diary. No boxes on the paper: thin lines and white space.
   Every size is in "rem", so the print grows with the phone's text size and the page simply gets longer. */
.bk-pg { position: relative; min-height: 100%; display: flex; flex-direction: column; padding: 16px 20px 36px 28px; font-variant-numeric: tabular-nums; } /* 36px at the foot: the fade (34px) and a little to spare */
.bk-pg::before { content: ""; position: absolute; inset: 0 0 auto; height: 220px; pointer-events: none; background: radial-gradient(70% 100% at 100% 0%, var(--glow, transparent), transparent 70%); }
.bk-pg.w { --glow: rgba(11,132,87,.14); } .bk-pg.l { --glow: rgba(194,46,74,.12); }
/* Small spaced capitals: the running head, the labels of the facts and the names of the writing parts. */
.bk-run, .bk-facts dt, .bk-part h3, .bk-trades h3, .bk-pat-row dt, .bk-cap { margin: 0; font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--pmut); overflow-wrap: anywhere; }
/* A day's titles (Hours, Plan, Trades, My trading rules...) are printed in the book's dark gold, so a title is
   told at once from the owner's own writing under it (the owner, Dec 1 2026: the two looked almost the same).
   5.5 to 1 against the paper. The line at the top of the page (weekday, page number) keeps its quiet ink. */
.bk-facts dt, .bk-part h3, .bk-trades h3 { color: var(--ptitle); }
/* The running head: the weekday and the week on the left, the page number on the right, with clear room between
   them. On the narrower phones the weekday is its first three letters ("WED · WEEK 46"), so the two always share
   one line there; with large text the page number takes a line of its own and still keeps to the right. */
.bk-run { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1.6em; padding-bottom: 8px; border-bottom: 1px solid var(--pline); letter-spacing: .16em; }
.bk-run span + span { margin-left: auto; white-space: nowrap; } .bk-run i { font-style: normal; }
/* The head of the page: the day number in gold foil (the page's one piece of gold) and, beside it, the month and
   year in serif italic over the day's result. The result is bold, with its sign, green or red, on one line, never
   tilted, boxed or cut, and it stands in the same place on every page of a book: a day of −$1,496.00 does not
   sit lower than a day of +$85.00.
   Where the page is wide enough for a result of six figures beside the day number, that is where it is. Where
   it is not (large text), the result has the line under the day number to itself, on every page; the rule for
   that is with the sizes for narrow phones at the end of this block. A result too long even for its place (seven
   figures and more) moves under the day number, whole. */
.bk-head { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 13px 0 12px; border-bottom: 1px solid var(--pline); }
.bk-num { flex: none; font: 400 4rem/.8 var(--serif); letter-spacing: -.03em; padding-right: 2px; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bk-day { flex: 1 1 0; min-width: min-content; display: flex; flex-direction: column; gap: 5px; }
.bk-my { font: italic 1.3125rem/1.15 var(--serif); } .bk-my i { font-size: .76em; color: var(--pmut); }
.bk-res { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
/* Money in one piece. Every amount the book prints (book.js, cash) stays on one line: its sign, the "$", the
   thousands and the cents never part. Each amount also carries the number of its letters as a class, c8 to c20,
   which is put into "--c" here. Where an amount has a place it must not leave, its size has a ceiling counted
   from that: the room it has (--pgw, the width of the page between its margins, or --rmw, the width of the
   room, in Contents; both are explained at the top of the room's styles) divided by its letters (a letter of
   these bold figures is at most .61 of its size wide). So a long amount is printed a little smaller instead of
   running off the paper, and a short one never reaches the ceiling. This holds on iPhones with iOS 15 too. */
.bk-amt, .bk-months small, #dDays .trade-result strong { white-space: nowrap; }
.trading-book .c8 { --c: 8; } .trading-book .c9 { --c: 9; } .trading-book .c10 { --c: 10; } .trading-book .c11 { --c: 11; } .trading-book .c12 { --c: 12; } .trading-book .c13 { --c: 13; } .trading-book .c14 { --c: 14; }
.trading-book .c15 { --c: 15; } .trading-book .c16 { --c: 16; } .trading-book .c17 { --c: 17; } .trading-book .c18 { --c: 18; } .trading-book .c19 { --c: 19; } .trading-book .c20 { --c: 20; }
/* The day's result. Everywhere, it is never wider than a line of the page. Where the browser can ask how wide
   the page is (inside "@supports", further down), its room is the page's width less the day number beside it
   (the widest, "10", is 4.34rem wide) and the gap: with normal text a result of six figures has its full size
   there on a 360px phone, and one of seven figures is a little smaller and stands in the same place. On an
   iPhone with iOS 15 a result that does not fit beside the day number moves under it, whole. */
.bk-res strong { font-size: 1.55rem; font-size: min(1.55rem, calc(var(--pgw) / (var(--c, 12) * .61))); font-weight: 800; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.bk-res strong.w { color: var(--pwin); } .bk-res strong.l { color: var(--ploss); } .bk-res strong.none { font-size: .95rem; font-weight: 700; letter-spacing: 0; color: var(--pmut); }
.bk-res small { font-size: .72rem; font-weight: 600; color: var(--pmut); }
/* The facts: a list of label and value, two across. "Felt" is last and takes the whole width. With very large
   text they sit one below the other. */
.bk-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(6rem, 40%), 1fr)); gap: 10px 14px; margin: 0; padding: 11px 0; border-bottom: 1px solid var(--pline); }
.bk-facts div { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .bk-facts .wide { grid-column: 1 / -1; }
.bk-facts dd { margin: 0; font-size: .875rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; } /* (a touch smaller on the narrowest phone, see the end of this block; with large text a value wraps) */
.bk-facts small { display: flex; align-items: center; gap: 3px; font-size: .78rem; font-weight: 500; color: var(--pmut); }
.bk-facts small.w { font-weight: 600; color: var(--pwin2); } .bk-facts small.l { font-weight: 600; color: var(--ploss); } .bk-facts small .ic { width: .82rem; height: .82rem; stroke-width: 2.6; }
.bk-stars { display: flex; gap: 1px; padding: 1px 0; } .bk-stars .ic { width: .875rem; height: .875rem; stroke-width: 1.5; fill: currentColor; } .bk-stars i { display: flex; gap: 1px; color: #9a8f7c; } .bk-stars i .ic { fill: none; }
/* The day's trades in a line or two. A trade stays in one piece where it can; with very large text on a narrow
   phone its result may drop under its name, but a result never breaks after its sign. */
.bk-trades { display: flex; flex-direction: column; gap: 3px; padding: 11px 0; border-bottom: 1px solid var(--pline); }
.bk-trades p { margin: 0; display: flex; flex-wrap: wrap; gap: 1px 16px; font-size: .85rem; line-height: 1.5; }
.bk-trades b { font-weight: 700; white-space: nowrap; font-size: min(1em, calc(var(--pgw) / (var(--c, 12) * .61))); } .bk-trades b.w { color: var(--pwin2); } .bk-trades b.l { color: var(--ploss); } .bk-trades em { font-style: normal; color: var(--pmut); }
/* A trade with a picture (book.js, A PICTURE ON A PAGE; phones only): its words and a small quiet picture icon in the
   page's muted ink, one button that looks exactly like the words around it. --bk-shot is the icon's size, the one
   place to change it ("em": it grows with the phone's text size). The result and the icon stay together on a line.
   The piece moves nothing: its button is only as big as its words and icon, and takes no other room on the line.
   The place a finger can tap is the piece's ::before: exactly its own row tall (a trade stretches to its row's
   height) and 8px wider on each side, half of the gap to a neighbour on the same row, so at least 44px wide. It never
   reaches the heading, the row above or below, or "+N more": a right tap beats a taller reach (the review of pull
   request 184: a 44px tall reach opened the first picture from the heading, and a finger on the edge of a trade
   without a picture opened its neighbour's). A trade without a picture, and the heading, answer a touch as well
   (a rule for :active that changes nothing), so a phone that moves a finger onto the nearest button (Android's Chrome)
   keeps a finger that is on them where it is: a tap there opens nothing. */
.bk-pic { --bk-shot: 1.375em; position: relative; } /* (the medium size, the owner's choice of three, Nov 29 2026) */
.bk-pic::before { content: ""; position: absolute; left: -8px; right: -8px; top: 0; bottom: 0; }
.bk-trades p:has(.bk-pic) > span:not(.bk-pic):active, .bk-trades:has(.bk-pic) > h3:active { --bk-touch: 1; } /* (a name only: nothing changes) */
.bk-shot { position: relative; z-index: 1; padding: 0; border-radius: 4px; text-align: start; } /* (its words over its own reach) */ .bk-shot > span { white-space: nowrap; }
/* (Its keyboard ring stays inside its row: 2px, half of it on the words' own box, so it neither touches the heading's
   letters nor the next row's.) */
.bk-shot:focus-visible { outline-width: 2px; outline-offset: -1px; }
/* (The icon's middle is at the middle of the capital letters, .36em over the line they stand on, at any size. Its
   margins above and below take back half a letter's height each, so up to 1.5em, the line's own height, it never
   makes its line taller than a line without it.) */
.bk-shot .ic { width: var(--bk-shot); height: var(--bk-shot); margin: -.5em 0 -.5em .35em; vertical-align: calc(.86em - var(--bk-shot) / 2); color: var(--pmut); stroke-width: 1.75; }
/* The writing, in full, with the line breaks the person typed. A word with no spaces wraps instead of running off the paper. */
.bk-part { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-top: 12px; }
.bk-part p { margin: 0; font-size: .875rem; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: pretty; }
/* Long writing (over 600 letters, marked by book.js) breaks its lines the plain way, one line after the other.
   That is what lets the turning page copy only the lines in view and still break every line where the page does.
   The mark is on the writing itself: in a box that holds two devices' writings, a long one breaks the plain way
   and a short one beside it keeps the breaks it always had. */
.bk-part p.long { text-wrap: wrap; }
/* What went well and What to improve side by side, a thin line between them, when both are short (book.js);
   with large text they drop one below the other and the line, which hangs just left of the second, is cut away. */
.bk-two { display: flex; flex-wrap: wrap; gap: 0 25px; overflow: hidden; } .bk-two .bk-part { flex: 1 1 max(6.5rem, 40%); } .bk-two .bk-part + .bk-part { box-shadow: -13px 0 0 -12px var(--pline); }
/* Lesson of the day: serif italic, the largest writing on the page after the date. It follows straight after
   what is above it. On a short day the empty paper is at the end, between the lesson and "Edit this day", which
   keeps to the foot of the paper. */
.bk-lesson { margin-top: 16px; gap: 3px; }
.bk-lesson p { font: italic 1.3125rem/1.2 var(--serif); }
/* The line between two devices' writings in one box ("— also written on another device —", put there by sync
   when both are kept). On the page it is a quiet divider, not writing: smaller than the writing (.7rem, four
   fifths of it), muted, upright also in the lesson, in no market's colour, and on ONE row whenever the page is
   wide enough for its 34 letters at that size (--pgw, the page's width, see the room above: 19.5 times the
   size). Only on a page narrower than that, which larger text makes, does it go onto two rows, as even as they
   can be: measured in Chrome, on a 320-wide phone from about 120% text, on a 390-wide one from about 160% (and
   in the lesson, below, from 100% and 110%). (Before, it got smaller instead, down to about 11 pixels against the
   writing's 24: whoever chose large text got the smallest words on the page. Review, round 9.) It is never
   cut. Without container queries (iOS 15) it may always go onto two rows; at the usual text size it fits on
   one anyway. (In the daily card's typing boxes the line is plain text; a typing box cannot style one line.) */
.bk-part p.bk-also { margin: 4px 0; font-family: inherit; font-style: normal; font-weight: 600; font-size: .7rem; line-height: 1.4; letter-spacing: .01em; color: var(--pmut); white-space: normal; text-wrap: balance; }
@supports (width: 1cqw) { .bk-part p.bk-also { white-space: nowrap; } @container bk-pg (max-width: 13.65rem) { .bk-part p.bk-also { white-space: normal; } } }
/* In "Lesson of the day" the writing is bigger (1.3125rem, above), and the divider is four fifths of IT, as in
   every other box: one rule for all of them (decided, review round 9; before, 11 pixels against the lesson's
   21). On one row while the page has room for 19.5 times its size (20.475rem), else on two or, at 200% on a
   320-wide phone, three. */
.bk-part.bk-lesson p.bk-also { font-size: 1.05rem; }
@supports (width: 1cqw) { @container bk-pg (max-width: 20.475rem) { .bk-part.bk-lesson p.bk-also { white-space: normal; } } }
.bk-foot { display: flex; margin-top: auto; padding-top: 4px; }
.bk-edit { position: relative; min-height: 44px; margin-left: -8px; padding: 0 8px; display: flex; align-items: center; gap: 6px; color: #7a5512; font-size: .82rem; font-weight: 700; }
.bk-edit .ic { width: 1rem; height: 1rem; stroke-width: 1.75; }

/* The chapter note: laid over the page, under the date, on the same paper, a shade lighter and lifted a little.
   While it lies there the rest of that day is put away. Its button stays in view at the foot of the paper. */
.bk-pg.noted { padding-bottom: 12px; } .bk-pg.noted > :not(.bk-run):not(.bk-head):not(.bk-chapter) { display: none; }
.bk-chapter { flex: 1 0 auto; display: flex; flex-direction: column; gap: 15px; margin: 12px -10px 0 -12px; padding: 18px 18px 0; border: 1px solid var(--pline); border-radius: 4px 12px 12px 4px; background: linear-gradient(180deg, var(--note1), var(--note2)); box-shadow: 0 14px 28px -12px rgba(60,40,10,.5), 0 2px 5px rgba(60,40,10,.12); }
.bk-chapter .bk-cap { letter-spacing: .14em; }
.bk-chapter h3 { margin: -8px 0 0; font: 400 1.5625rem/1.15 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
/* The note's four numbers, two across. A number that is wider than half the row (a total of five figures and
   more on a phone) takes a row to itself: it is never broken to fit. */
.bk-pat-row { display: flex; flex-wrap: wrap; gap: 12px 16px; margin: 0; padding: 13px 0; border-top: 1px solid var(--pline); border-bottom: 1px solid var(--pline); }
.bk-pat-row div { flex: 1 1 max(6.4rem, 40%); display: flex; flex-direction: column; gap: 2px; }
.bk-pat-row dd { margin: 0; font-size: 1.125rem; font-weight: 750; overflow-wrap: anywhere; } .bk-pat-row .bk-amt { font-size: min(1em, calc((var(--pgw) - 16px) / (var(--c, 12) * .62))); } .bk-pat-row dd small { font-size: .875rem; font-weight: 600; color: var(--pmut); } .bk-pat-row dd.w { color: var(--pwin2); } .bk-pat-row dd.l { color: var(--ploss); }
.bk-pat-list { display: flex; flex-direction: column; gap: 11px; }
.bk-pat-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 5px 8px; font-size: .875rem; overflow-wrap: anywhere; background: linear-gradient(rgba(110,80,30,.14), rgba(110,80,30,.14)) bottom / 100% 3px no-repeat; }
.bk-pat-item span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } /* a very long line is shown as its first two lines and "…" */
.bk-pat-item small { font-size: .78rem; font-weight: 600; color: var(--pmut); } .bk-pat-item i { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--ploss); } .bk-pat-item i.w { background: var(--pwin); }
.bk-pat-say { margin: 0; font-size: .84rem; line-height: 1.45; color: var(--pmut); text-wrap: pretty; } .bk-pat-say b { color: var(--ink); }
/* "See your hours", in the note of Broke hours: a plain link in the paper's ink, as tall as a finger needs. */
.bk-to-hours { align-self: flex-start; margin: -10px 0 -8px -4px; color: var(--ink); font-size: .875rem; }
.bk-chapter-foot { position: sticky; bottom: 0; margin: auto -18px 0; padding: 26px 18px 16px; border-radius: 0 0 12px 4px; background: linear-gradient(180deg, transparent, var(--note2) 24px); }
.bk-chapter-foot .primary-btn { width: 100%; min-height: 50px; font-size: 1rem; }

/* The row under the page: the two arrows, and between them the date with how long ago it was, over the strip of
   days (one bar per page: its height by the size of the day's result, green or red, the weekday's letter under
   it, a line at each new week and month). Slide the strip or tap a bar. The needle is in the market's line colour. */
.bk-nav { flex: none; display: flex; align-items: center; gap: 8px; }
.bk-nav .icon-btn { flex: none; display: grid; place-items: center; width: 48px; min-height: 48px; background: var(--surface); }
.bk-when { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* The date and how long ago it was, with a dot between them. They share one line wherever they can:
   - a wide row (the larger phones, a computer) prints the date in full: "Wed, September 23 · 11 months ago";
   - a narrower row (360 to 390px phones) leaves out the end of the month's name, and for a day of another year
     the weekday: "Wed, Sep 23 · 11 months ago", "Nov 13, 2025 · 23 months ago";
   - where even that does not fit (the smallest phone, large text), how long ago it was has a line of its own
     under the date, which is in full again.
   Which of the three it is depends only on the width of the row, counted in letters ("em"), never on the day,
   so nothing is ever cut and the book above keeps its size from one page to the next.
   The plain rule, outside "@supports", is the third: two lines, which can never cut anything. That is what an
   iPhone with iOS 15 shows on every phone, because it cannot ask how wide the row is. The two one-line forms
   are inside "@supports". */
.bk-readout { margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; font-size: .95rem; line-height: 1.25; }
.bk-readout b { font-weight: 700; } .bk-readout b i { font-style: normal; } .bk-readout span { font-weight: 500; color: var(--muted); white-space: nowrap; }
@supports (width: 1cqw) {
  @container bk-when (min-width: 13.81em) {
    .bk-readout { height: 1.25em; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: normal; gap: 0 .3em; overflow: hidden; }
    .bk-readout b { white-space: nowrap; } .bk-readout b i { display: none; } .bk-readout span::before { content: "· "; }
  }
  @container bk-when (min-width: 16.51em) { .bk-readout b i { display: inline; } }
}
.bk-rail { position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
/* Half a strip of empty room before the first bar and after the last one: the open page's bar is then under the
   needle, in the middle, however wide the strip is, and no code has to measure the strip to place it.
   The strip runs right to left: the newest day is at its right end, the older days to its left, the way the book's
   days run from left to right (book.js writes the bars newest first; the browser lays them out from the right). */
.bk-ribbon { direction: rtl; display: flex; height: 44px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.bk-ribbon::before, .bk-ribbon::after { content: ""; flex: 0 0 calc(50% - 9px); }
.bk-track { flex: none; box-sizing: border-box; display: flex; height: 100%; }
.bk-tick { position: relative; flex: none; width: 18px; height: 100%; padding: 0 0 15px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bk-tick i { width: 6px; border-radius: 3px; }
@supports (color: color-mix(in srgb, red, blue)) { .bk-tick i { background: color-mix(in srgb, var(--muted) 45%, transparent); } }
.bk-tick.w i { background: var(--win); } .bk-tick.l i { background: var(--loss); } .bk-tick.on i { width: 9px; }
.bk-tick.wk { box-shadow: inset 1px 0 0 var(--line); } .bk-tick.mon { box-shadow: inset 1.5px 0 0 var(--muted); } /* the line between a day and the day before it, which is on its left */
.bk-tick span { position: absolute; bottom: 0; font-size: 11px; font-weight: 700; line-height: 14px; color: var(--muted); } /* in px: a bar is 18px wide whatever the text size, so its letter must not grow into its neighbours */
.bk-needle { position: absolute; left: 50%; top: 2px; bottom: 15px; width: 3px; margin-left: -1.5px; border-radius: 3px; background: var(--accent-line); pointer-events: none; }
@supports (color: color-mix(in srgb, red, blue)) { .bk-needle { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-line) 16%, transparent); } }

/* Contents: the months, every saved day as a list, and "Your hours". Here the list is the one thing that scrolls. */
#bkIndex { gap: 10px; }
.bk-index { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 8px; outline: none; }
.bk-index > div { display: flex; flex-direction: column; gap: 10px; }
.bk-months { flex: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; scroll-snap-type: x proximity; } .bk-months button { scroll-snap-align: start; } /* a chip comes to rest at the row's left edge, whole */
.bk-months button { flex: none; display: grid; align-content: center; text-align: left; line-height: 1.2; min-height: 46px; padding: 5px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.bk-months b { font-size: .8rem; } .bk-months small { font-size: .6875rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.bk-months small.w { color: var(--win); } .bk-months small.l { color: var(--loss); }
.bk-months [aria-current="true"] { border: 1.5px solid var(--accent-line); }
/* Your trading hours / Your best session: plain bold headings, the same numbers and sentences as before. */
.bk-times { display: grid; gap: 10px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.bk-times h3 { margin: 0; font-size: 1.1rem; font-weight: 750; } .bk-times .hint { margin: 0; } .bk-times .bk-cap { color: var(--muted); } .bk-times .empty-state { border: 0; padding: 12px 4px; }
/* On time / Went past: two boxes side by side; a box whose amount is wider than half the row takes a row to itself. */
.bk-rule { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-rule div { flex: 1 1 max(6.5rem, 40%); display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); } .bk-rule .bk-amt { font-size: min(1em, calc((var(--rmw) - 74px) / (var(--c, 12) * .62))); }
.bk-rule div > span { display: flex; align-items: center; gap: 4px; font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); } /* the box's label only (not the amount, which is a span too: it was grey and spaced out like a label) */
.bk-rule div > span .ic { width: .8rem; height: .8rem; stroke-width: 2.6; }
.bk-rule b { font-size: 1rem; font-variant-numeric: tabular-nums; } .bk-rule b.win { color: var(--win); } .bk-rule b.loss { color: var(--loss); }

/* Cramped: a screen too short, or text too large, for a page that scrolls inside the room (a phone held sideways,
   the smallest phone with large text). Then it is the other way round: the page is as long as its day and the
   face of the room scrolls, filters and arrows with it. Either way only ONE thing scrolls under the finger.
   (A browser that does not know "@container", an iPhone with iOS 15, keeps the page that scrolls inside; the
   face can then scroll too.) */
/* A short room (the smallest phone): the chapter note takes the date's place too, and its button waits at the end
   of the note instead of holding a third of the paper. */
@supports (width: 1cqw) {
  @container bk-room (max-height: 40em) { .bk-pg.noted > .bk-head { display: none; } .bk-chapter-foot { position: static; padding-top: 6px; } }
  @container bk-room (max-height: 32em) {
    .bk-stage { flex: none; }
    .bk-under { position: relative; overflow: visible; min-height: 17em; } .bk-under > .bk-pg { min-height: 17em; }
    .bk-stage > .bk-fade { display: none; }
  }
}
/* The narrower phones. Every size here is still in "rem": it is a step smaller on a narrow screen, and from there
   it grows with the phone's text size like everything else. (Before, some sizes were tied to the width of the
   screen, so with large text they stopped growing: at 150% a value on the page was smaller than its label.) */
@media (max-width: 430px) { .br .tf-title h2 { font-size: 1.5rem; } }
@media (max-width: 385px) { .bk-filters { font-size: .76rem; } .bk-run i { display: none; } }
@media (max-width: 340px) {
  .br .tf-title h2 { font-size: 1.25rem; } .bk-filters { font-size: .6875rem; } .bk-cover-front b { font-size: 2.1rem; }
  .bk-facts dd { font-size: .8125rem; } .bk-chapter h3 { font-size: 1.45rem; } .bk-readout { font-size: .875rem; }
}
/* The result's place when the page is too narrow, counted in letters ("em", so large text counts; it is the width
   between the page's margins that is counted), for a result of six figures beside the day number: the month and year stay beside the day number and the result takes the
   line under them, on every page. The narrowest phones print the day number and the result a step smaller, so
   their measure is a little less. */
/* A wide page (the book on a computer): "3 trades · 2 won" has room beside the result, on its line, for every
   result up to seven figures, so that is where it is on every page there. On phones it is under the result. */
@media (max-width: 340px) {
  .bk-head { gap: 8px 10px; } .bk-num { font-size: 3.5rem; } .bk-res strong { font-size: 1.3rem; font-size: min(1.3rem, calc(var(--pgw) / (var(--c, 12) * .61))); }
  /* The line that says how to turn a page: a little smaller here, so that it is one line and covers less of the page. */
  .bk-msg { padding: 24px 40px 9px 6px; font-size: .9rem; }
}
/* (All of this needs to ask how wide the page is, so it is inside "@supports": see the top of the room's styles.
   An iPhone with iOS 15 keeps the plain rules above: the result beside the day number when it fits there, under
   it when it does not, never wider than the page.) */
@supports (width: 1cqw) {
  .bk-res strong { font-size: min(1.55rem, calc((100cqw - 4.4rem - 14px) / (var(--c, 12) * .61))); } /* beside the day number */
  @container bk-pg (min-width: 23em) { .bk-res { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; } }
  @media (min-width: 340.02px) {
    @container bk-pg (max-width: 16em) {
      .bk-day { display: contents; } .bk-my { flex: 1 1 0; min-width: min-content; }
      .bk-res { flex: 1 0 100%; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; }
      .bk-res strong { font-size: min(1.55rem, calc(100cqw / (var(--c, 12) * .61))); } /* on a line of its own it has the page's whole width */
    }
    /* Where the widest day number ("10") and the longest month ("September 2026") do not fit side by side on one
       line, the month takes the line under the day number on every page, even where a shorter date ("1", "May")
       would fit beside it: so the month, and the result under it, do not move from page to page with the date.
       (14.3em: with the gap the two need 13.05em in the iPhone's serif and 14.23em in Android's wider Noto Serif.) */
    @container bk-pg (max-width: 14.3em) { .bk-my { flex: 1 0 100%; } }
  }
  @media (max-width: 340px) {
    .bk-res strong { font-size: min(1.3rem, calc((100cqw - 3.85rem - 10px) / (var(--c, 12) * .61))); }
    @container bk-pg (max-width: 13.9em) {
      .bk-day { display: contents; } .bk-my { flex: 1 1 0; min-width: min-content; }
      .bk-res { flex: 1 0 100%; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; }
      .bk-res strong { font-size: min(1.3rem, calc(100cqw / (var(--c, 12) * .61))); } /* on a line of its own it has the page's whole width */
    }
    @container bk-pg (max-width: 13.5em) { .bk-my { flex: 1 0 100%; } } /* the same, with the smaller day number here (13.43em in Android's Noto Serif) */
  }
  /* Where even the longest month and its year ("September 2026", 7.84em, 9.0em in Android's Noto Serif) may not fit on one line, the year has
     the line under the month on every page, so that the result under them stands as low on a page of May as on
     one of September. */
  @container bk-pg (max-width: 9.1em) { .bk-my i { display: block; } }
}
/* Browser on a computer: a mouse drag turns the page too; the book keeps a real book's width instead of stretching wide. */
@media (min-width: 700px) { .bk-stage { width: 440px; max-width: calc(100% - 26px); margin-left: auto; margin-right: auto; } }

.bk-tm-say { margin: 0; font-size: .95rem; line-height: 1.45; } .bk-tm-say .bk-amt { font-size: min(1em, calc((var(--rmw) - 54px) / (var(--c, 12) * .6))); } .bk-tm-say b { color: var(--accent-ink); } .bk-tm-say .l { color: var(--error); font-weight: 700; }
.bk-tm-say b.win { color: var(--win); } .bk-tm-say b.loss { color: var(--loss); }
.bk-tm-rows { display: grid; gap: 4px; }
/* One row of the hours report: the name, a bar, the amount. With large text on a narrow phone the three do not
   fit side by side, and the amount drops under the name, at the right. */
.bk-tm { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 6px; border-radius: 12px; }
@supports (color: color-mix(in srgb, red, blue)) { .bk-tm.best { background: color-mix(in srgb, var(--accent-line) 12%, transparent); } .bk-tm.worst { background: color-mix(in srgb, var(--error) 12%, transparent); } }
.bk-tm-nm { flex: 0 1 5.75rem; min-width: 0; font-size: .84rem; font-weight: 700; line-height: 1.15; } .bk-tm-nm small, .bk-tm-val small { display: block; font-size: .7rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.bk-tm-bar { position: relative; flex: 1 1 1.5rem; height: 22px; } .bk-tm-bar::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.bk-tm-bar i { position: absolute; top: 3px; height: 16px; border-radius: 5px; min-width: 2px; }
.bk-tm-bar i.up { left: 50%; background: #22c55e; } .bk-tm-bar i.down { right: 50%; background: #f87171; }
.bk-tm-val .bk-amt { font-size: min(1em, calc((var(--rmw) - 66px) / (var(--c, 12) * .62))); }
.bk-tm-val { flex: 0 1 7.4rem; min-width: min-content; margin-left: auto; text-align: right; font-size: .84rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.bk-tm .tag { display: inline-block; font-style: normal; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 800; padding: 2px 6px; border-radius: 6px; margin: 3px 0 0 6px; }
.bk-tm .tag.g { border: 1px solid var(--accent-line); color: var(--accent-ink); } .bk-tm .tag.r { border: 1px solid var(--error); color: var(--error); }
/* "color-mix" on older iPhones. iPhones on iOS 15 up to 16.1 do not know color-mix(), which the book uses for
   five things: the tint and the darker letters of the chosen filter, the grey bars of days with no result on the
   strip, the soft ring round the strip's needle, and the tint on the best and worst rows of "Your hours". Each
   of those lines also has var() in it, and such a line is never thrown away when the stylesheet is read: it
   fails later and leaves nothing (no tint at all), whatever plain line was written before it. On those phones
   the chosen filter did not look chosen.
   So each color-mix() line of the book sits inside "@supports (color: color-mix(…))", where today's browsers
   read it exactly as before, and the older phones get the block below instead. It makes the same colours
   another way: a layer of the same colour, see-through by the same amount (a 12% layer of the market's colour
   over the box is what "12% of it mixed in" looks like), and for the darker letters in light mode the four
   colours worked out by hand (the market's line colour with 24% black: futures, stocks, crypto, forex).
   The Calculator's answer cards use two of these too (Nov 30 2026): the wash behind the "Best pick" / "Your pick"
   tag, and the market's darker ink in light mode for the pick's size number and the tags' words. */
@supports not (color: color-mix(in srgb, red, blue)) {
  .bk-filters button[aria-pressed="true"], .bk-tm.best, .bk-tm.worst, .pick-badge { position: relative; isolation: isolate; }
  .bk-filters button[aria-pressed="true"] { background: var(--field); }
  .bk-filters button[aria-pressed="true"]::before, .bk-tm.best::before, .bk-tm.worst::before, .pick-badge::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--accent-line); opacity: .12; pointer-events: none; }
  .pick-badge::before { opacity: .14; } /* the tag's wash is 14% */
  .bk-filters button[aria-pressed="true"]::before { border-radius: calc(12px - 1.5px); } /* the layer lies inside the filter's 1.5px border: its corners are that much less round, as the inside of the border is */
  .bk-tm.worst::before { background: var(--error); }
  .bk-tick i { background: var(--muted); opacity: .45; } .bk-tick.w i, .bk-tick.l i { opacity: 1; }
  .bk-needle::before { content: ""; position: absolute; inset: -4px; border-radius: 7px; background: var(--accent-line); opacity: .16; }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .trading-book, :root:not([data-theme="dark"]) .results { --accent-ink: #694400; } :root:not([data-theme="dark"]) body[data-asset="stocks"] .trading-book, :root:not([data-theme="dark"]) body[data-asset="stocks"] .results { --accent-ink: #035b42; }
    :root:not([data-theme="dark"]) body[data-asset="crypto"] .trading-book, :root:not([data-theme="dark"]) body[data-asset="crypto"] .results { --accent-ink: #173185; } :root:not([data-theme="dark"]) body[data-asset="forex"] .trading-book, :root:not([data-theme="dark"]) body[data-asset="forex"] .results { --accent-ink: #511980; }
  }
  :root[data-theme="light"] .trading-book, :root[data-theme="light"] .results { --accent-ink: #694400; } :root[data-theme="light"] body[data-asset="stocks"] .trading-book, :root[data-theme="light"] body[data-asset="stocks"] .results { --accent-ink: #035b42; }
  :root[data-theme="light"] body[data-asset="crypto"] .trading-book, :root[data-theme="light"] body[data-asset="crypto"] .results { --accent-ink: #173185; } :root[data-theme="light"] body[data-asset="forex"] .trading-book, :root[data-theme="light"] body[data-asset="forex"] .results { --accent-ink: #511980; }
}
/* My trading hours: Start and Stop on the daily card, and the kept / broke counts under the book */
/* Start and Stop sit side by side when both time boxes fit (390px phones and wider). On narrower phones, or with
   large text, Stop drops to its own line. Before, the Stop box stuck out past the card, and with large text it
   made the whole page wider than the screen. */
.hours-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.hours-row > div { flex: 1 1 7rem; display: grid; gap: 4px; } .hours-row label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); }
/* No dash between the two boxes and no container query here (Nov 2026): with "container-type" on this row, Chrome 157
   drew the row 0 px tall as soon as both times were set, so the Start and Stop boxes vanished until the next launch. */
#dHoursHint { margin: 6px 0 0; }
/* The line "For day trading. Leave empty if you hold for weeks." that stood above the clocks (Nov 28 2026) was taken
   out on Nov 30 2026 (Idael): the legend "My trading hours" with its quiet "your time · optional" says enough. The
   Start and Stop labels now follow the legend with the legend's own 6 px, as the feelings follow "How I feel". */
.outside-note { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--text); font-size: .88rem; line-height: 1.4; }
.outside-note b { color: var(--error); }
.outside-note.ok { background: color-mix(in srgb, #22c55e 14%, transparent); } .outside-note.ok b { color: #22c55e; }
/* "You stopped on time." in light mode: the bright green above is only about 2:1 against the note's pale green
   box, too faint to read. Light mode uses the app's dark green for win words on a tinted fill (--win-ink,
   #166534), which is 6.3:1 there. (The lighter #15803d would be 4.45:1, just under the 4.5 that text needs.)
   Dark mode keeps the bright green: on the dark box it reads well. */
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .outside-note.ok b { color: var(--win-ink); } }
:root[data-theme="light"] .outside-note.ok b { color: var(--win-ink); }
/* "What time did you stop trading?": the time box and, beside it, the Now button (as tall as the box). With
   large text the button drops under the box. */
.stop-row { display: flex; flex-wrap: wrap; gap: 8px; } .stop-row .time-pill { flex: 0 1 10rem; }
/* Time boxes: a small clock you can tap (it opens the time wheel), the time beside it */
.time-pill { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 5px 12px 5px 6px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--field); transition: border-color .15s, box-shadow .15s; }
.time-pill:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-line) 18%, transparent); }
.time-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin: -2px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--accent-ink); cursor: pointer; transition: transform .08s; }
.time-ic .ic { width: 1.375rem; height: 1.375rem; } /* grows with large text */ .time-ic:active { transform: scale(.92); }
.time-ic:focus-visible { outline: 2px solid var(--accent-line); outline-offset: -4px; }
.time-pill input { flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); font: 700 1.08rem/1.2 inherit; font-variant-numeric: tabular-nums; outline: none; }
.time-pill input::-webkit-calendar-picker-indicator { display: none; }
.time-pill input:focus { border: 0; box-shadow: none; outline: none; } /* the whole pill lights up instead */
.hours-row .time-pill { padding-right: 8px; gap: 6px; }
.hours-row .time-ic { margin: -5px; } /* a 44px tap area that takes the room of 34px */ .hours-row .time-pill input { font-size: 1rem; }

/* Time wheel: a sheet slides up with hour / minute / AM-PM wheels to spin to the exact time. Set time is the sheet's one filled button. */
.tw-back { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; background: rgba(5,6,9,0); transition: background .22s; }
.tw-back.open { background: rgba(5,6,9,.62); backdrop-filter: blur(3px); }
.tw-sheet { width: 100%; max-width: 480px; padding: 10px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0;
  border: 1px solid var(--line); border-bottom: 0;
  background: var(--surface); box-shadow: 0 -18px 50px rgba(0,0,0,.45);
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.9,.25,1); display: flex; flex-direction: column; align-items: center; }
.tw-back.open .tw-sheet { transform: none; }
.tw-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; margin-bottom: 6px; } .tw-top .tw-type { justify-self: end; } .tw-top .tw-link { justify-self: start; }
.tw-grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line); }
.tw-type { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent-ink); font-weight: 750; font-size: .95rem; }
.tw-type:active { transform: scale(.96); }
.tw-title { margin: 0; font-size: .78rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tw-big { margin: 4px 0 14px; font-size: 2.3rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--text); }
.tw-wheels { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 220px; margin-bottom: 18px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 32%, #000 68%, transparent); mask-image: linear-gradient(180deg, transparent, #000 32%, #000 68%, transparent); }
.tw-band { position: absolute; left: 0; right: 0; top: 88px; height: 44px; border-radius: 14px; pointer-events: none;
  border: 1.5px solid var(--accent-line); background: color-mix(in srgb, var(--accent-line) 10%, transparent); }
.tw-col { position: relative; width: 76px; height: 220px; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.tw-col::-webkit-scrollbar { display: none; }
.tw-col.tw-ampm { width: 70px; margin-left: 8px; }
.tw-pad { height: 44px; }
.tw-item { display: block; width: 100%; height: 44px; padding: 0; border: 0; background: none; scroll-snap-align: center;
  font: 650 1.45rem/44px inherit; font-variant-numeric: tabular-nums; color: var(--muted); opacity: .55; transition: color .12s, opacity .12s, transform .12s; }
.tw-item.on { color: var(--text); opacity: 1; font-weight: 800; transform: scale(1.08); }
.tw-ampm .tw-item { font-size: 1.15rem; }
.tw-colon { font-size: 1.6rem; font-weight: 800; color: var(--muted); z-index: 1; }
.tw-set { width: 100%; min-height: 54px; border-radius: 16px; font-size: 1.08rem; font-weight: 800; }
.tw-set:active { transform: scale(.98); }
.tw-link { min-width: 76px; text-align: left; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--muted); font-weight: 650; font-size: .95rem; }

/* ---- Add trade form (Journal): one calm set of fields. Gold is kept for Save; Long/Short and wins/losses carry
   their own colour plus a word or an arrow, so nothing depends on colour alone. Every tap target stays 44px+. ---- */
:root { --raised: #2b303a; --win: #22c55e; --loss: #f87171; --win-ink: #4ade80; --loss-ink: #fca5a5; --seg-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 2px 8px rgba(0, 0, 0, 0.35); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --raised: #ffffff; --win: #15803d; --loss: #b42318; --win-ink: #166534; --loss-ink: #991b1b; --seg-shadow: 0 0 0 1px var(--line), 0 1px 3px rgba(15, 23, 42, 0.14); } }
:root[data-theme="light"] { --raised: #ffffff; --win: #15803d; --loss: #b42318; --win-ink: #166534; --loss-ink: #991b1b; --seg-shadow: 0 0 0 1px var(--line), 0 1px 3px rgba(15, 23, 42, 0.14); }
/* Line icons, one weight everywhere (no emoji: they draw differently on every phone). */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ic-s { width: 14px; height: 14px; }
/* The market's colour as text on a tinted fill: a shade darker in light mode, so it stays easy to read. */
body { --accent-ink: var(--accent-line); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) body { --accent-ink: color-mix(in srgb, var(--accent-line) 76%, #000); } }
:root[data-theme="light"] body { --accent-ink: color-mix(in srgb, var(--accent-line) 76%, #000); }

/* The form is a sheet: it slides up over the page, its fields scroll inside it, and the result + Save stay at the bottom. */
/* --vv-top / --vv-h: the part of the screen still visible above the keyboard (set by journal-ui.js on phones). The sheet
   fills exactly that part, so its top, the box being typed in, and Save are all on screen while typing. */
.sheet { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100%); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
/* Keyboard up: the result and Save share one row and the grab line goes, which leaves room for the fields. */
.sheet.kb .tf-dock { flex-direction: row; align-items: center; padding-top: 8px; padding-bottom: 8px; } .sheet.kb .tf-sum { flex: 1; }
.sheet.kb .tf-dock .primary-btn { flex: none; width: auto; min-height: 48px; padding: 0 22px; } .sheet.kb .tf-grab, .sheet.kb .tf-sub { display: none; } .sheet.kb .tf-head { padding-top: 8px; padding-bottom: 6px; }
/* Almost no screen left above the keyboard: only the fields stay, so the box being typed in is always in view. */
/* (On an iPad they start below the window's own buttons, --win-buttons: there the visible part begins at the window's
   top edge, under the buttons. On an iPad held sideways with the keyboard up they sat on the first field, review of
   pull request 135. On a phone --win-buttons is 0 or missing, so the fields keep the whole height there, as before.) */
.sheet.tight .tf-head, .sheet.tight .tf-dock { display: none; } .sheet.tight .tf { height: calc(100% - var(--win-buttons, 0px)); border-radius: 0; }
.sheet-back { position: absolute; inset: 0; background: rgba(5, 6, 9, 0.62); animation: sheet-fade 0.18s ease-out; }
/* The sheet stops short of the top of the screen: below the clock on a phone, and on an iPad below the window's own
   buttons (--win-buttons, set by MainViewController.swift on an iPad only), which otherwise covered the first letters
   of "New trade" and "Trading Book" (the Add trade sheet and the Trading Book's room both are a .tf). On a phone it is
   0 or missing, so nothing moves there. (Not --win-top: on the iPhone Duo's small screen that is 18 with a safe area of
   0, for its rounded corners, and the sheet moved down 8 px there; review of pull request 135.) */
.tf { position: relative; width: 100%; max-width: 560px; height: calc(100% - max(10px, env(safe-area-inset-top, 0px), var(--win-buttons, 0px)) - 6px); display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.45); outline: none; animation: sheet-up 0.22s cubic-bezier(0.2, 0.9, 0.25, 1); }
@keyframes sheet-up { from { transform: translateY(28px); opacity: 0; } }
@keyframes sheet-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tf, .sheet-back { animation: none; } }
html.sheet-open, html.sheet-open body { overflow: hidden; }
/* Phones: the sheet covers the whole page, so the page is not drawn while it is up. (An iPhone would otherwise let a
   strip of the page show through the bar above its keyboard.) Wider screens keep the page visible at the sides. */
@media (max-width: 599px) { html.sheet-open main > :not(.sheet) { visibility: hidden; } }
html.sheet-kb main > :not(.sheet) { visibility: hidden; } /* keyboard up on any screen, a phone held sideways too */
.tf-grab { flex: none; align-self: center; width: 36px; height: 4px; margin: 8px 0 2px; border-radius: 2px; background: var(--line); }
.tf-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-padding: 12px 0; display: flex; flex-direction: column; gap: 14px;
  padding: 4px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px)); }
.tf-body > * { flex: none; }
.tf-head { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px max(8px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
.tf-title { flex: 1 1 6.5rem; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tf-title h2 { font-size: 1.35rem; font-weight: 750; letter-spacing: -0.02em; }
.tf-sub { font-size: 0.8rem; color: var(--muted); }
/* The date is almost always today, so it is one small button; the real date box sits invisibly on top of it. */
.tf-date { position: relative; flex: none; }
.tf-date-chip { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 0.9rem; font-weight: 650; white-space: nowrap; }
.tf-date-chip .ic { color: var(--muted); }
.tf-date input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.tf-date input:focus-visible + .tf-date-chip { border-color: var(--accent-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-line) 30%, transparent); }
.tf-date input[aria-invalid="true"] + .tf-date-chip { border-color: var(--error); } /* no date yet: the usual mark of a box that still needs something */
.tf-close { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--muted); }
/* The Add trade sheet's head: the title, the date button and the close button (X). The date button's words decide
   its width ("Today", "Yesterday", "Pick a date", "Wed, May 28", "May 24, 2028"), and on main the title, the X and
   the rows moved with them: "Yesterday" sent the X to a row of its own and the whole form moved down 52 px (a review
   of pull request 84 found it). Now the head's shape depends only on the sheet's width and the text size, never on
   the date's words, so a new date moves nothing:
   - Two rows, the way every browser draws it: the title with the X in the top right corner (where the Trading
     Book's X always is), then the date button on a row of its own, so it has the whole width for its words. Only
     where even that is too narrow (very large text on a small phone) do they end in "…" (read out in full); a long
     title takes two lines and never runs under the X. The X comes before the date only to the eye ("order"): Tab
     and a screen reader still go title, date, X, then Waiting / In trade / Finished.
   - One row, as on main, wherever the longest title and the longest date fit beside the X. The date always has the
     room of its longest words, the title the rest; on a wider sheet the date and the X stand at the right end.
   Worked out once, in Chrome with the iPhone's font at 100% text. Only the words grow with the text size: the
   longest title, "New order", is 101.7 px and the longest date, "May 24, 2028", 96.3 px of words (198 px: 12.375rem;
   12.45rem with a little to spare). The rest stays in pixels: 74 px around the date's words (edges, padding, two
   gaps, two icons), 44 px of X and two 8 px gaps (134 px). So one row needs 12.45rem + 134px of head: 333.2 px at
   16 px text (a 360 px phone gives 334: the sheet's 1 px edges, the head's 16 + 8 px padding), 345.7 at an
   iPhone's 17 px (a 375 px iPhone gives 349), 358.1 at 18 px (390 gives 364), 532.4 at 200% text (the 560 px sheet
   of a computer gives 534). A 320 px phone (294) has two rows; there, at 200% text, the date's row needs
   192.6 + 74 = 266.6 px and has 294, so every year stays whole. A browser that cannot read the rule (an iPhone with
   iOS 15 knows no "@container") keeps the two rows: steady too. */
.trade-form > .tf-head { container-type: inline-size; }
.trade-form .tf-title { flex: 0 0 calc(100% - 52px); } /* (52: the X and its gap, so the date goes to the second row) */
.trade-form .tf-close { order: 1; align-self: flex-start; }
.trade-form .tf-date { order: 2; min-width: 0; max-width: 100%; }
#tDateText { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@container (width >= calc(12.45rem + 134px)) {
  .trade-form .tf-title { flex: 1 1 auto; max-width: calc(100% - 6.05rem - 134px); }
  .trade-form .tf-close { order: 0; align-self: auto; }
  .trade-form .tf-date { order: 0; flex: 0 1 auto; max-width: calc(6.05rem + 74px); margin-left: auto; }
}
.tf-close .ic { width: 20px; height: 20px; }

/* Where is this trade? All three choices stay in view; the chosen one is a raised tile, not a gold one. */
.tf-block { display: flex; flex-direction: column; gap: 8px; }
.tf-label { font-size: 0.8rem; font-weight: 650; color: var(--muted); letter-spacing: 0.02em; }
.tf .kind3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tf .kind3 button, .halves button { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; line-height: 1.2; }
.tf .kind3 b { font-size: min(0.95rem, 4.4vw); font-weight: 700; }
.tf .kind3 small { font-size: min(0.75rem, 3.4vw); font-weight: 500; color: var(--muted); }
.tf .kind3 button[aria-pressed="true"], .halves button[aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: 0 0 0 1.5px var(--muted), var(--seg-shadow); }

.tf-card { min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tf-card-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; }
.tf-card h3 { margin: 0; font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.tf-card h3 .optional { font-size: 0.8rem; color: var(--muted); }
.tf-aside { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Quick (R) / Exact prices: two quiet tabs across the top of the card. The note on the right drops away when it doesn't fit. */
.tf-tabs { display: flex; flex-wrap: wrap; column-gap: 20px; max-height: 47px; overflow: hidden; margin: -14px -14px 0; padding: 0 14px; border-bottom: 1px solid var(--line); }
.tf-tabs button { min-height: 46px; font-size: min(0.95rem, 4.4vw); font-weight: 650; color: var(--muted); border-bottom: 2px solid transparent; outline-offset: -3px; }
.tf-tabs button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--accent-line); }
.tf-tabs-note { margin-left: auto; line-height: 46px; font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.tf-dir { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tf-dir button { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--field); color: var(--muted); font-weight: 700; }
.tf-dir [data-dir="short"] .ic { transform: rotate(90deg); }
.tf-dir [data-dir="long"][aria-pressed="true"] { border-color: var(--win); background: color-mix(in srgb, var(--win) 14%, var(--field)); color: var(--win-ink); }
.tf-dir [data-dir="short"][aria-pressed="true"] { border-color: var(--loss); background: color-mix(in srgb, var(--loss) 14%, var(--field)); color: var(--loss-ink); }
/* Long / Short with its message under it. "bad": Save was tapped with no side picked, so both buttons wear the error colour. */
.tf-dir-box { display: flex; flex-direction: column; gap: 8px; }
.tf-dir-box.bad .tf-dir button { border-color: var(--error); }

.tf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tf-grid .span { grid-column: 1 / -1; }
.tf input[type=number], .tf input[type=text] { font-size: max(1.1rem, 16px); font-weight: 700; }
.tf .money-input span { left: 12px; font-weight: 650; } .tf .money-input input { padding-left: 27px; }
/* A box with − and + (whole contracts) or a unit after the number (R). The box carries the border and the focus ring. */
.tf-step, .tf-unit { display: flex; align-items: center; min-height: var(--tap); background: var(--field); border: 1.5px solid var(--line); border-radius: 12px; }
.tf-step button { flex: none; align-self: stretch; width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--muted); }
.tf-step input, .tf-unit input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; }
.tf-step input { padding: 0; text-align: center; }
.tf-step.plain input { padding: 10px 12px; text-align: left; }
.tf-step input:focus, .tf-unit input:focus { box-shadow: none; }
.tf-step:focus-within, .tf-unit:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-line) 30%, transparent); }
.tf-step:has(input[aria-invalid="true"]), .tf-unit:has(input[aria-invalid="true"]) { border-color: var(--error); }
.tf-unit { width: 7rem; padding-right: 12px; }
.tf-unit span { color: var(--muted); font-weight: 650; }
/* The narrowest phones have no room for − and + beside the number: the number is typed there. */
@media (max-width: 349px) { .tf-step button { display: none; } .tf-step input { padding: 10px 12px; text-align: left; } }

/* From the calculator: the filled-in trade as a short summary. Edit opens the fields under it. */
.tf-ticket { display: flex; flex-direction: column; gap: 12px; }
.tf-ticket-top { display: flex; align-items: center; gap: 10px; }
.tf-ticket-top .trade-sym { font-size: 1.35rem; letter-spacing: -0.01em; }
.tf-ticket-top .ghost { margin-left: auto; display: flex; align-items: center; gap: 6px; padding: 0 14px; }
.tf-ticket-top .ghost[aria-expanded="true"] .ic { transform: rotate(180deg); }
.tf-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: 10px 8px; }
.tf-facts div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tf-facts dt { font-size: 0.75rem; font-weight: 650; color: var(--muted); }
.tf-facts dd { margin: 0; font-size: 1.1rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tTicketTarget { color: var(--accent-ink); }
.tf-fields { display: flex; flex-direction: column; gap: 12px; }
.tf-card.ticketed .tf-fields { padding-top: 12px; border-top: 1px solid var(--line); }

/* How did it end? Each button says what it means in dollars. Wins fill green, the stop fills red, a target fills gold. */
.tf .r-chips { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 8px; }
.tf .r-chips.no-loss { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tf .r-chips .chip { min-height: 62px; min-width: 0; padding: 4px 2px; border-radius: 12px; background: var(--field); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.tf .r-chips b { font-size: 1.05rem; font-weight: 750; }
.tf .r-chips small { max-width: 100%; font-size: min(0.75rem, 3.3vw); font-weight: 600; line-height: 1.15; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.tf .r-chips small:empty { display: none; }
.tf .r-chips .loss-chip b { color: var(--loss); }
.tf .r-chips .chip[aria-pressed="true"] { border-color: var(--win); background: color-mix(in srgb, var(--win) 14%, var(--field)); color: var(--win-ink); }
.tf .r-chips .loss-chip[aria-pressed="true"] { border-color: var(--loss); background: color-mix(in srgb, var(--loss) 14%, var(--field)); color: var(--loss-ink); }
.tf .r-chips.no-loss .chip[aria-pressed="true"] { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-line) 12%, var(--field)); color: var(--accent-ink); }
.tf .r-chips .chip[aria-pressed="true"] b, .tf .r-chips .chip[aria-pressed="true"] small { color: inherit; }
.tf .r-typed { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.tf .r-typed label { flex: 1 1 8rem; font-weight: 500; }
.tf .r-typed-row { flex: none; display: flex; gap: 8px; }
.tf .r-typed-row .ghost { min-width: 48px; font-size: 1.2rem; }

.tf-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tf-opt { min-height: 62px; min-width: 0; padding: 6px 12px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--field); text-align: left; }
.tf-opt b { font-size: 0.95rem; font-weight: 700; }
.tf-opt small { font-size: 0.8rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tf-opt.win b { color: var(--win-ink); } .tf-opt.loss b { color: var(--loss-ink); }
.tf-opt.win[aria-pressed="true"] { border-color: var(--win); background: color-mix(in srgb, var(--win) 12%, var(--field)); }
.tf-opt.loss[aria-pressed="true"] { border-color: var(--loss); background: color-mix(in srgb, var(--loss) 12%, var(--field)); }

.tf .chips-field legend { font-size: 0.8rem; }
.tf #tSetups .chip, .tf #tMistakes .chip { border-radius: 12px; background: transparent; }
.tf #tSetups .chip[aria-pressed="true"] { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-line) 12%, transparent); color: var(--accent-ink); }
.tf #tMistakes .chip[aria-pressed="true"] { border-color: var(--loss); background: color-mix(in srgb, var(--loss) 12%, transparent); color: var(--loss-ink); }
.tf textarea { min-height: 76px; resize: none; }
.tf-delete { align-self: center; min-height: 44px; padding: 0 16px; color: var(--error); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

/* The result in big numbers, with Save right under it: the foot of the sheet, always in reach. */
.tf-dock { flex: none; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, var(--bg));
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.tf-sum { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.tf-sum-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tf-sum-cap { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
#tSumBig, #pSum { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#tSumBig.muted { color: var(--muted); }
/* "Includes $1.16 fees" under the big number, in the small print of the line beside it. */
.tf-sum-fee { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tf-sum-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tf-pill { padding: 4px 10px; border-radius: 8px; font-size: 0.9rem; font-weight: 750; background: var(--surface-2); color: var(--text); }
/* (.tf .tf-dock in front, so the app's older .win / .loss text colours don't take over here.) */
.tf .tf-dock .tf-pill.win { background: color-mix(in srgb, var(--win) 16%, transparent); color: var(--win-ink); }
.tf .tf-dock .tf-pill.loss { background: color-mix(in srgb, var(--loss) 16%, transparent); color: var(--loss-ink); }
.tf-pill.target { background: color-mix(in srgb, var(--accent-line) 14%, transparent); color: var(--accent-ink); }
.tf-dock .primary-btn, .day-save .primary-btn { width: 100%; min-height: 54px; font-size: 1.05rem; }
/* A phone held sideways is short: the result and Save share one row, and the grab line goes. */
@media (max-height: 480px) {
  .tf-dock { flex-direction: row; align-items: center; padding-top: 8px; } .tf-sum { flex: 1; } .tf-dock .primary-btn { flex: none; width: auto; min-height: 48px; padding: 0 22px; }
  .tf-grab { display: none; } .tf-head { padding-top: 8px; padding-bottom: 6px; }
}

/* Open trades: the button for the planned target carries a small "target" tag instead of a picture. */
.close-r button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.15; }
.close-r small { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); }
.close-r .c-target { border-color: var(--accent-line); }
/* The target's own button shows its R to two places ("+1.9R", "+2.63R": both fit at 320, 360 and 390 px with normal
   to 200% text, light and dark, measured in Chrome). A target of 10R or more has seven signs ("+12.35R") and ran out of
   its row at 320 px, so it is written smaller, no wider than "+2.63R" (journal-ui.js gives it the class "long"). */
.close-r .c-target.long { font-size: 0.75rem; }
/* Large text on a narrow phone: the four buttons no longer fit side by side ("+3R" ran off the screen at 320 px with
   125% text and more, also on main). Measured in Chrome with the iPhone's font, with the widest real label, a "+3R"
   with its "target" tag: the four need 10.46rem of words and 83 px of edges, padding and three 6 px gaps, so one row
   from 10.5rem + 83px of row. Below that, "Stop −1R" has a row of its own and the three R buttons share the next in
   equal columns (a review found "+3R target" 107 px beside two of 89 at 360 px with 200% text): each as wide as the
   widest, "+3R" with its tag (2.74rem and 20 px), so three in a row from 8.25rem + 72px with two 6 px gaps; below
   that, two to a row, in equal columns too. */
#openList .pending-row { container-type: inline-size; }
@container (width < calc(10.5rem + 83px)) { .close-r { grid-template-columns: repeat(3, minmax(0, 1fr)); } .close-r .c-loss { grid-column: 1 / -1; } }
@container (width < calc(8.25rem + 72px)) { .close-r { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* A long ticker ("WWWWWWWWWWWW") ends in "…" rather than run off the screen with large text (also on main); its
   whole name is read out (the row's own words, and the open trade's "Edit open … trade"). Only a trade's ticker, in
   the trade list, open trades and pending orders: the Trading Book's Contents rows ("Today · Tuesday, November 17,
   2026") wrap their whole date, as on main (a review found it cut from 320 px with 125% text). */
.trade:not(.day-row) .trade-top .trade-sym, .pending-info .trade-top .trade-sym { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Small motions that make a tap feel answered: buttons dip when pressed, colours change softly, a card that appears
   fades in, the Undo message slides up. All of it is off when the phone asks for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .tf .chip, .tf .kind3 button, .tf-dir button, .tf-opt, .tf-tabs button, .tf-step button, .tf-date-chip, .tf-dock .primary-btn, .close-r button, .add-shot,
  #dailyPane .chip, #dailyPane .segmented button, .star, #dSave, #dNow,
  #calcView button, #marketsView button, .theme-toggle {
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease; }
  .tf .chip:active, .tf .kind3 button:active, .tf-dir button:active, .tf-opt:active, .tf-step button:active, .tf-dock .primary-btn:active, .close-r button:active, .add-shot:active,
  #dailyPane .chip:active, #dailyPane .segmented button:active, .star:active, #dSave:active, #dNow:active,
  #calcView button:active, #marketsView button:active, .theme-toggle:active { transform: scale(0.97); }
  #marketsView .market-card:active, #calcView .day-limit:active { transform: scale(0.985); } /* wide ones dip less */
  button.bk-closed { transition: transform 0.08s ease; } button.bk-closed:active { transform: scale(0.98); } /* the closed Trading Book dips as one piece */
  .tf-card, .tf-fields, .daily-section { animation: card-in 0.16s ease-out; } /* the Daily Journal's Plan or Review half fades in the same way */
  .star .ic { transition: fill 0.12s ease, opacity 0.12s ease; } /* a Discipline star fills softly; its dip when pressed is in the lists above */
  #tSumBig, .tf-pill { transition: color 0.12s ease, background-color 0.12s ease; }
  .toast { animation: toast-in 0.18s cubic-bezier(0.2, 0.9, 0.25, 1); }
  .day-bar.flash { animation: past-flash 0.4s ease-out; } /* the Daily Journal's date bar pulses once when a past day is opened */
}
@keyframes card-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes past-flash { from { box-shadow: 0 0 0 0 var(--accent-line); } to { box-shadow: 0 0 0 14px transparent; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
/* Calculator, Markets and the theme button (the bottom bar has its own press, see "Bottom navigation"): a pressed button also turns a shade darker (lighter in
   dark mode), with less motion too. */
#calcView button:active:not(.market-chip), #marketsView button:active, .theme-toggle:active, .market-chip:active::before { box-shadow: inset 0 0 0 99px rgba(128, 128, 128, 0.16); }
/* A pressed market card also shows its own colour all around its edge, so the press can be seen at once, before
   the card fills with the colour. */
#marketsView .market-card:active { border-color: var(--m); }

/* ---- THE SETTINGS LIST on Markets (the owner's design, Dec 2 2026; settings-ui.js) ----
   Under the four markets: groups of rows on one card each (--surface, --line, the cards' 18 px corners). A row is a quiet
   icon tile, the name, the value now in grey and a chevron, at least 52 px tall; the hairline between two rows starts
   after the icon. The icons are a soft grey on a tile of white at about 6 % (in light mode the same quiet grey on a
   tile of dark at 5 %): they never take the market's colour. The market's colour is only on a switch that is on.
   Large text: the name and the value wrap; the row grows. */
:root { --set-tile: rgba(255, 255, 255, 0.06); --set-ic: #c3c9d3; --set-chev: #5b6370; --switch-off: #2c313a; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --set-tile: rgba(15, 23, 42, 0.05); --set-ic: #5b6472; --set-chev: #a1a9b5; --switch-off: #d3d8df; } }
:root[data-theme="light"] { --set-tile: rgba(15, 23, 42, 0.05); --set-ic: #5b6472; --set-chev: #a1a9b5; --switch-off: #d3d8df; }
.set-group { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.market-grid + .set-group { margin-top: 16px; }
.set-head { margin: 0 4px; font-size: 0.74rem; line-height: 1.3; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.set-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.set-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin: 0; padding: 6px 14px; border: 0; border-radius: 0; background: none; color: var(--text); text-align: left; font: inherit; }
/* (The hairline: above every row that follows a row that shows, so a hidden first row leaves no line at the top.) */
.set-row:not([hidden]) ~ .set-row::before { content: ''; position: absolute; left: 54px; right: 0; top: 0; height: 1px; background: var(--line); }
.set-ico { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--set-tile); }
.set-ico svg { width: 17px; height: 17px; fill: none; stroke: var(--set-ic); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* NARROW SCREENS AND LARGE TEXT (the second review of the settings list, Dec 2 2026): words break only between whole
   words, and a number ("$1,250,000") never breaks: the name and the value are never squeezed below their longest word
   (min-width: auto). When the two do not fit side by side, the row wraps and the value goes to a line of its own under
   the name, at the right. The chevron stands apart, at the right edge, in the middle of the row (button.set-row), so it
   never moves to a line of its own. Nothing is measured: the browser lays it out. */
.set-row { flex-wrap: wrap; row-gap: 2px; }
button.set-row { padding-right: 38px; }
button.set-row .set-chev { position: absolute; right: 16px; top: 50%; margin-top: -7px; }
/* (The name keeps beside its icon: it is never wider than the row less the icon, so it wraps by words there instead of
   going to a line of its own. A switch row never wraps: its switch stays at the right, the name wraps by words.) */
.set-sw { flex-wrap: nowrap; } .set-sw .set-name { min-width: 0; }
.set-box:not(.set-in) .set-name { max-width: calc(100% - 40px); }
.set-name { flex: 1 1 auto; min-width: auto; font-size: 1rem; font-weight: 500; line-height: 1.3; color: var(--text); letter-spacing: 0; }
.set-val { flex: 0 1 auto; min-width: auto; margin-left: auto; color: var(--muted); font-size: 0.94rem; line-height: 1.3; text-align: right; font-variant-numeric: tabular-nums; }
.set-val:empty { display: none; }
.set-chev { flex: none; width: 8px; height: 14px; fill: none; stroke: var(--set-chev); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.set-foot { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: 0.8rem; }
/* Pressed: a row dips a little less than a button, as the market cards do (it is as wide), with the same shade. The switch
   dips as a button; its shade is drawn on its track only, not on the square place for the finger around it. */
@media (prefers-reduced-motion: no-preference) { #marketsView .set-row:active { transform: scale(0.985); } }
#marketsView .switch:active { box-shadow: none; }
/* (Twice the buttons' shade: the track is a small part of the switch's place, and the press must still be easy to see,
   scripts/qa-calc-markets.mjs.) */
#marketsView .switch:active::before { box-shadow: inset 0 0 0 99px rgba(128, 128, 128, 0.36); }
/* The switch: 46 x 28 px to see, in a place 56 x 48 px for the finger. Off: a quiet grey; on: the market's colour. */
.switch { position: relative; flex: none; width: 56px; height: 48px; min-height: 48px; margin: 0 -5px; padding: 0; border: 0; border-radius: 16px; background: none; }
.switch::before { content: ''; position: absolute; left: 5px; top: 10px; width: 46px; height: 28px; border-radius: 14px; background: var(--switch-off); }
.switch::after { content: ''; position: absolute; left: 7px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.switch[aria-checked="true"]::before { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:focus-visible { outline-offset: -2px; }
@media (prefers-reduced-motion: no-preference) { .switch::before { transition: background-color 0.18s ease; } .switch::after { transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.25, 1); } }

/* The sheet one setting opens in: from the bottom, as the app's other sheets, the page behind dimmed. Its card stands
   in it without its own frame; its title is the sheet's title. --vv-top / --vv-h: the part of the screen above the
   phone's keyboard while a box is typed in (settings-ui.js fit); the whole window otherwise. */
.set-sheet { position: fixed; left: 0; right: 0; top: var(--vv-top, 0px); height: var(--vv-h, 100%); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.set-panel { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 560px; max-height: calc(100% - max(10px, env(safe-area-inset-top, 0px), var(--win-buttons, 0px)) - 6px);
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.45); outline: none; animation: sheet-up 0.22s cubic-bezier(0.2, 0.9, 0.25, 1); }
@media (prefers-reduced-motion: reduce) { .set-panel { animation: none; } }
.set-panel > .tf-grab { margin-top: 10px; width: 38px; }
.set-body { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px max(18px, env(safe-area-inset-right, 0px)) 2px max(18px, env(safe-area-inset-left, 0px)); }
/* The Account sheet keeps one tall size from the start (600 px, or up to the gap at the top of a smaller screen): its card
   changes size as a sign-in goes on (one line while a purchase is checked, the signed-in panel after), and a sheet that
   fits its content would move the card up and down under the person's eyes each time (scripts/qa-web.mjs measures it).
   Done stays at the bottom; a card taller than the sheet, with very large text, scrolls inside it. */
.set-sheet[data-set="account"] .set-panel { height: 600px; }
.set-sheet[data-set="account"] .set-body { flex: 1 1 auto; }
.set-body > .card { gap: 14px; padding: 0; background: none; border: 0; border-radius: 0; }
#setBody > .card h2.small-title, #setBody > .card #accountTitle { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.set-body > .card > .hint, .set-body > .card > p:not(.field-error):not(.summary) { font-size: 0.95rem; line-height: 1.45; }
.set-body > .about-card { gap: 4px; }
.set-dock { flex: none; padding: 16px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); }
#setDone { width: 100%; min-height: 52px; border: 0; border-radius: 16px; font-size: 1.05rem; font-weight: 700; background: linear-gradient(100deg, var(--accent), var(--accent-2)); color: var(--on-accent); }
.view.locked #setDone { background: none; border: 1.5px solid var(--line); color: var(--text); }
/* Keyboard up: the grab line goes and Done sits closer, which leaves the room to the box being typed in. */
.set-sheet.kb .set-panel > .tf-grab { display: none; } .set-sheet.kb .set-dock { padding-top: 8px; padding-bottom: 8px; } .set-sheet.kb .set-body { padding-top: 10px; }
html.set-open, html.set-open body { overflow: hidden; }
/* (With the keyboard up the page behind is not drawn: an iPhone lets a strip of it show through the bar above its
   keyboard, as the Add trade sheet found.) */
html.set-kb main > :not(#marketsView), html.set-kb #marketsView > :not(#setSheet) { visibility: hidden; }
/* Inside a sheet: a small group of its own (a reminder's switch and its time), on the boxes' colour, no icons. */
.set-in { background: var(--field); }
.set-in .set-row { padding-inline: 16px; }
.set-in .set-row:not([hidden]) ~ .set-row::before { left: 16px; }
.set-in .set-name { font-size: 1rem; font-weight: 500; color: var(--text); letter-spacing: 0; }
/* The time row: the label stays on one line while it fits; the time box goes under it, at the right, when the two do
   not fit side by side (200% text). */
.set-time input { flex: none; margin-left: auto; width: auto; min-width: 0; min-height: 44px; padding: 0 2px; border: 0; background: none; text-align: right; font-size: 1rem; color: var(--muted); }
.set-time input:focus { box-shadow: none; color: var(--text); }
.set-time input:disabled { opacity: 0.45; }
.set-time:focus-within { box-shadow: inset 0 0 0 2px var(--accent-line); }
