/* ===== NeatStocks AI — App Shell ===== */

:root {
    --color-bg: #061018;
    --color-surface: #0f1b24;
    --color-surface-hover: #152634;
    --color-surface-raised: #172b39;
    --color-border: #203847;
    --color-border-strong: #33566d;
    --color-text: #e4edf2;
    --color-text-muted: #8da2b1;
    --color-accent: #6fd3ff;
    --color-accent-hover: #97e4ff;
    --color-success: #62d2a2;
    --color-warning: #ffbf69;
    --color-danger: #ff8d7a;
    --color-gold: #f0c36a;
    --shell-scrollbar-track: rgba(7, 17, 26, 0.82);
    --shell-scrollbar-thumb: rgba(74, 118, 143, 0.96);
    --shell-scrollbar-thumb-hover: rgba(99, 169, 205, 0.96);
    --shell-scrollbar-thumb-active: rgba(135, 216, 250, 0.98);
    --shell-scrollbar-thumb-border: rgba(11, 21, 29, 0.92);
    --sidebar-width: 304px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-surface: 0 20px 45px rgba(2, 10, 16, 0.35);
    --font-family: 'Segoe UI', 'Trebuchet MS', Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background-color: #061018;
    background:
        radial-gradient(circle at top left, rgba(111, 211, 255, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(240, 195, 106, 0.08), transparent 22%),
        linear-gradient(180deg, #07111a 0%, #08131c 45%, #061018 100%);
    overflow: hidden;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    color: var(--color-accent-hover);
}

/* ===== Layout ===== */

.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #061018;
    overflow: hidden;
}

/* ===== Shell ===== */

.workstation-body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
}

.app-shell {
    grid-column: 2;
    grid-row: 1;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    position: relative;
    overflow: hidden;
}

.app-main {
    padding: 16px 20px 18px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.app-main__inner {
    max-width: 1480px;
    margin: 0 auto;
    min-width: 0;
    min-height: 100%;
}

/* ===== Shell Scrollbars ===== */

.app-main,
.app-sidebar__nav {
    scrollbar-width: thin;
    scrollbar-color: var(--shell-scrollbar-thumb) var(--shell-scrollbar-track);
}

.app-main::-webkit-scrollbar,
.app-sidebar__nav::-webkit-scrollbar {
    width: 12px;
}

.app-main::-webkit-scrollbar-track,
.app-sidebar__nav::-webkit-scrollbar-track {
    background: var(--shell-scrollbar-track);
    border-radius: 999px;
}

.app-main::-webkit-scrollbar-thumb,
.app-sidebar__nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--shell-scrollbar-thumb) 0%, rgba(51, 86, 109, 0.98) 100%);
    border: 2px solid var(--shell-scrollbar-thumb-border);
    border-radius: 999px;
}

.app-main::-webkit-scrollbar-thumb:hover,
.app-sidebar__nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--shell-scrollbar-thumb-hover) 0%, rgba(79, 137, 168, 0.98) 100%);
}

.app-main::-webkit-scrollbar-thumb:active,
.app-sidebar__nav::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, var(--shell-scrollbar-thumb-active) 0%, rgba(101, 186, 224, 0.98) 100%);
}

.app-main::-webkit-scrollbar-corner,
.app-sidebar__nav::-webkit-scrollbar-corner {
    background: transparent;
}

/* ===== Header ===== */

.app-header {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 620px);
    align-items: center;
    gap: 14px;
    padding: 16px 24px 14px;
    background: rgba(10, 20, 29, 0.96);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 14px 30px rgba(2, 10, 16, 0.18);
    overflow: hidden;
}

.app-header__scope {
    min-width: 0;
}

.app-header__eyebrow {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.app-header__scope-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.app-header__context-note {
    margin-top: 6px;
    max-width: 520px;
    font-size: 12px;
    color: var(--color-warning);
}

.app-header__controls {
    min-width: 0;
    width: 100%;
    max-width: 620px;
    justify-self: end;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
    gap: 10px;
    align-items: stretch;
}

.command-search {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    width: 100%;
    min-height: 52px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(111, 211, 255, 0.18);
    background: rgba(15, 27, 36, 0.85);
    color: var(--color-text-muted);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.command-search__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.command-search__hint {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
}

.workspace-pill--context {
    color: var(--color-gold);
    border-color: rgba(240, 195, 106, 0.22);
    background: rgba(240, 195, 106, 0.08);
}

.header-context {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(15, 27, 36, 0.86);
    border: 1px solid var(--color-border);
}

.header-context__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

.header-context__value {
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-context__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--color-text-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-context__separator {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--color-border-strong);
    flex-shrink: 0;
}

.context-control {
    display: grid;
    gap: 6px;
    min-width: 210px;
    padding: 7px 10px;
    background: rgba(15, 27, 36, 0.86);
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

.context-control__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
}

.context-control__row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.context-select {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(6, 16, 24, 0.92);
    color: var(--color-text);
    font: inherit;
}

.context-select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(111, 211, 255, 0.12);
}

.context-submit {
    padding: 7px 10px;
    border: 1px solid rgba(111, 211, 255, 0.24);
    border-radius: 8px;
    background: rgba(111, 211, 255, 0.08);
    color: var(--color-accent);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.context-submit:hover {
    border-color: rgba(111, 211, 255, 0.4);
    color: var(--color-accent-hover);
}

.context-submit:disabled,
.context-select:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.context-control__helper {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.45;
}

/* ===== Sidebar ===== */

.app-sidebar {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    background:
        linear-gradient(180deg, rgba(15, 27, 36, 0.98) 0%, rgba(11, 21, 29, 0.98) 100%),
        var(--color-surface);
    border-right: 1px solid var(--color-border);
    overflow: hidden;
    padding: 16px 14px 14px;
}

.app-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 6px 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(51, 86, 109, 0.45);
}

.app-sidebar__brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #021018;
    background: linear-gradient(135deg, var(--color-accent), #d9f8ff);
}

.app-sidebar__brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.app-sidebar__brand-subtitle {
    font-size: 12px;
    color: var(--color-text-muted);
}

.app-sidebar__nav {
    padding: 4px 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    overflow-anchor: none;
    scrollbar-gutter: stable;
}

html.ns-rail-preload .app-sidebar__nav {
    visibility: hidden;
}

html.ns-rail-preload .nav-section__items {
    transition: none !important;
}

.nav-section {
    margin-bottom: 6px;
}

/* Base .nav-section__label definition — overridden by Pass 20 button styles below */
.nav-section__label {
    padding: 0 8px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 40px;
    padding: 5px 12px;
    margin-bottom: 3px;
    font-size: 13px;
    color: var(--color-text-muted);
    border: 1px solid transparent;
    border-radius: 14px;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.nav-link:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    border-color: rgba(111, 211, 255, 0.14);
    transform: translateX(2px);
}

.nav-link--active {
    color: var(--color-text);
    background: linear-gradient(90deg, rgba(111, 211, 255, 0.12), rgba(15, 27, 36, 0.88));
    border-color: rgba(111, 211, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(111, 211, 255, 0.06);
}

.nav-link__icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--color-accent);
    background: rgba(111, 211, 255, 0.10);
    border: 1px solid rgba(111, 211, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
}

.nav-link__content {
    flex: 1;
    font-weight: 600;
}

.nav-link__status {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.nav-link--active .nav-link__icon {
    color: #f7fcff;
    background: rgba(111, 211, 255, 0.18);
    border-color: rgba(111, 211, 255, 0.22);
}

.nav-link__status--live {
    color: var(--color-success);
}

.nav-link__status--foundation {
    color: var(--color-warning);
}

/* ===== Main Content ===== */

.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

/* ===== Cards ===== */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 14px;
}

.card__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card__subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

/* ===== Dashboard Grid ===== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

/* ===== Portfolio View ===== */

.user-group {
    margin-bottom: 32px;
}

.user-group__header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.user-group__name {
    font-size: 18px;
    font-weight: 700;
}

.user-group__email {
    font-size: 13px;
    color: var(--color-text-muted);
}

.persona-group {
    margin-left: 16px;
    margin-bottom: 20px;
}

.persona-group__header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.persona-group__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-accent);
}

