/* ---------------------------------------------------------------
   components.css - shared page furniture for algo-trading.
   Loaded on every page via base.html, after app.css (tokens).

   Sizes come from the --fs-* / --ctl-* tokens in app.css, so the
   desktop/tablet/phone scale is defined in one place there.

   Replaces the old style.css + tables.css for converted pages and
   keeps the class names those pages already use, so no markup
   contract changes:
     space-right, hidden_tag, action-buttons, disabled-link,
     text_align_center / _left / _right, ten-px-width,
     positive, negative, filter_input, filter-input-active,
     modal, modal-content, close, form-element,
     increase-input-width, error-message
   --------------------------------------------------------------- */

/* ---------------- page shell --------------------------------- */

.page {                  /* the whole screen width (owner, 2026-10-19); reading pages (help, about, tools) keep their own cap */
    padding: 20px 22px 32px;
}

.page-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

h1, h2, h3, h4, h5 {
    margin: 0 0 6px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

h1 { font-size: calc(26px * var(--text-scale, 1)); }
h2 { font-size: calc(21px * var(--text-scale, 1)); }
h3 { font-size: calc(18.5px * var(--text-scale, 1)); }

.page-subtitle {
    margin: 0;
    color: var(--ink-dim);
    font-size: calc(16px * var(--text-scale, 1));
}

p { margin: 0 0 10px; }

a         { color: var(--link); text-decoration: none; }
a:hover   { text-decoration: underline; }

footer {
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--ink-faint);
    font-size: var(--fs-meta);
}

/* ---------------- coin logo (static/js/coin_logo.js, ROADMAP F15) ---------
   Fixed size, so a table does not jump while the logos load. A coin
   without a logo gets a round badge with its first letters. */

.coin-name {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    vertical-align: middle;
}

/* a stock token's company name after its ticker: AAPL · Apple (ROADMAP F5); cut with ... where the cell is narrow */
.coin-title {
    color: var(--ink-dim);
    font-size: .92em;
    margin-inline-start: -3px;
    min-width: 0;
    max-width: 14em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coin-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
    vertical-align: middle;
}

.coin-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Exchange badges (ROADMAP F61, static/js/exchange_badge.js): logo on a light chip + name, tinted in the exchange's
   colour (--ex-color, set by the script) */
.ex-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-block: 1px; padding-inline: 2px 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--ex-color, #888) 45%, transparent);
    background-color: color-mix(in srgb, var(--ex-color, #888) 14%, transparent);
    color: var(--ink);
    font-size: calc(14.5px * var(--text-scale, 1));
    font-weight: 600;
    line-height: 18px;
    white-space: nowrap;
    vertical-align: middle;
}
.ex-badge-logo {
    width: 16px;
    height: 16px;
    padding: 1px;
    border-radius: 50%;
    background-color: #fff;
    object-fit: contain;
    flex: 0 0 auto;
}
.ex-badge.is-short { padding-inline-end: 2px; }

.coin-logo.is-badge {
    font-size: calc(10.5px * var(--text-scale, 1));
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1;
    color: hsl(var(--badge-hue, 215) 55% 82%);          /* dark theme (the default) */
    background-color: hsl(var(--badge-hue, 215) 30% 26%);
    user-select: none;
}

[data-bs-theme="light"] .coin-logo.is-badge {
    color: hsl(var(--badge-hue, 215) 45% 35%);
    background-color: hsl(var(--badge-hue, 215) 60% 88%);
}

.coin-logo.is-small { flex-basis: 16px; width: 16px; height: 16px; }
.coin-logo.is-small.is-badge { font-size: calc(9px * var(--text-scale, 1)); }
.coin-logo.is-large { flex-basis: 32px; width: 32px; height: 32px; }
.coin-logo.is-large.is-badge { font-size: calc(14px * var(--text-scale, 1)); }

/* ---------------- 7-day mini charts (static/js/mini_chart.js, ROADMAP F45) ---------
   A small "+" before each coin shows its chart; the bigger "+" above them shows / hides all. */

.mini-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    min-height: 0;
    padding: 0;
    margin-inline-end: 6px;
    vertical-align: middle;
    color: var(--ink-dim);
    background-color: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    font-family: var(--font-num); font-variant-numeric: tabular-nums;
    font-size: calc(17px * var(--text-scale, 1));
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.mini-toggle:hover { color: var(--ink); border-color: var(--accent); }
.mini-toggle.is-open { color: var(--link); border-color: var(--accent); background-color: var(--accent-soft); }
.mini-toggle.is-all { width: 26px; height: 26px; font-size: calc(21px * var(--text-scale, 1)); border-radius: 6px; }
.mini-toggle:disabled { opacity: .4; cursor: default; }

.mini-chart {
    padding: 8px 10px 6px;
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: start;
}

.mini-chart.is-loading { color: var(--ink-faint); }

.mini-chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    margin-bottom: 4px;
    font-size: var(--fs-meta);
    font-weight: 400;
    color: var(--ink-faint);
}

.mini-chart-title { color: var(--ink); font-weight: 600; }
.mini-chart-change, .mini-chart-range, .mini-chart-hover { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.mini-chart-hover { color: var(--ink-dim); }
.mini-chart-link { margin-inline-start: auto; }

.mini-chart-svg { display: block; width: 100%; height: 90px; overflow: visible; cursor: crosshair; }
.mini-chart-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.mini-chart-svg.is-up .mini-chart-line   { stroke: var(--chart-up); }
.mini-chart-svg.is-down .mini-chart-line { stroke: var(--chart-down); }
/* the area under the line fades from the line's colour to nothing (ROADMAP F88; static/js/svg_fade.js) */
.mini-chart-svg.is-up   { color: var(--chart-up); }
.mini-chart-svg.is-down { color: var(--chart-down); }
.mini-chart-area { stroke: none; }
.svg-fade-top    { stop-color: currentColor; stop-opacity: .30; }
.svg-fade-bottom { stop-color: currentColor; stop-opacity: 0; }
.mini-chart-cursor { stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 3 3; }

/* ---------------- price flash (static/js/price_flash.js, ROADMAP F46) ---------
   A new price lights its cell green (up) / red (down) and fades back. !important: table rows paint their own
   striped / hover backgrounds with more specific rules. */

@keyframes price-flash-up   { from { background-color: color-mix(in srgb, var(--up-ink) 45%, transparent); } to { background-color: transparent; } }
@keyframes price-flash-down { from { background-color: color-mix(in srgb, var(--down-ink) 45%, transparent); } to { background-color: transparent; } }

.price-flash-up   { animation: price-flash-up 1.2s ease-out !important; }
.price-flash-down { animation: price-flash-down 1.2s ease-out !important; }

@media (prefers-reduced-motion: reduce) {
    .price-flash-up, .price-flash-down { animation: none !important; }
}

/* ---------------- loading placeholders (static/js/skeleton.js, ROADMAP F47) --------- */

.skeleton-bar {
    display: inline-block;
    height: 12px;
    max-width: 180px;
    border-radius: 6px;
    vertical-align: middle;
    background: linear-gradient(90deg, var(--panel-3) 0%, var(--border) 50%, var(--panel-3) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes skeleton-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

tr.skeleton-row td { padding-top: 12px; padding-bottom: 12px; }
tr.skeleton-row:hover td { background-color: transparent; }
.skeleton-block { list-style: none; padding: 10px 0; }
.skeleton-block .skeleton-bar { max-width: none; height: 14px; }
/* F117: a chart's block and a card number's short bar */
.skeleton-chart { position: absolute; inset: 0; display: flex; padding: 8px; pointer-events: none; }
.skeleton-chart .skeleton-bar { width: 100% !important; max-width: none; height: 100%; border-radius: var(--radius-sm); }
[data-skeleton="chart"] { position: relative; min-height: 120px; }
.skeleton-value .skeleton-bar { width: 4.5em !important; height: .8em; }

@media (prefers-reduced-motion: reduce) {
    .skeleton-bar { animation: none; background: var(--panel-3); }
}

/* ---------------- pop-up confirmations (static/js/toast.js, ROADMAP F48) --------- */

.toast-stack {
    position: fixed;
    inset-inline-end: 16px;
    bottom: 16px;
    z-index: 1090;                  /* above Bootstrap dialogs (1055) */
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.toast-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-block: 10px; padding-inline: 12px 10px;
    color: var(--ink);
    background-color: var(--raised);
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    font-size: calc(16.5px * var(--text-scale, 1));
    pointer-events: auto;
    animation: toast-in .18s ease-out;
}

.toast-card.is-success { border-inline-start-color: var(--up-ink); }
.toast-card.is-error   { border-inline-start-color: var(--down-ink); }
.toast-card.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease; }

.toast-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 50%;
    color: var(--panel);
    background-color: var(--accent);
    font-size: calc(15px * var(--text-scale, 1));
    font-weight: 700;
}

.toast-card.is-success .toast-icon { background-color: var(--up-ink); }
.toast-card.is-error .toast-icon   { background-color: var(--down-ink); }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }

