/* UI kit: the shared components rebuilt pages are made of. Built from Trading X-ray; see every piece at /ui-kit
   on a local server. head.php loads this right after app-shell.css.

   The rules (tests/js/ui-scale.test.js enforces them for every stylesheet on the kit):
   - Type: only the --ui-type-* sizes in tokens.css, set as `font: <400|500|600> var(--ui-type-…) var(--ui-font)`.
     No 13px, 15px or half pixels. The number a block is about is display; its caption is lead; text is body;
     meta is caption. Chart labels use chart, inside charts only.
   - Shape: three radii, --ui-radius-control / card / frame. 3px only rounds data marks.
   - Colour: only the --ui-* roles. Colour carries meaning (gain, loss, drift, the accent), never decoration.
   - A compact row of figures (Home's week, Reports' KPIs): label and note at caption, the figure at title-m.
   - Buttons: .app-action-btn (app-content-controls.css) is the one action button: 40px tall, 14/20, weight 600,
     radius 6. Toolbar controls that filter or switch a view (Journal's Filters, View options) read at 500.
   - A page adds layout. When a page needs a piece that is not here, it is added here first, then used. */

/* Bold text is the semibold face: TSB Inter ships 400, 500 and 600 only, and `bolder` (the browser's and
   Tailwind's preflight) asks for 700 or 900. One class of specificity, so a page's own class rule still wins. */
.tsb-app-page :where(b, strong) { font-weight: 600; }

/* ============================================
   Chip
   One chip for a state or a tag on every rebuilt page. A soft tint carries the meaning and an
   icon leads when the state has one. data-state takes a setup's state words (SetupProof: edge,
   forming, drift, leak, early, sample); data-tone covers the rest (gain, loss, warn, accent, outline).
   ============================================ */
.ui-chip {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 5px;
    width: max-content;
    max-width: 100%;
    height: 24px;
    padding: 0 9px;
    border-radius: var(--ui-radius-control);
    background: var(--ui-raised);
    color: var(--ui-ink-2);
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
/* A chip a script fills (a count, a version) is not drawn while it is empty: no blank grey square before it knows. */
.ui-chip:empty { display: none; }

/* Doubled so a page's own icon size (.setup-library .sl-icon and the like) never resizes a chip's icon. 14 px: icons in
   chips are 14 (DESIGN-SYSTEM decision 4, Igor 12 Nov). */
.ui-chip.ui-chip > :is(svg, i) {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.ui-chip:is([data-state=edge], [data-state=forming], [data-tone=gain]) {
    background: var(--ui-gain-soft);
    color: var(--ui-gain);
}

.ui-chip:is([data-state=leak], [data-tone=loss]) {
    background: var(--ui-loss-soft);
    color: var(--ui-loss);
}

.ui-chip:is([data-state=drift], [data-tone=warn]) {
    background: var(--ui-warn-soft);
    color: var(--ui-warn);
}

.ui-chip[data-tone=accent] {
    background: var(--ui-accent-soft);
    color: var(--ui-accent-text);
}

.ui-chip[data-tone=outline] {
    background: none;
    box-shadow: inset 0 0 0 1px var(--ui-line-strong);
}

/* ============================================
   Icons: one weight everywhere (Igor 11 Nov, after the Shelf / List icons of the Setups prototype D: «везде жирные иконки
   например лучше чем у нас?» → «и это везде видимо надо делать… на видео при записи экрана это тоже будет хорошо
   смотреться»). Every line icon (Lucide and the sidebar's own set, both carry .lucide) draws one line at any size,
   instead of 1.1–1.7 px by size and page. No page sets an icon's stroke. Brand logos are images in the brand map and
   are not touched. The line is 1.5 px (Igor 12 Nov, «B · 1.5 px», on the live A 1.8 / B 1.5 / C proportional compare,
   docs/product/design/icon-weight-2026-11-12/: 1.8 read heavy at 14–16 px, where most icons are).
   ============================================ */
:root { --ui-icon-stroke: 1.5px; }
svg.lucide { stroke-width: var(--ui-icon-stroke) !important; }
:is(svg.lucide, .tsb-sidebar-icon-sprite symbol) :is(path, line, polyline, polygon, circle, rect, ellipse) { vector-effect: non-scaling-stroke; stroke-width: inherit !important; }

/* ============================================
   Page head: one anatomy on every app page (10 Nov 2026, docs/product/pages/design-base.md §2).
   Its parts sit in the head in reading order (a wrapper may be display:contents); the head places them:
   row 1, the title line (40 px): .ui-page-title, then .ui-page-sections (a section's sub-pages, the kit's segmented
          control) right after it, then .ui-page-actions on the right in one order: view → dates → ⋯ or the one action;
   row 2: .ui-page-meta, one 14 px grey line, facts joined by " · ", the account in view first;
   row 3: .ui-page-sentence, the page's answer in the trader's numbers (24/32; .ui-page-why for the grey clause).
   The account picker is the top bar's, never the page's. Dates are .ui-page-dates (calendar, range, chevron).
   ============================================ */
.ui-page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; min-width: 0; margin: 0 0 24px; padding: 0; border: 0; }
.ui-page-head::after { content: none; }
.ui-page-title { margin: 0; font: 600 var(--ui-type-title-l) var(--ui-font); letter-spacing: -.02em; color: var(--ui-ink); }
/* A page's title in its head is set like Journal's (-.04em); titles used elsewhere (checkout, a strategy's name field) keep -.02em. */
:is(.ui-page-head, .settings-heading) .ui-page-title { letter-spacing: -.04em; }
.ui-page-head .ui-page-back { order: -1; margin: 0 100% 8px 0; white-space: nowrap; }
.ui-page-head .ui-page-title { order: 0; flex: 0 1 auto; min-width: 0; min-height: 40px; overflow-wrap: anywhere; }
.ui-page-head .ui-page-sections { order: 1; flex: none; width: max-content; max-width: 100%; }
.ui-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ui-page-head .ui-page-actions { order: 2; flex: 0 1 auto; justify-content: flex-end; margin-left: auto; }
.ui-page-actions > .ui-link { margin-inline: 8px; }
.ui-page-meta { margin: 6px 0 0; font: 400 var(--ui-type-body) var(--ui-font); color: var(--ui-ink-2); }
.ui-page-meta :is(strong, b) { font-weight: 500; color: var(--ui-ink); }
.ui-page-head .ui-page-meta { order: 3; flex: 1 0 100%; margin: 4px 0 0; text-wrap: pretty; }
.ui-page-meta :is(a, button) { min-height: 0; padding: 0; border: 0; background: none; color: var(--ui-accent-text); font: inherit; cursor: pointer; }
.ui-page-meta .ui-link { font-weight: 500; }
.ui-page-sentence { margin: 0; max-width: 1040px; font: 600 var(--ui-type-title-m) var(--ui-font); letter-spacing: -.02em; color: var(--ui-ink); text-wrap: pretty; }
.ui-page-head .ui-page-sentence { order: 4; flex: 1 0 100%; margin-top: 24px; }
.ui-page-why { font-weight: 400; color: var(--ui-ink-2); }
.ui-page-sentence :is(.ui-gain, [data-tone=gain]) { color: var(--ui-gain); }
.ui-page-sentence :is(.ui-loss, [data-tone=loss]) { color: var(--ui-loss); }
.ui-page-dates { font-variant-numeric: tabular-nums; }

@media (max-width: 767px) {
    /* Phone: the title keeps its line with at most the one action; sub-pages take their own line and scroll sideways
       (never squeezed); the other controls follow the meta line at touch height. */
    .ui-page-head { margin-bottom: 16px; }
    .ui-page-head .ui-page-sections { order: 5; flex: 1 0 100%; width: auto; margin-top: 16px; overflow-x: auto; scrollbar-width: none; }
    .ui-page-head .ui-page-sections::-webkit-scrollbar { display: none; }
    .ui-page-head .ui-page-actions { order: 6; flex: 1 0 100%; justify-content: flex-start; margin: 16px 0 0; }
    .ui-page-head .ui-page-actions[data-head-keep] { order: 2; flex: 0 1 auto; margin: 0 0 0 auto; }
    .ui-page-head .ui-page-sentence { order: 7; margin-top: 16px; }
    .ui-page-head :is(.ui-page-sections .app-view-toggle-btn, .ui-page-actions .app-action-btn) { min-height: 44px; }
}

/* ============================================
   Panel: a white block with a hairline edge. One level only; a panel never holds another panel.
   ============================================ */
.ui-panel { position: relative; min-width: 0; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-card); background: var(--ui-page); color: var(--ui-ink); }
.ui-panel-head { display: flex; align-items: baseline; gap: 8px; }
.ui-panel-title { margin: 0; font: 600 var(--ui-type-lead) var(--ui-font); color: var(--ui-ink); }
.ui-panel-note { margin-left: auto; font: 400 var(--ui-type-caption) var(--ui-font); color: var(--ui-ink-3); }

/* ============================================
   Text: the headline that answers, running text, a quiet note, and a link that reads as text.
   ============================================ */
.ui-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font: 400 var(--ui-type-caption) var(--ui-font); color: var(--ui-ink-2); }
.ui-headline { margin: 0; font: 600 var(--ui-type-title-m) var(--ui-font); letter-spacing: -.02em; color: var(--ui-ink); text-wrap: balance; }
.ui-section-title { margin: 0; font: 600 var(--ui-type-title-s) var(--ui-font); letter-spacing: -.01em; color: var(--ui-ink); }
.ui-text { margin: 0; font: 400 var(--ui-type-body) var(--ui-font); color: var(--ui-ink-2); text-wrap: pretty; }
.ui-note { margin: 0; font: 400 var(--ui-type-caption) var(--ui-font); color: var(--ui-ink-3); }
.ui-link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--ui-accent-text); font: 500 var(--ui-type-caption) var(--ui-font); cursor: pointer; }
.ui-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ui-link :is(svg, i) { width: 14px; height: 14px; }
/* A link drawn as a button is a button: it never underlines, whatever a page's own `a:hover` rule says (many
   page stylesheets underline every link in their area). The kit's button and toggle, the gate's action, and any
   link a page marks as a button or names a button. Text links (.ui-link and plain links) keep their underline. */
a:is(.app-action-btn, .app-view-toggle-btn, .app-access-notice__action, [role="button"], [class*="-btn"], [class*="-button"]):is(:hover, :focus, :focus-visible, :active) { text-decoration: none !important; }
/* A link that is itself the question or the next step (Coach's ways in and follow-ups) reads at body size. */
.ui-link.ui-link-body { text-align: left; font: 500 var(--ui-type-body) var(--ui-font); }

/* ============================================
   Figures: the answer as up to three numbers. The number is the hero, the caption says what it is,
   the note gives the one comparison behind it.
   ============================================ */
.ui-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ui-figure { min-width: 0; }
.ui-figure-label { display: flex; align-items: center; gap: 8px; font: 400 var(--ui-type-caption) var(--ui-font); color: var(--ui-ink-2); }
.ui-figure-value { font: 600 var(--ui-type-display) var(--ui-font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ui-ink); }
.ui-figure-caption { margin-top: 6px; font: 400 var(--ui-type-lead) var(--ui-font); color: var(--ui-ink); }
.ui-figure-caption b { font-weight: 600; }
.ui-figure-note { margin-top: 4px; font: 400 var(--ui-type-body) var(--ui-font); color: var(--ui-ink-2); }
:is(.ui-figure-value, .ui-value, .ui-table-value)[data-tone=gain] { color: var(--ui-gain); }
:is(.ui-figure-value, .ui-value, .ui-table-value)[data-tone=loss] { color: var(--ui-loss); }

/* ============================================
   Rows: a label and its value, the proof beside a chart.
   ============================================ */
.ui-rows { display: grid; align-content: start; gap: 12px; margin: 0; }
.ui-rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.ui-rows dt { font: 400 var(--ui-type-body) var(--ui-font); color: var(--ui-ink-2); }
.ui-rows dd { flex: none; margin: 0; text-align: right; font: 600 var(--ui-type-lead) var(--ui-font); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ui-ink); }
.ui-rows dd small { margin-left: 6px; font: 400 var(--ui-type-caption) var(--ui-font); color: var(--ui-ink-2); }

/* ============================================
   Tab row: a page's own navigation under its answer (Reports' questions, a setup page's sections), as Reports
   drew it and Igor approved (12 Nov «да»): 14/20 500 words, 44 px, the chosen one in ink on a 2 px accent line, the
   rest grey, a hairline under the row, sideways on a phone. Items are links (aria-current) or buttons (aria-selected).
   ============================================ */