.persona-group__desc {
    font-size: 13px;
    color: var(--color-text-muted);
}

.portfolio-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-left: 8px;
}

.portfolio-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.15s;
}

.portfolio-card:hover {
    border-color: var(--color-accent);
}

.portfolio-card__name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.portfolio-card__desc {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.portfolio-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge--active {
    background: rgba(52, 211, 153, 0.15);
    color: var(--color-success);
}

.badge--inactive {
    background: rgba(139, 143, 163, 0.15);
    color: var(--color-text-muted);
}

.badge--strategy {
    background: rgba(79, 143, 247, 0.12);
    color: var(--color-accent);
}

.badge--transaction-buy {
    background: rgba(52, 211, 153, 0.12);
    color: var(--color-success);
}

.badge--transaction-sell {
    background: rgba(248, 113, 113, 0.12);
    color: var(--color-danger);
}

/* ===== Empty State ===== */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-text-muted);
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

/* ===== 404 ===== */

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    text-align: center;
}

.error-page__code {
    font-size: 64px;
    font-weight: 800;
    color: var(--color-text-muted);
    opacity: 0.3;
}

.error-page__message {
    font-size: 18px;
    color: var(--color-text-muted);
    margin-top: 8px;
}

/* ===== Portfolio Card Link ===== */

a.portfolio-card--link {
    display: block;
    color: inherit;
    text-decoration: none;
}

a.portfolio-card--link:hover {
    color: inherit;
}

/* ===== Buttons ===== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
}

.btn--secondary {
    background: var(--color-surface);
    color: var(--color-text-muted);
}

.btn--secondary:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    border-color: var(--color-accent);
}

.btn--primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.btn--primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: #fff;
}

/* ===== Portfolio Detail ===== */

.portfolio-detail__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.portfolio-detail__meta {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.portfolio-detail__desc {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 6px;
    max-width: 600px;
}

.portfolio-detail__note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--color-text-muted);
    max-width: 720px;
}

.asset-detail__note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--color-text-muted);
    max-width: 720px;
}

/* ===== Summary Cards ===== */

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.summary-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px 20px;
}

.summary-card__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.summary-card__value {
    font-size: 22px;
    font-weight: 700;
}

.summary-card__pct {
    font-size: 13px;
    font-weight: 500;
}

.summary-card__meta {
    margin-top: 8px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.summary-card--gain {
    border-color: rgba(52, 211, 153, 0.3);
}

.summary-card--gain .summary-card__value {
    color: var(--color-success);
}

.summary-card--loss {
    border-color: rgba(248, 113, 113, 0.3);
}

.summary-card--loss .summary-card__value {
    color: var(--color-danger);
}

/* ===== Allocation Bars ===== */

.allocation-section {
    margin-bottom: 28px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.allocation-bar {
    display: flex;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.allocation-bar__segment {
    min-width: 4px;
    transition: opacity 0.15s;
}

.allocation-bar__segment:hover {
    opacity: 0.8;
}

.allocation-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.allocation-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.allocation-legend__dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* ===== Data Table ===== */

.holdings-section {
    margin-bottom: 28px;
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--color-surface-hover);
}

.data-table tfoot td {
    background: var(--color-surface);
    border-top: 2px solid var(--color-border);
    border-bottom: none;
}

.text-right {
    text-align: right;
}

.text--gain {
    color: var(--color-success);
}

.text--loss {
    color: var(--color-danger);
}

.holdings__symbol {
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 0.02em;
}

.table-cell__meta {
    margin-top: 4px;
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ===== Asset Type Badges ===== */

.badge--type-equity {
    background: rgba(79, 143, 247, 0.12);
    color: #4a9eff;
}

.badge--type-etf {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
}

.badge--type-crypto {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.badge--type-bond {
    background: rgba(167, 139, 250, 0.12);
    color: #a78bfa;
}

.badge--type-mutual_fund {
    background: rgba(244, 114, 182, 0.12);
    color: #f472b6;
}

/* ===== Watchlists ===== */

.watchlist-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    margin-left: 8px;
}

.watchlist-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.15s, transform 0.15s;
}

.watchlist-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-1px);
}

a.watchlist-card--link {
    display: block;
    color: inherit;
    text-decoration: none;
}

a.watchlist-card--link:hover {
    color: inherit;
}

.watchlist-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.watchlist-card__name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.watchlist-card__desc {
    font-size: 13px;
    color: var(--color-text-muted);
}

.watchlist-card__meta {
    margin-top: 10px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.watchlist-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.watchlist-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(79, 143, 247, 0.08);
    border: 1px solid rgba(79, 143, 247, 0.18);
    color: var(--color-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mini-composition-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    margin-bottom: 10px;
}

.mini-composition-bar__segment {
    min-width: 6px;
}

.mini-composition-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.mini-composition-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mini-composition-legend__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.watchlist-item__subtext {
    color: var(--color-text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.watchlist-thesis-cell {
    min-width: 280px;
}

.badge--conviction-high {
    background: rgba(52, 211, 153, 0.12);
    color: var(--color-success);
}

.badge--conviction-medium {
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warning);
}

.badge--conviction-low {
    background: rgba(139, 143, 163, 0.15);
    color: var(--color-text-muted);
}

.badge--status-ready {
    background: rgba(52, 211, 153, 0.12);
    color: var(--color-success);
}

.badge--status-researching {
    background: rgba(79, 143, 247, 0.12);
    color: var(--color-accent);
}

.badge--status-watching {
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warning);
}

.badge--status-paused {
    background: rgba(139, 143, 163, 0.15);
    color: var(--color-text-muted);
}

/* ===== Asset Detail ===== */

.asset-link {
    color: var(--color-accent);
    text-decoration: none;
}

.asset-link:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

.asset-link--muted {
    color: var(--color-text);
}

.asset-link--muted:hover {
    color: var(--color-accent-hover);
}

.asset-detail__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.asset-detail__eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.asset-detail__title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.asset-detail__name {
    font-size: 18px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.asset-detail__meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.asset-detail__meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.asset-detail__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.asset-detail__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 20px;
}

.asset-detail__panel {
    min-width: 0;
}

.asset-detail__watchlist-stack {
    display: grid;
    gap: 12px;
}

.asset-detail__watchlist-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px 16px;
}

.asset-detail__watchlist-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.asset-detail__watchlist-name {
    font-size: 14px;
    font-weight: 600;
}

.asset-detail__watchlist-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.asset-detail__thesis {
    color: var(--color-text);
    margin-bottom: 6px;
}

.empty-state--compact {
    padding: 24px 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.notice {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-size: 13px;
}

.notice--success {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.25);
    color: var(--color-success);
}

.notice--error {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.25);
    color: var(--color-danger);
}

.transaction-form {
    display: grid;
    gap: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.form-field {
    display: grid;
    gap: 6px;
}

.form-field--full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(79, 143, 247, 0.12);
}

.form-textarea {
    resize: vertical;
    min-height: 92px;
}

.form-field--error .form-input,
.form-field--error .form-select,
.form-field--error .form-textarea {
    border-color: rgba(248, 113, 113, 0.6);
}

