:root {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --panel-soft: #f9fbff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e3e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* Layout */

.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: 220px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 20px 16px;
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 20px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    padding: 10px 12px;
    border-radius: 8px;
}

.nav-links a:hover {
    background: #f1f5f9;
}

/* Main */

.main-content {
    flex: 1;
    padding: 24px 32px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

/* Top bar */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
}

/* Cards */

.card,
.dashboard-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.card {
    padding: 24px;
    margin-bottom: 20px;
}

.dashboard-card {
    padding: 18px;
}

.dashboard-card h3 {
    margin-bottom: 12px;
}

/* Status pills */

.stat-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-pill {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-soft);
    font-size: 14px;
}

/* Status strip */

.status-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.status-chip {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel);
    font-size: 14px;
}

/* Grid */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

/* BotVision */

.placeholder-box {
    min-height: 220px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 16px;
    background: var(--panel-soft);
}

/* Insight Feed */

.insight-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-item {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-soft);
}

.insight-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.insight-title {
    font-weight: 700;
}

.insight-time {
    font-size: 12px;
    color: var(--muted);
}

.insight-body {
    color: var(--muted);
}

/* Bot thoughts compact rail (app.js dashboard_full; legacy path was dashboard_free) */
.insight-rail {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(520px, 58vh);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
}

.insight-rail--message {
    max-height: none;
    overflow: visible;
}