.toast-close {
    flex: 0 0 auto;
    min-height: 0;
    padding: 0 4px;
    color: var(--ink-faint);
    background: transparent;
    border: 0;
    font-size: calc(20px * var(--text-scale, 1));
    line-height: 1;
    cursor: pointer;
}

.toast-close:hover { color: var(--ink); }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 575.98px) {
    .toast-stack { inset-inline-start: 12px; inset-inline-end: 12px; bottom: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .toast-card { animation: none; }
    .toast-card.is-leaving { transition: none; }
}

/* ---------------- helpful empty pages (static/js/empty_state.js, ROADMAP F49) --------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 16px;
    text-align: center;
    white-space: normal;
}

.empty-state-icon { font-size: calc(32px * var(--text-scale, 1)); line-height: 1; margin-bottom: 4px; }
/* the site's icon set on an empty page (ROADMAP F87): a line drawing in a soft brand-coloured circle */
.empty-state-icon:has(> svg.icon) { display: inline-flex; align-items: center; justify-content: center;
    width: calc(56px * var(--text-scale, 1)); height: calc(56px * var(--text-scale, 1));
    color: var(--brand); background-color: var(--brand-soft); border-radius: 50%; }
.empty-state-icon > svg.icon { width: 55%; height: 55%; }

/* one icon set (ROADMAP F87): a symbol of templates/icon_sprite.html, drawn in the text colour (static/js/icons.js) */
svg.icon { width: 1.1em; height: 1.1em; flex: 0 0 auto; vertical-align: -0.18em; fill: none; stroke: currentColor;
           stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-state-title { margin: 0; color: var(--ink); font-size: calc(18px * var(--text-scale, 1)); font-weight: 600; }
.empty-state-text { margin: 0; max-width: 56ch; color: var(--ink-dim); font-size: calc(16.5px * var(--text-scale, 1)); }
.empty-state-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; margin-top: 8px; }
a.empty-state-button { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: var(--radius-sm); text-decoration: none; }
a.empty-state-button:hover { text-decoration: none; }

/* a link that looks like a plain button (e.g. Portfolio <-> Performance, ROADMAP F65) */
a.btn-plain {
    display: inline-flex;
    align-items: center;
    padding: var(--ctl-pad);
    min-height: var(--ctl-h);
    color: var(--ink);
    background-color: var(--panel-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--fs-ctl);
    font-weight: 500;
    text-decoration: none;
}
a.btn-plain:hover { background-color: var(--panel-2); border-color: var(--ink-faint); text-decoration: none; }
.empty-state-more { font-size: calc(16px * var(--text-scale, 1)); }
tr.empty-row td, tr.empty-row:hover td { background-color: transparent; }
tbody td[colspan] { white-space: normal; }   /* a row's message across the table wraps, never widens it (2026-10-25) */

/* ---------------- card --------------------------------------- */

.card-panel {
    padding: 16px 18px;
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

a.tool-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px 18px;
    min-height: 82px;
    color: var(--ink);
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

/* cards that open a page lift slightly on hover (ROADMAP F88; also a.home-card, a.help-card) */
a.tool-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    transform: translateY(-2px);
}

a.tool-card .tool-name { font-size: calc(17.5px * var(--text-scale, 1)); font-weight: 600; }
a.tool-card .tool-hint { color: var(--ink-dim); font-size: calc(16px * var(--text-scale, 1)); }

a.tool-card.is-disabled { pointer-events: none; opacity: .5; }

/* ---------------- filter / control bar ----------------------- */

.control-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--gap) 18px;
    padding: 14px 16px;
    margin-bottom: 16px;
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;   /* lets fields shrink instead of overflowing */
}

/* a field's label (F130): the field's name in --ink, bold, in normal letters - apart from the muted note under it */
.field > label {
    font-size: var(--fs-label);
    font-weight: 600;
    color: var(--ink);
}
/* a checkbox's own words are its value, not a heading */
.field > label.field-inline,
.field-group > label.field-inline { font-weight: 400; }

.field > select,
.field > input { min-width: 150px; }

.field-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* a row of checkboxes under one caption, e.g. the backtest's market regimes (B15) */
.field-group {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
}

.field-group > legend {
    width: 100%;
    padding: 0;
    margin-bottom: 4px;
    font-size: var(--fs-label);
    font-weight: 600;
    color: var(--ink);
}

.bar-actions {
    display: flex;
    align-items: center;
    gap: var(--gap);
    flex-wrap: wrap;
    margin-inline-start: auto;
}

/* an inline readout such as the ticker price: shaded, with no field border, so it never looks like a box to type in
   (F130) */
.readout {
    padding: 7px 12px;
    min-height: var(--ctl-h);
    display: flex;
    align-items: center;
    background-color: var(--panel-2);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-size: var(--fs-ctl);
}

.readout:empty { display: none; }

/* status / loading lines - the pages write text into these */
#loading_message,
#LoadingMessage,
#alertsLoadingMessage,
#create_alert_loading_message,
#tickerPrice {
    padding: 2px 0;
    color: var(--ink-dim);
    font-size: calc(16px * var(--text-scale, 1));
}

#loading_message:empty,
#LoadingMessage:empty,
#alertsLoadingMessage:empty,
#create_alert_loading_message:empty { display: none; }

/* ---------------- tables (was tables.css) --------------------
   Wide data tables scroll sideways inside .table-wrap rather than
   shrinking the type - on a phone you pan the table, you do not
   squint at it. */

.table-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
/* a table longer than the screen scrolls inside its box, so the sticky heading below has a box to stick to and the
   sideways scrollbar stays in view (P8; the owner chose this over a floating copy of the heading, 2026-11-01). Shorter
   tables do not change; a phone keeps its cards and page scroll; print.css lifts the limit */
@media (min-width: 768px) {
    .table-wrap { max-height: max(320px, calc(100dvh - 72px)); scrollbar-color: auto; }
    /* no upright bar: it would take its width from a table that just fits (owner, 2026-10-30: no sideways bar unless
       the screen is too narrow). The wheel, the touchpad and the keys still scroll; the sideways bar stays */
    .table-wrap::-webkit-scrollbar:vertical { width: 0; }
}

table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: var(--fs-data);
}

th, td {
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid var(--border-soft);
    text-align: start;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;     /* every digit the same width: numbers line up in columns (F50) */
}

thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    color: var(--ink);
    background-color: var(--panel-3);
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-label);
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* a table wider than its box first wraps its headings to two lines, then scrolls (owner, 2026-10-30: "make sure i don't
   have to use the horizontal scroll bar unless the screen width do not allow"); where it fits they stay on one line */
@media (min-width: 768px) { thead th { white-space: normal; } }
/* a laptop's screen: a little less room around each value (12 columns save about 100px) */
@media (min-width: 768px) and (max-width: 1599.98px) { th, td { padding-inline: 8px; } }
/* a 1280 / 1366 laptop: tighter still, and the headings without their letter spacing */
@media (min-width: 768px) and (max-width: 1399.98px) { th, td { padding-inline: 6px; } thead th { letter-spacing: 0; } }
/* td.cell-wrap: a text that may take two lines when the table would not fit otherwise (a time, a name, a pattern);
   td.cell-cut: a long value cut to one line, the full text in its title (an address, a message) */
@media (min-width: 768px) {
    td.cell-wrap { white-space: normal; overflow-wrap: anywhere; min-width: 5em; }
    td.cell-cut { max-width: 14em; overflow: hidden; text-overflow: ellipsis; }
}

tbody tr:nth-child(even) td { background-color: var(--row-alt); }
tbody tr:hover td           { background-color: var(--row-hover); }

/* a fixed coin column (P8): .fix-col-1 on the <table> keeps its first column in view when the table scrolls sideways,
   .fix-col-2 its second (for "# / Coin", "Time / Coin": the first one scrolls away). A solid cell with the row's tint
   painted over it: --row-alt and --row-hover see through, and the numbers slide under this cell */
tbody tr:nth-child(even) { --row-tint: var(--row-alt); }
tbody tr:hover           { --row-tint: var(--row-hover); }
tbody tr.is-selected     { --row-tint: var(--accent-soft); }
.fix-col-1 :is(thead th, tbody td):first-child:not([colspan]),
.fix-col-2 :is(thead th, tbody td):nth-child(2):not([colspan]) {
    position: sticky;
    inset-inline-start: 0;
    z-index: 1;
    background-color: var(--panel);
    background-image: linear-gradient(var(--row-tint, transparent), var(--row-tint, transparent));
    border-inline-end: 1px solid var(--border);
}
.fix-col-1 :is(thead th):first-child:not([colspan]),
.fix-col-2 :is(thead th):nth-child(2):not([colspan]) { z-index: 3; background-color: var(--panel-3); }   /* the corner: over both */
@media (max-width: 767.98px) {
    /* no columns to fix when each row is a card */
    table.phone-cards.fix-col-1 tbody td:first-child:not([colspan]),
    table.phone-cards.fix-col-2 tbody td:nth-child(2):not([colspan]) {
        position: static;
        background: transparent;
        border-inline-end: 0;
    }
}
tbody tr:last-child td      { border-bottom: 0; }

th.num { text-align: end; }   /* a numbers column: its head lines up with its numbers on every page (F130) */

td.num, td.text_align_right {
    text-align: end;
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
}

.text_align_center { text-align: center; }
.text_align_left   { text-align: start; }
.text_align_right  { text-align: end; }
.ten-px-width      { width: 90px; }

td.disabled  { color: var(--ink-faint); cursor: not-allowed; }
td.hyperlink { color: var(--link); text-decoration: underline; cursor: pointer; }

/* up / down. The screener page overrides these with its own scale. */
.positive { color: var(--up-ink); font-weight: 600; }
.negative { color: var(--down-ink); font-weight: 600; }
/* up / down with an arrow as well as colour (ROADMAP F51): static/js/updown_arrows.js sets data-arrow on a green / red
   number; read by eye, not aloud (the "/ ''" alternative text, where the browser has it) */
[data-arrow]::before { content: attr(data-arrow); margin-inline-end: .25em; font-size: .72em; vertical-align: .08em; }
[data-arrow]::before { content: attr(data-arrow) / ''; }

/* info icons with short explanations (ROADMAP F52): static/js/info_tips.js adds a .info-tip button after a column
   title that is a trading term; the "i" is drawn here so the title's own text stays as it was */
.info-tip { display: inline-flex; align-items: center; justify-content: center; width: 1.15em; height: 1.15em;
            margin-inline-start: .3em; padding: 0; border: 1px solid var(--ink-faint); border-radius: 50%;
            background: transparent; color: var(--ink-dim); font: italic 600 .7em/1 Georgia, serif;
            vertical-align: .12em; cursor: help; }
.info-tip::before { content: 'i' / ''; }
.info-tip:hover, .info-tip:focus-visible { color: var(--ink); border-color: var(--accent); }
.info-tip-box { position: fixed; z-index: 2000; padding: .5rem .65rem; border: 1px solid var(--border);
                border-radius: 8px; background: var(--raised); color: var(--ink); box-shadow: var(--shadow-md);
                font-size: calc(13px * var(--text-scale, 1)); font-weight: 400; line-height: 1.4; text-align: start;
                white-space: normal; pointer-events: auto; }
@media print { .info-tip, .info-tip-box { display: none !important; } }

/* ---------------- filter inputs inside tables ---------------- */

.filter-column { text-align: center; }

.filter_input {
    width: 100%;
    min-width: 58px;
    min-height: 34px;
    padding: 5px 8px;
    text-align: center;
    font-size: calc(16px * var(--text-scale, 1));
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
}

.filter_input::placeholder { color: var(--ink-faint); }
.filter_input:disabled     { opacity: .4; cursor: not-allowed; }
.filter-input-active       { border-color: var(--accent); background-color: var(--accent-soft); }

/* ---------------- the hand-rolled modal (was modal.css) ------
   NOTE: alerts.html uses class="modal" for its own overlay and
   also a Bootstrap .modal for the success dialog. These rules only
   restyle the plain overlay; .modal.fade (Bootstrap) is left alone. */

.modal:not(.fade) {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    width: 100%;
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background-color: rgb(0 0 0 / 0.6);
    backdrop-filter: blur(2px);
}

.modal:not(.fade) > .modal-content {
    width: min(760px, 94%);
    margin: 4% auto;
    padding: 22px 24px;
    color: var(--ink);
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.modal:not(.fade) .close {
    float: inline-end;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-faint);
    font-size: calc(30px * var(--text-scale, 1));
    line-height: 1;
    cursor: pointer;
}

.modal:not(.fade) .close:hover { color: var(--ink); }

.form-element {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.form-element > label { min-width: 120px; font-size: var(--fs-ctl); }

.form-element input[type="checkbox"] { width: 18px; height: 18px; }

/* a checkbox label should sit next to its box, not be pushed out */
.form-element input[type="checkbox"] + label,
.form-element label + input[type="checkbox"] { min-width: 0; }

.increase-input-width { width: 60%; }

.form-element.text-center { justify-content: center; }

/* Bootstrap's own modal, themed */
.modal.fade .modal-content {
    background-color: var(--panel);
    border: 1px solid var(--border);
    color: var(--ink);
}

.modal.fade .modal-header,
.modal.fade .modal-footer { border-color: var(--border); }

/* ---------------- misc --------------------------------------- */

.error-message {
    margin-bottom: 8px;
    color: var(--down-ink);
    font-size: calc(16px * var(--text-scale, 1));
}

textarea {                      /* colours and border: the shared field rule in app.css (F130) */
    width: 100%;
    max-width: 100%;
    padding: 9px 12px;
}


ul.plain { list-style: none; margin: 0; padding: 0; }

/* Bootstrap tab strip, themed and tappable */
.nav-tabs { border-bottom-color: var(--border); }

.nav-tabs .nav-link {
    color: var(--ink-dim);
    background-color: transparent;
    border-color: transparent;
    padding: 9px 14px;
    font-size: var(--fs-ctl);
    min-height: var(--ctl-h);
}

.nav-tabs .nav-link:hover { color: var(--ink); border-color: var(--border); }

.nav-tabs .nav-link.active {
    color: var(--ink);
    background-color: var(--panel);
    border-color: var(--border) var(--border) var(--panel);
}

/* error pages (404 / 500) - no navbar, centred */
.error-page {
    max-width: 560px;
    margin: 12vh auto 0;
    padding: 26px 28px;
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

/* ---------------- collapsible options panel ------------------ */
/* js/options_panel.js: one click on the bar opens / closes the page's options;
   closed, the bar shows a one-line summary of the current choices. */

.options-panel { margin-bottom: 16px; }

.options-panel > .options-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    padding: 8px 14px;
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: start;
}

.options-panel > .options-toggle:hover { background-color: var(--panel-2); }
.options-panel > .options-toggle:active { transform: none; }

/* chevron: points right when closed, down when open */
.options-toggle-icon {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    border-inline-end: 2px solid var(--ink-dim);
    border-bottom: 2px solid var(--ink-dim);
    transform: rotate(-45deg);
    transition: transform .15s ease;
}

.options-panel.is-open .options-toggle-icon { transform: rotate(45deg); }

.options-toggle-label {
    flex: 0 0 auto;
    font-size: var(--fs-label);
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.options-summary {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: var(--fs-meta);
    color: var(--ink);
}

.options-toggle-action {
    flex: 0 0 auto;
    margin-inline-start: auto;
    font-size: var(--fs-meta);
    color: var(--link);
}

.options-toggle-action::after { content: "Show"; }
.options-panel.is-open .options-toggle-action::after { content: "Hide"; }

.options-panel > .options-body { margin-top: 10px; }
.options-panel > .options-body > .control-bar:last-child { margin-bottom: 0; }

/* inside a bordered box (the screener toolbar): a plain row, no second border */
.options-panel.is-inline { margin-bottom: 0; }

.options-panel.is-inline > .options-toggle {
    min-height: 40px;
    padding: 8px 16px;
    background-color: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.options-panel.is-inline.is-open > .options-toggle { border-bottom: 1px solid var(--border-soft); }
.options-panel.is-inline > .options-body { margin-top: 0; }

/* ---------------- responsive --------------------------------- */

@media (max-width: 992px) {
    .page { padding: 16px 16px 26px; }
    .bar-actions { margin-inline-start: 0; }
}

@media (max-width: 576px) {
    .page { padding: 14px 12px 24px; }

    h1 { font-size: calc(23px * var(--text-scale, 1)); }
    h2 { font-size: calc(20px * var(--text-scale, 1)); }

    .page-head { margin-bottom: 14px; }

    /* stack the control bars: one field per row, full width */
    .control-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .field > select,
    .field > input { min-width: 0; width: 100%; }

    .bar-actions { width: 100%; }
    .bar-actions > button { flex: 1 1 auto; }

    .readout { width: 100%; }

    /* wide tables: pan them, do not shrink the numbers */
    .table-wrap { border-radius: var(--radius-sm); }
    th, td { padding: 9px 10px; }

    /* modal: labels above their inputs */
    .modal:not(.fade) > .modal-content { width: 100%; margin: 0; min-height: 100%; border: 0; border-radius: 0; padding: 18px 14px; }
    .form-element { align-items: stretch; flex-direction: column; gap: 6px; }
    .form-element > label { min-width: 0; }
    .form-element > input[type="text"],
    .form-element > input[type="time"],
    .form-element > input[type="datetime-local"],
    .form-element > select { width: 100%; }
    .increase-input-width { width: 100%; }

    /* the day-of-week checkbox rows stay horizontal - they are short */
    .form-element:has(input[type="checkbox"]) { flex-direction: row; flex-wrap: wrap; align-items: center; }

    .error-page { margin-top: 6vh; padding: 20px 16px; }

    .card-grid { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------------- chart legend (static/js/tv_charts.js, ROADMAP F54) --------- */

.tv-legend {
    position: absolute;
    top: 6px;
    left: 8px;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 10px;
    max-width: calc(100% - 90px);
    padding: 2px 6px;
    color: var(--ink-dim);
    background-color: color-mix(in srgb, var(--panel) 80%, transparent);
    border-radius: var(--radius-sm);
    font-size: calc(14px * var(--text-scale, 1));
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.tv-legend b { color: var(--ink); font-weight: 600; }
.tv-legend b.si-up { color: var(--up-ink); }
.tv-legend b.si-down { color: var(--down-ink); }
.tv-legend-break { flex-basis: 100%; height: 0; }                 /* the indicators' line (ROADMAP F64b) */
.tv-legend-dot { display: inline-block; width: 8px; height: 8px; margin-inline-end: 4px; border-radius: 50%; }

/* ---------------- phone layout (ROADMAP F57): bottom tab bar + tables as cards --------- */

.tabbar { display: none; }

@media (max-width: 767.98px) {
    /* the tab bar: fixed at the bottom, above the phone's home indicator */
    .tabbar {
        position: fixed;
        inset-inline-start: 0;
        inset-inline-end: 0;
        bottom: 0;
        z-index: 1030;
        display: flex;
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
        background-color: var(--panel);
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 10px rgb(0 0 0 / 0.15);
    }

    .tabbar-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 52px;
        padding: 4px 2px;
        color: var(--ink-faint);
        background: transparent;
        border: 0;
        border-radius: var(--radius-sm);
        font-size: calc(13.5px * var(--text-scale, 1));
        font-weight: 600;
        text-decoration: none;
    }

    .tabbar-item:hover { color: var(--ink); background: transparent; text-decoration: none; }
    .tabbar-item.active, .tabbar-item[aria-expanded="true"] { color: var(--link); }
    .tabbar-item.active svg { stroke: var(--link); }

    .tabbar-item svg {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* room for the bar at the end of every page; pop-ups sit above it */
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .toast-stack { bottom: calc(72px + env(safe-area-inset-bottom)); }

    /* tables as cards: one card per row, each value with its column name (data-label, set by phone_layout.js) */
    table.phone-cards,
    table.phone-cards tbody { display: block; width: 100%; }
    table.phone-cards thead { display: none; }

    table.phone-cards tbody tr {
        display: block;
        margin: 0 0 10px;
        padding: 8px 12px;
        background-color: var(--panel);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
    }

    table.phone-cards tbody tr:nth-child(even) td,
    table.phone-cards tbody tr:hover td { background-color: transparent; }

    /* block + a floated name: the cell's own content (often several pieces) stays together on the right */
    table.phone-cards tbody td {
        display: block;
        min-height: 30px;
        padding: 5px 0;
        border: 0;
        border-bottom: 1px solid var(--border-soft);
        white-space: normal;
        text-align: end;
        overflow-wrap: anywhere;
    }

    table.phone-cards tbody td:last-child { border-bottom: 0; }

    table.phone-cards tbody td[data-label]::before {
        content: attr(data-label);
        float: inline-start;
        max-width: 45%;
        margin-inline-end: 12px;
        color: var(--ink-dim);
        font-family: var(--font-ui);
        font-size: var(--fs-label);
        font-weight: 600;
        text-align: start;
    }

    table.phone-cards tbody td[data-label=""]::before { content: none; }

    /* the first value (coin, name) is the card's title */
    table.phone-cards tbody td:first-child {
        padding-top: 2px;
        font-size: calc(17.5px * var(--text-scale, 1));
        font-weight: 600;
        text-align: start;
    }

    table.phone-cards tbody td:first-child::before { content: none; }

    /* swipe actions (ROADMAP F110, static/js/swipe_cards.js): sideways moves are ours, up / down scroll the page; the
       card's values follow the finger over a strip naming the action (right: the accent, left: red for Delete / Clear) */
    table.phone-cards tbody tr[data-swipe-left],
    table.phone-cards tbody tr[data-swipe-right] { position: relative; overflow: hidden; touch-action: pan-y; }
    table.phone-cards tbody tr.is-swiping > td {
        position: relative;
        z-index: 1;
        background-color: var(--panel);
        transform: translateX(var(--swipe-x, 0));
    }
    table.phone-cards tbody tr.is-swiping::before {
        content: attr(data-swipe-label);
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        padding: 0 18px;
        color: #ffffff;
        font-weight: 700;
    }
    table.phone-cards tbody tr.swipe-right::before { justify-content: flex-start; background-color: var(--accent); }
    table.phone-cards tbody tr.swipe-left::before { justify-content: flex-end; background-color: var(--danger); }

    /* rows across the whole table (empty states, charts, placeholders): one full-width block */
    table.phone-cards tbody td[colspan] { display: block; text-align: start; border-bottom: 0; }
    table.phone-cards tbody tr.empty-row,
    table.phone-cards tbody tr.skeleton-row { padding: 4px 8px; }

    /* buttons of a card wrap onto several lines */
    table.phone-cards .row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
    .table-wrap:has(> table.phone-cards) { overflow: visible; border: 0; box-shadow: none; background: transparent; }
}

/* Alert delivery health (ROADMAP F19): the Notifications page's Delivery column and the channel cell on the alert pages */
.badge-soft.delivery-ok      { color: var(--up-ink);   border-color: var(--up-ink); }
.badge-soft.delivery-problem { color: var(--down-ink); border-color: var(--down-ink); }
.badge-soft.delivery-wait    { color: var(--ink-faint); }
.delivery-hint { margin-top: 4px; max-width: 46ch; font-size: calc(14.5px * var(--text-scale, 1)); color: var(--down-ink); }

/* First-visit tour on Home (ROADMAP F21, static/js/tour.js) */
.tour-card {
    position: absolute;
    z-index: 1090;
    width: min(360px, calc(100vw - 32px));
    padding: 14px 16px 12px;
    background: var(--raised);
    color: var(--ink);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-md);
}
.tour-card.tour-centered { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-step { margin: 0 0 2px; font-size: calc(14.5px * var(--text-scale, 1)); color: var(--ink-faint); }
.tour-title { margin: 0 0 6px; font-size: calc(18px * var(--text-scale, 1)); font-weight: 600; }
.tour-text { margin: 0 0 10px; font-size: calc(16px * var(--text-scale, 1)); color: var(--ink-dim); line-height: 1.5; }
.tour-link { margin: 0 0 10px; font-size: calc(16px * var(--text-scale, 1)); }
.tour-link a { color: var(--link); }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-spacer { flex: 1; }
.tour-card [hidden] { display: none !important; }
button.tour-skip { background: none; border: none; color: var(--ink-faint); padding: 4px 0; font-size: calc(15px * var(--text-scale, 1)); }
.tour-target { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
@media (prefers-reduced-motion: no-preference) {
    .tour-card { transition: top 0.15s ease, left 0.15s ease; }
}

/* ---------------- confirmation dialog (confirm_dialog.js, owner 2026-10-03) ------------------------------------
   One window for every "are you sure?" question: centred card on a dimmed page, a sheet at the bottom on a phone. */
.confirm-dialog {
    box-sizing: border-box;
    width: min(460px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    color: var(--ink);
    background-color: var(--raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgb(0 0 0 / 0.45);
    overflow: auto;
}
.confirm-dialog::backdrop { background-color: rgb(0 0 0 / 0.62); backdrop-filter: blur(2px); }
.confirm-card { margin: 0; }
.confirm-body { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 6px; }
.confirm-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--link);
    background-color: var(--accent-soft);
    font-size: calc(21px * var(--text-scale, 1));
    font-weight: 700;
}
.confirm-dialog.is-danger .confirm-icon { color: var(--down-ink); background-color: var(--danger-soft); }
.confirm-words { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.confirm-title { margin: 7px 0 6px; font-size: calc(19px * var(--text-scale, 1)); font-weight: 600; line-height: 1.35; color: var(--ink); }
.confirm-text p { margin: 0 0 6px; color: var(--ink-dim); line-height: 1.5; }
.confirm-details { margin: 6px 0 0; padding-inline-start: 18px; color: var(--ink-dim); font-size: var(--fs-meta); line-height: 1.5; }
.confirm-field { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.confirm-field-label { font-size: var(--fs-label); color: var(--ink-dim); }
.confirm-field input { width: 100%; }
.confirm-field-error { min-height: 1.2em; font-size: var(--fs-meta); color: var(--down-ink); }
.confirm-copy {
    width: 100%;
    padding: 8px 10px;
    color: var(--ink);
    background-color: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-code);
    font-size: calc(15px * var(--text-scale, 1));
    resize: vertical;
}
.confirm-copy-button { align-self: flex-start; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }
.confirm-actions button { min-width: 96px; }
button.btn-destructive {
    color: #ffffff;
    background-color: var(--danger);
    border: 1px solid var(--danger);
    font-weight: 600;
}
button.btn-destructive:hover { filter: brightness(1.08); background-color: var(--danger); border-color: var(--danger); }
@media (prefers-reduced-motion: no-preference) {
    .confirm-dialog[open] { animation: confirm-in 0.16s ease-out; }
    .confirm-dialog[open]::backdrop { animation: confirm-fade 0.16s ease-out; }
    .confirm-dialog.is-leaving { opacity: 0; transform: scale(0.98); transition: opacity 0.12s ease, transform 0.12s ease; }
}
@keyframes confirm-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes confirm-fade { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 575px) {
    .confirm-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-width: 1px 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .confirm-actions { flex-direction: column-reverse; }
    .confirm-actions button { width: 100%; min-height: 44px; }
}

/* ---------------- "Install app" guide for iPhone / iPad (ROADMAP M4) ---------------- */
/* static/js/install_app.js: the confirmation dialog's window (.confirm-dialog) with three drawn steps */

.install-guide-body { padding: 22px 22px 4px; }
.install-guide-body .confirm-title { margin-top: 0; }
.install-guide-note { margin: 0 0 14px; color: var(--ink-dim); font-size: var(--fs-meta); }
.install-guide-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: install-step; }
.install-guide-step { display: flex; align-items: center; gap: 14px; counter-increment: install-step; }
.install-guide-icon {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: var(--link);
    background-color: var(--panel-2);
    border: 1px solid var(--border);
}
.install-guide-icon::after {
    content: counter(install-step);
    position: absolute;
    top: -7px;
    inset-inline-start: -7px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--accent-ink);
    font-size: calc(14px * var(--text-scale, 1));
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}
.install-guide-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.install-guide-add { font-size: calc(16px * var(--text-scale, 1)); font-weight: 700; }
.install-guide-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.install-guide-words span { color: var(--ink-dim); font-size: var(--fs-meta); line-height: 1.45; }

/* ---------------- loading bar (ROADMAP F88) ------------------ */
/* static/js/page_progress.js: a thin line along the top while another page or a slow answer is on its way */

.page-progress {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    z-index: 2000;
    height: 2px;
    background-color: var(--accent);
    box-shadow: 0 0 6px var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
    opacity: 0;
    pointer-events: none;
    transition: transform .3s ease, opacity .2s ease;
}
.page-progress.is-on   { opacity: 1; }
.page-progress.is-done { opacity: 0; transition: transform .2s ease, opacity .3s ease .15s; }

/* ---------------- smooth tab changes (ROADMAP F88) ----------- */
/* the newly shown tab fades in and rises a little: Bootstrap tab panes by themselves, other pages through
   static/js/motion.js (enter) */

@media (prefers-reduced-motion: no-preference) {
    .tab-content > .tab-pane.active,
    .tab-enter { animation: tab-enter .22s ease-out; }
}
@keyframes tab-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- % cells shaded by the move (ROADMAP F84) ---- */
/* static/js/move_shade_rules.js gives a % cell move-up-1 ... move-up-5 / move-down-1 ... move-down-5 (light to strong,
   judged against the cell's time frame) or move-flat (0 %). The shades are the theme's own up / down colours, so both
   themes work; from shade 3 the text is the normal ink (tests/www/test_move_shade.py checks every pair reaches 4.5:1).
   The background rule is as specific as the striped / hovered row's, and comes later, so the shade wins. */

td.move-up-1   { --move-bg: color-mix(in srgb, var(--chart-up) 8%, transparent); }
td.move-up-2   { --move-bg: color-mix(in srgb, var(--chart-up) 15%, transparent); }
td.move-up-3   { --move-bg: color-mix(in srgb, var(--chart-up) 24%, transparent); }
td.move-up-4   { --move-bg: color-mix(in srgb, var(--chart-up) 36%, transparent); }
td.move-up-5   { --move-bg: color-mix(in srgb, var(--chart-up) 50%, transparent); }
td.move-down-1 { --move-bg: color-mix(in srgb, var(--chart-down) 8%, transparent); }
td.move-down-2 { --move-bg: color-mix(in srgb, var(--chart-down) 15%, transparent); }
td.move-down-3 { --move-bg: color-mix(in srgb, var(--chart-down) 24%, transparent); }
td.move-down-4 { --move-bg: color-mix(in srgb, var(--chart-down) 36%, transparent); }
td.move-down-5 { --move-bg: color-mix(in srgb, var(--chart-down) 50%, transparent); }
tbody tr td:is(.move-up-1, .move-up-2, .move-up-3, .move-up-4, .move-up-5, .move-down-1, .move-down-2, .move-down-3, .move-down-4, .move-down-5) { background-color: var(--move-bg); }
td:is(.move-up-3, .move-up-4, .move-up-5, .move-down-3, .move-down-4, .move-down-5),
td:is(.move-up-3, .move-up-4, .move-up-5, .move-down-3, .move-down-4, .move-down-5) .positive,
td:is(.move-up-3, .move-up-4, .move-up-5, .move-down-3, .move-down-4, .move-down-5) .negative { color: var(--ink); }
td.move-flat { color: var(--ink-faint); }

/* ---------------- freshness dot (ROADMAP F100) ------------------ */
/* static/js/freshness.js: in the menu bar after Search, the dot and one word (Live / Late / Stopped); the panel says how old. data-state on the box: live (green), late
   (amber), stopped (grey), wait (before the first answer). The panel lists each exchange. */

.freshness-dot {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 8px;
    color: var(--ink-dim);
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: calc(15px * var(--text-scale, 1));
    white-space: nowrap;
    cursor: pointer;
}
.freshness-dot:hover { color: var(--ink); border-color: var(--border); }
.freshness-light {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--ink-faint);
}
.freshness[data-state="live"] .freshness-dot .freshness-light,
.freshness-row[data-state="live"] .freshness-light { background-color: var(--up-ink); }
.freshness[data-state="late"] .freshness-dot .freshness-light,
.freshness-row[data-state="late"] .freshness-light { background-color: var(--chart-compare); }
.freshness[data-state="stopped"] .freshness-dot .freshness-light,
.freshness-row[data-state="stopped"] .freshness-light { background-color: var(--ink-faint); }
.freshness[data-state="live"] .freshness-dot .freshness-light { animation: freshness-pulse 2.4s ease-in-out infinite; }
@keyframes freshness-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) {
    .freshness[data-state="live"] .freshness-dot .freshness-light { animation: none; }
}
.freshness-text { font-variant-numeric: tabular-nums; }
.freshness[data-state="late"] .freshness-text { color: var(--ink); }

.freshness-panel { min-width: 250px; padding: 10px 14px; }
.freshness-summary { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); color: var(--ink); font-variant-numeric: tabular-nums; font-size: calc(15.5px * var(--text-scale, 1)); }
.freshness-title { margin-bottom: 6px; color: var(--ink); font-weight: 600; font-size: calc(15.5px * var(--text-scale, 1)); }
.freshness-list { margin: 0 0 8px; padding: 0; list-style: none; }
.freshness-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: calc(15.5px * var(--text-scale, 1)); }
.freshness-name { flex: 1; color: var(--ink); }
.freshness-age { color: var(--ink-dim); font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.freshness-note { margin: 0; color: var(--ink-faint); font-size: calc(14.5px * var(--text-scale, 1)); line-height: 1.4; white-space: normal; }

/* ---------------- alert bell and inbox (ROADMAP F102) ------------------ */
/* static/js/alert_bell.js: the bell after the freshness dot with the unread count; its panel lists the latest alerts
   (unread in bold with a dot). static/js/alert_inbox.js: the Alerts > Inbox page. */

.alert-bell[hidden] { display: none; }
.alert-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 34px;
    padding: 0;
    color: var(--ink-dim);
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.alert-bell-btn:hover { color: var(--ink); border-color: var(--border); }
.alert-bell[data-unread="yes"] .alert-bell-btn { color: var(--ink); }
.alert-bell-count {
    position: absolute;
    top: 1px;
    inset-inline-end: 0;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    color: #ffffff;
    background-color: var(--danger);
    border-radius: var(--radius-pill);
    font-size: calc(13px * var(--text-scale, 1));
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}
.alert-bell-count[hidden] { display: none; }

.alert-bell-panel { width: 340px; max-width: calc(100vw - 24px); padding: 0; }
.alert-bell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.alert-bell-title { color: var(--ink); font-weight: 600; font-size: calc(16px * var(--text-scale, 1)); }
.alert-bell-allread {
    padding: 3px 8px;
    color: var(--link);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: calc(15px * var(--text-scale, 1));
    cursor: pointer;
}
.alert-bell-allread:hover:not(:disabled) { background-color: var(--panel-2); }
.alert-bell-allread:disabled { color: var(--ink-faint); cursor: default; }
.alert-bell-list { max-height: 60vh; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.alert-bell-list > li + li { border-top: 1px solid var(--border-soft); }
a.alert-bell-item {
    position: relative;
    display: grid;
    gap: 2px;
    padding-block: 9px; padding-inline: 26px 14px;
    color: var(--ink-dim);
    text-decoration: none;
}
a.alert-bell-item:hover { background-color: var(--panel-2); text-decoration: none; }
a.alert-bell-item.is-unread { color: var(--ink); }
a.alert-bell-item.is-unread .alert-bell-top,
a.alert-bell-item.is-unread .alert-bell-what { font-weight: 600; }
a.alert-bell-item.is-unread::before {
    content: '';
    position: absolute;
    top: 15px;
    inset-inline-start: 11px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
}
.alert-bell-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: calc(16px * var(--text-scale, 1)); }
.alert-bell-dir { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: calc(15px * var(--text-scale, 1)); }
.alert-bell-what { font-size: calc(15px * var(--text-scale, 1)); white-space: normal; }
.alert-bell-when { color: var(--ink-faint); font-size: calc(14.5px * var(--text-scale, 1)); }
.alert-bell-empty { padding: 14px; color: var(--ink-dim); font-size: calc(15.5px * var(--text-scale, 1)); white-space: normal; }
a.alert-bell-all {
    display: block;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    font-size: calc(15.5px * var(--text-scale, 1));
    text-align: center;
}

/* the Inbox page */
.inbox-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.inbox-table tr.is-unread td { color: var(--ink); font-weight: 600; }
.inbox-table tr.is-unread td.inbox-dot::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
}
.inbox-table tbody tr { cursor: pointer; }
.inbox-table td.inbox-pick, .inbox-table th.inbox-pick { width: 34px; }
.inbox-table td.inbox-dot { width: 18px; }
/* the row a tapped app notification opened its page at: an alert in the Inbox, a strategy (ROADMAP M7) */
tr.is-opened > td { background: var(--accent-soft); }
.inbox-table .inbox-row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.inbox-more { margin-top: 12px; text-align: center; }

/* ---------------- since your last visit (ROADMAP F103) ------------------ */
/* static/js/since_visit.js: Home's card and the change on each Watchlists coin chip, shaded like the Screener's %
   cells (move_shade_rules.js gives move-up-1 ... move-down-5). */

.since-when { margin-inline-start: 6px; color: var(--ink-faint); font-size: calc(15px * var(--text-scale, 1)); font-weight: 400; }
.since-move {
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-size: calc(15px * var(--text-scale, 1));
    white-space: nowrap;
}
.since-move.is-up { color: var(--up-ink); }
.since-move.is-down { color: var(--down-ink); }
.since-move.is-flat { color: var(--ink-faint); }
.since-move.move-up-1   { background-color: color-mix(in srgb, var(--chart-up) 8%, transparent); }
.since-move.move-up-2   { background-color: color-mix(in srgb, var(--chart-up) 15%, transparent); }
.since-move.move-up-3   { background-color: color-mix(in srgb, var(--chart-up) 24%, transparent); }
.since-move.move-up-4   { background-color: color-mix(in srgb, var(--chart-up) 36%, transparent); }
.since-move.move-up-5   { background-color: color-mix(in srgb, var(--chart-up) 50%, transparent); }
.since-move.move-down-1 { background-color: color-mix(in srgb, var(--chart-down) 8%, transparent); }
.since-move.move-down-2 { background-color: color-mix(in srgb, var(--chart-down) 15%, transparent); }
.since-move.move-down-3 { background-color: color-mix(in srgb, var(--chart-down) 24%, transparent); }
.since-move.move-down-4 { background-color: color-mix(in srgb, var(--chart-down) 36%, transparent); }
.since-move.move-down-5 { background-color: color-mix(in srgb, var(--chart-down) 50%, transparent); }
.since-move:is(.move-up-3, .move-up-4, .move-up-5, .move-down-3, .move-down-4, .move-down-5) { color: var(--ink); }
.since-visit { margin-bottom: var(--gap); }
.since-visit .home-mover a { color: inherit; text-decoration: none; }
.wl-coin .since-move { margin-inline-start: 4px; font-size: calc(14.5px * var(--text-scale, 1)); }

/* the Undo button of a toast (ROADMAP F105, toastUndo in static/js/toast.js) */
.toast-undo {
    flex: none;
    padding: 3px 10px;
    color: var(--link);
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: calc(15.5px * var(--text-scale, 1));
    font-weight: 600;
    cursor: pointer;
}
.toast-undo:hover:not(:disabled) { background-color: var(--panel-2); }
.toast-undo:disabled { color: var(--ink-faint); cursor: default; }

/* ---------------- pop-out panels (ROADMAP F112) ------------------ */
/* a live feed in its own small window (?popout=1, static/js/popout.js; base.html marks <html class="is-popout">):
   the site's frame and the page's text go, the feed and its filters fill the window */
.popout-open { display: inline-flex; align-items: center; gap: 6px; }
html.is-popout .skip-link,
html.is-popout nav.navbar,
html.is-popout nav.tabbar,
html.is-popout .site-footer,
html.is-popout .access-banner,
html.is-popout .page-subtitle,
html.is-popout .page-head .bar-actions { display: none !important; }
html.is-popout body { padding-bottom: 0; }
html.is-popout .page { max-width: none; padding: 10px 12px; }
html.is-popout .page-head { margin-bottom: 8px; }
html.is-popout .page-head h1 { font-size: calc(19px * var(--text-scale, 1)); margin: 0; }

/* ---------------- wall / TV mode (ROADMAP F111) ------------------ */
/* static/js/wall_mode.js on Monitoring, Heat Maps, Liquidations: no site frame, the content fills the screen under a
   slim top line (page, freshness, clock, Exit) that fades when the mouse is still; the text is the user's x 1.4. */

.wall-open { display: inline-flex; align-items: center; gap: 6px; }
body.is-wall .skip-link,
body.is-wall nav.navbar,
body.is-wall nav.tabbar,
body.is-wall .site-footer,
body.is-wall .access-banner,
body.is-wall .options-panel,
body.is-wall form.control-bar,
body.is-wall .page-head { display: none !important; }
body.is-wall { padding-bottom: 0; }
body.is-wall .page { max-width: none; padding: calc(52px * var(--text-scale, 1)) 20px 16px; }
body.wall-idle { cursor: none; }

.wall-bar {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 8px 20px;
    background-color: var(--panel);
    border-bottom: 1px solid var(--border);
    transition: opacity .4s ease;
}
.wall-bar.is-idle { opacity: 0.25; }
.wall-title { flex: 1; color: var(--ink); font-weight: 700; font-size: calc(20px * var(--text-scale, 1)); }
.wall-fresh { color: var(--ink-dim); font-size: calc(16px * var(--text-scale, 1)); }
.wall-fresh[data-state="late"] { color: var(--chart-compare); }
.wall-fresh[data-state="stopped"] { color: var(--down-ink); }
.wall-clock { color: var(--ink); font-family: var(--font-num); font-variant-numeric: tabular-nums;
              font-size: calc(20px * var(--text-scale, 1)); }
@media (prefers-reduced-motion: reduce) { .wall-bar { transition: none; } }

/* ---------------- the motion kit (ROADMAP F115; static/js/motion.js, motion_auto.js) ---------------- */
/* sliding tab highlight: a pill behind segmented buttons, or an underline; always placed, it only slides with motion */
.has-motion-tabs { position: relative; isolation: isolate; }
.motion-tab-slider { position: absolute; left: 0; pointer-events: none; z-index: -1; }
.motion-tab-slider.is-pill { top: 0; bottom: 0; border-radius: 6px; background: var(--accent); }
.motion-tab-slider.is-line { bottom: 0; height: 2px; background: var(--brand); }        /* the brand teal: a highlight (F85) */
.has-motion-pill [role="tab"][aria-selected="true"] { background-color: transparent !important; border-color: transparent !important; }

@media (prefers-reduced-motion: no-preference) {
    .motion-enter { animation: motion-enter .25s ease-out backwards; animation-delay: var(--motion-delay, 0ms); }
    .motion-draw { animation: motion-draw .3s ease-out both; }
    .motion-tab-slider.is-ready { transition: transform .2s ease, width .2s ease; }
    .motion-reveal-wait > * { opacity: 0; }           /* until it scrolls into view (motion_auto.js, ROADMAP F118) */
}
@keyframes motion-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes motion-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------------- the installed app (ROADMAP M5) --------- */

/* room around the notch, the rounded corners and the home bar: viewport-fit=cover (base.html) lets the page run to
   the screen's edges in the installed app and in a phone held sideways; every inset is 0 where there is nothing to
   keep clear (a computer, a browser tab upright), so these rules hold everywhere. The bottom: the tab bar (F57). */
body {
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}
/* the iPhone's status bar (white text, base.html black-translucent) sits on a navy strip in both themes; the page
   scrolls under it, as in a phone's own apps */
body::before {
    content: "";
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    z-index: 1100;
    height: env(safe-area-inset-top);
    background-color: var(--app-bar);      /* the brand's navy (libs/app_manifest.py NAVY); a style may set its own */
    pointer-events: none;
}
.tabbar { padding-left: calc(4px + env(safe-area-inset-left)); padding-right: calc(4px + env(safe-area-inset-right)); }
.modal, .modal:not(.fade) { padding-top: env(safe-area-inset-top); }
@media (max-width: 575.98px) {
    .confirm-dialog { padding-bottom: env(safe-area-inset-bottom); }
}

/* no zoom when tapping a box: an iPhone zooms into any text box under 16 px. On touch screens boxes are 16 px at
   least (larger with a larger text size, F108); pinch-zoom stays (no maximum-scale, docs/DECISIONS.md 2026-10-09) */
@media (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]),
    select,
    textarea {
        font-size: max(16px, 1em) !important;
    }
}

/* the back arrow at the start of the menu bar / the chart's toolbar: only in the installed app (site_menu.back_link
   decides the pages; app_shell.js goes back one page) */
.app-back { display: none; }
@media (display-mode: standalone) {
    .app-back { display: inline-flex; }
}
html.app-installed .app-back { display: inline-flex; }
.app-back {
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-inline-end: 2px;
    margin-inline-start: -8px;
    color: var(--ink);
    border-radius: var(--radius-sm);
    text-decoration: none;
}
.app-back:hover, .app-back:focus-visible { color: var(--ink); background-color: var(--panel-2); }
.app-back svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.chart-app-back { width: 34px; height: 34px; margin-inline-start: 0; }

/* the page does not bounce at its top in the app: the pull spinner comes down instead */
html.app-installed, html.app-installed body { overscroll-behavior-y: none; }

/* pull down to refresh (app_shell.js): the round spinner comes down with the finger (--pull), turns green when
   letting go will refresh, and spins while the page's lists reload */
.app-pull {
    position: fixed;
    top: calc(env(safe-area-inset-top) - 44px);
    left: 50%;
    z-index: 1095;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    color: var(--ink-faint);
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: 50%;
    box-shadow: 0 4px 14px rgb(0 0 0 / 0.25);
    opacity: 0;
    transform: translateY(var(--pull, 0px)) rotate(var(--pull-turn, 0deg));
    pointer-events: none;
}
.app-pull.is-shown { opacity: 1; }
.app-pull:not(.is-shown) { transition: transform .2s ease, opacity .2s ease; }
.app-pull.is-ready, .app-pull.is-spinning { color: var(--link); }
.app-pull.is-spinning svg { animation: app-pull-spin .8s linear infinite; }
.app-pull svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes app-pull-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .app-pull.is-spinning svg { animation-duration: 2s; }
}