.form-error {
    font-size: 12px;
    color: var(--color-danger);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== Workstation Surfaces ===== */

.card {
    background: linear-gradient(180deg, rgba(20, 35, 46, 0.94) 0%, rgba(14, 25, 34, 0.94) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-surface);
}

.summary-card {
    background: linear-gradient(180deg, rgba(20, 35, 46, 0.94) 0%, rgba(14, 25, 34, 0.92) 100%);
    border-radius: 16px;
    box-shadow: var(--shadow-surface);
}

.table-wrap {
    border-radius: 16px;
}

.workstation-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px;
    margin-bottom: 24px;
    border: 1px solid rgba(111, 211, 255, 0.18);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(111, 211, 255, 0.1), transparent 38%),
        linear-gradient(180deg, rgba(20, 35, 46, 0.96) 0%, rgba(12, 23, 31, 0.96) 100%);
    box-shadow: var(--shadow-surface);
}

.workstation-hero--compact {
    padding: 20px 22px;
}

.workstation-hero__eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.workstation-hero__title {
    margin-bottom: 10px;
}

.workstation-hero__lead {
    max-width: 860px;
    color: var(--color-text-muted);
    font-size: 14px;
}

.workstation-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.workspace-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.03);
}

.workspace-pill--live {
    color: var(--color-success);
    border-color: rgba(98, 210, 162, 0.24);
    background: rgba(98, 210, 162, 0.08);
}

.workspace-pill--foundation {
    color: var(--color-warning);
    border-color: rgba(255, 191, 105, 0.24);
    background: rgba(255, 191, 105, 0.08);
}

.workstation-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
    gap: 18px;
}

.workstation-grid--detail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workstation-panel {
    min-width: 0;
}

.workstation-panel--wide {
    grid-column: 1 / -1;
}

.surface-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.surface-tile {
    display: block;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(12, 25, 34, 0.88);
    color: var(--color-text);
}

.surface-tile--link:hover {
    color: var(--color-text);
    border-color: rgba(111, 211, 255, 0.28);
    transform: translateY(-2px);
}

.surface-tile__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.surface-tile__title {
    font-size: 15px;
    font-weight: 700;
}

.surface-tile__text {
    color: var(--color-text-muted);
    font-size: 13px;
}

.workstation-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.workstation-context-panel__grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.95fr) minmax(320px, 1.05fr);
    gap: 14px;
    align-items: start;
}

.workstation-context-panel__summary {
    display: grid;
    gap: 12px;
}

.workstation-context-panel__card {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(12, 25, 34, 0.88);
}

.workstation-context-panel__eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.workstation-context-panel__title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.workstation-context-panel__meta {
    font-size: 13px;
    color: var(--color-text-muted);
}

.workstation-context-panel__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.workstation-context-panel__fact {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(12, 25, 34, 0.88);
}

.workstation-context-panel__fact-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.workstation-context-panel__fact-value {
    font-size: 13px;
    color: var(--color-text);
}

.workstation-context-panel__controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.workstation-context-panel__controls .context-control {
    min-width: 0;
    height: 100%;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.focus-card {
    display: block;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(12, 25, 34, 0.88);
    color: var(--color-text);
}

.focus-card--link:hover {
    color: var(--color-text);
    border-color: rgba(111, 211, 255, 0.28);
}

.focus-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.focus-card__title {
    font-size: 15px;
    font-weight: 700;
}

.focus-card__value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.focus-card__meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.metric-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.metric-strip--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-block {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(12, 25, 34, 0.88);
}

.metric-block--danger {
    border-color: rgba(255, 141, 122, 0.2);
}

.metric-block__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.metric-block__value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.insight-list {
    display: grid;
    gap: 10px;
}

.insight-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(12, 25, 34, 0.88);
}

.insight-row--stacked {
    align-items: stretch;
}

.insight-row__main {
    min-width: 0;
}

.insight-row__title {
    font-size: 14px;
    font-weight: 700;
}

.insight-row__meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.insight-row__aside {
    flex-shrink: 0;
    text-align: right;
}

.chip-row,
.radar-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.reason-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(111, 211, 255, 0.08);
    color: var(--color-text-muted);
}

.reason-chip--current {
    color: var(--color-success);
    border-color: rgba(98, 210, 162, 0.24);
    background: rgba(98, 210, 162, 0.08);
}

.reason-chip--lagging {
    color: var(--color-warning);
    border-color: rgba(255, 191, 105, 0.24);
    background: rgba(255, 191, 105, 0.08);
}

.reason-chip--missing {
    color: var(--color-danger);
    border-color: rgba(255, 141, 122, 0.24);
    background: rgba(255, 141, 122, 0.08);
}

.reason-chip--neutral {
    color: var(--color-text-muted);
}

.radar-rank {
    font-size: 16px;
    font-weight: 700;
}

.radar-table__asset {
    min-width: 220px;
}

.command-list {
    display: grid;
    gap: 10px;
}

.command-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(12, 25, 34, 0.88);
    color: var(--color-text);
}

.command-list__item:hover {
    color: var(--color-text);
    border-color: rgba(111, 211, 255, 0.26);
}

.command-list__label {
    font-weight: 600;
}

.command-list__arrow {
    color: var(--color-accent);
}

.fabric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.fabric-card {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(240, 195, 106, 0.12);
    background: rgba(12, 25, 34, 0.88);
}