.insight-rail-message {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

.insight-rail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.insight-rail-item.active {
    border: 2px solid #2563eb;
    background: #f0f5ff;
}

.insight-rail-item__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.insight-rail-item__sym {
    font-weight: 700;
    font-size: 0.875rem;
}

.insight-rail-item__tf {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
}

.insight-rail-item__state {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.insight-rail-item__head {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trend-watch-state-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1d4ed8;
}

.trend-watch-state-badge--live {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.trend-watch-state-badge--watch {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #475569;
}

.state-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.3px;
    line-height: 1.1;
    white-space: nowrap;
}

.state-in-position {
    background: #1f9d55;
    color: #ffffff;
}

.state-waiting {
    background: #6b7280;
    color: #ffffff;
}

.state-blocked {
    background: #d97706;
    color: #ffffff;
}

.trend-watch-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
}

.trend-watch-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trend-watch-k {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
}

.trend-watch-v {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

.trend-watch-reason {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.4;
    color: #475569;
}

.insight-card__head {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: baseline;
    gap: 6px 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.insight-card__symbol {
    font-weight: 700;
    font-size: 0.9375rem;
}

.insight-card__tf {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
}

.insight-card__state {
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    justify-self: end;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.insight-card__recency {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.insight-card__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 12px;
}

.insight-fact {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 5px 10px 6px;
    border-radius: 8px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    font-size: 12px;
}

.insight-fact__k {
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
}

.insight-fact__v {
    font-weight: 500;
    word-break: break-word;
}

.insight-card__raw-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.insight-card__raw-body {
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    max-height: 140px;
    overflow-y: auto;
}

.insight-card__meta {
    margin-top: 12px;
    font-size: 11px;
    color: var(--muted);
}

/* Positions */

.position-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.position-item.active {
    border: 4px solid red !important;
    background: yellow !important;
}

.position-item:last-child {
    border-bottom: 0;
}

.position-symbol {
    font-weight: 700;
}

.position-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.position-age {
    font-size: 12px;
    color: #374151;
    margin-top: 2px;
}

.position-summary {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin: 4px 0 6px 0;
}

.position-section {
    margin-top: 8px;
}

.section-label {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 2px;
}

.section-value {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    line-height: 1.35;
}

.strength-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    margin-left: 6px;
    line-height: 1.1;
}

.strength-strong {
    background: #16a34a;
    color: white;
}

.strength-medium {
    background: #3b82f6;
    color: white;
}

.strength-weak {
    background: #6b7280;
    color: white;
}

.strength-pill--thesis {
    background: #7c3aed;
    color: #fff;
}

.strength-pill--range {
    background: #0d9488;
    color: #fff;
}

.strength-pill--expansion {
    background: #ea580c;
    color: #fff;
}

.position-narrative-strip {
    margin: 8px 0 4px 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--border);
    font-size: 12px;
    line-height: 1.4;
    color: #1e293b;
}

.position-narrative-strip--hint {
    color: #475569;
    background: #f1f5f9;
}

.position-narrative-line {
    margin: 0 0 4px 0;
}

.position-narrative-line:last-child {
    margin-bottom: 0;
}

.position-narrative-line--muted {
    color: #64748b;
    font-size: 11px;
}

.position-narrative-k {
    font-weight: 700;
    color: #334155;
    margin-right: 4px;
}

.position-orchestration-detail {
    margin-top: 8px;
}

.position-orchestration-detail summary {
    cursor: pointer;
    user-select: none;
    color: #64748b;
    font-size: 12px;
}

.position-meta {
    margin-top: 6px;
    color: var(--muted);
}

.mc-expectation {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

/* Rows */

.capital-row,
.provider-row,
.pod-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
}

.capital-row:last-child,
.provider-row:last-child,
.pod-row:last-child {
    border-bottom: 0;
}

/* Buttons */

.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.btn:hover {
    background: var(--primary-hover);
}

/* Session */

.session-info {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px;
}

.session-info .session-info__who {
    color: #334155;
}

.session-info .session-info__who strong {
    font-weight: 600;
    color: #0f172a;
}

/* -------------------------------------------------------------------------- */
/* Paid app subpages (Portfolio, Settings, Activity) — nav chrome matches D2   */
/* -------------------------------------------------------------------------- */

body.hutch-dash-page {
    min-height: 100vh;
    background: #f1f4fa;
}

body.hutch-dash-page .layout {
    min-height: 100vh;
    background: #f1f4fa;
}

body.hutch-dash-page .main-content {
    padding: 20px 24px 40px;
    min-width: 0;
}

body.hutch-dash-page .container {
    max-width: 1180px;
    margin: 0 auto;
}

body.hutch-dash-page .dash2-product-header {
    margin-bottom: 28px;
}

body.hutch-dash-page .dash2-header-primary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

body.hutch-dash-page .dash2-wordmark {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    letter-spacing: -0.02em;
}

body.hutch-dash-page .dash2-wordmark:hover {
    color: #1e40af;
}

body.hutch-dash-page .dash2-topnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

body.hutch-dash-page .dash2-topnav a {
    text-decoration: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
}

body.hutch-dash-page .dash2-topnav a:hover {
    color: #0f172a;
    background: #e8edf5;
}

body.hutch-dash-page .dash2-topnav a[aria-current="page"] {
    color: #0f172a;
    background: #e2e8f0;
}

body.hutch-dash-page .dash2-header-meta {
    margin-top: 14px;
}

body.hutch-dash-page .dash2-topbar-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
}

body.hutch-dash-page .dash-chip {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    background: #f1f5f9;
    color: #64748b;
}

body.hutch-dash-page .dash-chip.ok {
    border-color: #d8e9dc;
    background: #f4faf6;
    color: #3f6212;
}

body.hutch-dash-page .dash-chip.warn {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

body.hutch-dash-page .dash-topbar-orch {
    display: inline-block;
    vertical-align: middle;
    position: relative;
}

body.hutch-dash-page .dash-topbar-orch > summary.dash-chip--orch {
    list-style: none;
    cursor: pointer;
    background: #f8fafc;
    color: #475569;
    border: 1px dashed #cbd5e1;
}

body.hutch-dash-page .dash-topbar-orch > summary.dash-chip--orch::-webkit-details-marker {
    display: none;
}

body.hutch-dash-page .dash-topbar-orch-body {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 6px;
    z-index: 50;
    min-width: 280px;
    max-width: min(420px, 92vw);
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    font-size: 12px;
}

body.hutch-dash-page .dash-topbar-orch-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: baseline;
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;
}

body.hutch-dash-page .dash-topbar-orch-row:last-child {
    border-bottom: 0;
}

body.hutch-dash-page .dash-topbar-orch-row span:first-child {
    color: #64748b;
}

body.hutch-dash-page .dash-topbar-orch-row code {
    font-size: 11px;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 4px;
    max-width: 200px;
    overflow: auto;
}

body.hutch-dash-page .dash-topbar-orch-muted {
    color: #64748b;
}

body.hutch-dash-page .session-info {
    font-size: 13px;
    color: #475569;
}

body.hutch-dash-page .session-info a {
    color: #2563eb;
    text-decoration: none;
}

body.hutch-dash-page .dashboard-card {
    background: #ffffff;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    padding: 20px 22px;
    margin-bottom: 20px;
}

body.hutch-dash-page .dashboard-card h3 {
    margin-top: 0;
    margin-bottom: 6px;
    color: #0f172a;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

body.hutch-dash-page .panel-sub {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
    line-height: 1.45;
}

body.hutch-dash-page .hutch-subpage-stack {
    display: grid;
    gap: 20px;
}

@media (min-width: 960px) {
    body.hutch-dash-page .hutch-subpage-stack--split {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

/* Activity — trade history (v1) */

.activity-history-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 4px;
}

.activity-history-heading h3 {
    margin: 0;
}

.activity-history-refresh {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

.activity-history-refresh:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
}

.activity-history-refresh:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.activity-trade-history {
    margin-top: 4px;
}

.activity-history-scroll {
    overflow-x: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.activity-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: #334155;
}

.activity-history-table th,
.activity-history-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #e8edf3;
    vertical-align: top;
}

.activity-history-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    white-space: nowrap;
    background: #f8fafc;
}

.activity-history-table tbody tr:hover {
    background: #fafbfc;
}

.activity-history-table .activity-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.activity-history-meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 10px;
}

