/* ============================================================================
   HINOVEST — Components (calm institutional)
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
body {
    margin: 0;
    background: var(--color-void);
    color: var(--color-text-primary);
    font-family: var(--font-display);
    font-size: var(--text-base);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv05" 1, "ss01" 1;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

/* Mono numerals everywhere financial */
.mono, .num {
    font-family: var(--font-mono);
    font-feature-settings: "tnum" 1, "zero" 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

::selection { background: var(--color-accent-muted); }

/* Scrollbars — quiet */
* { scrollbar-width: thin; scrollbar-color: var(--color-border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
    background: var(--color-border-mid);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: var(--radius-pill);
}
*::-webkit-scrollbar-thumb:hover { background: var(--color-border-strong); background-clip: padding-box; }

/* Universal focus-visible — high visibility, accessible */
:focus-visible {
    outline: none;
    box-shadow: var(--ring-focus);
    border-radius: var(--radius-sm);
}

/* Inputs that live INSIDE a styled pill (search boxes, tag fields): the universal ring
 * above draws a hard 4px halo around the bare input, stranded inside its own container.
 * Ring the pill instead — the treatment .tag-field already used. */
.topbar__search input:focus-visible,
.toolbar__search input:focus-visible,
.settings-filter input:focus-visible,
.tag-field input:focus-visible { box-shadow: none; }

.topbar__search,
.toolbar__search,
.settings-filter { transition: border-color 130ms ease, box-shadow 130ms ease, background 130ms ease; }
.topbar__search:hover,
.toolbar__search:hover,
.settings-filter:hover { border-color: var(--color-border-mid); }
.topbar__search:focus-within,
.toolbar__search:focus-within,
.settings-filter:focus-within {
    border-color: var(--color-accent-border);
    box-shadow: 0 0 0 3px var(--color-accent-muted);
    background: var(--color-surface-2);
}

/* ============================================================================
   SHELL
   ============================================================================ */
.shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--sidebar-w);
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-3);
    background: var(--color-surface-0);
    border-inline-end: 1px solid var(--color-border-subtle);
    transition: width 140ms cubic-bezier(0.22, 1, 0.36, 1);
}
.shell.is-collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 40px;
    padding: 0 var(--space-2);
    margin-bottom: var(--space-2);
    overflow: hidden;
}
.brand__mark {
    flex: 0 0 30px;
    width: 30px; height: 30px;
    border-radius: 8px;
    display: grid; place-items: center;
    background: linear-gradient(160deg, var(--color-accent-glow), var(--color-accent-deep));
    color: var(--color-accent-ink);
    font-weight: var(--weight-bold);
    font-size: 15px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}
.brand__word {
    font-weight: var(--weight-bold);
    font-size: var(--text-md);
    letter-spacing: 0.14em;
    white-space: nowrap;
    background: linear-gradient(180deg, var(--color-accent-glow), var(--color-accent-deep));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.shell.is-collapsed .brand__word { opacity: 0; pointer-events: none; }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav__label {
    padding: var(--space-4) var(--space-3) var(--space-2);
    color: var(--color-text-tertiary);
    font-size: var(--text-2xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}
.shell.is-collapsed .nav__label { height: 12px; padding-block: 8px 4px; color: transparent; }

.nav__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 36px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    cursor: pointer;
    white-space: nowrap;
    transition: background 110ms ease, color 110ms ease;
}
.nav__item .ico { flex: 0 0 18px; width: 18px; text-align: center; font-size: 16px; opacity: 0.85; }
.nav__item span:not(.ico) { overflow: hidden; }
.shell.is-collapsed .nav__item span:not(.ico) { opacity: 0; }
.nav__item:hover { background: var(--color-surface-2); color: var(--color-text-primary); }
.nav__item.is-active { background: var(--color-accent-muted); color: var(--color-accent-glow); }
.nav__item.is-active .ico { opacity: 1; }
.nav__item.is-active::before {
    content: ""; position: absolute;
    inset-block: 8px; inset-inline-start: 0;
    width: 3px; border-radius: var(--radius-pill);
    background: var(--color-accent-primary);
}
.nav__badge {
    margin-inline-start: auto;
    min-width: 20px; height: 18px; padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--color-surface-3);
    color: var(--color-text-secondary);
    font-size: var(--text-2xs); font-weight: var(--weight-semibold);
    display: grid; place-items: center;
}
.shell.is-collapsed .nav__badge { display: none; }