.fabric-card__title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.fabric-card__desc {
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.workstation-list {
    display: grid;
    gap: 8px;
    padding-left: 18px;
    color: var(--color-text-muted);
}

.workstation-list li {
    line-height: 1.55;
}

.registry-filters {
    padding: 18px 20px;
    margin-bottom: 24px;
}

.provider-run-summary {
    margin-top: 14px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(12, 25, 34, 0.88);
}

.provider-run-summary__title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.provider-run-summary__meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.ops-command {
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(6, 16, 24, 0.92);
    color: var(--color-text);
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    word-break: break-word;
}

@media (max-width: 1180px) {
    .app-header {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .app-header__controls {
        max-width: none;
        justify-self: stretch;
    }
}

@media (max-width: 980px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .app-sidebar {
        grid-column: 1;
        grid-row: 1;
        height: auto;
        max-height: min(38vh, 360px);
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding-bottom: 16px;
    }

    .app-shell {
        grid-column: 1;
        grid-row: 2;
    }

    .app-footer {
        grid-column: 1;
        grid-row: 3;
    }

    .app-sidebar__nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
    }

    .nav-section {
        margin-bottom: 0;
        padding: 8px;
        border-radius: 14px;
        background: rgba(12, 25, 34, 0.7);
        border: 1px solid rgba(51, 86, 109, 0.22);
    }

    .app-header {
        padding: 16px 20px;
    }

    .app-header__controls {
        grid-template-columns: minmax(0, 1fr);
    }

    .context-control {
        width: 100%;
    }

    .app-main {
        padding: 18px 16px 22px;
    }

    .workspace-bar {
        padding: 6px 16px;
        gap: 10px;
    }

    .workspace-bar__tabs {
        gap: 6px;
    }

    .app-footer__body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-section--identity {
        grid-column: 1 / -1;
    }

    .workstation-hero {
        flex-direction: column;
    }

    .workstation-hero__badges {
        justify-content: flex-start;
    }

    .workstation-grid,
    .workstation-grid--detail {
        grid-template-columns: 1fr;
    }

    .workstation-context-panel__grid,
    .workstation-context-panel__controls,
    .workstation-context-panel__facts {
        grid-template-columns: 1fr;
    }

    .metric-strip,
    .metric-strip--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .insight-row {
        flex-direction: column;
    }

    .insight-row__aside {
        text-align: left;
    }

    .asset-detail__grid {
        grid-template-columns: 1fr;
    }

    .asset-detail__header {
        flex-direction: column;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 860px) {
    .app-header__controls {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .app-header,
    .workstation-hero,
    .card,
    .summary-card {
        padding-left: 16px;
        padding-right: 16px;
    }

    .app-sidebar {
        max-height: min(42vh, 360px);
    }

    .workspace-bar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .workspace-bar__label {
        height: 26px;
        padding: 0 10px;
    }

    .workspace-tab {
        min-height: 28px;
        padding: 0 10px 0 8px;
    }

    .app-footer__body {
        grid-template-columns: 1fr;
        padding: 8px 16px 12px;
    }

    .footer-section--identity {
        grid-column: auto;
    }

    .surface-grid,
    .fabric-grid,
    .focus-grid,
    .dashboard-grid,
    .summary-cards,
    .portfolio-list,
    .watchlist-list {
        grid-template-columns: 1fr;
    }

    .metric-strip,
    .metric-strip--four {
        grid-template-columns: 1fr;
    }

    .workstation-context-panel__facts {
        grid-template-columns: 1fr;
    }

    .context-control__row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===== Pass 12 � Event & Catalyst Styles ===== */

.event-type-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    background: rgba(111, 211, 255, 0.12);
    color: var(--color-accent);
    border: 1px solid rgba(111, 211, 255, 0.22);
}

.event-type-chip--earnings       { background: rgba(98, 210, 162, 0.12); color: #62d2a2; border-color: rgba(98, 210, 162, 0.25); }
.event-type-chip--dividend       { background: rgba(240, 195, 106, 0.12); color: var(--color-gold); border-color: rgba(240, 195, 106, 0.25); }
.event-type-chip--guidance       { background: rgba(111, 211, 255, 0.12); color: var(--color-accent); border-color: rgba(111, 211, 255, 0.25); }
.event-type-chip--analyst-revision { background: rgba(180, 150, 255, 0.12); color: #c4a3ff; border-color: rgba(180, 150, 255, 0.25); }
.event-type-chip--regulatory     { background: rgba(255, 141, 122, 0.12); color: var(--color-danger); border-color: rgba(255, 141, 122, 0.25); }
.event-type-chip--macro-note     { background: rgba(255, 191, 105, 0.12); color: var(--color-warning); border-color: rgba(255, 191, 105, 0.25); }
.event-type-chip--thesis-catalyst { background: rgba(98, 210, 162, 0.10); color: #7de8b8; border-color: rgba(98, 210, 162, 0.20); }
.event-type-chip--risk-alert     { background: rgba(255, 100, 80, 0.14); color: #ff8070; border-color: rgba(255, 100, 80, 0.28); }
.event-type-chip--note           { background: rgba(141, 162, 177, 0.12); color: var(--color-text-muted); border-color: rgba(141, 162, 177, 0.20); }

.event-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    background: rgba(141, 162, 177, 0.10);
    color: var(--color-text-muted);
}

.event-status-chip--upcoming   { background: rgba(111, 211, 255, 0.14); color: var(--color-accent); }
.event-status-chip--active     { background: rgba(98, 210, 162, 0.14); color: var(--color-success); }
.event-status-chip--completed  { background: rgba(141, 162, 177, 0.10); color: var(--color-text-muted); }
.event-status-chip--dismissed  { background: rgba(141, 162, 177, 0.06); color: rgba(141, 162, 177, 0.5); }
.event-status-chip--archived   { background: rgba(141, 162, 177, 0.06); color: rgba(141, 162, 177, 0.4); }

.event-importance-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    background: rgba(141, 162, 177, 0.10);
    color: var(--color-text-muted);
}

.event-importance-chip--1 { background: rgba(141, 162, 177, 0.10); color: var(--color-text-muted); }
.event-importance-chip--2 { background: rgba(255, 191, 105, 0.12); color: var(--color-warning); }
.event-importance-chip--3 { background: rgba(255, 100, 80, 0.14); color: var(--color-danger); }

.row--muted td { opacity: 0.72; }

.subsection-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    margin-top: 4px;
}

.btn--compact {
    padding: 4px 12px;
    font-size: 12px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.section-heading .section-title {
    margin-bottom: 0;
}

.section-heading__actions {
    margin-left: auto;
}

/* ======================================================
   Pass 13 � Benchmark, Performance Context, Concentration
   ====================================================== */

/* Benchmark chip */
.benchmark-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: rgba(74, 158, 255, 0.13);
    color: #4a9eff;
    border: 1px solid rgba(74, 158, 255, 0.22);
}
.benchmark-chip--symbol {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.22);
}
.benchmark-chip--sm {
    font-size: 10px;
    padding: 1px 6px;
}

/* Performance indicator */
.perf-indicator {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}
.perf-indicator--pos {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
}
.perf-indicator--neg {
    background: rgba(255, 80, 80, 0.12);
    color: #ff5050;
}

/* Summary card modifier for warn */
.summary-card--warn {
    border-color: rgba(255, 191, 105, 0.40);
    background: rgba(255, 191, 105, 0.06);
}
.summary-card__meta {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 4px;
}
.summary-card__value--sm {
    font-size: 1rem;
}

.visual-chart {
    border: 1px solid rgba(111, 211, 255, 0.14);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(12, 25, 34, 0.92), rgba(8, 17, 24, 0.92));
    padding: 16px;
}

.visual-chart__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.visual-chart__title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.visual-chart__subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.visual-chart__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.visual-chart__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(111, 211, 255, 0.12);
    font-size: 11px;
}

.visual-chart__legend-swatch {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
}

.visual-chart__legend-label {
    color: var(--color-text-muted);
}

.visual-chart__legend-value {
    color: var(--color-text);
    font-weight: 600;
}

.visual-chart__highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.visual-chart__highlight {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(111, 211, 255, 0.10);
    background: rgba(255, 255, 255, 0.03);
}

.visual-chart__highlight-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.visual-chart__highlight-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.visual-chart__frame {
    overflow-x: auto;
}

.visual-chart__svg {
    width: 100%;
    min-height: 252px;
    display: block;
}

.visual-chart__grid-line {
    stroke: rgba(111, 211, 255, 0.10);
    stroke-width: 1;
}

.visual-chart__baseline {
    stroke: rgba(245, 166, 35, 0.35);
    stroke-width: 1.5;
    stroke-dasharray: 4 6;
}

.visual-chart__series-area {
    opacity: 0.95;
}

.visual-chart__series-line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.visual-chart__point {
    stroke: rgba(7, 17, 26, 0.92);
    stroke-width: 2.5;
}

.visual-chart__guide-label,
.visual-chart__axis-label {
    fill: var(--color-text-muted);
    font-size: 10px;
}

.visual-chart__note {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--color-text-muted);
}

/* Benchmark panel � performance context section on portfolio detail */
.benchmark-panel {
    margin-bottom: 32px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    border-radius: 16px;
    background: rgba(12, 25, 34, 0.88);
    padding: 24px;
}
.benchmark-panel__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.benchmark-panel__header .section-title {
    margin-bottom: 0;
}
.benchmark-panel__note {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-left: auto;
}
.benchmark-panel__chart {
    margin-bottom: 18px;
}
.benchmark-panel__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.benchmark-panel__block {
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(111, 211, 255, 0.10);
    background: rgba(255, 255, 255, 0.03);
}
.benchmark-panel__block--warn {
    border-color: rgba(255, 191, 105, 0.30);
    background: rgba(255, 191, 105, 0.04);
}
.benchmark-panel__block-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    text-transform: uppercase;
    margin-bottom: 10px;
}
.benchmark-panel__proxy {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.benchmark-panel__desc {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}
.benchmark-panel__price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.benchmark-panel__price {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
}
.benchmark-panel__date {
    font-size: 11px;
    color: var(--color-text-muted);
}
.benchmark-panel__provisional {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 10px;
    line-height: 1.6;
    border-left: 2px solid rgba(74, 158, 255, 0.25);
    padding-left: 10px;
}
.benchmark-panel__no-data {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 10px;
}

/* Concentration warning */
.concentration-warning {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-warning);
    margin-bottom: 12px;
}

