/* Components of the newer screens, in every style. Colours are tokens; these defaults make them look native in Black, and a skin overrides them. */
:root {
  --num: var(--mono); --code: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --brand: var(--accent); --brand-wash: color-mix(in srgb, var(--accent) 12%, transparent); --brand-rim: color-mix(in srgb, var(--accent) 35%, transparent);
  --tile: var(--surface); --hi: transparent; --lum: transparent; --bar: var(--surface);
  --ask-wash: color-mix(in srgb, var(--s1) 24%, transparent); --bid-wash: color-mix(in srgb, var(--s3) 26%, transparent);
}
code, .prompt, .small.mono { font-family: var(--code); }
.section-title__sub { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-3); white-space: pre-wrap; }
.section-row .section-title { flex: 1 1 auto; }

/* Clickable tiles */
.is-link { position: relative; }
.is-link { cursor: pointer; transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), border-color .15s; }
.is-link:hover { transform: translateY(-2px); border-color: var(--brand-rim); }
.is-link::after { content: "→"; position: absolute; top: 10px; right: 12px; color: var(--brand); font-size: 13px; opacity: 0; transition: opacity .15s, transform .15s; transform: translateX(-3px); }
.is-link:hover::after, .is-link:focus-visible::after { opacity: 1; transform: none; }
.is-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.back { border: 0; background: none; color: var(--text-2); padding: 0 0 10px; cursor: pointer; font-weight: 600; }
.back:hover { color: var(--brand); }

/* Дашборд: cards the owner can move */
.dash-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 28px; font-size: 12px; color: var(--text-3); }
.dash-reset { padding: 3px 9px; font-size: 12px; }
.dash-reset[hidden] { display: none; }
[data-card] { position: relative; }
.drag-handle { position: absolute; top: 10px; left: 1px; width: 13px; height: 22px; padding: 0; border: 0; border-radius: 4px; cursor: grab; touch-action: none; opacity: 0; transition: opacity .12s; background: radial-gradient(circle, var(--text-3) 1.1px, transparent 1.4px) center / 5px 6px; }
[data-card]:hover > .drag-handle, .drag-handle:focus-visible { opacity: .9; }
.drag-handle:hover { background-color: var(--surface-2); opacity: 1; }
.drag-handle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.is-dragging { z-index: 25; pointer-events: none; background-color: var(--surface); box-shadow: 0 22px 44px -18px rgba(0, 0, 0, .7), 0 0 0 1px var(--brand); }
.is-dragging.is-link { transition: none; }
.cards-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
@media (hover: none) { .drag-handle { opacity: .7; } .dash-tools span { display: none; } }