.ui-tabrow { display: flex; gap: 24px; max-width: 100%; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--ui-line); scrollbar-width: none; }
.ui-tabrow::-webkit-scrollbar { display: none; }
.ui-tabrow > :is(a, button) { position: relative; display: inline-flex; flex: none; align-items: center; height: 44px; padding: 0; border: 0; background: none; color: var(--ui-ink-2); font: 500 14px/20px var(--ui-font); white-space: nowrap; text-decoration: none; cursor: pointer; transition: color var(--ui-motion-fast, 120ms); }
.ui-tabrow > :is(a, button):hover { color: var(--ui-ink); }
.ui-tabrow > :is([aria-current]:not([aria-current=false]), [aria-selected=true]) { color: var(--ui-ink); }
.ui-tabrow > :is([aria-current]:not([aria-current=false]), [aria-selected=true])::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--app-accent, var(--ui-accent)); }
.ui-tabrow > :is(a, button):focus-visible { outline: 2px solid var(--ui-accent); outline-offset: -2px; }

/* ============================================
   Tabs: the sections of a page or the groups of a list, as text with an optional count. Use these when
   there are more than four choices; two to four views of one thing use the shared .app-view-toggle
   (shared-header-controls.css), Journal's segmented control.
   ============================================ */
.ui-tabs { display: flex; gap: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ui-tabs::-webkit-scrollbar { display: none; }
.ui-tabs button { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--ui-radius-control); background: none; color: var(--ui-ink-2); font: 500 var(--ui-type-body) var(--ui-font); white-space: nowrap; cursor: pointer; }
.ui-tabs button:hover { background: var(--ui-hover); color: var(--ui-ink); }
.ui-tabs button[aria-selected=true] { background: var(--ui-accent-soft); color: var(--ui-accent-text); }
.ui-tabs small { font: 500 var(--ui-type-caption) var(--ui-font); opacity: .72; }
/* More tabs than the width holds (scale sweep 14 Nov #6): assets/ui-tabs.js wraps the strip, fades the edge that hides
   tabs and puts a round arrow there that scrolls to them. Without the script the strip still scrolls. */
.ui-tabs-wrap { position: relative; min-width: 0; }
.ui-tabs-wrap.is-more-end > .ui-tabs { -webkit-mask-image: linear-gradient(to right, currentColor calc(100% - 56px), transparent); mask-image: linear-gradient(to right, currentColor calc(100% - 56px), transparent); }
.ui-tabs-wrap.is-more-start > .ui-tabs { -webkit-mask-image: linear-gradient(to left, currentColor calc(100% - 56px), transparent); mask-image: linear-gradient(to left, currentColor calc(100% - 56px), transparent); }
.ui-tabs-wrap.is-more-start.is-more-end > .ui-tabs { -webkit-mask-image: linear-gradient(to right, transparent, currentColor 56px, currentColor calc(100% - 56px), transparent); mask-image: linear-gradient(to right, transparent, currentColor 56px, currentColor calc(100% - 56px), transparent); }
.ui-tabs-arrow { position: absolute; top: 50%; z-index: 1; display: none; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--ui-line); border-radius: 50%; background: var(--ui-page); color: var(--ui-ink-2); box-shadow: var(--ui-shadow-pop); transform: translateY(-50%); cursor: pointer; }
.ui-tabs-arrow:hover { color: var(--ui-ink); }
.ui-tabs-arrow svg { width: 16px; height: 16px; }
.ui-tabs-wrap.is-more-start > .ui-tabs-arrow.is-start { display: inline-flex; left: 0; }
.ui-tabs-wrap.is-more-end > .ui-tabs-arrow.is-end { display: inline-flex; right: 0; }

/* ============================================
   State: empty, not enough data yet, could not load. Optional drawing, a title, one or two
   sentences, and at most two actions.
   ============================================ */
.ui-state { display: grid; justify-items: start; gap: 6px; }
.ui-state-art { width: 200px; height: auto; margin-bottom: 10px; }
/* Each drawing has its own dark version (light graphite, the same accent mark); no filter inverts it. */
.ui-state-art-dark, html.dark .ui-state-art:not(.ui-state-art-dark) { display: none; }
html.dark .ui-state-art-dark { display: inline-block; }
.ui-state-title { margin: 0; font: 600 var(--ui-type-title-s) var(--ui-font); color: var(--ui-ink); text-wrap: balance; }
.ui-state-text { margin: 0; max-width: 640px; font: 400 var(--ui-type-body) var(--ui-font); color: var(--ui-ink-2); }
.ui-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }

/* ============================================
   Notice: one line about the page itself (part of the history could not be read).
   ============================================ */
/* The notice (Igor 11 Nov: «для уведомлений у нас в journal был дизайн»): Journal's status stack, lifted. A band on the
   notice surface, a filled 20 px icon in its tone on the first line, a bold lead in ink with the rest of the line grey,
   the actions as accent text on the right. Plain text, a lead + detail, or a block with paragraphs all fit:
   <div class="ui-notice" data-tone="loss|warn|gain|info"><span class="ui-notice-icon"><i data-lucide="circle-alert"></i></span>
     <p class="ui-notice-copy"><strong>Lead.</strong> <span>The rest.</span></p><div class="ui-notice-actions">…</div></div>
   Journal's own stack (journal-workspace.css) is the full-width variant of the same band. */
.ui-notice { position: relative; box-sizing: border-box; min-height: 44px; margin: 0; padding: 12px 16px; border: 0; border-radius: var(--ui-radius-control); background: var(--ui-notice-surface, var(--ui-raised)); color: var(--ui-ink-2); font: 400 var(--ui-type-body) var(--ui-font); line-height: 20px; text-wrap: pretty; }
.ui-notice :is(strong, b, h3) { margin: 0; color: var(--ui-ink); font: 600 var(--ui-type-body) var(--ui-font); line-height: 20px; }
.ui-notice :is(p, ul) { margin: 4px 0 0; color: var(--ui-ink-2); }
.ui-notice > :first-child:is(p, .ui-notice-copy), .ui-notice > .ui-notice-icon + :is(p, .ui-notice-copy, strong, h3) { margin-top: 0; }
.ui-notice-copy { margin: 0; min-width: 0; }
.ui-notice-copy > p { display: inline; margin: 0; }
.ui-notice-copy > strong + :is(span, p):not(:empty)::before { content: "·"; margin: 0 8px; color: var(--ui-ink-3); } /* write the lead and the rest with no space between: the dot carries the gaps */
/* A notice that changes tone carries one icon per tone; only its tone's shows. */
.ui-notice-icon > [data-notice-tone] { display: none; }
.ui-notice[data-tone=warn] .ui-notice-icon > [data-notice-tone=warn], .ui-notice[data-tone=info] .ui-notice-icon > [data-notice-tone=info], .ui-notice[data-tone=loss] .ui-notice-icon > [data-notice-tone=loss], .ui-notice[data-tone=gain] .ui-notice-icon > [data-notice-tone=gain] { display: block; }
.ui-notice a:not(.app-action-btn) { color: var(--ui-accent-text); font-weight: 500; text-decoration: none; }
.ui-notice a:not(.app-action-btn):hover { text-decoration: underline; text-underline-offset: 3px; }
/* The icon hangs in a 32 px gutter on the first line, whatever the copy below it is made of. */
.ui-notice:has(> .ui-notice-icon) { padding-left: 48px; }
.ui-notice > .ui-notice-icon { position: absolute; top: 12px; left: 16px; display: grid; place-items: center; width: 20px; height: 20px; color: var(--ui-accent-text); }
.ui-notice > .ui-notice-icon svg { width: 20px; height: 20px; stroke-width: 2; }
.ui-notice:is([data-tone=loss], [role=alert]:not([data-tone])) > .ui-notice-icon { color: var(--ui-loss); }
.ui-notice[data-tone=warn] > .ui-notice-icon { color: var(--ui-warn); }
.ui-notice[data-tone=gain] > .ui-notice-icon { color: var(--ui-gain); }
/* Alert and check icons are filled in their tone, their mark cut out in the band's colour (Journal's). */
.ui-notice > .ui-notice-icon :is(.lucide-circle-alert, .lucide-triangle-alert, .lucide-circle-check, .lucide-circle-x) { fill: currentColor; stroke: var(--ui-notice-surface, var(--ui-raised)); }
.ui-notice > .ui-notice-icon :is(.lucide-circle-alert, .lucide-circle-check, .lucide-circle-x) circle { stroke: currentColor; }
/* With actions: the copy and the actions share the row, the actions on the right; they wrap under the copy when narrow. */
.ui-notice:has(> .ui-notice-actions) { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; padding-block: 4px; }
.ui-notice:has(> .ui-notice-actions) > .ui-notice-icon { top: 12px; }
.ui-notice:has(> .ui-notice-actions) > :is(.ui-notice-copy, p, div:not(.ui-notice-actions)) { flex: 1 1 320px; padding-block: 8px; }
.ui-notice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-left: auto; }
.ui-notice-actions :is(a, button):not(.app-action-btn-primary) { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 12px; border: 0; border-radius: var(--ui-radius-control); background: transparent; box-shadow: none; color: var(--ui-accent-text); font: 500 var(--ui-type-body) var(--ui-font); text-decoration: none; cursor: pointer; }
.ui-notice-actions :is(a, button):not(.app-action-btn-primary):hover { background: var(--ui-accent-soft); }
@media (max-width: 767px) {
    .ui-notice-actions :is(a, button) { min-height: 44px; }
}

/* ============================================
   Table: rows of one kind (trades), under a group title (the day) when the order allows, each group in
   one card. Column labels are captions, the row's name is lead, its figure is title-s and carries the tone.
   The card is drawn from one cell that every row shows (.ui-table-box): its ::before covers the whole row,
   because a table row's own pseudo-element would take a column. Mark a group's first and last rows
   .is-first / .is-last. Columns are as wide as their content; the one .ui-table-fill column takes the rest
   (text there truncates). The page adds its columns.
   ============================================ */
.ui-table { width: 100%; min-width: 0; border-collapse: separate; border-spacing: 0; isolation: isolate; font: 400 var(--ui-type-body) var(--ui-font); color: var(--ui-ink); font-variant-numeric: tabular-nums; }
.ui-table :is(th, td) { width: 1%; padding: 0 12px; border: 0; background: none; vertical-align: middle; white-space: nowrap; }
.ui-table :is(th, td).ui-table-fill { width: auto; max-width: 0; }
.ui-table .ui-table-fill > * { display: block; overflow: hidden; text-overflow: ellipsis; }
.ui-table th { height: 32px; padding-bottom: 4px; vertical-align: bottom; text-align: left; font: 400 var(--ui-type-caption) var(--ui-font); color: var(--ui-ink-2); }
.ui-table-group > td { height: 56px; padding-bottom: 10px; vertical-align: bottom; }
.ui-table-group-title { display: flex; align-items: baseline; gap: 8px; font: 600 var(--ui-type-lead) var(--ui-font); color: var(--ui-ink); }
.ui-table-group-title span { font-weight: 400; color: var(--ui-ink-2); }
.ui-table-group-title small { font: 400 var(--ui-type-caption) var(--ui-font); color: var(--ui-ink-3); }
.ui-table-row { position: relative; cursor: pointer; }
.ui-table-row > td { height: 64px; }
.ui-table-row > .ui-table-box::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 1px solid var(--ui-line); border-top-width: 0; background: var(--ui-page); pointer-events: none; }
.ui-table-row.is-first > .ui-table-box::before { border-top-width: 1px; border-top-left-radius: var(--ui-radius-card); border-top-right-radius: var(--ui-radius-card); }
.ui-table-row.is-last > .ui-table-box::before { border-bottom-left-radius: var(--ui-radius-card); border-bottom-right-radius: var(--ui-radius-card); }
.ui-table-row:hover > .ui-table-box::before { background: var(--ui-hover); }
.ui-table-row:is(.selected, [aria-current=true]) > .ui-table-box::before { background: var(--ui-accent-soft); }
.ui-table-row:focus-visible { outline: 0; }
.ui-table-row:focus-visible > .ui-table-box::before { box-shadow: inset 0 0 0 2px var(--ui-accent-text); }
.ui-table-name { font: 600 var(--ui-type-lead) var(--ui-font); letter-spacing: -.01em; color: var(--ui-ink); }
.ui-table-meta { font: 400 var(--ui-type-caption) var(--ui-font); color: var(--ui-ink-3); }
.ui-table-value { font: 600 var(--ui-type-title-s) var(--ui-font); letter-spacing: -.02em; white-space: nowrap; color: var(--ui-ink); }