/* Concentration bars */
.concentration-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.concentration-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.concentration-bar-label {
    font-size: 11px;
    color: var(--color-text-muted);
    min-width: 96px;
}
.concentration-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 3px;
    overflow: hidden;
}
.concentration-bar-fill {
    height: 100%;
    background: #4a9eff;
    border-radius: 3px;
    transition: width 0.3s ease;
}
.concentration-bar-fill--warn {
    background: var(--color-warning);
}
.concentration-bar-pct {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text);
    min-width: 36px;
    text-align: right;
}

/* Top holdings list (in performance context panel) */
.top-holdings-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.top-holding-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.top-holding-row__symbol {
    font-size: 12px;
    font-weight: 600;
    min-width: 48px;
}
.top-holding-row__bar-wrap {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    overflow: hidden;
}
.top-holding-row__bar {
    height: 100%;
    background: #4a9eff;
    border-radius: 3px;
}
.top-holding-row__pct {
    font-size: 11px;
    color: var(--color-text-muted);
    min-width: 36px;
    text-align: right;
}
.top-holding-row__value {
    font-size: 11px;
    color: var(--color-text-muted);
    min-width: 64px;
    text-align: right;
}

/* ======================================================
   Pass 14 — Workstation Data Grid Foundation
   ====================================================== */

/* --- Grid container: owns horizontal scroll, clips properly --- */
.wg-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(111, 211, 255, 0.10);
    border-radius: 12px;
    background: rgba(12, 25, 34, 0.88);
    transition: opacity 0.12s ease;
}

/* Loading state applied during in-place grid swaps */
.wg-loading {
    opacity: 0.5;
    pointer-events: none;
    cursor: wait;
}

/*
 * Tall-grid variant: owns local vertical scroll in addition to horizontal.
 * Use on grids that can grow beyond the viewport (events, asset registry, large holdings).
 *
 * The thead sticky header (position: sticky; top: 0) continues to work correctly
 * because it sticks relative to the nearest scrolling ancestor — this container.
 *
 * --wg-max-h can be overridden per-page via a style attribute if needed.
 */
.wg-container--tall {
    max-height: var(--wg-max-h, 62vh);
    overflow-y: auto;
}

/* --- Grid table --- */
.wg-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px; /* force scroll rather than squish on mobile */
}

/* --- Sticky header --- */
.wg-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(8, 18, 26, 0.97);
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid rgba(111, 211, 255, 0.12);
    text-align: left;
    user-select: none;
}

/* Sortable header link */
.wg-th-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.wg-th-link:hover {
    color: var(--color-text);
}

/* Sort icon */
.wg-sort-icon {
    font-size: 10px;
    opacity: 0.4;
    font-style: normal;
}
.wg-sort-icon--active {
    opacity: 1;
    color: #4a9eff;
}

/* --- Table body --- */
.wg-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.1s ease;
}
.wg-table tbody tr:hover {
    background: rgba(74, 158, 255, 0.04);
}
.wg-table tbody td {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--color-text);
    vertical-align: top;
}

/* --- Subline: secondary metadata inside a cell --- */
.wg-subline {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 3px;
    line-height: 1.45;
}

/* --- Column modifier classes --- */
.wg-col--num {
    text-align: right;
    white-space: nowrap;
}
.wg-col--tight {
    white-space: nowrap;
    width: 1%;
}
.wg-col--symbol {
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* --- Footer totals row --- */
.wg-table tfoot tr {
    border-top: 1px solid rgba(111, 211, 255, 0.15);
}
.wg-table tfoot td {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    background: rgba(8, 18, 26, 0.6);
    white-space: nowrap;
}

/* --- Grid toolbar (pagination bar) --- */
.wg-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-top: 1px solid rgba(111, 211, 255, 0.08);
    flex-wrap: wrap;
    background: rgba(8, 18, 26, 0.5);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}
.wg-toolbar__meta {
    font-size: 12px;
    color: var(--color-text-muted);
    flex: 1;
    white-space: nowrap;
}

/* --- Pagination --- */
.wg-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}
.wg-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(74, 158, 255, 0.08);
    color: #4a9eff;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid rgba(74, 158, 255, 0.15);
    transition: background 0.12s;
}
.wg-page-btn:hover {
    background: rgba(74, 158, 255, 0.20);
}
.wg-page-current {
    font-size: 12px;
    color: var(--color-text-muted);
    padding: 0 6px;
    white-space: nowrap;
}

/* --- Page-size selector --- */
.wg-page-size-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.wg-page-size-label {
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.wg-page-size-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(111, 211, 255, 0.15);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 12px;
    padding: 3px 8px;
    cursor: pointer;
}

/* Gain / loss text colours re-declared inside .wg-table for specificity */
.wg-table .text--gain { color: var(--color-success); }
.wg-table .text--loss { color: var(--color-danger); }

/* ==========================================================================
   Pass 15 — Watchlist Thesis & Decision Workflow
   ========================================================================== */