.sidebar__spacer { flex: 1; }

.userpill {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--radius);
    border: 1px solid var(--color-border-subtle);
    background: var(--color-surface-1);
    overflow: hidden;
}
.userpill__avatar {
    flex: 0 0 32px; width: 32px; height: 32px;
    border-radius: var(--radius-pill);
    display: grid; place-items: center;
    background: var(--color-surface-3);
    color: var(--color-text-primary);
    font-weight: var(--weight-semibold); font-size: var(--text-sm);
}
/* flex: 1 so the name block absorbs the free space and the logout button lands at the
   pill's trailing edge instead of hugging the text. */
/* ---- Global search dropdown ---- */
.topbar__search-wrap { position: relative; display: flex; min-width: 0; }
.search-results {
    position: absolute; top: calc(100% + 6px); inset-inline-start: 0;
    width: min(420px, 92vw); max-height: 62vh; overflow-y: auto; z-index: 1200;
    padding: var(--space-2);
    border: 1px solid var(--color-border-mid); border-radius: var(--radius);
    background: var(--color-surface-1); box-shadow: var(--shadow-float);
}
.search-results__empty { margin: 0; padding: var(--space-3); font-size: var(--text-sm); color: var(--color-text-tertiary); }
.search-group + .search-group { margin-top: var(--space-2); border-top: 1px solid var(--color-border-subtle); padding-top: var(--space-2); }
.search-group__head {
    display: flex; align-items: center; gap: 6px; padding: 4px var(--space-2);
    font-size: var(--text-2xs); font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--color-text-tertiary);
}
.search-group__head span { margin-inline-start: auto; font-family: var(--font-mono); font-weight: 500; }
.search-hit {
    display: flex; flex-direction: column; gap: 1px;
    padding: 6px var(--space-2); border-radius: var(--radius-sm);
    text-decoration: none; color: var(--color-text-primary);
}
.search-hit:hover, .search-hit.is-cursor { background: var(--color-accent-muted); }
.search-hit__label { font-size: var(--text-sm); }
.search-hit__sub { font-size: var(--text-2xs); color: var(--color-text-tertiary); }