.activity-history-state {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.activity-history-state--error {
    color: #b42318;
}

.activity-history-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
}

.activity-history-badge--manual {
    background: #eff6ff;
    color: #1d4ed8;
}

.activity-history-badge--auto {
    background: #f0fdf4;
    color: #166534;
}

.activity-history-expand-col {
    width: 36px;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.activity-history-expand-cell {
    vertical-align: middle;
    text-align: center;
    padding: 6px 4px !important;
}

.activity-history-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}

.activity-history-expand-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.activity-history-expand-placeholder {
    display: inline-block;
    color: #cbd5e1;
    font-size: 12px;
}

.activity-history-type-meta {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    color: #94a3b8;
    vertical-align: middle;
}

.activity-history-detail-cell {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 14px 16px !important;
}

.activity-lifecycle-root {
    max-width: 720px;
}

.activity-lifecycle-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.activity-lifecycle-flow-arrow {
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.2;
    padding: 2px 0 6px;
}

.activity-lifecycle-section {
    margin: 0 0 4px;
}

.activity-lifecycle-section--exit {
    margin-top: 2px;
}

.activity-lifecycle-h {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.activity-lifecycle-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    padding: 12px 14px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.activity-lifecycle-card--exit {
    border-color: #cbd5e1;
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.activity-lifecycle-card--scale {
    padding: 10px 12px;
}

.activity-lifecycle-kv {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.45;
}

.activity-lifecycle-kv:last-child {
    margin-bottom: 0;
}

.activity-lifecycle-kv-label {
    flex: 0 0 auto;
    min-width: 108px;
    font-weight: 600;
    color: #475569;
}

.activity-lifecycle-kv-value {
    flex: 1 1 160px;
    color: #1e293b;
    word-break: break-word;
}

.activity-lifecycle-badge {
    display: inline-block;
    margin: 0 4px 4px 0;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #e0e7ff;
}

.activity-lifecycle-exit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-bottom: 12px;
}

@media (max-width: 560px) {
    .activity-lifecycle-exit-grid {
        grid-template-columns: 1fr;
    }
}

.activity-lifecycle-exit-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 4px;
}

.activity-lifecycle-exit-value {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

.activity-lifecycle-exit-value--broker {
    color: #334155;
    font-weight: 500;
}

.activity-lifecycle-exit-badges {
    margin-top: 8px;
}

.activity-lifecycle-scale-step {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.activity-lifecycle-scale-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-lifecycle-scale-n {
    font-weight: 700;
    color: #64748b;
    margin-right: 8px;
}

.activity-lifecycle-scale-ts {
    color: #64748b;
    font-size: 12px;
}

.activity-lifecycle-scale-reasons {
    margin-top: 6px;
}

.activity-lifecycle-section--warn .activity-lifecycle-warn-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
}

.activity-lifecycle-section--warn {
    margin-top: 8px;
}

.activity-lifecycle-section--warn .activity-lifecycle-h {
    color: #b45309;
}

.activity-lifecycle-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.activity-lifecycle-copy-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    cursor: pointer;
    font-family: inherit;
}

.activity-lifecycle-copy-btn:hover:not(:disabled) {
    background: #f8fafc;
}

.activity-lifecycle-copy-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.activity-lifecycle-msg {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.activity-lifecycle-card--compact {
    margin-top: 8px;
    padding: 10px 12px;
}
.hutch-setup-soft-gate-banner {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #78350f;
    font-size: 14px;
    line-height: 1.45;
}

.hutch-setup-soft-gate-banner__title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #92400e;
}

.hutch-setup-soft-gate-banner__hint {
    margin: 0 0 8px;
}

.hutch-setup-soft-gate-banner__action {
    margin: 0;
}

.hutch-setup-soft-gate-banner__link {
    font-weight: 600;
    color: #b45309;
    text-decoration: underline;
}

.hutch-setup-soft-gate-banner__link:hover {
    color: #92400e;
}

.hutch-setup-soft-gate-banner__actions--row {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Trading setup reminder (no saved templates yet) */
.hutch-trading-setup-banner {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #bae6fd;
    background: #f0f9ff;
    color: #0c4a6e;
    font-size: 14px;
    line-height: 1.45;
}

.hutch-trading-setup-banner__title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #075985;
}

.hutch-trading-setup-banner__hint {
    margin: 0 0 10px;
}

.hutch-trading-setup-banner__actions {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Slice 12 / 13 — Settings → Broker connection */

.settings-broker-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.settings-broker-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Slice 13: when the user lands here from the dashboard Live Bot card via
   the #settings-broker-connection-card fragment, briefly highlight so the
   landing target is unambiguous. */
@keyframes hutch-broker-card-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.55); }
    60% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.settings-broker-card:target {
    border: 1px solid #93c5fd;
    animation: hutch-broker-card-pulse 1.4s ease-out 1;
    scroll-margin-top: 12px;
}

.broker-headline--loading {
    color: #6b7280;
}

.broker-headline {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-soft);
    font-size: 13px;
}