/* Settings */
.top__row { position: relative; }
.settings { position: static; }
.settings__host { position: absolute; top: calc(100% - 2px); right: 16px; z-index: 30; }
#settings { font-size: 17px; line-height: 1; padding-inline: 8px; }
.range-hint { font-size: 12px; color: var(--text-3); }
.range-hint:empty { display: none; }
/* The disabled control keeps the same words in its title; on most screens the line would break the header row. */
@media (max-width: 1700px) { .range-hint { display: none; } }
.settings__panel { width: min(340px, calc(100vw - 32px)); padding: 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .55); }
.settings__title { margin: 10px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.settings__title:first-child { margin-top: 0; }
.settings__hint { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.skin-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.skin-card { display: flex; flex-direction: column; gap: 3px; padding: 8px; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.skin-card:hover { border-color: var(--line-strong); }
.skin-card[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.skin-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.skin-card b { font-size: 13px; }
.skin-card small { font-size: 11px; line-height: 1.3; color: var(--text-3); }
.skin-card__swatch { display: flex; align-items: flex-end; gap: 4px; height: 44px; margin-bottom: 4px; padding: 7px 8px; border-radius: 7px; }
.skin-card__swatch i { flex: 1; border-radius: 3px 3px 0 0; }
.skin-card__swatch i:nth-child(1) { height: 40%; } .skin-card__swatch i:nth-child(2) { height: 65%; } .skin-card__swatch i:nth-child(3) { height: 100%; }
.skin-card--flicket .skin-card__swatch { background: linear-gradient(135deg, #24344c, #101620); }
.skin-card--flicket .skin-card__swatch i { background: #dcb257; }
.skin-card--black .skin-card__swatch { background: #111110; box-shadow: inset 0 0 0 1px #2e2e2b; }
.skin-card--black .skin-card__swatch i { background: #3987e5; }

/* Charts */
.chart-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .8s cubic-bezier(.3, .7, .2, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .baseline-line { stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .baseline-text { fill: var(--brand); font: 600 11px var(--num); }
.chart .plot-label { fill: var(--text); font: 500 12.5px var(--sans); }
.chart .plot-label--muted { fill: var(--text-3); }
.chart .plot-value { fill: var(--text); font: 600 12.5px var(--num); font-variant-numeric: tabular-nums; }

/* Metric page: a boarding pass */
.pass { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 260px; border: 1px solid var(--line-strong); border-radius: 20px; overflow: hidden; background: linear-gradient(120deg, var(--brand-wash), transparent 45%), var(--surface); box-shadow: inset 0 1px 0 var(--hi), var(--shadow); }
.pass__main { padding: 18px 22px; min-width: 0; }
.pass__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.pass__title { margin: 4px 0 8px; font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.pass__value { font: 800 44px/1.05 var(--num); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.pass__sub { margin-top: 6px; color: var(--text-2); font-size: 13px; }
.pass__chip { margin-top: 8px; }
.pass__stub { position: relative; margin: 0; padding: 18px 20px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-content: center; border-left: 2px dashed var(--line-strong); }
.pass__stub::before, .pass__stub::after { content: ""; position: absolute; left: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-strong); }
.pass__stub::before { top: -11px; }
.pass__stub::after { bottom: -11px; }
.pass__stub dt { color: var(--text-3); font-size: 12px; }
.pass__stub dd { margin: 0; font-weight: 600; font-size: 13px; text-align: right; }
.metric-intro { margin: 12px 0 0; color: var(--text-2); max-width: 75ch; }
.index-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px 28px; }
.index-meter__head { display: flex; align-items: baseline; gap: 8px; font-weight: 600; }
.index-meter__head b { margin-left: auto; font: 800 20px var(--num); font-variant-numeric: tabular-nums; }
.index-meter__head small { font: 400 11px var(--sans); color: var(--text-3); }
.index-meter__head em { font-style: normal; font-size: 12px; color: var(--text-3); min-width: 56px; text-align: right; }
.index-bar { height: 8px; margin-top: 6px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.index-bar i { display: block; height: 100%; border-radius: inherit; }
.index-bar--brand i { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 45%, transparent), var(--brand)); }
.index-bar--good i { background: linear-gradient(90deg, color-mix(in srgb, var(--good) 45%, transparent), var(--good)); }
.index-bar--warn i { background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 45%, transparent), var(--warn)); }
.index-bar--crit i { background: linear-gradient(90deg, color-mix(in srgb, var(--crit) 45%, transparent), var(--crit)); }
.index-why { margin: 8px 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: 13px; }
.index-why li + li { margin-top: 3px; }
.index-verdict { margin: 12px 0 0; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-weight: 600; }
.note-card { color: var(--text-2); }

/* Рост: the order book */
.ticker { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.tick { background: var(--surface); padding: 9px 13px; min-width: 0; }
.tick span { display: block; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.tick b { display: block; font: 700 21px/1.3 var(--num); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tick small { display: block; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tick--ask b { color: var(--s1); } .tick--bid b { color: var(--s3); } .tick--att b { color: var(--crit-ink); }
.rise-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px; margin-top: 12px; align-items: start; }
.book { font-size: 13px; }
.book th { position: static; background: none; cursor: default; color: var(--text-3); font-weight: 500; font-size: 11.5px; text-align: right; border: 0; padding: 0 8px 4px; }
.book th:first-child { text-align: left; }
.book td { padding: 0 8px; height: 25px; border: 0; text-align: right; font-variant-numeric: tabular-nums; }
.book td:first-child { text-align: left; }
.book tr { background-repeat: no-repeat; background-position: right center; }
.book tbody tr:hover td { background: none; }
.book tr.ask { background-image: linear-gradient(var(--ask-wash), var(--ask-wash)); }
.book tr.bid { background-image: linear-gradient(var(--bid-wash), var(--bid-wash)); }
.book tr.ask td:nth-child(2) { color: var(--s1); font-weight: 700; }
.book tr.bid td:nth-child(2) { color: var(--s3); font-weight: 700; }
.book td.book__side { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); height: 22px; }
.book__spread td { height: auto; padding: 7px 8px; background: var(--crit-wash); border-block: 1px solid var(--line-strong); text-align: left; }
.book tbody tr.book__spread:hover td { background: var(--crit-wash); }
.book__spread div { display: flex; align-items: baseline; justify-content: space-between; font-weight: 600; }
.book__spread b { font: 800 20px var(--num); color: var(--crit-ink); }
.split-book { display: flex; flex-direction: column; gap: 4px; }
.split-book__head { display: grid; grid-template-columns: 1fr 120px 1fr; font-size: 11.5px; color: var(--text-3); margin-bottom: 2px; }
.split-book__head span:last-child { text-align: right; }
.split-book__row { display: grid; grid-template-columns: 1fr 120px 1fr; align-items: center; }
.split-book__name { text-align: center; color: var(--text-2); font-size: 13px; }
.split-book__side { position: relative; height: 28px; }
.split-book__side i { position: absolute; top: 0; bottom: 0; }
.split-book__side b { position: absolute; top: 4px; font-variant-numeric: tabular-nums; }
.split-book__side--ask i { right: 0; background: var(--ask-wash); border-right: 2px solid var(--s1); }
.split-book__side--ask b { left: 6px; color: var(--s1); }
.split-book__side--bid i { left: 0; background: var(--bid-wash); border-left: 2px solid var(--s3); }
.split-book__side--bid b { right: 6px; color: var(--s3); }
.chart-wait { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--text-2); font-size: 13px; }
.tasks { display: grid; gap: 6px; }
.task { border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 12px; background-color: var(--tile); }
.task--red { border-left-color: var(--crit); } .task--amber { border-left-color: var(--warn); } .task--green { border-left-color: var(--good); }
.task summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 76px minmax(90px, auto) 150px auto; gap: 12px; align-items: center; padding: 8px 12px; cursor: pointer; list-style: none; }
.task summary::-webkit-details-marker { display: none; }
.task summary:hover { background: var(--surface-2); border-radius: 11px; }
.task__main { display: flex; flex-direction: column; min-width: 0; }
.task__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task__next { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task__type { font-size: 12px; color: var(--text-3); }
.task__impact { font-size: 12px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.task[open] .task__next { white-space: normal; }
.tag { font-size: 11.5px; border-radius: 6px; padding: 1px 7px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; justify-self: start; }
.tag--agent { background: var(--good-wash); color: var(--good-ink); font-weight: 600; }
.tag--you { background: var(--crit-wash); color: var(--crit-ink); font-weight: 600; }
.copy-btn { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.dots { display: inline-flex; gap: 2px; }
.dots i { width: 8px; height: 8px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--line-strong); }
.dots i.on { background: var(--s3); border-color: var(--s3); }
.dots i.now { background: var(--s1); border-color: var(--s1); }
.dots i.att { background: var(--crit); border-color: var(--crit); }
.task__body { padding: 2px 14px 12px; }
.task__detail { margin: 4px 0 8px; color: var(--text-2); font-size: 13px; }
.stages { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 12px; font-size: 12.5px; }
.stages li { display: flex; flex-direction: column; padding-left: 10px; border-left: 2px solid var(--line-strong); color: var(--text-3); }
.stages b { font-weight: 600; color: var(--text-2); }
.stages .is-done { border-left-color: var(--s3); } .stages .is-now { border-left-color: var(--s1); } .stages .is-att { border-left-color: var(--crit); }
.prompt { margin: 8px 0 0; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.tape-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.tape-new { color: var(--s1); }

/* Когорты */
.hops { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.hops::before { content: ""; position: absolute; left: 6px; right: 12%; top: 6px; border-top: 2px dashed var(--line-strong); }
.hop { position: relative; display: flex; flex-direction: column; min-width: 0; padding-right: 10px; }
.hop i { width: 13px; height: 13px; border-radius: 50%; background: var(--brand); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--brand); margin-bottom: 8px; }
.hop b { font: 700 24px/1.15 var(--num); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hop span { font-size: 12.5px; color: var(--text-2); }
.hop em { font-style: normal; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.finds { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 10px; }
.find { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background-color: var(--tile); box-shadow: inset 0 1px 0 var(--hi), var(--shadow); }
.find h3 { margin: 0 0 3px; font-size: 14px; line-height: 1.3; font-weight: 700; }
.find p { margin: 0; color: var(--text-2); font-size: 13px; }
.find .find__do { margin-top: 6px; color: var(--text); }
.find__do b { font-weight: 600; }
.find__icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.find--good .find__icon { background: var(--good-wash); color: var(--good-ink); }
.find--bad .find__icon { background: var(--crit-wash); color: var(--crit-ink); }
.find--warn .find__icon { background: var(--warn-wash); color: var(--warn-ink); }
.plot-tools { margin-bottom: 8px; }
.grid--1 { gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  .chart-line { animation: none; stroke-dashoffset: 0; stroke-dasharray: none; }
  .is-link, .is-link::after { transition: none; }
  .is-link:hover { transform: none; }
}
@media (max-width: 1100px) {
  .rise-grid { grid-template-columns: minmax(0, 1fr); }
  .task summary { grid-template-columns: minmax(0, 1fr) auto; }
  .task__main { grid-column: 1 / -1; }
  .task__impact { text-align: left; }
}
@media (max-width: 720px) {
  .pass { grid-template-columns: minmax(0, 1fr); }
  .pass__stub { border-left: 0; border-top: 2px dashed var(--line-strong); }
  .pass__stub::before, .pass__stub::after { display: none; }
  .pass__value { font-size: 34px; }
  .hops { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .hops::before { display: none; }
  .tick:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