/* ---------------- the shared look (ROADMAP F130, owner 2026-10-13) ---------------------------------------------
   One set of styles every page uses, so a field, a label, a note and a button always look the same:
     field   - darker than its card with a clear border (app.css: --field-bg / --field-border)
     label   - the field's name, --ink, bold (app.css label, .field > label)
     note    - .note / .field-hint: smaller (--fs-note), --ink-faint, no box
     section - .form-card: a titled card; .form-rows of .form-row = label | field (two columns, one on phones)
     buttons - .btn-accent one main action per screen; plain <button> the others; .btn-quiet a small text action;
               .btn-destructive red, for harmful steps
     states  - .notice.is-error / .is-warn / .is-ok: a short line that says what happened and what to do */

.note, .field-hint, .si-note, .form-card-note {
    color: var(--ink-faint);
    font-size: var(--fs-note);
    font-weight: 400;
    line-height: 1.45;
}
.field-hint { display: block; margin: 2px 0 0; max-width: 60ch; }
p.note { margin: 0 0 8px; }

/* a titled card around a form part or a result */
.form-card {
    margin: 0 0 16px;
    padding: 16px 18px 18px;
    background-color: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.form-card[hidden] { display: none; }
.form-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 12px; }
.form-card-head > h2 { margin: 0; font-size: calc(19px * var(--text-scale, 1)); }
.form-card-head > .form-card-step {
    display: inline-flex; align-items: center; justify-content: center;
    width: calc(26px * var(--text-scale, 1)); height: calc(26px * var(--text-scale, 1));
    color: var(--accent-ink); background-color: var(--accent); border-radius: 50%;
    font-size: var(--fs-note); font-weight: 700;
}
.form-card-head > .form-card-note { flex-basis: 100%; margin: 0; }