.broker-headline-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1f2937;
}

.broker-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex: 0 0 auto;
}

.broker-dot--ok {
    background: #16a34a;
}

.broker-dot--warn {
    background: #d97706;
}

.broker-dot--off {
    background: #dc2626;
}

.broker-snap {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 6px 18px;
    padding: 10px 12px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.broker-snap-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #1f2937;
}

.broker-snap-row span {
    color: #6b7280;
}

.broker-snap-row strong {
    font-weight: 600;
}

/* Settings live readiness mini-grid (shared with exchange_setup page styles) */

#settings-broker-readiness .readiness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

#settings-broker-readiness .readiness-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    padding: 12px 14px;
}

#settings-broker-readiness .readiness-card h2 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #1f2937;
}

#settings-broker-readiness .readiness-card ul {
    margin: 0;
    padding-left: 1.05rem;
    font-size: 13px;
    line-height: 1.5;
    color: #1f2937;
}

#settings-broker-readiness .readiness-table {
    width: 100%;
    margin-top: 8px;
    border-collapse: collapse;
    font-size: 12px;
}

#settings-broker-readiness .readiness-table th,
#settings-broker-readiness .readiness-table td {
    border-bottom: 1px solid #f1f5f9;
    padding: 4px 6px;
    text-align: left;
}

#settings-broker-readiness .readiness-error,
#settings-broker-readiness .readiness-safety,
#settings-broker-readiness .readiness-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #6b7280;
}

#settings-broker-readiness .readiness-error {
    color: #b42318;
}

/* Slice 12 — Live Bot card compact broker connection */

.runtime-env-card__broker {
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #1f2937;
}

.runtime-env-card__broker-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.runtime-env-card__broker-link {
    margin-top: 4px;
    font-size: 11px;
    color: #2563eb;
    text-decoration: none;
}

.runtime-env-card__broker-link:hover {
    text-decoration: underline;
}

/* Slice 14 — confirmation pill after canonical_env save redirect to dashboard */

.hutch-dashboard-save-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    background: #ecfdf5;
    color: #065f46;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 1px 2px rgba(15, 118, 110, 0.08);
    animation: hutch-save-pill-in 220ms ease-out;
}

@keyframes hutch-save-pill-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.hutch-dashboard-save-pill__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
    flex: 0 0 auto;
}

.hutch-dashboard-save-pill__close {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: #065f46;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
}

.hutch-dashboard-save-pill__close:hover {
    background: #d1fae5;
}

/* Slice 14 — Strategy Setups page advanced/diagnostic banner */

.ss-advanced-page-banner {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #fcd34d;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    line-height: 1.55;
}

.ss-advanced-page-banner strong {
    color: #78350f;
}

/* -------------------------------------------------------------------------- */
/* Slice M — marketing / onboarding continuity                                */
/* -------------------------------------------------------------------------- */

.btn--small {
    padding: 6px 12px;
    font-size: 13px;
}

.form-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.error-box {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 13px;
    line-height: 1.5;
}
.error-box:empty {
    display: none;
}

body.hutch-marketing-page {
    background: #f7f9fd;
}

.hutch-marketing-page__main {
    max-width: 960px;
    margin: 0 auto;
}

.hutch-marketing-hero {
    padding: 36px 32px;
    text-align: center;
}

.hutch-marketing-hero--narrow {
    padding-bottom: 24px;
}

.hutch-marketing-hero__eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hutch-marketing-hero__title {
    margin: 0 0 12px;
    font-size: 32px;
    line-height: 1.2;
    color: #0f172a;
}

.hutch-marketing-hero__lede {
    margin: 0 auto 20px;
    max-width: 620px;
    font-size: 16px;
    line-height: 1.55;
    color: var(--muted);
}

.hutch-marketing-hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.hutch-marketing-hero__hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.hutch-marketing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.hutch-marketing-feature {
    padding: 22px;
}

.hutch-marketing-feature h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #0f172a;
}

.hutch-marketing-feature p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
}

.hutch-marketing-steps {
    margin: 0 0 16px;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.6;
}

.hutch-marketing-steps li {
    margin-bottom: 8px;
}

.hutch-marketing-steps strong {
    color: #0f172a;
    margin-right: 4px;
}

.hutch-marketing-footnote {
    background: #f8fafc;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

[data-show-when="signed-in"] {
    display: none;
}

body[data-hutch-auth="signed-in"] [data-show-when="signed-in"] {
    display: inline-flex;
}

body[data-hutch-auth="signed-in"] [data-show-when="signed-out"] {
    display: none;
}

/* Auth pages (signup / login / forgot / verify_check) */
.hutch-auth-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    gap: 20px;
    align-items: start;
    max-width: 880px;
    margin: 0 auto;
}

@media (max-width: 720px) {
    .hutch-auth-page {
        grid-template-columns: 1fr;
    }
}

.hutch-auth-card {
    padding: 28px 28px 24px;
}