/* ============================================
   Step bar: a rounded 4px bar over each step of a path (Trading Day's day, New account).
   Done and current steps fill with the accent.
   ============================================ */
.ui-step-bar { position: relative; }
.ui-step-bar::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; border-radius: 999px; background: var(--ui-line); }
.ui-step-bar:is(.is-active, .is-done)::before { background: var(--ui-accent); }
/* The number of a step in a path (Strategy Lab's idea path, the four steps of Strategy from a link). */
.ui-step-num { display: inline-grid; flex: none; place-items: center; width: 24px; height: 24px; border-radius: var(--ui-radius-control); background: var(--ui-raised); color: var(--ui-ink-2); font: 500 var(--ui-type-caption) var(--ui-font); text-align: center; }

/* ============================================
   Where an idea comes from → TSB (Strategy Lab's idea path, Strategy from a link): the YouTube mark large, a link
   mark at its height (Igor 10 Nov: «крупнее лого ютуба», «лучше бы ссылку поставил»), an arrow, TSB's wordmark.
   ============================================ */
.ui-source-pair { display: flex; align-items: center; gap: 12px; height: 40px; color: var(--ui-ink-3); }
.ui-source-pair > .ui-source-yt { flex: none; width: 40px; height: 28px; }
.ui-source-pair > .ui-source-link { flex: none; width: 28px; height: 28px; color: var(--ui-ink-2); }
.ui-source-pair > :is(svg, i):not(.ui-source-yt, .ui-source-link) { width: 16px; height: 16px; }
.ui-source-tsb { flex: none; width: 58px; height: 17px; background: var(--ui-ink); -webkit-mask: var(--ui-source-tsb) left center / contain no-repeat; mask: var(--ui-source-tsb) left center / contain no-repeat; }

/* ============================================
   Charts: text inside a chart and the one tooltip every chart uses.
   ============================================ */
.ui-chart text { font: 400 var(--ui-type-chart) var(--ui-font); fill: var(--ui-ink-3); }
.ui-tip { position: fixed; z-index: 30; min-width: 150px; padding: 8px 10px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-control); background: var(--ui-page); box-shadow: 0 8px 24px rgb(0 0 0 / .14); color: var(--ui-ink); font: 400 var(--ui-type-caption) var(--ui-font); pointer-events: none; }
.ui-tip b { display: block; font: 600 var(--ui-type-body) var(--ui-font); font-variant-numeric: tabular-nums; }
.ui-tip span { display: block; color: var(--ui-ink-2); font-variant-numeric: tabular-nums; }

@media (max-width: 767px) {
    .ui-figures { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .ui-figure-value { font: 600 var(--ui-type-title-l) var(--ui-font); }
    .ui-headline { font: 600 var(--ui-type-title-s) var(--ui-font); }
}

/* ---- The lock (one for the whole app; Igor 5 Nov, docs/product/design/locks-2026-11-05) ----------------------------
   A quiet line inside the trader's own page where Pro continues: the padlock, one sentence, one "… in Pro" link that
   opens the Pro sheet. Drawn only by tsbRenderLock() (includes/gate-card.php) or TSBLock.html() (assets/gates-v2.js);
   tests/js/lock-system.test.js keeps page-local copies out. No frame, no fill, one hairline above it. */
.ui-lock { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 16px 0; border-top: 1px solid var(--ui-line); color: var(--ui-ink); font: 400 var(--ui-type-body) var(--ui-font); }
.tsb-content-controls.ui-lock { font: 400 var(--ui-type-body) var(--ui-font); } /* the lock carries the controls' class, whose 16 px lead size came after this rule (Igor 8 Nov «что со шрифтом») */
.ui-lock--bare { border-top: 0; }
.ui-lock-icon { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--ui-ink-2); }
.ui-lock-copy { flex: 1 1 0; min-width: 0; }
.ui-lock-line { margin: 0; color: var(--ui-ink); font-weight: 500; text-wrap: pretty; } /* medium, so the lock's own line stands above its grey sub (Igor 13 Nov «тонко так и нужно?» → «Да, везде») */
.ui-lock-sub { margin: 2px 0 0; color: var(--ui-ink-2); text-wrap: pretty; }
.ui-lock-meter { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); font-variant-numeric: tabular-nums; }
.ui-lock-meter > span { position: relative; width: 64px; height: 2px; border-radius: 999px; background: var(--ui-line-strong); overflow: hidden; }
.ui-lock-meter > span > i { position: absolute; inset: 0 auto 0 0; width: var(--used, 100%); background: var(--ui-ink-2); }
.ui-lock-go { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 20px; margin-left: auto; color: var(--ui-accent-text); font: 500 var(--ui-type-body) var(--ui-font); text-decoration: none; white-space: nowrap; }
.ui-lock-go:hover { text-decoration: underline; text-underline-offset: 3px; }
.ui-lock-go:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; border-radius: 3px; }
.ui-lock-go svg { width: 16px; height: 16px; flex: none; }
.ui-lock-cta { flex: none; align-self: center; margin: 0 0 0 auto; } /* centred on the copy, never pulled up against the lock's top line (Igor 8 Nov «кнопка прилипла») */
/* With a button, the line sits on the button's 40 px row: copy centred in it, the padlock on its first line (Igor 8 Nov «выравняй»). */
.ui-lock:has(.ui-lock-cta) .ui-lock-copy { min-height: 40px; display: flex; flex-direction: column; justify-content: center; }
.ui-lock:has(.ui-lock-cta) .ui-lock-icon { margin-top: 10px; }
/* A locked action: an ordinary button with the same padlock and a quiet "Pro" mark; it opens the Pro sheet. */
.ui-lock-btn .ui-lock-icon { width: 16px; height: 16px; margin: 0; }
.ui-lock-pro { margin-left: 2px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
/* a locked section in a page's tabs keeps its own icon; one small lock stands after its name (Igor 25 Nov «немного странно
   смотрится»), the word is for a screen reader and stays inside its tab */
.ui-page-sections > [data-pro-open] { position: relative; }
.ui-page-sections > [data-pro-open] .ui-lock-icon { width: 14px; height: 14px; margin: 0 0 0 2px; color: var(--ui-ink-3); }
.ui-page-sections > [data-pro-open] .ui-lock-pro { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 767px) {
    .ui-lock { flex-wrap: wrap; row-gap: 8px; }
    .ui-lock-copy { flex-basis: calc(100% - 32px); }
    .ui-lock-go { flex-basis: calc(100% - 32px); margin-left: 32px; } /* its own line, under the copy, inside the page */
    .ui-lock-cta { margin: 0 0 0 32px; }
    .ui-lock:has(.ui-lock-cta) .ui-lock-copy { min-height: 0; }
    .ui-lock:has(.ui-lock-cta) .ui-lock-icon { margin-top: 1px; }
    /* The button carries the padlock (open): the copy and the button start at the lock's edge, no line padlock to sit under. */
    .ui-lock:not(:has(> .ui-lock-icon)) .ui-lock-copy { flex-basis: 100%; }
    .ui-lock:not(:has(> .ui-lock-icon)) :is(.ui-lock-go, .ui-lock-cta) { margin-left: 0; }
}

/* ============================================
   Charts (docs/product/pages/CHARTS.md): the family's look for assets/tsb-charts.js (T2–T7, T9, T10); T1 keeps the
   .tsb-paths-* look above, and both share its tooltip. Text inside a chart 11 px, names and values 12, money tabular.
   ============================================ */
.tsb-c-label { margin: 0 0 8px; font: 500 var(--ui-type-caption) var(--ui-font); color: var(--ui-ink-2); }
.tsb-c-plot { position: relative; }
.tsb-c-plot.is-scroll { overflow-x: auto; scrollbar-width: thin; }
.tsb-c-svg { display: block; overflow: visible; font-family: var(--ui-font); font-variant-numeric: tabular-nums; }
.tsb-c-grid { stroke: var(--ui-line); stroke-width: 1; shape-rendering: crispEdges; }
.tsb-c-grid.is-zero { stroke: var(--ui-line-strong); stroke-width: 1.25; }
.tsb-c-axis { fill: var(--ui-ink-3); font-size: 11px; }
.tsb-c-axis.is-strong { fill: var(--ui-ink); font-weight: 500; }
/* A new year on the trade squares (T2): a hairline and the year in bold, as X-ray's film (Igor 14 Nov). */
.tsb-c-year { stroke: var(--ui-line-strong); stroke-width: 1; }
.tsb-c-axis.is-year { fill: var(--ui-ink); font-weight: 600; }
.tsb-c-value { font-size: 12px; font-weight: 600; }
.tsb-c-name { fill: var(--ui-ink); font-size: 12px; font-weight: 500; }
.tsb-c-name.is-quiet { fill: var(--ui-ink-2); font-weight: 400; }
.tsb-c-tail { font-size: 12px; font-weight: 500; }
.tsb-c-ref { stroke: var(--ui-ink-3); stroke-width: 1; }
.tsb-c-ref-name { fill: var(--ui-ink-2); font-size: 11px; }
.tsb-c-ref-value { fill: var(--ui-ink-2); font-size: 12px; font-weight: 600; }
.tsb-c-rug { stroke-width: 1; opacity: .5; }
:is(.tsb-c-bar, .tsb-c-cell, .tsb-c-sq) { cursor: default; transition: opacity var(--ui-motion-fast, 120ms) ease; }
:is(.tsb-c-bar, .tsb-c-cell, .tsb-c-sq).is-dim { opacity: .3; }
:is(.tsb-c-bar, .tsb-c-cell, .tsb-c-sq):focus { outline: none; }
:is(.tsb-c-bar, .tsb-c-cell, .tsb-c-sq):focus-visible { stroke: var(--ui-accent); stroke-width: 2; }
.tsb-c-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 8px 0 0; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); text-wrap: pretty; }
.tsb-c-key { display: inline-flex; align-items: center; gap: 4px; }
.tsb-c-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.tsb-c-key i + i { margin-left: -2px; }
/* the days grid's mark in its legend: the cell's folded corner (tsb-charts.js grid), not a dot (Igor 22 Nov) */
.tsb-c-dot { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 3px; background: linear-gradient(225deg, color-mix(in srgb, var(--ui-ink) 38%, transparent) 40%, var(--ui-raised) 40%); vertical-align: -1px; }
.tsb-c-tag { position: absolute; z-index: 1; pointer-events: none; white-space: nowrap; font: 500 var(--ui-type-caption) var(--ui-font); color: var(--ui-ink-2); font-variant-numeric: tabular-nums; }
.tsb-c-tag b { font-weight: 600; color: var(--ui-ink); }
.tsb-c-tag.is-pill { padding: 2px 8px; border-radius: var(--ui-radius-control); background: var(--ui-page); box-shadow: inset 0 0 0 1px var(--ui-line-strong); color: var(--ui-ink); font-weight: 600; }
.tsb-c-tag.is-pill.is-gain { background: var(--ui-gain-soft); box-shadow: none; color: var(--ui-gain); }
.tsb-c-tag.is-pill.is-loss { background: var(--ui-loss-soft); box-shadow: none; color: var(--ui-loss); }
.tsb-c-pill-prev { color: var(--ui-ink-2); font-weight: 400; }
.tsb-c-tag.is-side { display: grid; line-height: 16px; }
.tsb-c-tag.is-side span { font-size: 12px; color: var(--ui-ink-3); }
.tsb-c-tag.is-side b { font-size: 14px; }
.tsb-c-tag.is-side.is-gain b { color: var(--ui-gain); }
.tsb-c-tag.is-side.is-loss b { color: var(--ui-loss); }
.tsb-c-tag.is-callout { display: grid; gap: 0; line-height: 18px; }
.tsb-c-tag.is-callout b { font-size: 16px; line-height: 20px; }
.tsb-c-tag.is-callout.is-loss b { color: var(--ui-loss); }
.tsb-c-tag.is-callout span { font-size: 12px; color: var(--ui-ink-2); }
.tsb-c-tag.is-bracket { padding-bottom: 2px; font-size: 12px; color: var(--ui-ink-2); }
.tsb-c-tag.is-bracket b { color: var(--ui-ink); }
.tsb-c-tag.is-note { font-size: 12px; color: var(--ui-ink-2); }
.tsb-c-tag.is-note.is-strong { color: var(--ui-ink); font-weight: 600; }
.tsb-c-tag.is-note.is-loss b { color: var(--ui-loss); }
.tsb-c-tag.is-note.is-gain b { color: var(--ui-gain); }
.tsb-c-tag.is-value { font-size: 12px; }
.tsb-c-tag.is-value b { font-size: 14px; }
.tsb-c-tag.is-value.is-loss b { color: var(--ui-loss); }
.tsb-c-tag.is-value.is-gain b { color: var(--ui-gain); }
.tsb-c-tag.is-value.is-quiet b { color: var(--ui-ink-2); }
.tsb-c-count { font-size: 11px; font-weight: 500; }
.tsb-c-early { position: absolute; top: 0; right: 0; z-index: 1; padding: 2px 8px; border-radius: var(--ui-radius-control); background: var(--ui-warn-soft); color: var(--ui-warn); font: 500 var(--ui-type-caption) var(--ui-font); }
.tsb-c-plot.is-scroll { -webkit-mask-image: linear-gradient(90deg, transparent 0, var(--ui-ink) 24px); mask-image: linear-gradient(90deg, transparent 0, var(--ui-ink) 24px); }
.tsb-c-cursor { stroke: var(--ui-ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.tsb-c-empty { display: grid; place-items: center; text-wrap: balance; border: 1px dashed var(--ui-line-strong); border-radius: var(--ui-radius-control); color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); text-align: center; padding: 0 16px; }
.tsb-c-empty.is-micro { border-style: dashed; }

/* ============================================
   Tile: a 36 px icon tile that names what a row is (a weekday rule, a session, an instrument). The tone tints it;
   the icon is one 20 px Lucide glyph. First used by Strategy Lab (9 Nov 2026, prototype C); for any list of kinds.
   ============================================ */
.ui-tile { display: inline-grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: var(--ui-radius-control); background: var(--ui-accent-soft); color: var(--ui-accent-text); }
.ui-tile :is(svg, i) { width: 20px; height: 20px; }
.ui-tile[data-tone=gain] { background: var(--ui-gain-soft); color: var(--ui-gain); }
.ui-tile[data-tone=loss] { background: var(--ui-loss-soft); color: var(--ui-loss); }
.ui-tile[data-tone=warn] { background: var(--ui-warn-soft); color: var(--ui-warn); }
.ui-tile[data-tone=quiet] { background: var(--ui-raised); color: var(--ui-ink-2); }

/* ============================================
   Paper: a saved draft as a sheet with a folded corner (Igor 9 Nov: «прикольно смотрится»). A link or a button;
   kind on top, the title, a footer with its state and "Open".
   ============================================ */
.ui-paper { position: relative; display: flex; flex-direction: column; align-items: stretch; width: 100%; max-width: 260px; min-height: 200px; padding: 24px; border: 0; border-radius: var(--ui-radius-control); background: var(--ui-raised); color: var(--ui-ink); text-align: left; text-decoration: none; clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 0 100%); }
.ui-paper::after { content: ''; position: absolute; top: 0; right: 0; width: 24px; height: 24px; border-bottom-left-radius: var(--ui-radius-control); background: var(--ui-line-strong); }
a.ui-paper:hover { background: var(--ui-hover); text-decoration: none; }
.ui-paper:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ui-accent); }
.ui-paper.is-empty { min-height: 160px; color: var(--ui-ink-3); }
.ui-paper-lines { display: flex; gap: 4px; margin: 0 32px 20px 0; }
.ui-paper-lines i { width: 20px; height: 3px; background: var(--ui-line-strong); }
.ui-paper-lines i:first-child { background: var(--ui-bar-gain); }
.ui-paper.is-empty .ui-paper-lines i:first-child { background: var(--ui-line-strong); }
.ui-paper-kind { margin-bottom: 8px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.ui-paper-title { font: 600 var(--ui-type-lead) var(--ui-font); overflow-wrap: anywhere; text-wrap: balance; }
.ui-paper-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 24px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.ui-paper-open { display: inline-flex; align-items: center; gap: 4px; color: var(--ui-accent-text); font-weight: 500; white-space: nowrap; }
.ui-paper-open :is(svg, i) { width: 14px; height: 14px; }

/* One way to draw a running total (design-base §12, Igor 11 Nov «C, сделки на линии»): assets/tsb-paths-chart.js draws,
   this styles it. */
.tsb-paths{--tsb-paths-gain:var(--ui-bar-gain);--tsb-paths-loss:var(--ui-bar-loss);--tsb-paths-quiet:var(--ui-ink-3);--tsb-paths-accent:var(--app-accent,var(--ui-accent));--tsb-paths-page:var(--ui-page);--tsb-paths-ink2:var(--ui-ink-2);--tsb-paths-ink3:var(--ui-ink-3);position:relative;min-width:0}
.tsb-paths-label{margin:0 0 8px;color:var(--ui-ink-2);font:400 var(--ui-type-caption) var(--ui-font)}
.tsb-paths-plot{position:relative}
.tsb-paths-svg{display:block;max-width:100%;height:auto;overflow:visible}
.tsb-paths-svg text{font-family:var(--ui-font);font-variant-numeric:tabular-nums}
.tsb-paths-grid{stroke:var(--ui-line);stroke-width:1;shape-rendering:crispEdges}
.tsb-paths-grid.is-zero{stroke:var(--ui-line-strong);stroke-dasharray:3 4}
.tsb-paths-sum,.tsb-paths-month{fill:var(--ui-ink-3);font-size:11px}
.tsb-paths-line{fill:none;stroke-linecap:round;stroke-linejoin:round}
.tsb-paths-mark,.tsb-paths-end{stroke-width:1.5}
.tsb-paths-end{stroke-width:2}
.tsb-paths-name{fill:var(--ui-ink);font-size:12px;font-weight:500}
.tsb-paths-name.is-quiet{fill:var(--ui-ink-2);font-weight:400}
.tsb-paths-value{font-size:18px;font-weight:600;letter-spacing:-.01em}
/* A chart's end figure (13 Nov, the chart family's floor): a figure, not a chart label, so HTML at the section-title size,
   the same as a phone's end figure (.tsb-r-ends b); TSBCharts.ribbon and TSBPathsChart draw it in a foreignObject. */
.tsb-paths-figure-box{overflow:visible}
.tsb-paths-figure{display:inline-block;margin:0;color:var(--ui-ink);font:600 var(--ui-type-title-s) var(--ui-font);letter-spacing:-.01em;font-variant-numeric:tabular-nums;white-space:nowrap}
.tsb-paths-figure.tsb-r-is-gain{color:var(--ui-gain)}.tsb-paths-figure.tsb-r-is-loss{color:var(--ui-loss)}.tsb-paths-figure.tsb-r-is-quiet{color:var(--ui-ink-2)}
.tsb-paths-cross{stroke:var(--ui-line-strong)}
.tsb-paths-hit{fill:transparent;cursor:crosshair}
.tsb-paths-tip{position:absolute;z-index:2;display:grid;gap:2px;min-width:150px;padding:8px 10px;border:1px solid var(--ui-line);border-radius:6px;background:var(--ui-page);box-shadow:0 8px 24px rgb(0 0 0/.08);color:var(--ui-ink-2);font:400 var(--ui-type-caption) var(--ui-font);white-space:nowrap;pointer-events:none}
.tsb-paths-tip[hidden]{display:none}
.tsb-paths-tip b{color:var(--ui-ink);font-weight:600}
.tsb-paths-ends{display:flex;flex-wrap:wrap;gap:8px 24px;margin:0 0 8px}
.tsb-paths-ends p{display:grid;gap:2px;margin:0}
.tsb-paths-ends span{display:inline-flex;align-items:center;gap:8px;color:var(--ui-ink);font:500 var(--ui-type-caption) var(--ui-font)}
.tsb-paths-ends i{display:block;width:14px;height:3px;border-radius:3px}
.tsb-paths-ends b{padding-left:22px;font:600 var(--ui-type-lead) var(--ui-font);font-variant-numeric:tabular-nums}
.tsb-paths-note{display:flex;align-items:center;gap:8px;margin:8px 0 0;color:var(--ui-ink-2);font:400 var(--ui-type-caption) var(--ui-font)}
.tsb-paths-note>i{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--ui-bar-loss)}