/* label | field rows: the label (and its hint) on the left, the field on the right */
.form-rows { display: grid; gap: 14px 32px; }
.form-row {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    align-items: start;
    gap: 4px 16px;
}
.form-row[hidden] { display: none; }
.form-row > label, .form-row > .form-row-label {
    padding-top: calc((var(--ctl-h) - 1.4em) / 2);   /* the label's line in the middle of its field's height */
    color: var(--ink);
    font-size: var(--fs-label);
    font-weight: 600;
    line-height: 1.4;
}
.form-row > .form-row-label > .field-hint { font-weight: 400; }
.form-row-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.form-row-field > select, .form-row-field > input:not([type="checkbox"]):not([type="radio"]) { flex: 0 1 280px; min-width: 0; }
.form-row-field > .field-hint { flex-basis: 100%; margin: 0; }
.form-row-field > label.field-inline { font-weight: 400; }
/* two rows side by side where the screen is wide enough for both */
@media (min-width: 1280px) {
    .form-rows.is-two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-rows.is-two-up > .is-wide { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
    .form-row { grid-template-columns: minmax(0, 1fr); }
    .form-row > label, .form-row > .form-row-label { padding-top: 0; }
    .form-row-field > select, .form-row-field > input:not([type="checkbox"]):not([type="radio"]) { flex: 1 1 100%; }
}

/* folded rarely used settings inside a card: "More ..." */
details.form-more { margin-top: 14px; border-top: 1px solid var(--border-soft); padding-top: 10px; }
details.form-more > summary { cursor: pointer; color: var(--link); font-weight: 600; width: fit-content; }
details.form-more[open] > summary { margin-bottom: 12px; }

/* a small text action next to a field (Add, Remove, Reset): quieter than a button */
button.btn-quiet {
    min-height: 0;
    padding: 4px 6px;
    color: var(--link);
    background-color: transparent;
    border-color: transparent;
    font-weight: 600;
}
button.btn-quiet:hover { background-color: var(--accent-soft); border-color: transparent; }
a.btn-destructive {
    display: inline-flex; align-items: center; padding: var(--ctl-pad); min-height: var(--ctl-h);
    color: #ffffff; background-color: var(--danger); border: 1px solid var(--danger); border-radius: var(--radius-sm);
    font-size: var(--fs-ctl); font-weight: 600; text-decoration: none;
}
a.btn-destructive:hover { filter: brightness(1.08); text-decoration: none; }
/* the row of a form's buttons: the main one first */
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 4px; }