.hutch-auth-card h1 {
    margin: 0 0 8px;
    color: #0f172a;
}

.hutch-auth-card__lede {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.hutch-auth-card__forgot {
    margin: 12px 0 0;
    font-size: 13px;
}

.hutch-auth-card__alt {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
}

.hutch-auth-card__alt a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.hutch-auth-card__alt a:hover {
    text-decoration: underline;
}

.hutch-auth-side {
    padding: 24px;
    background: var(--panel-soft);
}

.hutch-auth-side h3 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #0f172a;
}

.hutch-auth-side__steps {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.hutch-auth-side__steps--bulleted {
    list-style: disc;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-stack label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #334155;
    font-weight: 600;
}

.form-stack input[type="email"],
.form-stack input[type="password"],
.form-stack input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
}

.form-stack input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Plan-select page */
.hutch-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}

.hutch-plan-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.hutch-plan-card--featured {
    border: 2px solid var(--primary);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.hutch-plan-card__header {
    margin-bottom: 16px;
}

.hutch-plan-card__title {
    margin: 0 0 6px;
    font-size: 20px;
    color: #0f172a;
}

.hutch-plan-card__price {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.hutch-plan-card__price strong {
    font-size: 22px;
    color: #0f172a;
    margin-right: 4px;
}

.hutch-plan-card__price-suffix {
    font-size: 13px;
}

.hutch-plan-card__badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hutch-plan-card__features {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    flex: 1;
}

.hutch-plan-card__features li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.hutch-plan-card__features li:last-child {
    border-bottom: 0;
}

.hutch-plan-grid__footnote {
    margin: 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* Verify-result variants (set via JS data-state attribute) */
.hutch-verify-result[data-state="success"] {
    border-color: #bbf7d0;
}

.hutch-verify-result[data-state="failure"] {
    border-color: #fecaca;
}

/* Account dropdown (session-info) */
.hutch-account {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hutch-account__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
}

.hutch-account__button:hover {
    background: #f8fafc;
}

.hutch-account__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.hutch-account__email {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hutch-account__caret {
    color: var(--muted);
    font-size: 10px;
    margin-left: 2px;
}

.hutch-account__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
    z-index: 30;
}

.hutch-account__menu[hidden] {
    display: none;
}

.hutch-account__menu-header {
    padding: 6px 8px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.hutch-account__menu-email {
    font-weight: 600;
    color: #0f172a;
    font-size: 13px;
    word-break: break-all;
}

.hutch-account__menu-meta {
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hutch-account__chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 11px;
    letter-spacing: 0.02em;
}

.hutch-account__chip--warn {
    background: #fef3c7;
    color: #92400e;
}

.hutch-account__chip--ok {
    background: #dcfce7;
    color: #166534;
}

.hutch-account__menu-item {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.hutch-account__menu-item:hover {
    background: #f1f5f9;
}

.hutch-account__menu-item--danger {
    color: #991b1b;
}

/* Verify-email banner shown on protected pages */
.hutch-verify-banner {
    margin: 0 auto 14px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.hutch-verify-banner__text {
    flex: 1;
    min-width: 200px;
}

.hutch-verify-banner__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hutch-verify-banner__btn {
    background: transparent;
    border: 1px solid #d97706;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.hutch-verify-banner__btn:hover {
    background: rgba(217, 119, 6, 0.08);
}

.hutch-verify-banner__btn--ghost {
    border-color: transparent;
    color: #92400e;
}

/* UX hierarchy — infrastructure ids & orchestration behind advanced (Trading Setups + shared) */

.ss-pod-infra-details {
    margin-top: 6px;
}

.ss-pod-infra-summary {
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.ss-pod-infra-details .ss-pod-infra-summary::-webkit-details-marker {
    display: none;
}

.ss-pod-id--nested {
    margin-top: 4px;
    font-size: 11px;
    color: #64748b;
}

.fleet-orchestration-details {
    margin-top: 14px;
    border: 1px dashed #e3e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    background: #f9fbff;
}

.fleet-orchestration-summary {
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #475569;
    list-style: none;
}

.fleet-orchestration-details .fleet-orchestration-summary::-webkit-details-marker {
    display: none;
}

.fleet-orchestration-body {
    margin-top: 10px;
}

.pod-mode-truth-grid--diagnostics {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e8edf3;
}

/* -------------------------------------------------------------------------- */
/* Intelligence workspace — drawer, chips, live feed, multi-TF context.       */
/* Shared across all major pages so the intelligence layer is part of the     */
/* product identity, not a dashboard-specific widget.                         */
/*                                                                            */
/* Visual hierarchy (the single source of truth for operational presence):    */
/*   1. USER FOCUS (highest)                                                  */
/*      .intel-chip.is-active — cool indigo focus ring + soft aura.           */
/*      Always wins. Nothing else may visually outweigh it.                   */
/*      Chip identity is SYMBOL-only — TF interactions never move ownership.  */
/*   2. OPERATIONAL STATE (passive, glance-visible, never steals focus)       */
/*      .intel-chip[data-state="IN_POSITION"] — three calm cues:              */
/*        • small warm amber dot via ::before                                 */
/*        • faint cream chip face                                             */
/*        • slim warm inset left rule (capital engaged on this side)          */
/*   3. COMBINED FOCUS + OPERATIONAL                                          */
/*      cool ring (inner) + faint warm halo (outer) + warm inset left rule    */
/*      + slightly brighter amber dot ring. Reads as "important, held,        */
/*      observed" without becoming loud.                                      */
/*   4. RISK HINT                                                             */
/*      .intel-chip[data-state="BLOCKED"] — restrained amber accent only.     */
/* -------------------------------------------------------------------------- */

.market-drawer-toggle {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
}

.market-drawer-toggle:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.intel-drawer-toggle {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #312e81;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
}

.intel-drawer-toggle:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

.intel-drawer-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4f46e5;
    box-shadow: 0 0 0 2px #eef2ff;
    opacity: 0;
    transform: scale(0.6);
    pointer-events: none;
    transition: opacity 280ms ease, transform 280ms ease;
}

.intel-drawer-badge.is-on {
    opacity: 1;
    transform: scale(1);
}

.market-drawer {
    --market-drawer-w: 380px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(var(--market-drawer-w), min(520px, 92vw));
    max-width: 92vw;
    z-index: 1190;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
}

.market-drawer.market-drawer--open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.market-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 0;
}

.market-drawer__head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.market-drawer__close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0 4px;
    border-radius: 6px;
}

.market-drawer__close:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.market-drawer__sub {
    margin: 6px 18px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
}

.market-drawer__toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px 12px;
    flex-wrap: wrap;
}

.market-drawer__toolbar label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.market-drawer__width {
    flex: 1;
    min-width: 120px;
    accent-color: #0f766e;
}

.market-drawer__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 18px 18px;
}

.intel-drawer {
    --intel-drawer-w: 380px;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(var(--intel-drawer-w), min(520px, 92vw));
    max-width: 92vw;
    z-index: 1190;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
}

.intel-drawer.intel-drawer--open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}

.intel-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 0;
}