/* ============================================
   Grid (Igor 11 Nov 2026: «у тебя вообще есть возможность делать качественный дизайн с идеальной сеткой и
   выравниваниями?» → «Да, с Coach»). One grid for every page's content, measured from Journal's content box
   (main: padding 24, 16 on a phone; up to 1800 px), so every block's edges sit on the same lines.
   - The page's content wrapper carries .ui-grid-scope (the grid measures the page, never the window).
   - A content width of 900 px and more: 12 columns, gutter 24 (1512 → 1190 px of content, a column ≈ 77 px).
     560–899: 8 columns, gutter 24 (768 → 604 px). Under 560: 4 columns, gutter 16 (390 → 358 px).
   - .ui-grid lays its children on the columns; a child spans all of them unless it says .ui-span-N (N of 12);
     .ui-span-md-N sets its span in the 8-column grid and .ui-span-sm-N in the 4-column one (else full width).
   - Vertical rhythm: every gap, padding and height on the 4 px step (4/8/12/16/24/32/48/64); a card pads 24 (16 on
     a phone) so its text starts on the inner line the next card's text starts on.
   - docs/product/qa/craft-audit/craft-audit.mjs --grid measures it: grid-off, row-misaligned.
   ============================================ */
.ui-grid-scope { container: ui-grid / inline-size; }
.ui-grid {
    --ui-grid-cols: 12;
    --ui-grid-gutter: 24px;
    display: grid;
    grid-template-columns: repeat(var(--ui-grid-cols), minmax(0, 1fr));
    column-gap: var(--ui-grid-gutter);
    row-gap: var(--ui-grid-row-gap, 32px);
    min-width: 0;
}
.ui-grid > * { grid-column: 1 / -1; min-width: 0; }
.ui-grid > .ui-span-1 { grid-column: span 1; } .ui-grid > .ui-span-2 { grid-column: span 2; } .ui-grid > .ui-span-3 { grid-column: span 3; }
.ui-grid > .ui-span-4 { grid-column: span 4; } .ui-grid > .ui-span-5 { grid-column: span 5; } .ui-grid > .ui-span-6 { grid-column: span 6; }
.ui-grid > .ui-span-7 { grid-column: span 7; } .ui-grid > .ui-span-8 { grid-column: span 8; } .ui-grid > .ui-span-9 { grid-column: span 9; }
.ui-grid > .ui-span-10 { grid-column: span 10; } .ui-grid > .ui-span-11 { grid-column: span 11; } .ui-grid > .ui-span-12 { grid-column: 1 / -1; }
@container ui-grid (max-width: 899px) {
    .ui-grid { --ui-grid-cols: 8; }
    .ui-grid > [class*="ui-span-"] { grid-column: 1 / -1; }
    .ui-grid > .ui-span-md-2 { grid-column: span 2; } .ui-grid > .ui-span-md-3 { grid-column: span 3; } .ui-grid > .ui-span-md-4 { grid-column: span 4; }
    .ui-grid > .ui-span-md-5 { grid-column: span 5; } .ui-grid > .ui-span-md-6 { grid-column: span 6; }
}
@container ui-grid (max-width: 559px) {
    .ui-grid { --ui-grid-cols: 4; --ui-grid-gutter: 16px; row-gap: var(--ui-grid-row-gap-sm, 24px); }
    .ui-grid > [class*="ui-span-"] { grid-column: 1 / -1; }
    .ui-grid > .ui-span-sm-1 { grid-column: span 1; } .ui-grid > .ui-span-sm-2 { grid-column: span 2; } .ui-grid > .ui-span-sm-3 { grid-column: span 3; }
}

/* Charts through time on TradingView's engine (assets/tsb-charts-tv.js): the engine draws on canvas; the legend of
   each pane is HTML at its top left and follows the crosshair. */