/* a message that needs reading: what happened and what to do next (errors and warnings only - notes stay unboxed) */
.notice {
    margin: 8px 0;
    padding: 10px 14px;
    color: var(--ink);
    background-color: var(--panel-2);
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--link);
    border-radius: var(--radius-sm);
    font-size: var(--fs-meta);
}
.notice:empty, .notice[hidden] { display: none; }
.notice.is-error { border-inline-start-color: var(--down-ink); background-color: var(--danger-soft); }
.notice.is-warn  { border-inline-start-color: var(--chart-compare); }
.notice.is-ok    { border-inline-start-color: var(--up-ink); }
/* a harmful step's button (Delete, Turn off, the kill switch): red words and edge on every page; the step it opens
   is confirmed in a dialog whose final button is filled red (button.btn-destructive) */
button.danger, .tr-kill-btn {
    color: var(--down-ink);
    border-color: var(--down-ink);
    font-weight: 600;
}
button.danger:hover:not(:disabled), .tr-kill-btn:hover { color: var(--down-ink); background-color: var(--danger-soft); border-color: var(--down-ink); }

/* The Symbol dropdown with its search inside (owner, 2026-10-19; static/js/symbol_combo.js) - every page that picks a
   symbol or an asset: the button looks like the site's fields (app.css, F130), its panel is a raised pop-up; the
   page's own field stays inside it, out of sight (it keeps the value and the form's "required" check) */