.intel-drawer__head h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.intel-drawer__close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 0 4px;
    border-radius: 6px;
}

.intel-drawer__close:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.intel-drawer__sub {
    margin: 6px 18px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
}

.intel-drawer__toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px 12px;
    flex-wrap: wrap;
}

.intel-drawer__toolbar label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.intel-drawer__width {
    flex: 1;
    min-width: 120px;
    accent-color: #4f46e5;
}

.intel-drawer__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.intel-section__title {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.intel-symbol-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Base chip: neutral, recedes. */
.intel-chip {
    position: relative;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: border-color 220ms ease, background 220ms ease,
        box-shadow 320ms ease, color 220ms ease;
}

.intel-chip:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/*
 * IN_POSITION — passive operational marker (capital engaged).
 *
 * Three calm cues layered on a neutral chip, none of them loud:
 *   1. amber dot via ::before — glance-visible indicator
 *   2. faint cream tint on the chip face — subtle "temperature" without
 *      colour-coding the symbol
 *   3. warm inset left rule — slim vertical edge that says "this side is
 *      operationally engaged" the way a docked panel signals attention
 *
 * The focus ring (see `.intel-chip.is-active`) still wins; capital
 * presence is intentionally a secondary layer.
 */
.intel-chip[data-state="IN_POSITION"] {
    background: #fffaf2;
    border-color: #f3e4cc;
    box-shadow: inset 3px 0 0 0 rgba(217, 119, 6, 0.42);
}

.intel-chip[data-state="IN_POSITION"]:hover {
    background: #fff5e6;
    border-color: #f1d6a8;
}

.intel-chip[data-state="IN_POSITION"]::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    margin-right: 7px;
    vertical-align: middle;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.20);
    transition: box-shadow 320ms ease;
}

/* BLOCKED — restrained risk hint, amber pip only. Never red. */
.intel-chip[data-state="BLOCKED"]::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d97706;
    opacity: 0.55;
    margin-right: 7px;
    vertical-align: middle;
}

/*
 * USER FOCUS — always wins. Cool indigo ring takes visual priority over any
 * operational marker. The amber dot remains visible (set by ::before above)
 * so the user can see "this is my focus AND it has capital engaged".
 */
.intel-chip.is-active {
    border-color: #4f46e5;
    background: #eef2ff;
    color: #1e1b4b;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.10);
}

/* WAITING + selected (and default selected): slow cool breathing — under observation. */
.intel-chip[data-state="WAITING"].is-active,
.intel-chip:not([data-state]).is-active {
    animation: hutch-intel-breathing 7.6s ease-in-out infinite;
}