.tsb-tv { position: relative; width: 100%; }
.tsb-tv-host { position: absolute; inset: 0; }
.tsb-tv-legend { position: absolute; top: 6px; left: 8px; z-index: 3; display: grid; gap: 2px; max-width: calc(100% - 96px); pointer-events: none; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); font-variant-numeric: tabular-nums; }
.tsb-tv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.tsb-tv-row > * { white-space: nowrap; }
.tsb-tv-legend b { color: var(--ui-ink); font-weight: 600; }
.tsb-tv-legend b.is-gain { color: var(--ui-gain); }
.tsb-tv-legend b.is-loss { color: var(--ui-loss); }
.tsb-tv-quiet { color: var(--ui-ink-3); }
.tsb-tv-swatch { display: inline-block; width: 12px; height: 2px; }
.tsb-tv-legend .is-early { padding: 0 8px; border-radius: var(--ui-radius-control); background: var(--ui-warn-soft); color: var(--ui-warn); font-weight: 500; }
.tsb-tv-bar { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.tsb-tv-tools { display: flex; gap: 2px; padding: 2px; border-radius: var(--ui-radius-control); background: var(--ui-raised); }
.tsb-tv-tools button { padding: 0 8px; border: 0; border-radius: var(--ui-radius-control); background: none; color: var(--ui-ink-2); font: 500 var(--ui-type-caption) var(--ui-font); cursor: pointer; }
.tsb-tv-tools button[aria-pressed="true"] { background: var(--ui-page); color: var(--ui-ink); }
.tsb-tv-tools button:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 1px; }
/* Extra views of the chart family (CHARTS.md): the steps over a chart, the micro row's reading and cursor */
.tsb-c-steps { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 4px; }
.tsb-c-steps button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--ui-line-strong); border-radius: var(--ui-radius-control); background: var(--ui-page); color: var(--ui-ink-2); cursor: pointer; }
.tsb-c-steps button:hover:not(:disabled) { color: var(--ui-ink); border-color: var(--ui-ink-3); }
.tsb-c-steps button:disabled { opacity: .4; cursor: default; }
.tsb-c-steps button:focus-visible, .tsb-c-svg:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.tsb-c-microread { margin: 4px 0 0; min-height: 20px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); font-variant-numeric: tabular-nums; }
.tsb-c-microread b { color: var(--ui-ink); font-weight: 600; }
.tsb-c-microread b.is-gain { color: var(--ui-gain); }
.tsb-c-microread b.is-loss { color: var(--ui-loss); }
.tsb-c-microcursor { stroke: var(--ui-ink-3); stroke-width: 1; stroke-dasharray: 2 2; }
/* The ribbon (Reports' period ribbon as a family drawing; T5 is its 'dips' lens). Values as reports-workspace.css draws them. */
.tsb-r { position: relative; }
.tsb-r-chapters { position: relative; height: 58px; }
.tsb-r-chapter { position: absolute; top: 0; display: flex; flex-direction: column; align-items: flex-start; height: 100%; padding: 0 10px; border-left: 1px solid var(--ui-line); color: var(--ui-ink-2); font-size: 12px; line-height: 20px; overflow: hidden; white-space: nowrap; }
.tsb-r-chapter:first-child { padding-left: 0; border-left: 0; }
.tsb-r-chapter b { color: var(--ui-ink); font-size: 16px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tsb-r-chapter b.tsb-r-is-gain { color: var(--ui-gain); }
.tsb-r-chapter b.tsb-r-is-loss { color: var(--ui-loss); }
.tsb-r-chapter b.tsb-r-is-quiet { color: var(--ui-ink-2); } /* a stretch that made nothing: $0 is no gain (the gate 14 Nov) */
.tsb-r-pins { position: relative; height: 48px; }
.tsb-r-pins.is-two { height: 88px; }
.tsb-r-pins.is-stack { height: auto; display: grid; gap: 8px; }
.tsb-r-pin { position: absolute; top: 0; z-index: 1; margin: 0; padding: 0 8px 0 10px; border-left: 2px solid var(--ui-bar-gain); background: var(--ui-page); color: var(--ui-ink-2); font-size: 12px; line-height: 18px; white-space: nowrap; }
.tsb-r-pin.is-end { padding: 0 10px 0 8px; border-left: 0; border-right: 2px solid var(--ui-bar-gain); text-align: right; }
.tsb-r-pin.is-end.is-loss { border-right-color: var(--ui-bar-loss); }
.tsb-r-pins.is-stack .tsb-r-pin { position: static; }
.tsb-r-pin.is-loss { border-left-color: var(--ui-bar-loss); }
.tsb-r-pin b { display: block; color: var(--ui-ink); font-weight: 500; }
/* The year switch of the chart family (Igor 14 Nov «Да, так»; the ribbon, month-by-month periods): the kit's segmented control at the chart's left edge, above it. */
.tsb-c-range { width: fit-content; max-width: 100%; margin: 0 0 16px; }
.tsb-r-ends { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: 8px; }
.tsb-r-ends p { margin: 0; }
.tsb-r-ends small { display: block; color: var(--ui-ink-2); font-size: 12px; line-height: 16px; }
.tsb-r-ends b { display: block; font-size: 20px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tsb-r-ends span { display: block; color: var(--ui-ink-2); font-size: 12px; line-height: 16px; }
/* the hovered close on a ribbon's line (ribbon hoverDot), drawn as the end dot is: the line's ink ringed in the page */
.tsb-paths-hover { fill: var(--ui-ink); stroke: var(--ui-page); stroke-width: 2; pointer-events: none; }
/* readings over the plot on a wide chart (ribbon ends: 'above'): what the bars are, at the row's right end */
.tsb-r-ends.is-above .tsb-r-ends-bars { margin-left: auto; text-align: right; }
.tsb-r-ends b.tsb-r-is-gain, .tsb-r-svg .tsb-r-is-gain { color: var(--ui-gain); fill: var(--ui-gain); }
.tsb-r-ends b.tsb-r-is-loss, .tsb-r-svg .tsb-r-is-loss { color: var(--ui-loss); fill: var(--ui-loss); }
.tsb-r-divider { stroke: var(--ui-line); }
/* 2.25: the line in its sign colours reads lighter and more precise (18 Nov, design/money-line-2026-11-18/weight.html;
   the coordinator's pick, Igor's «мне везде он кажется дороже»); the setup card keeps its 2 (setup-shelf.css) */
.tsb-r-line { stroke: var(--ui-ink); stroke-width: 2.25; }
.tsb-r-prior { stroke: var(--ui-ink-3); stroke-width: 1.75; stroke-dasharray: 4 5; }
/* o.second (Prop's film): the plan's ending, dashed in the gain tone, quieter than the hero, apart from the floor's dash */
.tsb-r-second { stroke: var(--ui-bar-gain); stroke-width: 2; stroke-dasharray: 7 5; opacity: .85; }
.tsb-r-svg .tsb-r-is-quiet { fill: var(--ui-ink-2); }
.tsb-r-ends b.tsb-r-is-quiet { color: var(--ui-ink-2); }
.tsb-r-tint { fill: color-mix(in srgb, var(--ui-bar-loss) 8%, var(--ui-page)); }
.tsb-r-tint.is-strong { fill: color-mix(in srgb, var(--ui-bar-loss) 14%, var(--ui-page)); }
.tsb-r-peak { stroke: var(--ui-bar-loss); stroke-dasharray: 3 4; opacity: .4; }
.tsb-r-note { fill: var(--ui-loss); font-size: 12px; font-weight: 500; paint-order: stroke; stroke: var(--ui-page); stroke-width: 4px; stroke-linejoin: round; }
.tsb-r-ring { fill: var(--ui-page); stroke: var(--ui-bar-gain); stroke-width: 1.75; }
.tsb-r-ring.is-loss { stroke: var(--ui-bar-loss); }
.tsb-r-base { stroke: var(--ui-line); }
/* A setup's rule versions behind the path (ribbon bands): every other stretch shaded, its name at the plot's foot. */
.tsb-r-band { fill: transparent; }
.tsb-r-band.is-alt { fill: color-mix(in srgb, var(--ui-ink) 4%, transparent); }
.tsb-r-band-name { fill: var(--ui-ink-3); font-size: 11px; paint-order: stroke; stroke: var(--ui-page); stroke-width: 4px; stroke-linejoin: round; }
.tsb-r-band.is-chosen { fill: color-mix(in srgb, var(--ui-accent) 8%, transparent); }
.tsb-r-band-name.is-chosen { fill: var(--ui-accent-text); font-weight: 500; }
/* The money between the ribbon's line and its comparison (o.between; the Dashboard's plan, Igor 16 Nov): a plain tint in
   the tone of who is ahead, the band between two lines of design-base §14. */
.tsb-r-between.is-behind { fill: color-mix(in srgb, var(--ui-bar-loss) 14%, transparent); }
.tsb-r-between.is-ahead { fill: color-mix(in srgb, var(--ui-bar-gain) 14%, transparent); }
/* the wash between the money line and $0 in the line's own tone (the Baseline, Igor 18 Nov «Yes, A + B's band»): flat, no
   gradient, quieter than a band between two lines */
.tsb-r-wash { stroke: none; }
.tsb-r-wash.is-up { fill: color-mix(in srgb, var(--ui-bar-gain) 11%, transparent); }
.tsb-r-wash.is-down { fill: color-mix(in srgb, var(--ui-bar-loss) 10%, transparent); }
.tsb-r-wash.is-context { fill: color-mix(in srgb, var(--ui-ink-3) 7%, transparent); } /* a path's context before its period (TSBCharts.closeup) */
.tsb-c-grid.is-split { stroke: var(--ui-ink-3); stroke-opacity: .55; stroke-width: 1; } /* the boundary between context and period */
/* The Dashboard's Path (TSBCharts.periodPath, .candles; 20 Nov): a level, the gap under the peak, the peak's ring, candles and price tags */
.tsb-p-level { stroke: var(--ui-ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.tsb-p-gap { stroke: var(--ui-loss); stroke-width: 2; }
.tsb-p-ring { fill: var(--ui-page); stroke: var(--ui-ink); stroke-width: 2; }
.tsb-b-bar.is-context { fill: var(--ui-ink-3); opacity: .55; }
.tsb-k-wick { stroke-width: 1; shape-rendering: crispEdges; } .tsb-k-wick.is-gain { stroke: var(--ui-gain); } .tsb-k-wick.is-loss { stroke: var(--ui-loss); } .tsb-k-wick.is-flat { stroke: var(--ui-ink-2); }
/* filled marks in the columns' gain/loss (.tsb-b-bar), as every bar on the Dashboard (Igor 20 Nov «тут что другие цвета рандомные?») */
.tsb-k-body.is-gain { fill: var(--ui-gain); } .tsb-k-body.is-loss { fill: var(--ui-loss); } .tsb-k-body.is-flat { fill: var(--ui-ink-2); }
.tsb-k-lit { fill: var(--ui-loss-soft); } /* the worst day's column (TSBCharts.dayCandles) */
.tsb-k-last { stroke-width: 1; stroke-dasharray: 1 3; } .tsb-k-last.is-gain { stroke: var(--ui-gain); } .tsb-k-last.is-loss { stroke: var(--ui-loss); }
.tsb-k-tag rect { stroke-width: 1; } .tsb-k-tag text { font: 600 var(--ui-type-chart) var(--ui-font); font-variant-numeric: tabular-nums; }
.tsb-k-tag.is-peak rect { fill: var(--ui-page); stroke: var(--ui-ink-3); } .tsb-k-tag.is-peak text { fill: var(--ui-ink); } .tsb-k-tag-k { fill: var(--ui-ink-2); font-weight: 400; }
.tsb-k-tag.is-now.is-gain rect { fill: var(--ui-gain); stroke: var(--ui-gain); } .tsb-k-tag.is-now.is-loss rect { fill: var(--ui-loss); stroke: var(--ui-loss); } .tsb-k-tag.is-now text { fill: var(--ui-on-fill); }
html.dark .tsb-r-wash.is-up { fill: color-mix(in srgb, var(--ui-bar-gain) 15%, transparent); }
html.dark .tsb-r-wash.is-down { fill: color-mix(in srgb, var(--ui-bar-loss) 15%, transparent); }
/* the comparison before o.compare.until (a look back with today's plan): dotted, as the spec draws a plan not yet kept */
.tsb-r-prior.is-back { stroke-dasharray: 0 5; stroke-linecap: round; stroke-width: 2.25; }
/* on the dark page a 14% tint reads as nothing: the same tones, stronger */
html.dark .tsb-r-between.is-behind { fill: color-mix(in srgb, var(--ui-bar-loss) 16%, transparent); }
html.dark .tsb-f-hatch-bg.is-loss { fill: color-mix(in srgb, var(--ui-bar-loss) 30%, transparent); }
html.dark .tsb-r-between.is-ahead { fill: color-mix(in srgb, var(--ui-bar-gain) 16%, transparent); }
html.dark .tsb-f-hatch-bg.is-gain { fill: color-mix(in srgb, var(--ui-bar-gain) 30%, transparent); }
html.dark .tsb-f-hatch.is-gain { stroke: var(--ui-bar-gain); }
html.dark .tsb-f-hatch.is-loss { stroke: var(--ui-bar-loss); }
/* From you to your plan (TSBCharts.fall): the ends solid, each line of the plan a hatched step with its edge, the level
   dotted bar to bar, the gap a bracket; a look back's ends quieter. */
.tsb-f-bar.is-gain { fill: var(--ui-bar-gain); }
.tsb-f-bar.is-loss { fill: var(--ui-bar-loss); }
.tsb-f.is-back .tsb-f-bar { fill-opacity: .55; }
.tsb-f-hatch-bg.is-gain { fill: color-mix(in srgb, var(--ui-bar-gain) 14%, transparent); }
.tsb-f-hatch-bg.is-loss { fill: color-mix(in srgb, var(--ui-bar-loss) 14%, transparent); }
.tsb-f-hatch { stroke-width: 1.25; }
.tsb-f-hatch.is-gain { stroke: color-mix(in srgb, var(--ui-bar-gain) 60%, transparent); }
.tsb-f-hatch.is-loss { stroke: color-mix(in srgb, var(--ui-bar-loss) 60%, transparent); }
.tsb-f-edge { stroke-width: 2; }
.tsb-f-edge.is-gain { stroke: var(--ui-bar-gain); }
.tsb-f-edge.is-loss { stroke: var(--ui-bar-loss); }
.tsb-f-value { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tsb-f-value.is-gain { fill: var(--ui-gain); }
.tsb-f-value.is-loss { fill: var(--ui-loss); }
.tsb-f-link, .tsb-f-guide { stroke: var(--ui-ink-3); stroke-width: 1; stroke-dasharray: 1 3; shape-rendering: crispEdges; }
.tsb-f-bracket { fill: none; stroke: var(--ui-ink); stroke-width: 1.5; stroke-linejoin: round; }
.tsb-f-gap { fill: var(--ui-ink); font-size: 12px; font-weight: 600; }
.tsb-f-col.is-step { outline: none; }
.tsb-f-col.is-step.is-hot .tsb-f-name { fill: var(--ui-ink); font-weight: 600; }
.tsb-f-col.is-step:focus-visible rect { outline: 2px solid var(--ui-accent-text); outline-offset: 2px; }
.tsb-f .tsb-r-hit { cursor: default; }
/* The waterfall builds on its first sight (o.enter; the Dashboard's script, Igor 16 Nov): each column a short rise in turn,
   the gap's bracket and words last. Opacity and transform only (no layout); "backwards" so nothing holds after it. */
.tsb-f.is-pending :is(.tsb-f-col, .tsb-f-link, .tsb-f-guide, .tsb-f-bracket, .tsb-f-gap) { opacity: 0; }
.tsb-f.is-enter :is(.tsb-f-col, .tsb-f-link, .tsb-f-guide, .tsb-f-bracket, .tsb-f-gap) { animation: tsb-f-in .42s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 260ms + var(--tsb-f-shift, 0ms)); }
.tsb-f.is-enter :is(.tsb-f-link, .tsb-f-guide, .tsb-f-bracket, .tsb-f-gap) { animation-name: tsb-f-fade; }
/* The ghost (o.ghost, the Dashboard's face; Igor 16 Nov «A · Призрак»): his line by its sign (o.sign; «может линию так
   красить?»), green over $0 and red under it; the ghost — he, keeping every line of his plan — a pale lit line; the
   places he left it a red dot each, the words in a callout beside it. */
.tsb-r-line.is-up { stroke: var(--ui-bar-gain); }
.tsb-r-line.is-down { stroke: var(--ui-bar-loss); }
/* a replay's player on the ribbon (o.played): the days still to come a quiet line, the played close a dot */
.tsb-r-line.is-context { stroke: var(--ui-line-strong); stroke-width: 2; }
.tsb-r-cursor { fill: var(--ui-bar-gain); stroke: var(--ui-page); stroke-width: 2; }
.tsb-r-cursor.is-loss { fill: var(--ui-bar-loss); }
.tsb-r.is-ghost .tsb-r-prior { stroke: color-mix(in srgb, var(--ui-ink) 42%, transparent); stroke-width: 2.25; stroke-dasharray: none; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--ui-ink) 22%, transparent)); }
.tsb-r.is-ghost .tsb-r-prior.is-back { stroke-dasharray: 0 5; stroke-linecap: round; filter: none; }
html.dark .tsb-r.is-ghost .tsb-r-prior { stroke: color-mix(in srgb, var(--ui-ink) 58%, transparent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ui-ink) 30%, transparent)); }
.tsb-r-mark { fill: var(--ui-loss); stroke: var(--ui-page); stroke-width: 2; }
.tsb-r-call { transition: opacity .25s; }
.tsb-r-call-box { fill: var(--ui-page); stroke: var(--ui-line-strong); }
.tsb-r-call-text { fill: var(--ui-ink); font-size: 12px; font-weight: 500; }
.tsb-r-call-fig { fill: var(--ui-loss); font-weight: 600; } .tsb-r-call-fig.is-gain { fill: var(--ui-gain); }
.tsb-r-mark.is-gain { fill: var(--ui-bar-gain); }
.tsb-r-call-leg { stroke: var(--ui-line-strong); stroke-width: 1; }
.tsb-r-endname { font-weight: 600; } .tsb-r-endname.is-quiet { fill: var(--ui-ink-2); }
.tsb-r-dot { fill: var(--ui-page); stroke: var(--ui-ink-2); stroke-width: 1.5; }
.tsb-r-mark-num { fill: var(--ui-loss); } .tsb-r-mark-num.is-gain { fill: var(--ui-gain); }
.tsb-r-mark-num-text { fill: var(--ui-on-fill); font-size: 11px; font-weight: 600; }
.tsb-r-marklist { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; font: 400 var(--ui-type-body) var(--ui-font); }
.tsb-r-marklist li { display: flex; align-items: baseline; gap: 8px; }
.tsb-r-marklist b { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ui-loss); color: var(--ui-on-fill); font: 600 12px/20px var(--ui-font); }
.tsb-r-marklist b.is-gain { background: var(--ui-gain); }
.tsb-r-marklist em { font-style: normal; font-weight: 600; } .tsb-r-marklist em.is-loss { color: var(--ui-loss); } .tsb-r-marklist em.is-gain { color: var(--ui-gain); }
.tsb-r.is-ghost .tsb-r-band { fill: transparent; } .tsb-r.is-ghost .tsb-r-band:not(.is-chosen) { fill: color-mix(in srgb, var(--ui-ink) 3%, transparent); }
@keyframes tsb-f-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes tsb-f-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tsb-f.is-pending :is(.tsb-f-col, .tsb-f-link, .tsb-f-guide, .tsb-f-bracket, .tsb-f-gap) { opacity: 1; } .tsb-f.is-enter * { animation: none; } }
/* Day bars in full colour (Igor 12 Nov: faded bars look dull, «ну попробуй»). */
.tsb-r-bar.is-gain { fill: var(--ui-bar-gain); }
.tsb-r-bar.is-loss { fill: var(--ui-bar-loss); }
/* "//" where months without a trade are skipped: it sits on the chapter rule, so the page colour cuts the rule behind it */
.tsb-r-gap { paint-order: stroke; stroke: var(--ui-page); stroke-width: 6px; stroke-linejoin: round; }
.tsb-r-axis-plate { fill: var(--ui-page); }
.tsb-r-axis { paint-order: stroke; stroke: var(--ui-page); stroke-width: 4px; stroke-linejoin: round; }
.tsb-r-hit { fill: transparent; cursor: default; }
.tsb-r-rule { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ui-line); }
.tsb-r-thread { stroke: var(--ui-bar-gain); stroke-width: 1; opacity: .6; }
.tsb-r-thread.is-loss { stroke: var(--ui-bar-loss); }
.tsb-r-thread-top { position: absolute; bottom: 0; width: 1px; background: var(--ui-bar-gain); opacity: .6; }
.tsb-r-thread-top.is-loss { background: var(--ui-bar-loss); }
/* T7 days, a month as Journal's calendar draws it (.journal-calendar-day: padding 10/12, date 14/20 500, money 18/24 600, meta 12/20) */
.tsb-g-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tsb-g-head p { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0; }
.tsb-g-head b { color: var(--ui-ink); font: 600 var(--ui-type-title-s) var(--ui-font); }
.tsb-g-head span { color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); font-variant-numeric: tabular-nums; }
.tsb-g-head .tsb-c-steps { margin: 0; }
.tsb-g { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 1px; border: 1px solid var(--ui-line); background: var(--ui-line); font-family: var(--ui-font); font-variant-numeric: tabular-nums; }
.tsb-g-wd { padding: 8px 12px; background: var(--ui-page); color: var(--ui-ink-2); font-size: 12px; line-height: 20px; }
.tsb-g-day { display: flex; flex-direction: column; min-height: 112px; padding: 10px 12px; background: var(--ui-page); }
.tsb-g-day i { color: var(--ui-ink-3); font-style: normal; font-size: 14px; line-height: 20px; }
.tsb-g-day.has-trades i { color: var(--ui-ink); font-weight: 500; }
.tsb-g-day.is-other i { color: var(--ui-line-strong); }
.tsb-g-day b { margin-top: 8px; font-size: 16px; line-height: 24px; font-weight: 600; white-space: nowrap; }
.tsb-g-day small { color: var(--ui-ink); font-size: 12px; line-height: 20px; font-weight: 500; }
.tsb-g-day em { color: var(--ui-loss); font-style: normal; font-size: 12px; line-height: 20px; }
.tsb-g-day.is-gain { background: var(--ui-gain-soft); }
.tsb-g-day.is-gain b { color: var(--ui-gain); }
.tsb-g-day.is-loss { background: var(--ui-loss-soft); }
.tsb-g-day.is-loss b { color: var(--ui-loss); }
.tsb-g-day.is-today { box-shadow: inset 0 0 0 2px var(--ui-accent); }
.tsb-g.is-phone .tsb-g-wd { padding: 6px; }
.tsb-g.is-phone .tsb-g-day { min-height: 64px; padding: 6px; }
.tsb-g.is-phone .tsb-g-day i { font-size: 12px; }
.tsb-g.is-phone .tsb-g-day b { margin-top: 4px; font-size: 14px; line-height: 20px; }
.tsb-g.is-phone .tsb-g-day.is-ruled { box-shadow: inset 0 2px 0 var(--ui-bar-loss); }