.symbol-combo { position: relative; min-width: 220px; }
.symbol-combo-source {
    position: absolute !important; inset-inline-start: 0; bottom: 0; width: 1px !important; height: 1px !important;
    min-width: 0 !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0;
    pointer-events: none;
}
.symbol-combo-empty { color: var(--ink-faint); }
.symbol-combo-button {
    display: flex; align-items: center; gap: 8px; width: 100%;
    min-height: var(--ctl-h); padding: var(--ctl-pad); padding-inline-end: 30px;
    color: var(--ink); background: var(--field-bg); border: 1px solid var(--field-border);
    border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-ctl); text-align: start; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%),          /* the select's arrow */
                      linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%);
    background-position: calc(100% - 16px) calc(50% + 2px), calc(100% - 11px) calc(50% + 2px);
    background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
[dir="rtl"] .symbol-combo-button { background-position: 11px calc(50% + 2px), 16px calc(50% + 2px); }
.symbol-combo-button:hover:not(:disabled) { border-color: var(--field-border-hover); }
.symbol-combo-button[aria-expanded="true"] { border-color: var(--accent); }
.symbol-combo-button:disabled { opacity: .55; cursor: not-allowed; }
.symbol-combo-pair { color: var(--ink-dim); font-size: var(--fs-meta); }
.symbol-combo-panel {                    /* placed by the script over the page (position: fixed), see place() */
    position: fixed; z-index: 1090; padding: 8px;
    background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.symbol-combo-search { width: 100%; }
/* the list in columns (owner, 2026-10-24): as many 260 px columns as the panel holds (symbol_combo.js COLUMNS sets
   its width), a row each; a long pair ends in "..." before the coin's name does, and the two never overlap */
.symbol-combo-list {
    list-style: none; margin: 8px 0 0; padding: 0; max-height: 360px; overflow-y: auto;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 2px 4px; align-content: start;
}
.symbol-combo-list li {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0;
    padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer;
}
.symbol-combo-list .coin-name { flex: 0 0 auto; min-width: 0; max-width: 62%; }    /* the name first, the pair gives way */
.symbol-combo-coin, .symbol-combo-pair { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.symbol-combo-list .symbol-combo-pair { flex: 0 1 auto; }
.symbol-combo-button .coin-name, .symbol-combo-button .symbol-combo-pair { flex: 0 1 auto; }
.symbol-combo-list li:hover, .symbol-combo-list li.is-active { background: var(--panel-3); }
.symbol-combo-list li[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--accent); }
/* a choice this level may not pick (owner, 2026-10-21): shown dimmed with its lock */
.symbol-combo-list li.is-locked { opacity: .55; cursor: not-allowed; }
.symbol-combo-list li.is-locked:hover { background: none; }
.symbol-combo-lock { color: var(--ink-dim); font-size: var(--fs-meta); white-space: nowrap; }
.symbol-combo-note { margin: 6px 8px 0; color: var(--ink-faint); font-size: var(--fs-meta); }
@media (max-width: 640px) {
    .symbol-combo { min-width: 0; width: 100%; }
}
