/* Coach in the right panel (assets/coach-panel.js) inside the shared shell (assets/side-panel.css). Journal is the base:
   flat, space and one hairline between parts, the composer the one frame; the action block is a tint, not a border.
   Colours are the --ui-* roles; the accent is the trader's own (--ui-accent from --app-accent). */
.cp-shell .tsb-side-panel-head { padding-bottom: 12px; }
/* The head as two rows: the title with its actions, then "Looking at" across the whole width, so the period ends on
   the close button's edge instead of floating mid-panel (Igor 14 Nov «вот это не пофиксил»). */
.cp-shell .tsb-side-panel-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0 8px; align-items: start; }
.cp-shell .tsb-side-panel-head > div:first-child { display: contents; }
.cp-shell .tsb-side-panel-head :is(.tsb-side-panel-eyebrow, h2) { grid-column: 1; }
.cp-shell .tsb-side-panel-sub { grid-column: 1 / -1; }
.cp-shell .tsb-side-panel-actions { grid-column: 2; grid-row: 1; }
.cp-shell .tsb-side-panel-close { grid-column: 3; grid-row: 1; }
.cp-shell .tsb-side-panel-head h2 { display: flex; align-items: center; gap: 8px; font: 600 var(--ui-type-lead) var(--ui-font); }
.cp-shell .tsb-side-panel-head h2 .cv-glyph { width: 20px; height: 20px; flex: none; }
.cp-shell .tsb-side-panel-body { padding: 0; }
.cp-shell .tsb-side-panel-foot { display: block; padding: 0 16px 12px; border-top: 0; }
.cp-shell :where(h3, p, ol) { margin: 0; }