.userpill__meta { flex: 1; min-width: 0; overflow: hidden; }
.userpill__logout { flex: none; margin-inline-start: auto; }
.userpill__meta strong { display: block; font-size: var(--text-sm); font-weight: var(--weight-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userpill__meta span { display: block; font-size: var(--text-xs); color: var(--color-text-tertiary); white-space: nowrap; }
.shell.is-collapsed .userpill__meta { display: none; }

/* ---- Main column ---- */
.main {
    flex: 1;
    min-width: 0;
    margin-inline-start: var(--sidebar-w);
    transition: margin-inline-start 140ms cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
}
.shell.is-collapsed .main { margin-inline-start: var(--sidebar-w-collapsed); }

/* ---- Topbar ---- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: var(--space-3);
    padding: 0 var(--space-5);
    background: color-mix(in srgb, var(--color-void) 88%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--color-border-subtle);
}
.topbar__toggle {
    width: 32px; height: 32px; flex: 0 0 32px;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    background: transparent; color: var(--color-text-secondary);
    display: grid; place-items: center; cursor: pointer;
    transition: background 110ms ease, color 110ms ease, border-color 110ms ease;
}
.topbar__toggle:hover { background: var(--color-surface-2); color: var(--color-text-primary); }

.crumb { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--color-text-tertiary); }
.crumb b { color: var(--color-text-primary); font-weight: var(--weight-semibold); }
.crumb .sep { opacity: 0.5; }

.topbar__search {
    display: flex; align-items: center; gap: var(--space-2);
    width: min(320px, 30vw);
    height: 34px; padding: 0 var(--space-3);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    background: var(--color-surface-1);
    color: var(--color-text-tertiary);
    margin-inline-start: var(--space-4);
}
.topbar__search input {
    flex: 1; min-width: 0; border: 0; background: transparent;
    color: var(--color-text-primary); font-size: var(--text-sm); outline: none;
}
.topbar__search kbd {
    flex: none;
    font-family: var(--font-mono); font-size: 10px; line-height: 1.6;
    padding: 1px 6px; border-radius: 5px;
    border: 1px solid var(--color-border-subtle);
    background: var(--color-surface-inset);
    color: var(--color-text-tertiary);
    transition: opacity 130ms ease;
}
/* The hint has served its purpose once you are typing in the box. */
.topbar__search:focus-within kbd { opacity: 0; }
.topbar__search .bi-search { color: var(--color-text-tertiary); transition: color 130ms ease; }
.topbar__search:focus-within .bi-search { color: var(--color-accent-glow); }
.topbar__spacer { flex: 1; }

/* ---- Workspace tabs ---- */
.tabs {
    display: flex; align-items: center; gap: var(--space-1);
    padding: var(--space-2) var(--space-5) 0;
    border-bottom: 1px solid var(--color-border-subtle);
    overflow-x: auto;
    background: var(--color-void);
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    position: relative;
    display: inline-flex; align-items: center; gap: var(--space-2);
    height: 38px; padding: 0 var(--space-3);
    border: 0; background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--text-sm); font-weight: var(--weight-medium);
    cursor: pointer; white-space: nowrap;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: color 110ms ease, background 110ms ease;
}
.tab .ico { font-size: 14px; opacity: 0.7; }
.tab:hover { color: var(--color-text-primary); background: var(--color-surface-1); }
.tab.is-active { color: var(--color-text-primary); }
.tab.is-active::after {
    content: ""; position: absolute;
    inset-inline: 6px; bottom: -1px; height: 2px;
    background: var(--color-accent-primary); border-radius: 2px 2px 0 0;
}
.tab__close {
    width: 16px; height: 16px; padding: 0; border: 0; border-radius: 4px;
    background: transparent; color: var(--color-text-tertiary);
    display: grid; place-items: center; cursor: pointer; font-size: 13px; line-height: 1;
    opacity: 0; transition: opacity 110ms ease, background 110ms ease;
}
.tab:hover .tab__close, .tab.is-active .tab__close { opacity: 1; }
.tab__close:hover { background: var(--color-surface-3); color: var(--color-text-primary); }

/* ---- Content scroll region ---- */
.content {
    flex: 1;
    padding: var(--space-6) var(--space-5) var(--space-12);
    max-width: 1480px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================================================
   PAGE HEADER
   ============================================================================ */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: var(--space-4); flex-wrap: wrap;
    margin-bottom: var(--space-6);
}
.page-head__eyebrow {
    display: inline-flex; align-items: center; gap: var(--space-2);
    color: var(--color-text-tertiary);
    font-size: var(--text-xs); font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider); text-transform: uppercase;
    margin-bottom: var(--space-2);
}
.page-head__eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-profit); }
.page-head h1 { margin: 0; font-size: var(--text-3xl); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); }
.page-head__sub { margin: var(--space-2) 0 0; color: var(--color-text-secondary); font-size: var(--text-sm); max-width: 60ch; }
.page-head__actions { display: flex; align-items: center; gap: var(--space-2); }

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    height: 36px; padding: 0 var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: var(--text-sm); font-weight: var(--weight-semibold);
    cursor: pointer; white-space: nowrap; user-select: none;
    transition: background 110ms ease, color 110ms ease, border-color 110ms ease, box-shadow 110ms ease;
}
.btn .ico { font-size: 15px; }
.btn--primary { background: var(--color-accent-primary); color: var(--color-accent-ink); }
.btn--primary:hover { background: var(--color-accent-glow); }
.btn--primary:active { background: var(--color-accent-deep); }
.btn--ghost { background: transparent; color: var(--color-text-secondary); border-color: var(--color-border-mid); }
.btn--ghost:hover { background: var(--color-surface-2); color: var(--color-text-primary); border-color: var(--color-border-strong); }
.btn--subtle { background: var(--color-surface-2); color: var(--color-text-primary); }
.btn--subtle:hover { background: var(--color-surface-3); }
.btn--danger { background: var(--color-loss-muted); color: var(--color-loss); border-color: transparent; }
.btn--danger:hover { background: color-mix(in srgb, var(--color-loss) 18%, transparent); }
.btn--sm { height: 30px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.iconbtn {
    width: 34px; height: 34px; flex: 0 0 34px;
    display: grid; place-items: center;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    background: var(--color-surface-1); color: var(--color-text-secondary);
    cursor: pointer; font-size: 16px;
    transition: background 110ms ease, color 110ms ease, border-color 110ms ease;
}
.iconbtn:hover { background: var(--color-surface-2); color: var(--color-text-primary); border-color: var(--color-border-mid); }
.iconbtn.is-active { background: var(--color-accent-muted); color: var(--color-accent-glow); border-color: var(--color-accent-border); }

/* segmented control */
.segment {
    display: inline-flex; padding: 3px;
    background: var(--color-surface-1);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    gap: 2px;
}
.segment button {
    height: 26px; padding: 0 var(--space-3); border: 0; border-radius: 5px;
    background: transparent; color: var(--color-text-secondary);
    font-size: var(--text-xs); font-weight: var(--weight-semibold); cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background 110ms ease, color 110ms ease;
}
.segment button:hover { color: var(--color-text-primary); }
.segment button.is-active { background: var(--color-surface-3); color: var(--color-text-primary); }

/* ============================================================================
   CARDS
   ============================================================================ */
.card {
    background: var(--color-surface-1);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}
.card__head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: var(--space-4); padding: var(--space-5) var(--space-5) 0;
}
.card__eyebrow {
    color: var(--color-text-tertiary);
    font-size: var(--text-2xs); font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wider); text-transform: uppercase;
}
.card__head h3 { margin: 4px 0 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.card__head p { margin: 4px 0 0; color: var(--color-text-secondary); font-size: var(--text-sm); }
.card__body { padding: var(--space-5); }

/* ============================================================================
   KPI STRIP
   ============================================================================ */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--color-surface-1);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-5);
}
.kpi {
    padding: var(--space-5);
    border-inline-end: 1px solid var(--color-border-subtle);
    display: flex; flex-direction: column; gap: var(--space-3);
}
.kpi:last-child { border-inline-end: 0; }
.kpi__label {
    display: inline-flex; align-items: center; gap: var(--space-2);
    color: var(--color-text-secondary); font-size: var(--text-xs);
    font-weight: var(--weight-medium);
}
.kpi__label .ico { font-size: 14px; color: var(--color-text-tertiary); }
.kpi__value {
    font-family: var(--font-mono); font-size: var(--text-3xl);
    font-weight: var(--weight-semibold); line-height: 1;
    letter-spacing: var(--tracking-tight);
    font-variant-numeric: tabular-nums;
}
.kpi__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.kpi__delta {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: var(--text-xs); font-weight: var(--weight-semibold);
    font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.kpi__delta .ico { font-size: 13px; }
.kpi__hint { color: var(--color-text-tertiary); font-size: var(--text-2xs); }

/* spark */
.kpi__spark { height: 24px; width: 100%; display: block; }

/* ============================================================================
   SEMANTIC TEXT — never color alone (icon/sign accompany)
   ============================================================================ */
.is-pos { color: var(--color-profit); }
.is-neg { color: var(--color-loss); }
.is-warn { color: var(--color-warning); }
.is-info { color: var(--color-info); }
.muted { color: var(--color-text-secondary); }
.dim { color: var(--color-text-tertiary); }

/* badges */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    height: 22px; padding: 0 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-2xs); font-weight: var(--weight-semibold);
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.badge .ico { font-size: 12px; }
.badge--pos { background: var(--color-profit-muted); color: var(--color-profit); }
.badge--neg { background: var(--color-loss-muted); color: var(--color-loss); }
.badge--warn { background: var(--color-warning-muted); color: var(--color-warning); }
.badge--info { background: var(--color-info-muted); color: var(--color-info); }
.badge--neutral { background: var(--color-surface-3); color: var(--color-text-secondary); }
.badge--long { background: var(--color-profit-muted); color: var(--color-profit); }
.badge--short { background: var(--color-loss-muted); color: var(--color-loss); }
.badge--outline { background: transparent; border-color: var(--color-border-mid); color: var(--color-text-secondary); }