/*
 * COMBINED — focused AND operationally engaged.
 *
 * Inner shadow stack: warm left rule (slightly stronger here so the
 * "capital engaged" cue stays legible against the cool focus background)
 * + cool inner focus ring + faint warm outer halo. Reads as
 * "important, held, observed". No breathing — held positions should feel
 * stable, not animated.
 */
.intel-chip[data-state="IN_POSITION"].is-active {
    border-color: #4f46e5;
    background: #f3f0ff;
    color: #1e1b4b;
    box-shadow: inset 3px 0 0 0 rgba(217, 119, 6, 0.55),
                0 0 0 3px rgba(79, 70, 229, 0.14),
                0 0 0 6px rgba(217, 119, 6, 0.12);
    animation: none;
}

.intel-chip[data-state="IN_POSITION"].is-active::before {
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.36);
}

@keyframes hutch-intel-breathing {
    0%, 100% { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08); }
    50%      { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16); }
}

@media (prefers-reduced-motion: reduce) {
    .intel-chip,
    .intel-chip.is-active {
        animation: none !important;
        transition: none !important;
    }
}

/*
 * The live feed is a transient activity layer — not a chat log. It lives in
 * its own bounded lane below the anchored orientation surfaces (chips +
 * multi-TF) so feed growth never separates them. Internal scroll handles any
 * overflow; the LIVE_MAX cap in state.js keeps content small in practice.
 */
.intel-live-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    max-height: 240px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.intel-live-feed::-webkit-scrollbar {
    width: 6px;
}

.intel-live-feed::-webkit-scrollbar-track {
    background: transparent;
}

.intel-live-feed::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.intel-live-feed::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/*
 * Anchored orientation surfaces (chips + multi-TF). These never need to
 * scroll internally; they're sized by content. Marked explicitly so future
 * layout changes can target them without affecting the feed lane.
 */
.intel-section--anchor {
    flex: 0 0 auto;
}

.intel-section--feed {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/*
 * Idle / quiet feed line: slimmer than a card so silence reads as
 * intentional rather than as an empty card occupying the lane.
 */
.intel-live-feed-quiet {
    margin: 0;
    padding: 4px 2px;
    font-size: 12px;
    line-height: 1.5;
    font-style: italic;
    letter-spacing: 0.01em;
    color: #94a3b8;
}

/*
 * Live feed weight hierarchy — five levels of emotional gravity.
 *
 *   .intel-live-feed-quiet                    — idle silence (above)
 *   .intel-live-event--ambient                — atmospheric posture (lightest event)
 *   .intel-live-event--watch (and default)    — mid-cycle watch-state
 *   .intel-live-event--shift                  — meaningful posture / action change
 *   .intel-live-event--lifecycle              — entry / exit (highest gravity)
 *
 * Each tier carries different chrome (border, weight, contrast) so the user
 * can read importance peripherally without parsing each line.
 */

.intel-live-event {
    margin: 0;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid #e8edf3;
    background: #ffffff;
    font-size: 13px;
    line-height: 1.55;
    color: #334155;
    letter-spacing: 0.01em;
    animation: hutch-intel-event-in 220ms ease-out;
}

.intel-live-event time {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 6px;
}

/*
 * Ambient observations — atmospheric and recessive. Lightest event tier:
 * no card chrome, slim indigo left-rule, italic, lowered opacity. They
 * acknowledge that nothing meaningful happened — the lane is still alive.
 */
.intel-live-event--ambient {
    padding: 7px 14px;
    border-color: transparent;
    border-left: 2px solid #c7d2fe;
    border-radius: 0 8px 8px 0;
    background: transparent;
    box-shadow: none;
    color: #64748b;
    font-style: italic;
    font-size: 12px;
    line-height: 1.5;
    opacity: 0.86;
}

.intel-live-event--ambient time {
    font-size: 9px;
    font-weight: 600;
    color: #a8b3c2;
    margin-bottom: 3px;
    letter-spacing: 0.05em;
}

/* Watch-state (mid-cycle posture notes) — default chrome already covers this. */
.intel-live-event--watch {
    /* inherits .intel-live-event defaults */
}

/*
 * Shift — meaningful state / posture change. Slightly stronger text contrast
 * and a subtle left accent so it reads heavier than watch but still calm.
 */
.intel-live-event--shift {
    border-color: #dde3ec;
    border-left: 2px solid #cbd5e1;
    color: #1f2937;
}

/*
 * Lifecycle — capital state crossed in or out of a position. Highest gravity
 * tier in the lane: warmer accent (the same amber language as the chips' "in
 * position" marker), slightly bolder text. Still operational, never loud.
 */
.intel-live-event--lifecycle {
    border-color: #f1d6a8;
    border-left: 3px solid rgba(217, 119, 6, 0.55);
    background: #fffdf8;
    color: #1f2937;
    font-weight: 500;
}

.intel-live-event--lifecycle time {
    color: #c08a3b;
}

@keyframes hutch-intel-event-in {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .intel-live-event { animation: none !important; }
}

.intel-nav-pair {
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    display: inline;
    padding: 0;
    margin: 0 4px 0 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #3730a3;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: #c7d2fe;
    text-underline-offset: 3px;
}

.intel-nav-pair:hover {
    color: #1e1b4b;
    text-decoration-color: #818cf8;
}

.intel-nav-pair:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}