/* ============================================
   Field: every plain input, select, search and text area (DESIGN-SYSTEM §3, Igor 13 Nov «Yes, start»): Journal's
   field, 40 px (44 on a phone), radius 6, 14/20; a text area grows with its text. The label sits above it, 14/500 ink.
   Rich text is the one editor (TSBDocumentBlockEditor), never a styled text area.
   ============================================ */
.ui-field { box-sizing: border-box; width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--ui-line-strong); border-radius: var(--ui-radius-control, 6px); background: var(--ui-page); color: var(--ui-ink); font: 400 var(--ui-type-body-size, 14px)/20px var(--ui-font); accent-color: var(--app-accent); transition: background-color 120ms, border-color 120ms; }
textarea.ui-field { display: block; min-height: 80px; resize: vertical; field-sizing: content; }
select.ui-field { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23666a65' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-position: right 12px center; background-repeat: no-repeat; }
.ui-field::placeholder { color: var(--ui-ink-3); opacity: 1; }
.ui-field:hover:not(:disabled):not(:focus) { background-color: var(--ui-hover); border-color: var(--app-border-hover, var(--ui-line-strong)); }
.ui-field:focus-visible { outline: 2px solid var(--ui-accent-text); outline-offset: 2px; }
.ui-field:disabled, .ui-field[readonly] { background: var(--ui-raised); color: var(--ui-ink-2); cursor: default; }
@media (max-width: 600px) { .ui-field { min-height: 44px; } }

/* The trade atlas and its mini months (TSBCharts.atlas / .minis, the Dashboard's first screen, Igor 17 Nov
   «Переносим»): days on hairlines, no day cards, no underlines; the marks are the art. */
.tsb-at { display: flex; flex-direction: column; min-width: 0; }
.tsb-at-head { position: relative; margin-bottom: 16px; }
.tsb-at-sub { margin: 0 0 4px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.tsb-at-title { margin: 0; font: 600 var(--ui-type-title-m) var(--ui-font); letter-spacing: -.02em; }
.tsb-at-sum { position: absolute; right: 0; bottom: 4px; display: flex; gap: 12px; align-items: baseline; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); white-space: nowrap; }
.tsb-at-sum b { font: 500 var(--ui-type-lead) var(--ui-font); color: var(--ui-ink); font-variant-numeric: tabular-nums; }
.tsb-at-wd, .tsb-at-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 56px; }
.tsb-at-wd { margin-bottom: 8px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.tsb-at-wd > span { padding-left: 8px; }
.tsb-at-wd > span:last-child { padding: 0; text-align: right; }
.tsb-at-day, .tsb-at-blank, .tsb-at-week { min-width: 0; border: 0; border-top: 1px solid var(--ui-line); border-radius: 0; background: none; }
.tsb-at-day { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px 8px; color: var(--ui-ink-2); font: inherit; text-align: left; cursor: pointer; }
.tsb-at-day:hover { color: var(--ui-ink); }
.tsb-at-day:focus-visible { outline: 1px solid var(--ui-accent); outline-offset: -2px; }
.tsb-at-date { display: flex; align-items: baseline; gap: 4px; }
.tsb-at-num { min-width: 20px; height: 20px; margin-left: -2px; font: 400 var(--ui-type-caption) var(--ui-font); text-align: center; }
.tsb-at-day.is-empty:not(.is-today) .tsb-at-num { opacity: .6; }
.tsb-at-day.is-today .tsb-at-num { border-radius: 50%; outline: 1px solid var(--ui-accent); color: var(--ui-accent-text); }
/* the chosen day's number in a filled accent circle, as a date picker marks its pick; today keeps its outline ring (Igor 18 Nov
   on the atlas: «акцентный и не видно») */
.tsb-at-day.is-chosen .tsb-at-num { border-radius: 50%; background: var(--ui-accent); color: var(--ui-on-accent); font-weight: 600; }
.tsb-at-day.is-today.is-chosen .tsb-at-num { color: var(--ui-on-accent); outline-offset: 2px; }
.tsb-at-month { color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.tsb-at-marks { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 3px; max-width: calc(4 * var(--mark) + 9px); min-height: 8px; }
.tsb-at-mark { flex: 0 0 var(--mark); width: var(--mark); height: var(--mark); border-radius: 50%; background: var(--ui-ink-2); }
.tsb-at-mark.is-gain { background: var(--ui-gain); }
.tsb-at-mark.is-loss { background: var(--ui-loss); }
.tsb-at-mark.is-quiet { opacity: .18; }
.tsb-at-mark.is-mid { transform: scale(.78); }
.tsb-at-mark.is-small { transform: scale(.56); }
.tsb-at-net { min-height: 20px; font: 400 var(--ui-type-caption) var(--ui-font); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tsb-at-net.is-gain, .tsb-at-week.is-gain, .tsb-mm-net.is-gain, .tsb-at-sum b.is-gain { color: var(--ui-gain); }
.tsb-at-net.is-loss, .tsb-at-week.is-loss, .tsb-mm-net.is-loss, .tsb-at-sum b.is-loss { color: var(--ui-loss); }
.tsb-at-week { display: flex; align-items: flex-end; justify-content: flex-end; padding: 6px 0; font: 400 var(--ui-type-caption) var(--ui-font); white-space: nowrap; opacity: .8; font-variant-numeric: tabular-nums; }
.tsb-at-gap { grid-column: 1 / -1; padding: 6px 8px; border-top: 1px solid var(--ui-line); color: var(--ui-ink-3); font: 400 var(--ui-type-caption) var(--ui-font); }
.tsb-at.is-narrow .tsb-at-gap { padding: 6px 0; }
.tsb-at-dense { display: flex; align-items: center; justify-content: center; min-width: 36px; min-height: 28px; border-radius: var(--ui-radius-control); background: var(--ui-raised); font: 600 var(--ui-type-body) var(--ui-font); }
.tsb-at-dense.is-gain { background: color-mix(in srgb, var(--ui-gain) 14%, var(--ui-page)); color: var(--ui-gain); }
.tsb-at-dense.is-loss { background: color-mix(in srgb, var(--ui-loss) 14%, var(--ui-page)); color: var(--ui-loss); }
.tsb-at-dense.is-lit.is-gain { background: color-mix(in srgb, var(--ui-gain) 24%, var(--ui-page)); }
.tsb-at-dense.is-lit.is-loss { background: color-mix(in srgb, var(--ui-loss) 24%, var(--ui-page)); }
.tsb-at-dense.is-quiet { opacity: .3; }
.tsb-at.is-narrow .tsb-at-head { margin-bottom: 12px; }
.tsb-at.is-narrow .tsb-at-sum { position: static; margin-top: 4px; }
.tsb-at.is-narrow .tsb-at-title { font: 600 var(--ui-type-title-s) var(--ui-font); }
.tsb-at.is-narrow :is(.tsb-at-wd, .tsb-at-days) { grid-template-columns: repeat(7, minmax(0, 1fr)) 42px; }
.tsb-at.is-narrow .tsb-at-wd > span { padding-left: 3px; }
.tsb-at.is-narrow .tsb-at-day { padding: 6px 2px; }
.tsb-at.is-narrow .tsb-at-days > :nth-child(8n + 1) { padding-left: 0; }
.tsb-at.is-narrow .tsb-at-days > :nth-child(8n + 1) .tsb-at-num { margin-left: 0; text-align: left; }
.tsb-at.is-narrow .tsb-at-marks { gap: 2px; max-width: calc(3 * var(--mark) + 4px); }
.tsb-at.is-narrow :is(.tsb-at-net, .tsb-at-week) { letter-spacing: -.04em; }
.tsb-at.is-narrow .tsb-at-dense { min-width: 28px; min-height: 28px; font: 600 var(--ui-type-caption) var(--ui-font); }
.tsb-mm { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.tsb-mm.is-narrow { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 1px 8px; overscroll-behavior-x: contain; }
.tsb-mm-month { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; padding: 8px 0; border: 0; border-radius: var(--ui-radius-control); background: none; color: var(--ui-ink-2); font: inherit; text-align: left; cursor: pointer; }
.tsb-mm.is-narrow .tsb-mm-month { flex: 0 0 88px; scroll-snap-align: start; }
.tsb-mm-month.is-chosen { background: var(--ui-raised); box-shadow: 0 0 0 4px var(--ui-raised); color: var(--ui-ink); }
.tsb-mm-month:is(:hover, :focus-visible) { outline: 1px solid var(--ui-line-strong); outline-offset: 4px; }
.tsb-mm-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, 10px); gap: 1px; align-items: center; justify-items: center; margin-bottom: 4px; }
.tsb-mm-day { width: var(--dot); height: var(--dot); border-radius: 50%; background: var(--ui-line); }
.tsb-mm-day.is-gain { background: var(--ui-gain); }
.tsb-mm-day.is-loss { background: var(--ui-loss); }
.tsb-mm-day.is-quiet { opacity: .25; }
.tsb-mm-name { display: flex; justify-content: space-between; gap: 4px; font: 500 var(--ui-type-caption) var(--ui-font); }
.tsb-mm-name > span { color: var(--ui-ink-2); font-weight: 400; }
.tsb-mm-net { font: 400 var(--ui-type-caption) var(--ui-font); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tsb-mm-year { padding: 12px 0; border-top: 1px solid var(--ui-line); }
.tsb-mm-year > h3 { margin: 0 0 8px; font: 500 var(--ui-type-body) var(--ui-font); }
.tsb-mm-year + .tsb-mm-year { margin-top: 8px; }

/* A sheet: a written thing that is not a link (design-base §14 paper — radius 6 0 6 6, a 20 px fold, 1 px line, the soft
   shadow, raised 45 % / dark 70 %). The Dashboard's "Left with this habit" (Igor 17 Nov «правую часть может на листике
   сделать, как у нас уже прием в сетапах и в daily»). */
.ui-sheet { position: relative; padding: 24px 24px 20px; border: 1px solid var(--ui-line); border-radius: 6px 0 6px 6px; background: color-mix(in srgb, var(--ui-raised) 45%, var(--ui-page)); box-shadow: 0 3px 6px rgb(29 29 34 / .035), 0 12px 24px rgb(29 29 34 / .02); clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%); }
.ui-sheet::after { content: ''; position: absolute; top: 0; right: 0; width: 20px; height: 20px; border-bottom-left-radius: 6px; background: var(--ui-line-strong); }
:is(html.dark, [data-theme="dark"]) .ui-sheet { background: color-mix(in srgb, var(--ui-raised) 70%, var(--ui-page)); box-shadow: 0 3px 6px rgb(0 0 0 / .2), 0 12px 24px rgb(0 0 0 / .12); }

/* Sessions on the day's hours (the Dashboard's Today plate): a lane per market on 00:00–24:00, open ones in the accent,
   now as a dashed accent line; from TSBMarketSessions.model, drawn by the page. */
.tsb-ln { margin: 12px 0; }
.tsb-ln-scale { display: flex; justify-content: space-between; margin-left: 64px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.tsb-ln-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; height: 20px; font: 400 var(--ui-type-caption) var(--ui-font); }
.tsb-ln-lane { position: relative; height: 8px; border-radius: 3px; background: var(--ui-raised); }
.tsb-ln-lane > span { position: absolute; top: 0; height: 100%; border-radius: 3px; background: var(--ui-line-strong); }
.tsb-ln-lane > span.is-open { background: var(--ui-accent); opacity: .75; }
.tsb-ln-now { position: absolute; top: -3px; bottom: -3px; border-left: 1px dashed var(--ui-accent); }

/* The dialog (DESIGN-SYSTEM decision 3, the Journal modal's anatomy, lifted from setup-plan-dialog's .spd for pages that
   read a list in place — the Dashboard's day, releases, trades and numbers): title 24 on a hairline, a quiet 40 px close,
   body 24, rows on hairlines, actions on a hairline, radius 16; Escape and a click outside close it. */
.ui-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid var(--ui-line); border-radius: 16px; background: var(--ui-page); color: var(--ui-ink); box-shadow: var(--ui-shadow-dialog); overflow: hidden; }
.ui-dialog[open] { display: flex; flex-direction: column; }
.ui-dialog::backdrop { background: var(--app-modal-backdrop, rgb(38 39 40 / .2)); backdrop-filter: var(--app-modal-backdrop-filter, blur(5px)); }
.ui-dialog-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 16px 16px 24px; border-bottom: 1px solid var(--ui-line); }
.ui-dialog-title { margin: 0; font: 600 var(--ui-type-title-m) var(--ui-font); letter-spacing: -.01em; overflow-wrap: anywhere; }
.ui-dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px; font: 400 var(--ui-type-body) var(--ui-font); }
.ui-dialog-body > p { margin: 0 0 16px; color: var(--ui-ink-2); }
.ui-dialog-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--ui-line); }
/* the rows are divided by the line above each; the last closes on the body's space, so a footer's line is never doubled */
.ui-dialog-row b { font-weight: 500; overflow-wrap: anywhere; }
.ui-dialog-row small { display: block; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.ui-dialog-row > :last-child { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.ui-dialog-foot { display: flex; flex: none; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--ui-line); }

/* The Dashboard's drawings (TSBCharts.ghost / path / moment / bars / hours / weekdays / rdist / shares / improve): text 11 px
   on the plot, values 600, a halo of the page under labels that sit on a line; money only in the gain/loss roles. */
.tsb-b-text { fill: var(--ui-ink); font: 400 var(--ui-type-chart) var(--ui-font); }
.tsb-b-text.is-quiet { fill: var(--ui-ink-2); }
.tsb-b-text.is-value, .tsb-b-text.is-end { font-weight: 600; }
.tsb-b-text.is-halo, .tsb-b-text.is-end { paint-order: stroke; stroke: var(--ui-page); stroke-width: 5; stroke-linejoin: round; }
.tsb-b-text.is-raised { stroke: var(--ui-raised); }
.tsb-b-text.is-gap { fill: var(--ui-loss); font-weight: 600; }
.tsb-b-text.is-gap.is-made { fill: var(--ui-gain); }
.tsb-b-hatch { stroke: var(--ui-loss); stroke-opacity: .22; stroke-width: 1; }
.tsb-b-hatch.is-strong { stroke-opacity: .45; }
.tsb-b-hatch.is-gain { stroke: var(--ui-gain); stroke-opacity: .55; }
.tsb-b-extra { stroke: none; }
.tsb-b-text.is-extra { fill: var(--ui-gain); font-weight: 600; }
.tsb-b-line { fill: none; stroke: var(--ui-ink); stroke-width: 2; stroke-linejoin: round; }
/* the money line in the sign's colours, as the ribbon's (.tsb-r-line.is-up / .is-down) */
.tsb-b-line.is-gain { stroke: var(--ui-bar-gain); }
.tsb-b-line.is-loss { stroke: var(--ui-bar-loss); }
.tsb-b-plan { fill: none; stroke: var(--ui-ink-2); stroke-width: 1.5; stroke-dasharray: 4 3; }
.tsb-b-dot { stroke: var(--ui-page); stroke-width: 2; cursor: pointer; }
.tsb-b-dot.is-gain, .tsb-b-bar.is-gain, .tsb-b-month.is-gain { fill: var(--ui-gain); }
.tsb-b-dot.is-loss, .tsb-b-bar.is-loss, .tsb-b-month.is-loss { fill: var(--ui-loss); }
.tsb-b-dot.is-flat, .tsb-b-bar.is-flat { fill: var(--ui-ink-3); }
.tsb-b-dot.is-picked { stroke: var(--ui-accent); stroke-width: 3; r: 6; }
.tsb-b-hit { fill: transparent; }
.tsb-b-hover { fill: var(--ui-ink); stroke: var(--ui-page); stroke-width: 2; pointer-events: none; }
.tsb-b-hover.is-loss { fill: var(--ui-loss); }
.tsb-b-box { fill: var(--ui-page); stroke: var(--ui-line-strong); stroke-width: 1; }
.tsb-b-leader { stroke: var(--ui-ink-2); stroke-width: 1; }
.tsb-b-call { cursor: pointer; }
.tsb-b-call.is-picked .tsb-b-box, .tsb-b-call.is-picked .tsb-b-leader { stroke: var(--ui-accent); }
.tsb-b-call.is-picked .tsb-b-text { fill: var(--ui-accent-text); }
/* a ghost on a phone: a number beside a marked dot instead of a box (18 Nov) */
.tsb-b-num circle { fill: var(--ui-ink); stroke: var(--ui-page); stroke-width: 2; }
.tsb-b-num text { fill: var(--ui-page); font: 600 var(--ui-type-chart) var(--ui-font); }
.tsb-b-num.is-picked circle { fill: var(--ui-accent); }
.tsb-b-you { stroke: var(--ui-loss); stroke-width: 1; }
.tsb-b-them { stroke: var(--ui-ink-2); stroke-width: 1; }
.tsb-b-track { fill: var(--ui-raised); }
.tsb-b-band { fill: color-mix(in srgb, var(--ui-accent) 6%, transparent); stroke: none; }
/* the line around a lit period: quiet and thin, so the period's own stretch reads first */
.tsb-b-line.is-context { stroke: var(--ui-ink-3); stroke-width: 1.5; }
.tsb-b-soft { fill-opacity: .22; }
.tsb-b-soft.is-gain { fill: var(--ui-gain); }
.tsb-b-soft.is-loss { fill: var(--ui-loss); }
.tsb-b-fill.is-gain { fill: var(--ui-gain); } .tsb-b-fill.is-loss { fill: var(--ui-loss); } .tsb-b-fill.is-flat { fill: var(--ui-ink-3); } /* TSBCharts.bars: solid, its words white on it (20 Nov) */
.tsb-b-on-fill .tsb-b-text { fill: var(--ui-on-fill); }
/* in dark the gain/loss fills are light, so words on them take the page's dark */
:is(html.dark, [data-theme="dark"]) :is(.tsb-b-on-fill .tsb-b-text, .tsb-k-tag.is-now text) { fill: var(--ui-page); }
.tsb-b-bar.is-quiet, .tsb-b-month { fill: var(--ui-line-strong); }
.tsb-b-month.is-early { fill: none; stroke: var(--ui-ink-2); stroke-width: 1; }
.tsb-b-hour.is-gain { fill: var(--ui-gain); }
.tsb-b-hour.is-loss { fill: var(--ui-loss); }
.tsb-b-hour.is-none { fill: var(--ui-raised); }
.tsb-b-hour.is-best { stroke: var(--ui-ink); stroke-width: 2; }
.tsb-b-pin { fill: var(--ui-ink); }
.tsb-b-level { stroke: var(--ui-ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
.tsb-b-step { stroke: var(--ui-ink-2); stroke-width: 1; }
.tsb-b-divider { stroke: var(--ui-line-strong); stroke-width: 1; }
.tsb-b [data-tip] { outline: none; }
.tsb-b [data-tip]:focus-visible { stroke: var(--ui-accent); stroke-width: 2; }

/* Prop's room, said on the chart (tsb-charts.js ribbonFace o.room, Igor 22 Nov): the figure at the end, the floor named, where it
   locked, the closest the equity came */
.tsb-r-room-bracket { fill: none; stroke: var(--ui-ink-2); stroke-width: 1.25; }
.tsb-r-room-figure { font: 600 14px var(--ui-font); fill: var(--ui-ink); font-variant-numeric: tabular-nums; }
.tsb-r-room-floor { font: 500 12px var(--ui-font); fill: var(--ui-ink-3); }
.tsb-r-room-note { font: 600 12px var(--ui-font); fill: var(--ui-ink); font-variant-numeric: tabular-nums; }
.tsb-r-room-note .is-quiet { font-weight: 400; fill: var(--ui-ink-3); }
.tsb-r-room-close { fill: var(--ui-page); stroke: var(--ui-ink); stroke-width: 1.5; }
.tsb-r-room-lock { fill: var(--ui-ink-3); stroke: var(--ui-page); stroke-width: 1.5; }

/* T1 Path by trade (tsb-charts.js attempt, Igor 22 Nov «B, по сделкам», design/chart-lines-2026-11-22 B): a point after every
   trade, straight segments with round joins, the floor one thin solid step, the room and the zone under the floor lightly
   tinted, points only at the closest and the end, the labels on the chart, the day's result as bars under it. Prop's room
   chart, attempts and test starts draw it; other products follow after Igor's «норм» on Prop. */
.tsb-a .tsb-c-svg { display: block; overflow: visible; }
.tsb-a-grid { stroke: var(--ui-line); stroke-width: 1; shape-rendering: crispEdges; }
.tsb-a-label { fill: var(--ui-ink-3); font: 400 11px var(--ui-font); font-variant-numeric: tabular-nums; }
.tsb-a-below { fill: color-mix(in srgb, var(--ui-bar-loss) 7%, transparent); }
.tsb-a-room { fill: color-mix(in srgb, var(--ui-bar-gain) 9%, transparent); }
.tsb-a-band { fill: color-mix(in srgb, var(--ui-ink) 4%, transparent); }
.tsb-a-band-stop { stop-color: var(--ui-ink); stop-opacity: .07; }
.tsb-a-band-stop.is-end { stop-opacity: 0; }
.tsb-a-floor { fill: none; stroke: var(--ui-ink-3); stroke-width: 1.25; stroke-linejoin: round; }
.tsb-a-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.tsb-a-line.is-up { stroke: var(--ui-bar-gain); }
.tsb-a-line.is-down { stroke: var(--ui-bar-loss); }
.tsb-a-second { fill: none; stroke: color-mix(in srgb, var(--ui-bar-gain) 55%, var(--ui-page)); stroke-width: 1.25; stroke-linejoin: round; stroke-linecap: round; }
.tsb-a-second-end { fill: color-mix(in srgb, var(--ui-bar-gain) 55%, var(--ui-page)); }
.tsb-a-dot { fill: var(--ui-page); stroke: var(--ui-ink); stroke-width: 1.5; }
.tsb-a-end.is-gain { fill: var(--ui-bar-gain); }
.tsb-a-end.is-loss { fill: var(--ui-bar-loss); }
.tsb-a-note { fill: var(--ui-ink); font: 600 12px var(--ui-font); font-variant-numeric: tabular-nums; }
.tsb-a-note .is-quiet { font-weight: 400; fill: var(--ui-ink-3); }
.tsb-a-note.is-second { fill: var(--ui-gain); font-weight: 500; }
.tsb-a-fig { fill: var(--ui-ink); font: 600 14px var(--ui-font); font-variant-numeric: tabular-nums; }
.tsb-a-flab { fill: var(--ui-ink-3); font: 500 12px var(--ui-font); }
/* opt-in target line (TSBCharts.attempt o.target, 23 Nov): thin, dashed, quieter than the floor */
.tsb-a-target { stroke: var(--ui-ink-3); stroke-width: 1; stroke-dasharray: 4 4; }
.tsb-a-flab.is-target { fill: var(--ui-ink-2); }
.tsb-a-bar.is-gain { fill: var(--ui-bar-gain); }
.tsb-a-bar.is-loss { fill: var(--ui-bar-loss); }
.tsb-a-bar.is-quiet { fill-opacity: .35; }
.tsb-a-cross { stroke: var(--ui-ink-3); stroke-width: 1; pointer-events: none; }
.tsb-a-hit { fill: transparent; cursor: pointer; }
/* opt-in (My accounts' live view, 23 Nov): a what-if loss in the loss tone; today's level dashed from the last point */
.tsb-a-second.is-loss { stroke: color-mix(in srgb, var(--ui-bar-loss) 60%, var(--ui-page)); }
.tsb-a-second-end.is-loss { fill: color-mix(in srgb, var(--ui-bar-loss) 60%, var(--ui-page)); }
.tsb-a-note.is-second.is-loss { fill: var(--ui-loss); }
.tsb-a-ref { pointer-events: none; }
.tsb-a-ref line { stroke: var(--ui-ink-3); stroke-width: 1; stroke-dasharray: 3 4; }
.tsb-a-ref.is-daily line { stroke: var(--ui-loss); }
html.dark .tsb-a-below { fill: color-mix(in srgb, var(--ui-bar-loss) 12%, transparent); }
html.dark .tsb-a-room { fill: color-mix(in srgb, var(--ui-bar-gain) 14%, transparent); }
/* opt-in (My accounts' studio view, assets/prop-studio.js, 23 Nov): a rule's path in the accent with the room it changes
   tinted, rings where it left a trade out, the chosen session as an accent hairline */
.tsb-a-second.is-accent { stroke: var(--ui-accent); stroke-width: 2; }
.tsb-a-second-end.is-accent { fill: var(--ui-accent); }
.tsb-a-note.is-second.is-accent { fill: var(--ui-accent-text); }
.tsb-a-gap { fill: color-mix(in srgb, var(--ui-accent) 14%, transparent); }
.tsb-a-mark { fill: var(--ui-page); stroke: var(--ui-accent); stroke-width: 1.5; pointer-events: none; }
.tsb-a-chosen { stroke: var(--ui-accent); stroke-width: 1; pointer-events: none; }
.tsb-a-chosen-dot { fill: var(--ui-page); stroke: var(--ui-accent); stroke-width: 2; pointer-events: none; }
.tsb-a-chosen-dot.is-filled { fill: var(--ui-accent); stroke: var(--ui-page); stroke-width: 2.5; }
/* TSBCharts.session: a session on its clock, the day stop and what came after it */
.tsb-s-line { fill: none; stroke: var(--ui-ink-2); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.tsb-s-stop { stroke: var(--ui-loss); stroke-width: 1; stroke-dasharray: 3 4; }
.tsb-s-stopx { stroke: var(--ui-loss); stroke-width: 1; }
.tsb-s-after { fill: color-mix(in srgb, var(--ui-bar-loss) 7%, transparent); }
html.dark .tsb-s-after { fill: color-mix(in srgb, var(--ui-bar-loss) 12%, transparent); }
.tsb-s-note { fill: var(--ui-ink-2); font: 500 11px var(--ui-font); }
.tsb-s-note.is-loss, .tsb-a-label.is-loss { fill: var(--ui-loss); }
.tsb-s-dot { stroke: var(--ui-page); stroke-width: 1.5; }
.tsb-s-dot.is-gain { fill: var(--ui-bar-gain); }
.tsb-s-dot.is-loss { fill: var(--ui-bar-loss); }
.tsb-s-dot.is-out { fill: var(--ui-page); stroke: var(--ui-accent); stroke-width: 2; }
.tsb-s-trade { cursor: pointer; outline: 0; }
.tsb-s-trade.is-chosen .tsb-s-dot, .tsb-s-trade:focus-visible .tsb-s-dot { stroke: var(--ui-ink); stroke-width: 2; }
.tsb-s-hit { fill: transparent; }
.tsb-s-reading { fill: var(--ui-ink); font: 600 11px var(--ui-font); font-variant-numeric: tabular-nums; pointer-events: none; }
/* Settings' switch (settings-rules.css .rules-switch), lifted into the kit for a second consumer: My accounts' rule switches */
.ui-switch { appearance: none; position: relative; flex: none; width: 36px; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: var(--ui-ink-3); cursor: pointer; transition: background-color var(--ui-motion-fast, .15s) ease; }
.ui-switch::after { content: ''; position: absolute; inset: -9px -4px; }
.ui-switch::before { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ui-on-fill); transition: transform var(--ui-motion-fast, .15s) ease; }
.ui-switch[aria-checked="true"] { background: var(--ui-accent); }
.ui-switch[aria-checked="true"]::before { transform: translateX(14px); background: var(--ui-on-accent); }
.ui-switch:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ui-switch, .ui-switch::before { transition: none; } }