/* ============================================================================
   EQUITY CHART
   ============================================================================ */
.chart-wrap { position: relative; }
.chart-svg { width: 100%; height: 300px; display: block; overflow: visible; }
.chart-grid line { stroke: var(--chart-grid); stroke-width: 1; }
.chart-axis text { fill: var(--chart-axis); font-family: var(--font-mono); font-size: 11px; }
.chart-area { fill: url(#equityFill); }
.chart-line { fill: none; stroke: var(--color-accent-primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--color-surface-1); stroke: var(--color-accent-primary); stroke-width: 2; }
.chart-cursor { stroke: var(--color-border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip {
    position: absolute; pointer-events: none; z-index: 5;
    padding: 8px 10px; border-radius: var(--radius-sm);
    background: var(--color-surface-3);
    border: 1px solid var(--color-border-mid);
    box-shadow: var(--shadow-float);
    font-size: var(--text-xs); white-space: nowrap;
    transform: translate(-50%, -120%); transition: opacity 90ms ease; opacity: 0;
}
.chart-tip b { font-family: var(--font-mono); font-size: var(--text-sm); }

/* chart toolbar */
.chart-stat-row { display: flex; gap: var(--space-6); flex-wrap: wrap; margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border-subtle); }
.chart-stat { display: flex; flex-direction: column; gap: 2px; }
.chart-stat .k { color: var(--color-text-tertiary); font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.chart-stat .v { font-family: var(--font-mono); font-size: var(--text-md); font-weight: var(--weight-semibold); }

/* ============================================================================
   GRID HELPERS
   ============================================================================ */
.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--space-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--space-5); }
.stack { display: grid; gap: var(--space-5); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(300px, 1fr); gap: var(--space-5); align-items: start; }

/* metric group */
.metric-list { display: grid; gap: 1px; background: var(--color-border-subtle); border-radius: var(--radius); overflow: hidden; }
.metric-row {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface-1);
}
.metric-row__k { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--color-text-secondary); font-size: var(--text-sm); }
.metric-row__k .ico { color: var(--color-text-tertiary); font-size: 14px; }
.metric-row__v { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }

/* ---- Global loading overlay (long-running full-page actions) -------------- */
.app-loading {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--color-void) 60%, transparent);
    backdrop-filter: blur(2px);
}
.app-loading[hidden] { display: none; }
.app-loading__card {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--color-border-mid); border-radius: var(--radius);
    background: var(--color-surface-1); box-shadow: var(--shadow-float);
}
.app-loading__msg { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text-primary); }
.app-loading__spinner {
    width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
    border: 2.5px solid var(--color-border-strong);
    border-top-color: var(--color-accent-primary);
    animation: app-loading-spin 0.7s linear infinite;
}
@keyframes app-loading-spin { to { transform: rotate(360deg); } }
button.is-loading, .btn.is-loading { opacity: 0.7; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .app-loading__spinner { animation-duration: 1.6s; } }

/* ============================================================================
   RULE WARNING (trades table)
   ============================================================================ */
/* One line from the warning system. Clipped to the column: the whole point is
   to notice it at a glance, and the title attribute carries the full text. */
.trade-warn {
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--color-loss); font-size: var(--text-xs);
}
.trade-warn .bi { flex: none; }