/* "Looking at …": what Coach is reading, and the period it reads */
.cp-looking { margin-top: 8px; } /* 8 px under the title, not 22 (Igor 14 Nov «под coach пустовато») */
.cp-looking-label { display: block; color: var(--ui-ink-3); font: 400 var(--ui-type-caption) var(--ui-font); }
.cp-looking-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; } /* what and the period on one centre line (Igor 14 Nov «левое чуть выше», «не по уровню»): the icon first made a baseline row read its bottom edge */
.cp-looking-what { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ui-ink); font: 500 var(--ui-type-body) var(--ui-font); }
/* What Coach is reading is never cut ("Your week · 2 Nov–5 …"): it wraps to a second line beside the period menu. */
.cp-looking-what span { min-width: 0; text-wrap: pretty; }
.cp-looking-what :is(svg, i) { width: 16px; height: 16px; flex: none; color: var(--ui-ink-2); }
.cp-period > summary { min-height: 32px; margin-right: -8px; padding-inline: 8px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.cp-period .cv-period-menu { right: 0; left: auto; width: 200px; }

.cp { padding: 20px 20px 24px; color: var(--ui-ink); font: 400 var(--ui-type-body) var(--ui-font); }

/* Coach's first line about the page */
.cp-meta { display: flex; align-items: center; gap: 6px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.cp-meta .cv-glyph { width: 16px; height: 16px; color: var(--ui-ink); }
.cp-sentence { margin-top: 8px; font: 600 var(--ui-type-title-s) var(--ui-font); letter-spacing: -.01em; text-wrap: pretty; }
.cp-empty { margin-top: 8px; color: var(--ui-ink-2); text-wrap: pretty; }
.cp-rows { display: grid; gap: 10px; margin-top: 16px; padding: 0; list-style: none; }
.cp-row-item { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; border-radius: var(--ui-radius-control); }
.cp-n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ui-ink); color: var(--ui-page); font: 600 var(--ui-type-caption-size)/1 var(--ui-font); transform: translateY(3px); }
.cp-n.is-none { background: none; }
/* A list with no number at all keeps no empty slot: its text starts on the panel's edge (Igor 14 Nov «что тут?»). */
.cp-rows:not(:has(.cp-n:not(.is-none))) .cp-n.is-none { display: none; }
.cp-rows:not(:has(.cp-n:not(.is-none))) .cp-row-item { grid-template-columns: minmax(0, 1fr) auto; }
.cp-row-text { min-width: 0; }
.cp-row-label { font-weight: 500; }
.cp-row-text small { display: block; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.cp-row-value { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-row-value[data-tone=loss] { color: var(--ui-loss); }
.cp-row-value[data-tone=gain] { color: var(--ui-gain); }
.cp-like, .cp-words { margin-top: 12px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.cp-like { color: var(--ui-ink); font: 400 var(--ui-type-body) var(--ui-font); }
.cp-words > span:first-child { margin-right: 6px; color: var(--ui-ink-3); }
.cp .ui-link { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }

/* The action: a tint, one primary button; done → one line with Undo */
.cp-action { display: grid; gap: 12px; margin-top: 20px; padding: 14px 16px; border-radius: var(--ui-radius-card); background: var(--ui-accent-soft); }
.cp-action-go { display: flex; justify-content: flex-start; padding-left: 30px; } /* under the words, on their edge after the flag (Igor 14 Nov «кнопка странно висит») */
.cp-action-text { display: flex; gap: 10px; min-width: 0; }
.cp-action-text > :is(svg, i) { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--ui-accent-text); }
.cp-action-words { font: 600 var(--ui-type-body) var(--ui-font); }
.cp-action-note { margin-top: 4px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.cp-action-status { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.cp-action-status[hidden] { display: none; }
.cp-action-status > :is(svg, i) { width: 16px; height: 16px; color: var(--ui-gain); }

/* The conversation: your words, Coach's answer drawn by the Coach page's renderers at panel size */
.cp-turns:not(:empty) { margin-top: 24px; }
.cp-first:empty + .cp-turns { margin-top: 0; }
.cp-turn { padding: 20px 0; border-top: 1px solid var(--ui-line); }
.cp-you { display: flex; align-items: center; gap: 4px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.cp-you :is(svg, i) { width: 14px; height: 14px; }
.cp-q { margin-top: 4px; font: 500 var(--ui-type-lead) var(--ui-font); overflow-wrap: anywhere; }
.cp-a { margin-top: 12px; }
.cp .cv-headline { margin-top: 8px; font: 600 var(--ui-type-title-s) var(--ui-font); letter-spacing: -.01em; }
.cp .cv-lead.is-split { display: block; }
.cp .cv-lead-proof { padding-top: 16px; }
.cp .cv-kpis { gap: 12px 24px; margin-top: 16px; }
.cp .cv-kpis dd { font: 600 var(--ui-type-title-m) var(--ui-font); }
.cp .cv-body .ui-text { font: 400 var(--ui-type-body) var(--ui-font); }
.cp .cv-section { margin-top: 20px; }
.cp .cv-table-wrap { overflow-x: auto; }
.cp .cv-trade-table :is(.cv-trade-thumb, .cv-trade-note, .cv-trade-setup, .cv-trade-r, th.cv-fill, th.cv-num:not(:last-child)) { display: none; }
.cp .cv-follow { display: none; }
.cp .cv-test { display: grid; gap: 12px; }
.cp-chip-line { margin-bottom: 6px; }
.cp-quiet { color: var(--ui-ink-2); font: 400 var(--ui-type-body) var(--ui-font); text-wrap: pretty; }
.cp-scope-note { margin-top: 12px; font-size: var(--ui-type-caption-size); }

/* Foot: follow-ups over the composer, the panel's one frame */
/* Follow-ups wrap instead of running off the panel's edge mid-word (CRAFT-RULES 8). */
/* One row that scrolls sideways (Igor 14 Nov «вот это массивно, нет?» on three chips stacked in three rows). */
.cp-follow { display: flex; flex-wrap: nowrap; gap: 6px; padding: 10px 0 8px; overflow-x: auto; scrollbar-width: none; }
.cp-follow::-webkit-scrollbar { display: none; }
.cp-follow[hidden], .cp-follow:empty { display: none; }
.cp-follow-chip { flex: none; min-height: 32px; padding: 0 12px; border: 1px solid var(--ui-line-strong); border-radius: 999px; background: var(--ui-page); color: var(--ui-ink); font: 400 var(--ui-type-caption) var(--ui-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cp-follow-chip:hover { background: var(--ui-hover); }
.cp-follow:empty + .cp-composer { margin-top: 12px; }
.cp-composer { padding: 10px 10px 6px 14px; border: 1px solid var(--ui-line-strong); border-radius: var(--ui-radius-card); background: var(--ui-page); }
.cp-composer[hidden] { display: none; }
.cp-composer:focus-within { border-color: var(--ui-accent); box-shadow: 0 0 0 3px var(--ui-accent-soft); }
.cp-pointed { margin-bottom: 6px; }
.cp-pointed[hidden] { display: none; }
.cp-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 26px; padding: 0 4px 0 8px; border-radius: var(--ui-radius-control); background: var(--ui-accent-soft); color: var(--ui-ink); font: 500 var(--ui-type-caption) var(--ui-font); }
.cp-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-chip :is(svg, i) { width: 14px; height: 14px; flex: none; color: var(--ui-accent-text); }
.cp-chip-x { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: var(--ui-radius-control); background: none; color: var(--ui-ink-2); cursor: pointer; }
.cp-chip-x:hover { background: var(--ui-hover); }
.cp-field { display: flex; align-items: flex-start; gap: 8px; }
.cp-field textarea { flex: 1; min-width: 0; min-height: 24px; max-height: 160px; padding: 2px 0; border: 0; outline: 0; resize: none; background: none; color: var(--ui-ink); font: 400 var(--ui-type-body) var(--ui-font); }
.cp-field textarea:is(:focus, :focus-visible) { outline: 0; box-shadow: none; }
.cp-field textarea::placeholder { color: var(--ui-ink-3); opacity: 1; }
.cp-say:empty { display: none; }
.cp-row { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.cp-row .app-action-btn { min-height: 32px; }
.cp-spacer { flex: 1; }
.cp-left { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: 2px; color: var(--ui-ink-3); cursor: default; }
.cp-left:empty { display: none; }
.cp-left[data-tone=warn] { color: var(--ui-warn, #b7791f); }
.cp-questions { position: relative; }
/* Opens upward from the composer. The shared menu sets top/right (.tsb-content-controls .app-content-menu); with both top and
   bottom set the menu collapsed to its last line ("All questions") under the composer. */
.tsb-content-controls .app-content-menu.cp-menu { top: auto; right: auto; bottom: calc(100% + 6px); left: 0; z-index: 3; width: min(340px, calc(100vw - 48px)); max-height: min(360px, calc(100dvh - 160px)); overflow-y: auto; }
.cp-menu[hidden] { display: none; }
.cp-menu .app-action-btn { justify-content: flex-start; width: 100%; height: auto; min-height: 36px; padding-block: 6px; text-align: left; white-space: normal; }
.cp-menu-group { margin: 8px 10px 4px; color: var(--ui-ink-3); font: 500 var(--ui-type-caption) var(--ui-font); }
.cp-menu-all { justify-content: space-between !important; border-top: 1px solid var(--ui-line) !important; border-radius: 0 !important; }
.cp-note { margin-top: 6px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
.cp-note[hidden], .cp-lock[hidden] { display: none; }
.cp-lock { padding-top: 12px; }
/* The panel is phone-narrow at any width: the shared lock's action goes under its words, as ui-kit does on a phone. */
.cp-lock .ui-lock { flex-wrap: wrap; row-gap: 12px; }
.cp-lock .ui-lock-copy { flex-basis: calc(100% - 32px); }
.cp-lock .ui-lock-cta { margin: 0 0 0 32px; }
.cp-lock .ui-lock-go { flex-basis: calc(100% - 32px); margin-left: 32px; }

/* The rail mark has a dot when Coach has a line for this page */
[data-workspace-coach].has-coach-line { position: relative; }
[data-workspace-coach].has-coach-line::after { content: ""; position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--ui-accent, var(--app-accent)); box-shadow: 0 0 0 2px var(--ws-brand-bg, var(--app-accent)); }
/* On a page's own header (the trade review) the dot's ring is that header's surface, not the top bar's indigo. */
.review-companions > [data-workspace-coach].has-coach-line::after { box-shadow: 0 0 0 2px var(--tr-surface, var(--ui-page, #fff)); }
/* On the brand rail the accent dot vanished into the accent (Igor 14 Nov «тут точку не видно»): white there. */
#workspace-global-rail [data-workspace-coach].has-coach-line::after { background: var(--ui-on-accent, #fff); }

/* Numbered marks on the page underneath: a small ink circle beside the element; text gets a thin underline (a thick one
   is too heavy on a big headline), a row a thin rule on its left edge. */
.coach-marks { position: absolute; inset: 0 auto auto 0; width: 0; height: 0; z-index: 93; pointer-events: none; } /* under the panel (94), which sits under the top bar (95) */
.coach-mark { position: absolute; top: 0; left: 0; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ui-ink, #1d1d22); color: var(--ui-page, #fff); font: 600 12px/1 var(--ui-font, Inter, sans-serif); box-shadow: 0 0 0 2px var(--ui-page, #fff); transition: transform .12s ease-out; }
.coach-mark[hidden] { display: none; }
.coach-mark.is-hot { background: var(--ui-accent, var(--app-accent)); }
[data-coach-marked=text] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); }
[data-coach-marked=block] { box-shadow: inset 2px 0 0 var(--ui-ink, #1d1d22); }
@media (prefers-reduced-motion: reduce) { .coach-mark { transition: none; } }

@media (max-width: 767px) {
    .cp { padding: 16px 16px 20px; }
    .cp-shell .tsb-side-panel-foot { padding: 0 12px 10px; }
}
/* Design C (13 Nov): one figure for this page, with its delta, under the sentence; the numbered proof follows. */
.cp-figure { margin-top: 12px; }
.cp-figure-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cp-figure-value { font: 600 var(--ui-type-title-l) var(--ui-font); letter-spacing: -.035em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ui-ink); }
.cp-figure-value[data-tone=loss] { color: var(--ui-loss); }
.cp-figure-value[data-tone=gain] { color: var(--ui-gain); }
.cp-figure-caption { margin-top: 4px; color: var(--ui-ink-2); font: 400 var(--ui-type-caption) var(--ui-font); }
/* "Ask Coach …" on any page: the kit's quiet button with Coach's glyph at 16 (Setups', Trading Day's day and calendar). */
.app-action-btn .cv-glyph { width: 16px; height: 16px; flex: none; }