.intel-multitf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.intel-mtf-cell {
    border: 1px solid #e8edf3;
    border-radius: 10px;
    padding: 10px 10px 8px;
    background: #ffffff;
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
    transition: opacity 280ms ease, border-color 220ms ease;
}

.intel-mtf-cell strong {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

.intel-mtf-cell--skeleton .intel-mtf-detail {
    color: #cbd5e1;
}

.intel-mtf-nav {
    font: inherit;
    display: block;
    width: 100%;
    text-align: left;
    padding: 0 0 6px;
    margin: 0 0 4px;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    color: #0f172a;
}

.intel-mtf-nav-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.intel-mtf-nav:hover .intel-mtf-nav-label {
    color: #3730a3;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.intel-mtf-nav:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
    border-radius: 4px;
}

.intel-mtf-detail {
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
}

.intel-mtf-cell--pending {
    opacity: 0.78;
}

.intel-query-reply {
    min-height: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #334155;
}

/*
 * Operational query reply panel.
 *
 * Three text tiers (lead → list → note) with calm chrome. Busy state dims
 * the body and lights up the dashed border slightly so the user sees that
 * something is happening without the panel "flashing".
 */
.intel-query-reply__body {
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 12px 14px;
    background: #ffffff;
    color: #475569;
    transition: border-color 220ms ease, color 220ms ease, opacity 220ms ease;
}

.intel-query-reply__body.is-busy {
    border-color: #c7d2fe;
    color: #64748b;
    opacity: 0.86;
    font-style: italic;
}

.intel-query-reply__lead {
    margin: 0;
    color: #1f2937;
    font-size: 13px;
    line-height: 1.55;
}

.intel-query-reply__list {
    margin: 8px 0 0;
    padding-left: 16px;
    list-style: disc;
    color: #475569;
}

.intel-query-reply__list li {
    margin: 2px 0;
    font-size: 12.5px;
    line-height: 1.5;
}

.intel-query-reply__note {
    margin: 8px 0 0;
    font-size: 11.5px;
    line-height: 1.45;
    color: #94a3b8;
    font-style: italic;
    letter-spacing: 0.01em;
}

.intel-query-form {
    position: relative;
    display: flex;
    gap: 8px;
    padding: 12px 18px 18px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    margin-top: auto;
}

.intel-query-form input[type="text"] {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.intel-query-form button[type="submit"] {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #4f46e5;
    background: #4f46e5;
    color: #ffffff;
    cursor: pointer;
}

.intel-query-form button[type="submit"]:hover {
    background: #4338ca;
}

/*
 * Operational query discoverability surface.
 *
 * A small "?" button sits between the input and the submit. Clicking it
 * opens a slim grouped popover above the form with pill-style example
 * commands. Each pill fills the input on click. Intentionally minimal —
 * no welcome copy, no narrative, no AI-onboarding tone.
 */
.intel-query-help {
    flex: 0 0 auto;
    width: 36px;
    height: 40px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.intel-query-help:hover,
.intel-query-help:focus-visible {
    border-color: #c7d2fe;
    color: #4f46e5;
    background: #eef2ff;
    outline: none;
}

.intel-query-help[aria-expanded="true"] {
    border-color: #4f46e5;
    color: #1e1b4b;
    background: #eef2ff;
}

.intel-query-help-pop {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 18px;
    right: 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12), 0 1px 0 rgba(15, 23, 42, 0.04);
    padding: 12px 14px;
    z-index: 2;
    max-height: 60vh;
    overflow-y: auto;
    animation: hutch-intel-help-in 200ms ease-out;
}

.intel-query-help-pop[hidden] {
    display: none;
}

.intel-query-help-pop__hint {
    margin: 0 0 10px;
    font-size: 11px;
    line-height: 1.4;
    color: #94a3b8;
    font-style: italic;
}

.intel-query-help-pop__group {
    margin: 0 0 10px;
}

.intel-query-help-pop__group:last-child {
    margin-bottom: 0;
}

.intel-query-help-pop__group h5 {
    margin: 0 0 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94a3b8;
}

.intel-query-help-pop__group ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.intel-query-help-pop__group li {
    margin: 0;
    padding: 0;
}

.intel-query-help-pop__group button {
    font: inherit;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.intel-query-help-pop__group button:hover,
.intel-query-help-pop__group button:focus-visible {
    border-color: #c7d2fe;
    color: #1e1b4b;
    background: #eef2ff;
    outline: none;
}

@keyframes hutch-intel-help-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .intel-query-help-pop { animation: none !important; }
    .intel-query-help,
    .intel-query-help-pop__group button {
        transition: none !important;
    }
}