/* --- Posture badges --- */
.badge--posture {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.badge--posture-high_conviction { background: rgba(52, 211, 153, 0.15); color: #34d399; border-color: rgba(52, 211, 153, 0.3); }
.badge--posture-risk_watch      { background: rgba(239, 68, 68, 0.15);  color: #ef4444; border-color: rgba(239, 68, 68, 0.3); }
.badge--posture-ready           { background: rgba(74, 158, 255, 0.15); color: #4a9eff; border-color: rgba(74, 158, 255, 0.3); }
.badge--posture-waiting         { background: rgba(167, 139, 250, 0.15); color: #a78bfa; border-color: rgba(167, 139, 250, 0.3); }
.badge--posture-researching     { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
.badge--posture-observing       { background: rgba(139, 143, 163, 0.12); color: #8b8fa3; border-color: rgba(139, 143, 163, 0.25); }
.badge--posture-archived        { background: rgba(75, 85, 99, 0.12);   color: #6b7280; border-color: rgba(75, 85, 99, 0.25); }

/* --- Review status badges --- */
.badge--review-stale        { background: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); border-radius: 20px; padding: 2px 7px; font-size: 10px; }
.badge--review-needs_update { background: rgba(245, 158, 11, 0.12); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.25); border-radius: 20px; padding: 2px 7px; font-size: 10px; }
.badge--review-pending      { background: rgba(139, 143, 163, 0.10); color: #8b8fa3; border: 1px solid rgba(139, 143, 163, 0.2); border-radius: 20px; padding: 2px 7px; font-size: 10px; }
.badge--review-current      { background: rgba(52, 211, 153, 0.10); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.2); border-radius: 20px; padding: 2px 7px; font-size: 10px; }

/* --- Posture-aware watchlist chips --- */
.watchlist-chip--ready      { color: #4a9eff; }
.watchlist-chip--conviction { color: #34d399; }

/* --- Thesis cards grid --- */
.thesis-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.thesis-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px 18px;
    border-left: 3px solid var(--color-border);
    transition: border-color 0.15s;
}
.thesis-card--posture-high_conviction { border-left-color: #34d399; }
.thesis-card--posture-risk_watch      { border-left-color: #ef4444; }
.thesis-card--posture-ready           { border-left-color: #4a9eff; }
.thesis-card--posture-waiting         { border-left-color: #a78bfa; }
.thesis-card--posture-researching     { border-left-color: #f59e0b; }
.thesis-card--posture-observing       { border-left-color: var(--color-border); }
.thesis-card--posture-archived        { opacity: 0.6; }
.thesis-card--stale                   { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25); }

.thesis-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.thesis-card__identity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.thesis-card__symbol {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
}
.thesis-card__symbol:hover { color: var(--color-accent); }
.thesis-card__name {
    font-size: 13px;
    color: var(--color-text-muted);
}
.thesis-card__posture-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.thesis-card__thesis {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0 0 10px;
    line-height: 1.5;
}
.thesis-card__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}
@media (max-width: 720px) {
    .thesis-card__body { grid-template-columns: 1fr; }
}
.thesis-card__section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 3px;
}
.thesis-card__section-label--bull  { color: #34d399; }
.thesis-card__section-label--bear  { color: #ef4444; }
.thesis-card__section-label--break { color: #f59e0b; }
.thesis-card__section-text {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.5;
}
.thesis-card__footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}
.thesis-card__meta {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* --- Form helpers --- */
.form-static {
    padding: 8px 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
}
.panel-heading {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}
.panel-heading--mt { margin-top: 24px; }

/* --- Thesis signal row extras (Today view) --- */
.thesis-signal__watchlist {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-left: 6px;
}
.insight-row__meta--bull    { color: #34d399; font-size: 11px; }
.insight-row__meta--trigger { color: #f59e0b; font-size: 11px; }

/* --- Summary card alert state --- */
.summary-card--alert .summary-card__value { color: #ef4444; }

/* --- btn--xs variant --- */
.btn--xs {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   Pass 16 — Attention and Alert Rules Foundation
   ========================================================================== */

/* --- Severity indicator inline label (heading prefix) --- */
.attention-severity {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-right: 6px;
}
.attention-severity--critical { background: rgba(239, 68, 68, 0.18);  color: #ef4444; }
.attention-severity--high     { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.attention-severity--medium   { background: rgba(74, 158, 255, 0.15); color: #4a9eff; }
.attention-severity--low      { background: rgba(139, 143, 163, 0.12); color: #8b8fa3; }

/* --- Severity badge (attention item aside) --- */
.attention-severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid transparent;
    margin-bottom: 6px;
}
.attention-severity-badge--critical { background: rgba(239, 68, 68, 0.18);  color: #ef4444; border-color: rgba(239, 68, 68, 0.35); }
.attention-severity-badge--high     { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border-color: rgba(245, 158, 11, 0.30); }
.attention-severity-badge--medium   { background: rgba(74, 158, 255, 0.15); color: #4a9eff; border-color: rgba(74, 158, 255, 0.30); }
.attention-severity-badge--low      { background: rgba(139, 143, 163, 0.12); color: #8b8fa3; border-color: rgba(139, 143, 163, 0.25); }

/* --- Attention group section border accent --- */
.attention-group--critical { border-left: 3px solid #ef4444; }
.attention-group--high     { border-left: 3px solid #f59e0b; }
.attention-group--medium   { border-left: 3px solid #4a9eff; }
.attention-group--low      { border-left: 3px solid #8b8fa3; }

/* --- Rule chip inside insight-row title --- */
.attention-rule-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(111, 211, 255, 0.08);
    border: 1px solid rgba(111, 211, 255, 0.15);
    color: var(--color-text-muted);
    margin-left: 8px;
    vertical-align: middle;
}

/* --- Reason text inside insight-row --- */
.insight-row__meta--reason {
    font-size: 13px;
    color: var(--color-text);
    font-weight: 400;
    margin-top: 4px;
}

/* --- Compact button row for action links --- */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.btn-row--compact {
    gap: 4px;
}

/* --- Attention summary strip on Today --- */
.attention-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.attention-summary-block {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(111, 211, 255, 0.10);
    background: rgba(12, 25, 34, 0.88);
    text-align: center;
}
.attention-summary-block--critical { border-color: rgba(239, 68, 68, 0.25); }
.attention-summary-block--high     { border-color: rgba(245, 158, 11, 0.22); }
.attention-summary-block__count {
    font-size: 20px;
    font-weight: 700;
}
.attention-summary-block--critical .attention-summary-block__count { color: #ef4444; }
.attention-summary-block--high     .attention-summary-block__count { color: #f59e0b; }
.attention-summary-block--medium   .attention-summary-block__count { color: #4a9eff; }
.attention-summary-block--low      .attention-summary-block__count { color: #8b8fa3; }
.attention-summary-block__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin-top: 3px;
}

/* --- Watchlist attention inline context --- */
.watchlist-attention-list {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}
.watchlist-attention-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(111, 211, 255, 0.10);
    background: rgba(12, 25, 34, 0.88);
    font-size: 13px;
}
.watchlist-attention-row--critical { border-left: 3px solid #ef4444; }
.watchlist-attention-row--high     { border-left: 3px solid #f59e0b; }
.watchlist-attention-row--medium   { border-left: 3px solid #4a9eff; }
.watchlist-attention-row--low      { border-left: 3px solid #8b8fa3; }

@media (max-width: 640px) {
    .attention-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================================================
   Pass 17 — Review Journal / Decision Log
   ========================================================================== */

/* Review log badge (type chip) */
.badge--review-type {
    background: rgba(74, 158, 255, 0.12);
    color: #4a9eff;
    border: 1px solid rgba(74, 158, 255, 0.25);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Compact review history inside thesis cards */
.thesis-card__review-log {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.thesis-card__review-log-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.thesis-card__review-entry {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
    font-size: 12px;
}

.thesis-card__review-entry:last-child {
    border-bottom: none;
}

.review-entry__date {
    color: var(--color-text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.review-entry__transition {
    color: #a78bfa;
    font-size: 11px;
    white-space: nowrap;
}

.review-entry__transition--status {
    color: #f59e0b;
}

.review-entry__summary {
    color: var(--color-text);
    font-size: 12px;
    flex: 1;
    min-width: 0;
}

.review-entry__source {
    font-size: 11px;
    color: var(--color-text-muted);
    font-style: italic;
}

/* Review history timeline on asset detail */
.review-history-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-timeline-entry {
    background: rgba(8, 18, 26, 0.5);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 12px 16px;
}

.review-timeline-entry__header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.review-timeline-entry__summary {
    font-size: 13px;
    color: var(--color-text);
    margin-bottom: 4px;
}

.review-timeline-entry__rationale {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.review-timeline-entry__next-step {
    font-size: 12px;
    color: #34d399;
    margin-top: 6px;
}

.review-timeline-entry__next-label {
    font-weight: 600;
    margin-right: 4px;
}

/* Review log create form helpers */
.review-log-context {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.form-static {
    display: block;
    padding: 6px 0;
    color: var(--color-text);
    font-size: 13px;
}

.form-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 0 0 12px;
}

.form-hint--inline {
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 400;
    margin-left: 4px;
}

.form-grid--2col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid--3col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid--full {
    grid-template-columns: 1fr;
}

@media (max-width: 640px) {
    .form-grid--2col,
    .form-grid--3col {
        grid-template-columns: 1fr;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   PASS 20 — Shell Navigation and Workspace Chrome (UX Corrected)
   ════════════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────────
   Collapsible Left-Rail Navigation — Full-Row Section Headers
   ────────────────────────────────────────────────────────────────────── */

/*
 * .nav-section__label is now a <button> so the entire header row is
 * clickable. Reset native button defaults and apply workstation style.
 */
.nav-section__label {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px 7px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    background: rgba(8, 18, 26, 0.60);
    border: 1px solid rgba(51, 86, 109, 0.18);
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    user-select: none;
    transition: background 0.13s ease, color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
    margin-bottom: 4px;
}

.nav-section__label:hover {
    background: rgba(111, 211, 255, 0.12);
    border-color: rgba(111, 211, 255, 0.24);
    color: var(--color-text);
    transform: translateX(1px);
}

.nav-section__label:focus-visible {
    outline: none;
    border-color: rgba(111, 211, 255, 0.36);
    box-shadow: 0 0 0 3px rgba(111, 211, 255, 0.16);
}

.nav-section__label-text {
    flex: 1;
    min-width: 0;
    font-weight: 700;
}

/* Arrow indicator — visible chip, rotates on collapse, not the primary target */
.nav-section__toggle-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(111, 211, 255, 0.08);
    font-size: 20px;
    color: var(--color-text-muted);
    opacity: 0.88;
    line-height: 1;
    transition: transform 0.2s ease, opacity 0.15s ease, color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.nav-section__toggle-arrow::after {
    content: '▾';
    display: inline-block;
}

.nav-section--collapsed .nav-section__toggle-arrow {
    transform: rotate(-90deg);
}

.nav-section__label:hover .nav-section__toggle-arrow {
    opacity: 1;
    color: var(--color-accent);
    background: rgba(111, 211, 255, 0.14);
    border-color: rgba(111, 211, 255, 0.22);
}

/* Items collapse animation */
.nav-section__items {
    overflow: hidden;
    transition: max-height 0.22s ease, opacity 0.18s ease;
    max-height: 600px;
    opacity: 1;
}

.nav-section--collapsed .nav-section__items {
    max-height: 0;
    opacity: 0;
}

/* ──────────────────────────────────────────────────────────────────────
   Workspace Bar — Contextual Surface Navigation
   ────────────────────────────────────────────────────────────────────── */

.workspace-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 20px;
    min-height: 50px;
    background: linear-gradient(180deg, rgba(24, 44, 58, 0.97) 0%, rgba(17, 31, 41, 0.99) 100%);
    border-top: 1px solid rgba(111, 211, 255, 0.10);
    border-bottom: 1px solid var(--color-border-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 12px 20px rgba(2, 10, 16, 0.18);
    flex-shrink: 0;
    position: relative;
    z-index: 4;
    overflow-x: auto;
    scrollbar-width: none;
}

.workspace-bar::-webkit-scrollbar {
    display: none;
}

.workspace-bar__context {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.workspace-bar__label {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    font-size: 10px;
    font-weight: 700;
    color: #d6f6ff;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    white-space: nowrap;
    border-radius: 999px;
    border: 1px solid rgba(111, 211, 255, 0.18);
    background: rgba(111, 211, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.workspace-bar__tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    padding-bottom: 1px;
}

.workspace-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 12px 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-decoration: none;
    border: 1px solid rgba(51, 86, 109, 0.38);
    border-radius: 10px;
    background: rgba(7, 17, 26, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    white-space: nowrap;
    transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    flex-shrink: 0;
}

.workspace-tab:hover {
    color: var(--color-text);
    background: rgba(111, 211, 255, 0.09);
    border-color: rgba(111, 211, 255, 0.22);
}

.workspace-tab--active {
    color: #f7fcff;
    border-color: rgba(111, 211, 255, 0.34);
    background: linear-gradient(180deg, rgba(111, 211, 255, 0.18) 0%, rgba(54, 106, 134, 0.14) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(111, 211, 255, 0.06);
}

.workspace-tab--muted {
    opacity: 0.55;
    pointer-events: none;
}

.workspace-tab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: rgba(111, 211, 255, 0.12);
    color: var(--color-accent);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.workspace-tab--active .workspace-tab__icon {
    background: rgba(111, 211, 255, 0.22);
    color: #ffffff;
}

.workspace-tab__label {
    white-space: nowrap;
}

/* ──────────────────────────────────────────────────────────────────────
   Breadcrumbs
   ────────────────────────────────────────────────────────────────────── */

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 11px;
}

.breadcrumb-sep {
    color: var(--color-text-muted);
    opacity: 0.5;
}

.breadcrumb-item {
    color: var(--color-text-muted);
    font-weight: 500;
}

.breadcrumb-item--link {
    color: var(--color-accent);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.breadcrumb-item--link:hover {
    opacity: 1;
    text-decoration: underline;
}

.breadcrumb-item--current {
    color: var(--color-text);
}

/* ──────────────────────────────────────────────────────────────────────
   Related Actions Panel
   ────────────────────────────────────────────────────────────────────── */

.related-actions {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 10px 12px;
}

.related-actions__heading {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.related-actions__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.related-action-link {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.12s ease, color 0.12s ease;
}

.related-action-link:hover {
    background: rgba(111, 211, 255, 0.09);
    color: #fff;
}

/* ──────────────────────────────────────────────────────────────────────
   Thesis Refresh Workspace
   ────────────────────────────────────────────────────────────────────── */

.thesis-refresh-surface-grid {
    margin-bottom: 18px;
}

.thesis-refresh-layout {
    align-items: start;
}

.thesis-refresh-sidebar {
    display: grid;
    gap: 18px;
    align-content: start;
}

.thesis-refresh-queue-banner {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(111, 211, 255, 0.22);
    background: rgba(17, 39, 52, 0.9);
    color: var(--color-text);
    font-size: 13px;
}

.thesis-refresh-panel__intro {
    margin: 0 0 18px;
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.thesis-refresh-empty {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.55;
}

.thesis-evidence__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.thesis-evidence__meta {
    margin: 6px 0 0;
    color: var(--color-text-muted);
    font-size: 12px;
}

.thesis-evidence__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.thesis-evidence__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.thesis-evidence__entry {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(111, 211, 255, 0.12);
    background: rgba(12, 25, 34, 0.78);
}

.thesis-evidence__entry-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.thesis-evidence__date {
    color: var(--color-text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.thesis-evidence__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.thesis-evidence__summary {
    margin: 6px 0 0;
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.55;
}

.thesis-refresh-links {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.thesis-refresh-links__intro {
    margin: 0 0 10px;
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.thesis-refresh-links__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.thesis-refresh-links__meta {
    padding: 0 8px 4px;
    color: var(--color-text-muted);
    font-size: 11px;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .thesis-evidence__top {
        flex-direction: column;
    }

    .thesis-evidence__actions {
        justify-content: flex-start;
    }

    .thesis-evidence__entry-top {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ──────────────────────────────────────────────────────────────────────
   Application Footer — Visibly Present Shell Region
   ────────────────────────────────────────────────────────────────────── */

.app-footer {
    grid-column: 1 / -1;
    grid-row: 2;
    position: relative;
    z-index: 4;
    width: 100%;
    border-top: 2px solid var(--color-border-strong);
    background: linear-gradient(180deg, rgba(21, 39, 50, 0.98) 0%, rgba(9, 18, 25, 0.99) 100%);
    box-shadow: inset 0 1px 0 rgba(111, 211, 255, 0.05), 0 -16px 28px rgba(2, 10, 16, 0.22);
    backdrop-filter: blur(14px);
}

/* Ticker accommodation zone — 0-height structural reservation only */
.app-footer__ticker-zone {
    height: 0;
    overflow: hidden;
    border-bottom: 0 solid var(--color-border);
    transition: height 0.2s ease, border-width 0.2s ease;
}

.app-footer__ticker-zone--active {
    height: 34px;
    border-bottom-width: 1px;
}

.app-footer__body {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    padding: 8px 18px 10px;
}

.app-footer__body::-webkit-scrollbar {
    display: none;
}

.footer-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    padding: 8px 10px 9px;
    border: 1px solid rgba(51, 86, 109, 0.34);
    border-radius: 12px;
    background: rgba(7, 17, 26, 0.52);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.footer-section--identity {
    text-align: left;
}

.footer-section__label {
    font-size: 9px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 4px;
    white-space: nowrap;
}

.footer-section__links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 4px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.12s ease, background 0.12s ease;
}

.footer-link:hover {
    color: var(--color-accent);
    background: rgba(111, 211, 255, 0.08);
}

.footer-section__note {
    font-size: 10px;
    color: var(--color-text-muted);
    line-height: 1.35;
    white-space: normal;
}

.footer-section__note--muted {
    opacity: 0.55;
    font-size: 9px;
}

/* ──────────────────────────────────────────────────────────────────────
   Pass 21 — Watchlist Operating Plan Foundation
   ────────────────────────────────────────────────────────────────────── */

.operating-plan {
    margin-top: 12px;
    padding: 12px 13px;
    border: 1px solid rgba(51, 86, 109, 0.34);
    border-radius: 12px;
    background: rgba(7, 17, 26, 0.42);
}

.operating-plan--compact {
    padding: 10px 11px;
}

.operating-plan__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.operating-plan__title {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.operating-plan__summary {
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.5;
}

.plan-signal {
    margin-top: 10px;
    padding: 10px 11px;
    border: 1px solid rgba(46, 196, 182, 0.14);
    border-radius: 12px;
    background: rgba(10, 22, 31, 0.82);
}

.plan-signal--compact {
    padding: 9px 10px;
}

.plan-signal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.plan-signal__state {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plan-signal__state--entry {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
}

.plan-signal__state--trim {
    color: #f5a623;
    background: rgba(245, 166, 35, 0.12);
}

.plan-signal__state--break {
    color: #ff8d7a;
    background: rgba(255, 141, 122, 0.12);
}

.plan-signal__state--watch {
    color: #6fd3ff;
    background: rgba(111, 211, 255, 0.12);
}

.plan-signal__state--muted {
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.05);
}

.plan-signal__meta {
    font-size: 11px;
    color: var(--color-text-muted);
}

.plan-signal__track-wrap {
    margin-bottom: 10px;
}

.plan-signal__track {
    position: relative;
    height: 20px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 141, 122, 0.14), rgba(111, 211, 255, 0.10), rgba(245, 166, 35, 0.14));
    overflow: hidden;
}

.plan-signal__entry-band {
    position: absolute;
    top: 3px;
    bottom: 3px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.20);
    border: 1px solid rgba(52, 211, 153, 0.28);
}

.plan-signal__marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    transform: translateX(-50%);
    background: rgba(111, 211, 255, 0.55);
}

.plan-signal__marker--entry {
    background: rgba(52, 211, 153, 0.80);
}

.plan-signal__marker--trim {
    background: rgba(245, 166, 35, 0.88);
}

.plan-signal__marker--break {
    background: rgba(255, 141, 122, 0.88);
}

.plan-signal__marker--current {
    background: #6fd3ff;
    width: 3px;
}

.plan-signal__axis {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 7px;
    font-size: 10px;
    color: var(--color-text-muted);
}

.plan-signal__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.plan-signal__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.plan-signal__legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
    background: rgba(111, 211, 255, 0.55);
}

.plan-signal__legend-dot--entry {
    background: rgba(52, 211, 153, 0.88);
}

.plan-signal__legend-dot--trim {
    background: rgba(245, 166, 35, 0.88);
}

.plan-signal__legend-dot--break {
    background: rgba(255, 141, 122, 0.88);
}

.plan-signal__legend-dot--current {
    background: #6fd3ff;
}

.plan-signal__legend-text {
    color: var(--color-text);
}

.plan-signal__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.plan-signal__chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid rgba(111, 211, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text);
}

.plan-signal__chip--entry {
    border-color: rgba(52, 211, 153, 0.28);
}

.plan-signal__chip--trim {
    border-color: rgba(245, 166, 35, 0.28);
}

.plan-signal__chip--break {
    border-color: rgba(255, 141, 122, 0.28);
}

.operating-plan__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.operating-plan__metric {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 72px;
    padding: 8px 9px;
    border: 1px solid rgba(51, 86, 109, 0.3);
    border-radius: 10px;
    background: rgba(15, 27, 36, 0.84);
}

.operating-plan__metric--soon {
    border-color: rgba(240, 195, 106, 0.32);
    background: rgba(240, 195, 106, 0.10);
}

.operating-plan__metric--alert,
.operating-plan__metric--break {
    border-color: rgba(255, 141, 122, 0.38);
    background: rgba(255, 141, 122, 0.12);
}

.operating-plan__metric-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.operating-plan__metric-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.operating-plan__metric-meta {
    font-size: 11px;
    color: var(--color-text-muted);
}

.operating-plan__note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.45;
}

.operating-plan__note strong {
    color: var(--color-text);
    font-weight: 600;
}

.operating-plan__empty {
    font-size: 12px;
    color: var(--color-text-muted);
}

@media (max-width: 760px) {
    .visual-chart {
        padding: 14px;
    }

    .visual-chart__svg {
        min-height: 220px;
    }

    .plan-signal__header {
        align-items: flex-start;
    }

    .plan-signal__legend,
    .plan-signal__chips {
        gap: 6px;
    }
}

/* ──────────────────────────────────────────────────────────────────────
   Pass 23 — Review Queue And Operator Worklist Foundation
   ────────────────────────────────────────────────────────────────────── */

.worklist-category-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.worklist-category-strip--compact {
    margin-bottom: 14px;
}

.worklist-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid rgba(51, 86, 109, 0.32);
    border-radius: 999px;
    background: rgba(10, 22, 31, 0.82);
}

.worklist-category-chip__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text);
}

.worklist-category-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(111, 211, 255, 0.12);
    color: #6fd3ff;
    font-size: 11px;
    font-weight: 700;
}

.worklist-sections {
    display: grid;
    gap: 16px;
}

.worklist-sections--compact {
    gap: 14px;
}

.worklist-section {
    padding: 14px;
    border: 1px solid rgba(51, 86, 109, 0.30);
    border-radius: 14px;
    background: rgba(7, 17, 26, 0.44);
}

.worklist-section--due_now {
    border-color: rgba(255, 141, 122, 0.28);
}

.worklist-section--upcoming {
    border-color: rgba(111, 211, 255, 0.24);
}

.worklist-section--blocked {
    border-color: rgba(240, 195, 106, 0.24);
}

.worklist-section--completed {
    border-color: rgba(46, 196, 182, 0.24);
}

.worklist-section__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.worklist-section__title {
    margin: 0;
    font-size: 15px;
    color: var(--color-text);
}

.worklist-section__meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.45;
}

.worklist-section__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font-size: 12px;
    font-weight: 700;
}

.worklist-item-list {
    display: grid;
    gap: 12px;
}

.worklist-item {
    padding: 13px;
    border: 1px solid rgba(51, 86, 109, 0.28);
    border-radius: 13px;
    background: rgba(15, 27, 36, 0.84);
}

.worklist-item__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.worklist-item__eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.worklist-item__title {
    margin: 5px 0 0;
    font-size: 15px;
    color: var(--color-text);
}

.worklist-item__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.worklist-item__badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.worklist-item__badge--due {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
}

.worklist-item__badge--critical,
.worklist-item__badge--high {
    background: rgba(255, 141, 122, 0.14);
    color: #ffb4a7;
}

.worklist-item__badge--medium {
    background: rgba(240, 195, 106, 0.16);
    color: #f0c36a;
}

.worklist-item__badge--low {
    background: rgba(111, 211, 255, 0.12);
    color: #6fd3ff;
}

.worklist-item__reason {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text);
}

.worklist-item__facts {
    display: grid;
    gap: 8px;
    margin-top: 11px;
}

.worklist-item__fact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.worklist-item__fact-label {
    font-weight: 700;
    color: var(--color-text);
}

.worklist-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.worklist-item__form {
    margin: 0;
}

.worklist-empty-state {
    border: 1px dashed rgba(51, 86, 109, 0.28);
    border-radius: 12px;
    background: rgba(15, 27, 36, 0.58);
}

.worklist-section__footer {
    margin-top: 12px;
}

@media (max-width: 760px) {
    .worklist-section,
    .worklist-item {
        padding: 12px;
    }

    .worklist-section__heading,
    .worklist-item__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .worklist-item__badges {
        justify-content: flex-start;
    }
}
