:root {
    --dm-left-panel-min-height: 500px;
    --dm-context-panel-min-height: 500px;
    --dm-placeholder-min-height: 320px;
    --dm-chart-placeholder-min-height: 150px;
    --dm-table-shell-height: 260px;
    --dm-placeholder-centered-min-height: 220px;
    --dm-fg-card-min-height: 128px;
    --dm-fg-gauge-min-height: 140px;
    --dm-context-scroll-max-height: calc(100vh - 220px);
    --dm-context-scroll-min-height: 980px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; }
a { color: inherit; text-decoration: none; }
.box { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: inset 0 1px 0 var(--page-color-204); }
.brand-block { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-size: 24px; font-weight: 700; letter-spacing: 0.02em; }
.brand-sub { margin-top: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.eyebrow { margin-bottom: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.landing-page { min-height: 100vh; }
.site-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; gap: 20px; padding: 20px; }
.landing-header { display: grid; grid-template-columns: 1fr minmax(320px, 420px); gap: 20px; align-items: start; }
.landing-header-left, .landing-header-right, .landing-main { padding: 20px; }
.login-box { min-height: 300px; }
.login-box.login-box-pin { min-height: 300px; }
.login-title { margin-bottom: 16px; font-size: 18px; font-weight: 700; }
.auth-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.auth-choice-button { display: inline-flex; justify-content: center; align-items: center; min-height: 38px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--page-color-164); color: var(--text); font-weight: 700; }
.auth-choice-button.is-active, .auth-choice-button:hover { border-color: var(--app-color-001); background: var(--app-color-002); }
.login-form, .auth-form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 6px; }
.form-row label { font-size: 13px; color: var(--app-color-003); }
.form-row input, .form-row textarea { width: 100%; border: 1px solid var(--border-2); border-radius: 8px; background: var(--page-color-164); color: var(--text); padding: 10px 12px; }
.form-row textarea { resize: vertical; min-height: 96px; font-family: Arial, Helvetica, sans-serif; }
.form-row button { border: 0; border-radius: 8px; background: var(--accent); color: var(--page-color-050); padding: 10px 14px; font-weight: 700; cursor: pointer; }
.form-row button:hover { background: var(--accent-hover); }
.form-row-submit { margin-top: 2px; }
.form-row-pin-only { margin-top: 28px; }
.auth-error { margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error-text); }
.auth-notice { margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; background: var(--app-color-004); border: 1px solid var(--app-color-005); color: var(--app-color-006); }
.auth-copy { color: var(--muted); line-height: 1.45; }
.auth-trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.readonly-value { padding: 10px 12px; border-radius: 8px; background: var(--page-color-164); border: 1px solid var(--border-2); color: var(--text); }
.landing-main { min-height: 420px; }
.landing-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 40px; color: var(--muted); font-size: 13px; }
.footer-right { text-align: right; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { background: var(--app-color-007); border-right: 1px solid var(--border); padding: 18px 14px 20px; display: grid; grid-template-rows: auto 1fr; gap: 18px; }
.sidebar-brand { padding: 4px 6px 10px; border-bottom: 1px solid var(--page-color-187); }
.sidebar-nav { display: grid; align-content: start; gap: 6px; }
.nav-link { display: block; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; color: var(--app-color-008); transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.nav-link:hover { background: var(--app-color-009); border-color: var(--border); color: var(--page-color-202); }
.nav-link.is-active { background: var(--app-color-010); border-color: var(--app-color-011); color: var(--page-color-202); }
.nav-link-logout { margin-top: 12px; }
.nav-switch-form { display: grid; gap: 6px; margin-top: 14px; padding: 10px 6px 0; border-top: 1px solid var(--page-color-198); }
.nav-switch-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.nav-switch-select { width: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--page-color-164); color: var(--text); padding: 9px 10px; }
.main-shell { min-width: 0; display: grid; grid-template-rows: auto 1fr; }
.topbar { display: grid; grid-template-columns: minmax(640px, 1fr) auto; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--app-color-012); backdrop-filter: blur(8px); }
.topbar-command { min-width: 0; }
.command-shell { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px; align-items: center; }
.command-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; }
.command-input { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--page-color-164); color: var(--text); padding: 10px 12px; }
.topbar-meta { display: flex; gap: 10px; align-items: center; }
.pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel-2); color: var(--text); }
.pill.is-message-unread { border-color: var(--app-color-013); background: var(--app-color-014); color: var(--app-color-015); }
.content { padding: 20px; }

.sql-inspector-shell{display:grid;gap:16px;min-width:0;color:var(--text)}
.sql-inspector-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.sql-inspector-head h1{margin:0;font-size:24px;color:var(--text)}
.sql-inspector-sub{margin-top:6px;color:var(--muted);line-height:1.45}
.sql-inspector-card{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:14px 16px;min-width:0;color:var(--text)}
.sql-inspector-form{display:grid;gap:12px}
.sql-inspector-grid{display:grid;grid-template-columns:160px 220px;gap:12px}
.sql-inspector-field{display:grid;gap:6px}
.sql-inspector-field label{font-size:12px;color:var(--muted)}
.sql-inspector-field input,.sql-inspector-field textarea{width:100%;border:1px solid var(--border);border-radius:10px;background:var(--page-color-164);color:var(--text);padding:10px 12px}
.sql-inspector-field textarea{min-height:260px;font-family:Consolas,Monaco,monospace;font-size:13px;line-height:1.45;resize:vertical}
.sql-inspector-hint{font-size:12px;color:var(--muted);line-height:1.4}
.sql-inspector-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.sql-inspector-check{display:inline-flex;align-items:center;gap:8px;color:var(--muted);font-size:13px}
.sql-inspector-check input{width:auto}
.sql-inspector-button{border:0;border-radius:10px;background:var(--accent);color:var(--page-color-050);font-weight:700;padding:10px 14px;cursor:pointer}
.sql-inspector-secondary{border:1px solid var(--border);border-radius:10px;background:var(--page-color-100);color:var(--text);font-weight:700;padding:10px 14px;cursor:pointer;text-decoration:none}
.sql-inspector-notice{border:1px solid var(--border);border-radius:12px;background:var(--page-color-100);padding:12px 14px;color:var(--muted);line-height:1.5}
.sql-inspector-notice.is-error{border-color:var(--error-border);background:var(--error-bg);color:var(--error-text)}
.sql-inspector-notice.is-ok{color:var(--page-color-155)}
.sql-inspector-meta{display:flex;flex-wrap:wrap;gap:8px}
.sql-inspector-pill{display:inline-flex;align-items:center;min-height:28px;padding:0 9px;border-radius:999px;border:1px solid var(--border);background:var(--page-color-100);color:var(--muted);font-size:12px}
.sql-inspector-pill.is-ok{color:var(--page-color-155)}
.sql-inspector-pill.is-error,.sql-inspector-pill.is-blocked{color:var(--app-color-016)}
.sql-inspector-sql{white-space:pre-wrap;word-break:break-word;font-family:Consolas,Monaco,monospace;font-size:12px}
.sql-inspector-table-wrap{overflow:auto;max-width:100%}
.sql-inspector-table{width:100%;border-collapse:collapse;font-size:12px;min-width:760px}
.sql-inspector-table th,.sql-inspector-table td{border:1px solid var(--border);padding:7px 8px;text-align:left;vertical-align:top}
.sql-inspector-table th{background:var(--page-color-159);color:var(--page-color-038);white-space:nowrap}
.sql-inspector-table td{color:var(--page-color-160);max-width:520px;word-break:break-word}
.sql-inspector-result{display:grid;gap:12px}
.sql-inspector-result summary{cursor:pointer;font-weight:700;color:var(--text)}
@media(max-width:800px){.sql-inspector-grid{grid-template-columns:1fr}.sql-inspector-head{display:grid}}

.dashboard-shell { display: grid; gap: 18px; }
.context-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.context-chip, .kpi-card, .panel-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.context-chip { padding: 12px 14px; display: grid; gap: 5px; }
.context-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.11em; color: var(--muted); }
.context-value { font-size: 15px; font-weight: 600; }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card { padding: 14px 16px; display: grid; gap: 8px; min-height: 94px; }
.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.kpi-value { font-size: 24px; font-weight: 700; }
.panel-grid { display: grid; gap: 16px; }
.panel-grid-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-card { min-height: 360px; display: grid; grid-template-rows: auto 1fr; }
.panel-card-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.panel-card-header h2 { margin: 0; font-size: 16px; }
.panel-card-body { padding: 14px 16px; min-width: 0; }
.panel-placeholder { color: var(--muted); line-height: 1.55; }
.panel-loader { color: var(--muted); }
.runtime-error-box { border: 1px solid var(--error-border); background: var(--error-bg); border-radius: 10px; padding: 14px 16px; }
.runtime-error-title { font-weight: 600; margin-bottom: 6px; color: var(--error-text); }
.runtime-error-message { color: var(--app-color-017); white-space: pre-wrap; word-break: break-word; }
.alerts-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    height: 100%;
    min-height: 0;
}

#dm-events-alerts .alerts-main-grid {
    height: 340px;
    max-height: 340px;
}

.alert-main-grid {
    height: 100%;
    min-height: 0;
    max-height: none;
}

.alerts-left-column {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alerts-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 0;
    flex: 0 0 auto;
}

.alerts-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.alerts-filter-group label {
    font-size: 12px;
    color: var(--muted);
}

.alerts-filter-input {
    width: 100%;
    min-width: 0;
}

.alerts-lookback-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    flex: 0 0 auto;
}

.alerts-lookback-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--page-color-187);
    color: var(--muted);
    font-size: 11px;
}

.alerts-list,
.alert-detail-container {
    min-height: 0;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    scrollbar-gutter: stable both-edges;
}

.alerts-list {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 8px;
}

.alert-row {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid var(--app-color-018);
    border-radius: 10px;
    background: var(--app-color-019);
    cursor: pointer;
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
}

.alert-row.is-unread {
    background: var(--alert-unread-bg);
    border-color: var(--alert-unread-border);
}

.alert-row.is-read {
    background: var(--app-color-019);
    border-color: var(--app-color-018);
    opacity: 1;
}

.alert-row.is-recent {
    border-left: 4px solid var(--app-color-020);
}

.alert-row:hover,
.alert-row.is-active {
    background: var(--app-color-021);
    border-color: var(--app-color-020);
}

.alert-row-status {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

.alert-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.alert-status-dot.is-unread {
    background: var(--alert-unread-dot);
}

.alert-status-dot.is-read {
    background: var(--alert-read-dot);
}

.alert-row-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.alert-title-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.alert-title {
    font-weight: 600;
    color: var(--page-color-202);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-chip {
    font-size: 11px;
    line-height: 1;
    flex: 0 0 auto;
}

.alert-chip-recent {
    color: var(--alert-unread-dot);
}

.alert-meta {
    font-size: 12px;
    color: var(--page-color-300);
    opacity: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-empty-state {
    padding: 14px 16px;
    border: 1px solid var(--app-color-018);
    border-radius: 10px;
    background: var(--app-color-019);
    color: var(--app-color-022);
}

.alert-detail-container {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    border: 1px solid var(--app-color-018);
    border-radius: 10px;
    background: var(--app-color-019);
}

.alert-detail-placeholder {
    color: var(--app-color-022);
    opacity: .78;
}

.alert-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.alert-detail-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.25;
    color: var(--page-color-202);
    margin-bottom: 6px;
}

.alert-detail-meta {
    font-size: 12px;
    color: var(--page-color-300);
    opacity: 1;
    margin-bottom: 0;
}

.alert-detail-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.alert-fact {
    border: 1px solid var(--app-color-018);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--alert-unread-bg);
    min-width: 0;
}

.alert-fact-label {
    font-size: 11px;
    color: var(--muted);
    opacity: 1;
    margin-bottom: 4px;
}

.alert-fact-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--page-color-202);
    overflow-wrap: anywhere;
}

.alert-detail-body {
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
    margin-bottom: 16px;
}

.alert-memo-box {
    border-top: 1px solid var(--app-color-018);
    padding-top: 14px;
    margin-top: auto;
}

.alert-memo-label {
    display: inline-block;
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--page-color-378);
}

.alert-memo-text {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    border: 1px solid var(--app-color-023);
    border-radius: 8px;
    background: var(--page-color-167);
    color: var(--page-color-044);
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    outline: none;
}

.alert-memo-text::placeholder {
    color: var(--app-color-024);
}

.alert-memo-text:focus {
    border-color: var(--app-color-025);
    box-shadow: 0 0 0 2px var(--app-color-026);
}

.alert-memo-actions {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-memo-status {
    font-size: 12px;
    color: var(--muted);
}

.dm-events-panel {
    min-height: 420px;
    height: 420px;
}

.dm-events-panel .panel-card-body {
    min-height: 0;
}

.dm-events-panel-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.events-page-shell {
    display: grid;
    gap: 16px;
}

.events-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

.events-page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--page-color-202);
    margin-bottom: 4px;
}

.events-page-subtitle {
    color: var(--muted);
    font-size: 13px;
}

.events-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
    gap: 16px;
    min-height: 720px;
}

.events-left-column,
.events-detail-container {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.events-left-column {
    padding: 14px 16px;
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 14px;
}

.events-toolbar {
    display: grid;
    grid-template-columns: 1.2fr repeat(5, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.events-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.events-filter-group label {
    font-size: 12px;
    color: var(--muted);
}

.events-filter-input,
.events-filter-group input,
.events-filter-group select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border-2);
    border-radius: 8px;
    background: var(--page-color-164);
    color: var(--text);
    padding: 10px 12px;
}

.events-list-shell {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 8px;
}

.events-list-body {
    height: 620px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.events-history-row {
    display: grid;
    grid-template-columns: 80px 148px 150px minmax(0, 1fr) 140px;
    gap: 10px;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.events-history-row-header {
    padding: 0 12px 6px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

button.events-history-row {
    border: 1px solid var(--app-color-018);
    border-radius: 10px;
    background: var(--app-color-019);
    color: var(--text);
    text-align: left;
    padding: 12px;
    cursor: pointer;
}

button.events-history-row.is-unread {
    background: var(--alert-unread-bg);
    border-color: var(--alert-unread-border);
}

button.events-history-row.is-read {
    background: var(--app-color-019);
    border-color: var(--app-color-018);
}

button.events-history-row.is-recent {
    border-left: 4px solid var(--app-color-020);
}

button.events-history-row:hover,
button.events-history-row.is-active {
    background: var(--app-color-021);
    border-color: var(--app-color-020);
}

.events-history-status,
.events-history-date,
.events-history-type,
.events-history-source,
.events-history-title {
    min-width: 0;
}

.events-history-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.events-mini-chip {
    font-size: 12px;
    line-height: 1;
}

.events-history-date,
.events-history-type,
.events-history-source {
    color: var(--page-color-300);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.events-history-title {
    color: var(--page-color-202);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.events-detail-container {
    min-height: 720px;
    max-height: 720px;
    overflow-y: auto;
    padding: 14px 16px;
}

/* Decision Matrix */
.decision-context .kpi-card {
    padding: 8px 10px;
    min-height: 56px;
    gap: 4px;
}
.decision-context .kpi-label {
    font-size: 10px;
    line-height: 1.1;
}
.decision-context .kpi-value {
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
    word-break: break-word;
}
.decision-context .dm-portfolio-select {
    width: 100%;
    border: 1px solid var(--border-2);
    border-radius: 8px;
    background: var(--page-color-164);
    color: var(--text);
    padding: 6px 8px;
    font-size: 13px;
    min-height: 34px;
}
.decision-context .dm-sector-bars {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.decision-context .dm-sector-row {
    display: grid;
    grid-template-columns: 150px minmax(0,1fr) 64px;
    gap: 10px;
    align-items: center;
}
.decision-context .dm-sector-name {
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.decision-context .dm-sector-track {
    height: 10px;
    border-radius: 999px;
    background: var(--page-color-186);
    overflow: hidden;
}
.decision-context .dm-sector-fill {
    height: 100%;
    border-radius: 999px;
}
.decision-context .dm-sector-value {
    text-align: right;
    font-size: 11px;
    color: var(--muted);
}

.decision-context .dm-allocation-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.decision-context .dm-alloc-row {
    display: grid;
    grid-template-columns: 150px minmax(0,1fr) 64px;
    gap: 10px;
    align-items: center;
}

.decision-context .dm-alloc-name {
    font-size: 12px;
    color: var(--app-color-027);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.decision-context .dm-alloc-track {
    height: 8px;
    background: var(--page-color-186);
    border-radius: 999px;
    overflow: hidden;
}

.decision-context .dm-alloc-fill {
    height: 100%;
    background: var(--app-color-028);
    border-radius: 999px;
}

.decision-context .dm-alloc-value {
    font-size: 11px;
    color: var(--app-color-029);
    text-align: right;
}

.dm-left-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.dm-left-table-overview th:first-child,
.dm-left-table-overview td:first-child,
.dm-left-table-market th:first-child,
.dm-left-table-market td:first-child,
.dm-left-table-performance th:first-child,
.dm-left-table-performance td:first-child {
    width: 42%;
}

.dm-left-table-overview th:nth-last-child(-n+2),
.dm-left-table-overview td:nth-last-child(-n+2),
.dm-left-table-market th:nth-last-child(-n+2),
.dm-left-table-market td:nth-last-child(-n+2),
.dm-left-table-performance th:nth-last-child(-n+2),
.dm-left-table-performance td:nth-last-child(-n+2) {
    width: 10%;
}

.dm-left-table th,
.dm-left-table td {
    vertical-align: middle;
}

.dm-cell-symbol-rich {
    min-width: 0;
    white-space: normal !important;
}

.dm-symbol-cell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    min-width: 0;
    min-height: 38px;
}

.dm-symbol-cell-media {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    flex: 0 0 auto;
}

.dm-symbol-indicators {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 14px;
    padding-top: 1px;
    flex: 0 0 14px;
}

.dm-symbol-indicators.is-empty {
    display: none;
}

.dm-symbol-indicator-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 12px;
    line-height: 1;
}

.dm-symbol-indicator-slot:empty {
    display: none;
}

.dm-symbol-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid transparent;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
}

.dm-symbol-logo img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: transparent;
}

.dm-symbol-logo-fallback {
    color: var(--page-color-044);
    font-size: 12px;
    font-weight: 700;
}

.dm-symbol-logo-with-fallback {
    position: relative;
    background: var(--page-color-042);
    border-color: var(--page-color-203);
}

.dm-symbol-logo-with-fallback img {
    position: relative;
    z-index: 1;
}

.dm-symbol-logo-with-fallback .dm-symbol-logo-fallback-text {
    display: none;
    color: var(--page-color-044);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
}

.dm-symbol-logo-with-fallback.is-fallback img {
    display: none;
}

.dm-symbol-logo-with-fallback.is-fallback .dm-symbol-logo-fallback-text {
    display: inline-flex;
}

.dm-symbol-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.dm-symbol-headline {
    min-width: 0;
    display: flex;
    align-items: center;
}

.dm-symbol-detail-trigger-rich {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dm-symbol-headline-text {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.dm-symbol-code {
    font-size: 13px;
    font-weight: 700;
    color: var(--page-color-202);
    letter-spacing: 0.02em;
}

.dm-symbol-currency {
    padding: 1px 5px;
    border: 1px solid var(--page-color-316);
    border-radius: 999px;
    background: var(--page-color-187);
    font-size: 10px;
    font-weight: 700;
    color: var(--app-color-030);
    line-height: 1.35;
    white-space: nowrap;
}

.dm-symbol-name {
    min-width: 0;
    font-size: 12px;
    color: var(--page-color-300);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.dm-mini-chart-inline {
    flex: 0 0 auto;
}

.alert-symbol {
    font-size: 13px;
    font-weight: 600;
    color: var(--page-color-202);
    margin-right: 6px;
    letter-spacing: 0.02em;
}
.dm-mini-chart {
    width:60px;
    height:20px;
    opacity:0.6;
    cursor:pointer;
}
.dm-mini-chart:hover {
    opacity:1;
}
.dm-row-active {
    background: var(--page-color-201) !important;
}


.dm-top-symbol-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dm-symbol-detail-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
}

.dm-symbol-doc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    color: var(--muted);
    opacity: 0.9;
}

.dm-symbol-row:hover .dm-symbol-doc-icon {
    color: var(--page-color-044);
    opacity: 1;
}

.dm-event-flag,
.dm-notes-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    min-height: 12px;
    line-height: 1;
    font-size: 12px;
    text-decoration: none;
}

.dm-event-flag {
    color: var(--app-color-031);
}

.dm-event-flag:hover {
    color: var(--page-color-066);
}

.dm-event-flag-empty {
    display: none;
}

.dm-notes-flag {
    color: var(--app-color-032);
}

.dm-notes-flag.has-memo {
    color: var(--page-color-378);
}


.alerts-main-grid {
    position: relative;
}

.alerts-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: none;
}

.alerts-overlay.is-open {
    display: block;
}

.alerts-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: var(--app-color-033);
    backdrop-filter: blur(2px);
    border-radius: 12px;
}

.alerts-overlay-panel {
    position: absolute;
    inset: 8px;
    background: linear-gradient(180deg, var(--page-color-164) 0%, var(--app-color-019) 100%);
    border: 1px solid var(--alert-unread-border);
    border-radius: 12px;
    box-shadow: 0 18px 40px var(--page-color-375);
    overflow: auto;
    padding: 18px 18px 16px;
}

.alerts-overlay-close {
    position: sticky;
    top: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--app-color-011);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--page-color-044);
    font-size: 16px;
    cursor: pointer;
    z-index: 2;
}

.alerts-overlay-close:hover {
    background: var(--app-color-010);
    border-color: var(--alert-selected-border);
}

.alerts-overlay-body {
    margin-top: 8px;
}

.alerts-overlay .alert-detail-head {
    padding-right: 44px;
}

.alerts-overlay .alert-detail-container,
.alerts-overlay #alert-detail {
    border: 0;
    background: transparent;
    padding: 0;
}


.dm-symbol-row {
    cursor: pointer;
}

.dm-symbol-row:hover {
    background: var(--app-color-034);
}

.dm-symbol-row .dm-cell-symbol {
    position: relative;
}

.symbol-overlay {
    position: fixed;
    top: 76px;
    right: 20px;
    bottom: 20px;
    left: calc(50% + 8px);
    z-index: 80;
}

.symbol-overlay .alerts-overlay-panel {
    inset: 0;
    overflow: auto;
}

.symbol-detail {
    display: grid;
    gap: 16px;
}

.symbol-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding-right: 44px;
    position: sticky;
    top: 0;
    z-index: 12;
    padding-top: 2px;
    padding-bottom: 10px;
    background: var(--app-color-019);
}

.symbol-detail-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--page-color-202);
}

.symbol-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    margin-top: 6px;
}

.symbol-detail-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.symbol-tabbed-detail {
    display: grid;
    gap: 14px;
}

.symbol-tab-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.symbol-tab-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--page-color-186);
    border-radius: 12px;
    background: var(--alert-unread-bg);
    position: sticky;
    top: 62px;
    z-index: 11;
}

.symbol-tab-list label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 7px 10px;
    border: 1px solid var(--page-color-186);
    border-radius: 8px;
    background: var(--page-color-185);
    color: var(--page-color-300);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    cursor: pointer;
    white-space: nowrap;
}

.symbol-tab-list label:hover {
    border-color: var(--page-color-373);
    color: var(--page-color-044);
}

.symbol-tab-input[data-tab="overview"]:checked ~ .symbol-tab-list label[data-tab-label="overview"],
.symbol-tab-input[data-tab="earnings"]:checked ~ .symbol-tab-list label[data-tab-label="earnings"],
.symbol-tab-input[data-tab="financials"]:checked ~ .symbol-tab-list label[data-tab-label="financials"],
.symbol-tab-input[data-tab="analysts"]:checked ~ .symbol-tab-list label[data-tab-label="analysts"],
.symbol-tab-input[data-tab="events"]:checked ~ .symbol-tab-list label[data-tab-label="events"],
.symbol-tab-input[data-tab="risk"]:checked ~ .symbol-tab-list label[data-tab-label="risk"],
.symbol-tab-input[data-tab="borrow"]:checked ~ .symbol-tab-list label[data-tab-label="borrow"],
.symbol-tab-input[data-tab="guidance"]:checked ~ .symbol-tab-list label[data-tab-label="guidance"] {
    background: var(--page-color-049);
    border-color: var(--page-color-049);
    color: var(--page-color-202);
}

.symbol-tab-panel {
    display: none;
}

.symbol-tab-input[data-tab="overview"]:checked ~ .symbol-tab-panels .symbol-tab-panel[data-symbol-tab-panel="overview"],
.symbol-tab-input[data-tab="earnings"]:checked ~ .symbol-tab-panels .symbol-tab-panel[data-symbol-tab-panel="earnings"],
.symbol-tab-input[data-tab="financials"]:checked ~ .symbol-tab-panels .symbol-tab-panel[data-symbol-tab-panel="financials"],
.symbol-tab-input[data-tab="analysts"]:checked ~ .symbol-tab-panels .symbol-tab-panel[data-symbol-tab-panel="analysts"],
.symbol-tab-input[data-tab="events"]:checked ~ .symbol-tab-panels .symbol-tab-panel[data-symbol-tab-panel="events"],
.symbol-tab-input[data-tab="risk"]:checked ~ .symbol-tab-panels .symbol-tab-panel[data-symbol-tab-panel="risk"],
.symbol-tab-input[data-tab="borrow"]:checked ~ .symbol-tab-panels .symbol-tab-panel[data-symbol-tab-panel="borrow"],
.symbol-tab-input[data-tab="guidance"]:checked ~ .symbol-tab-panels .symbol-tab-panel[data-symbol-tab-panel="guidance"] {
    display: block;
}

.symbol-detail-facts-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.symbol-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.symbol-overview-card {
    border: 1px solid var(--page-color-186);
    border-radius: 12px;
    background: var(--alert-unread-bg);
    padding: 12px;
    display: grid;
    gap: 10px;
    min-width: 0;
}

.symbol-overview-card-wide {
    grid-column: 1 / -1;
}

.symbol-overview-card.is-positive {
    border-color: var(--page-color-228);
}

.symbol-overview-card.is-negative {
    border-color: var(--page-color-231);
}

.symbol-overview-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.symbol-overview-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.symbol-overview-posture {
    color: var(--page-color-050);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 4px;
}

.symbol-overview-note,
.symbol-overview-thesis {
    color: var(--page-color-300);
    font-size: 12px;
    line-height: 1.45;
}

.symbol-overview-thesis {
    color: var(--page-color-044);
}

.symbol-overview-bars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.symbol-stacked-bar {
    display: flex;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--page-color-234);
    border: 1px solid var(--page-color-198);
}

.symbol-stacked-bar span {
    display: block;
    min-width: 2px;
}

.symbol-stacked-bar .is-positive {
    background: var(--app-color-035);
}

.symbol-stacked-bar .is-neutral {
    background: var(--app-color-036);
}

.symbol-stacked-bar .is-negative {
    background: var(--app-color-037);
}

.symbol-overview-kpis {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--page-color-300);
    font-size: 12px;
}

.symbol-overview-kpis strong {
    color: var(--page-color-050);
}

.symbol-overview-mini-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.symbol-subsection-title {
    margin: 14px 0 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--page-color-044);
    letter-spacing: 0;
}

.symbol-detail-copy {
    color: var(--app-color-022);
    line-height: 1.55;
}

.symbol-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.symbol-chart-card {
    border: 1px solid var(--app-color-018);
    border-radius: 10px;
    background: var(--app-color-019);
    padding: 12px 12px 10px;
    display: grid;
    gap: 10px;
    min-height: 180px;
}

.symbol-chart-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.symbol-chart-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
    align-items: end;
    gap: 6px;
    min-height: 118px;
}

.symbol-chart-bar-wrap {
    display: grid;
    gap: 6px;
    align-items: end;
    justify-items: stretch;
}

.symbol-chart-bar {
    min-height: 12px;
    border-radius: 6px 6px 0 0;
    background: var(--macro-zone-low);
    position: relative;
}

.symbol-chart-bar.is-negative {
    background: var(--page-color-191);
}

.symbol-chart-bar.is-neutral {
    background: var(--app-color-038);
}

.symbol-chart-bar.is-alt {
    background: var(--app-color-039);
}

.symbol-chart-bar.is-alt2 {
    background: var(--app-color-040);
}

.symbol-chart-value {
    font-size: 11px;
    font-weight: 700;
    color: var(--page-color-044);
    text-align: center;
}

.symbol-chart-year {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
}

.symbol-detail-sections {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 12px;
}

.symbol-detail-side-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.symbol-tab-panel[data-symbol-tab-panel="events"] .symbol-detail-side-grid {
    grid-template-columns: minmax(0, 1fr);
}

.symbol-detail-section {
    border: 1px solid var(--app-color-018);
    border-radius: 10px;
    background: var(--app-color-019);
    padding: 14px 16px;
}

.symbol-detail-section h3 {
    margin: 0 0 10px;
    font-size: 14px;
    color: var(--page-color-202);
}


.symbol-events-table th.is-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 16px;
}

.symbol-events-table th.is-sortable::after {
    content: '↕';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--muted);
    opacity: 0.75;
}

.symbol-events-table th.is-sortable.is-sort-asc::after {
    content: '↑';
    color: var(--page-color-044);
    opacity: 1;
}

.symbol-events-table th.is-sortable.is-sort-desc::after {
    content: '↓';
    color: var(--page-color-044);
    opacity: 1;
}

.symbol-action-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--page-color-186);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.symbol-action-badge.is-upgrade,
.symbol-change-cell.is-upgrade {
    color: var(--macro-zone-neutral);
}

.symbol-action-badge.is-upgrade {
    background: var(--app-color-041);
    border-color: var(--app-color-042);
}

.symbol-action-badge.is-downgrade,
.symbol-change-cell.is-downgrade {
    color: var(--app-color-043);
}

.symbol-action-badge.is-downgrade {
    background: var(--app-color-044);
    border-color: var(--app-color-045);
}

.symbol-action-badge.is-neutral,
.symbol-change-cell.is-neutral {
    color: var(--app-color-046);
}

.symbol-action-badge.is-neutral {
    background: var(--app-color-047);
    border-color: var(--app-color-048);
}

.symbol-change-cell {
    font-weight: 600;
}

.symbol-events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.symbol-events-table th,
.symbol-events-table td {
    padding: 6px 4px;
    border-bottom: 1px solid var(--page-color-198);
    text-align: left;
    vertical-align: top;
}

.symbol-events-table th {
    color: var(--muted);
    font-weight: 600;
}

.symbol-empty-state {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1100px) {
    .symbol-detail-facts,
    .symbol-detail-facts-compact,
    .symbol-overview-grid,
    .symbol-overview-bars,
    .symbol-overview-mini-facts,
    .symbol-mini-grid,
    .symbol-detail-sections,
    .symbol-detail-side-grid {
        grid-template-columns: 1fr;
    }

    .symbol-tab-list {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}


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

.symbol-event-card {
    border: 1px solid var(--page-color-186);
    border-radius: 10px;
    background: var(--alert-unread-bg);
    padding: 10px 12px;
    display: grid;
    gap: 8px;
}

.symbol-event-card.is-positive {
    border-color: var(--app-color-042);
    background: var(--app-color-049);
}

.symbol-event-card.is-negative {
    border-color: var(--app-color-045);
    background: var(--app-color-050);
}

.symbol-event-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.symbol-event-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--page-color-202);
    line-height: 1.35;
}

.symbol-event-date {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

.symbol-event-subline {
    font-size: 11px;
    color: var(--muted);
}

.symbol-event-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.symbol-event-stat {
    border: 1px solid var(--page-color-198);
    border-radius: 8px;
    background: var(--page-color-204);
    padding: 7px 8px;
    min-width: 0;
}

.symbol-event-stat-label {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 3px;
}

.symbol-event-stat-value {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--page-color-044);
    overflow-wrap: anywhere;
}

.workbench-decision-surface {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(255,255,255,0.025);
    min-width: 0;
}

.workbench-decision-preview,
.workbench-decision-section {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.workbench-decision-section {
    gap: 6px;
}

.workbench-decision-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--page-color-202);
}

.workbench-decision-meta-grid,
.workbench-decision-payload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    min-width: 0;
}

.workbench-decision-payload-grid {
    gap: 6px;
}

.workbench-decision-effect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    min-width: 0;
}

.workbench-decision-risk-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.workbench-decision-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    align-items: end;
    min-width: 0;
}

.workbench-decision-command-row {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) repeat(3, auto);
    gap: 8px;
    align-items: end;
    min-width: 0;
}

.workbench-decision-command-row button,
.workbench-decision-inline-actions button,
.workbench-action-modal-actions button {
    white-space: nowrap;
}

.workbench-decision-inline-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.workbench-action-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(2,6,23,0.78);
}

.workbench-action-modal-dialog {
    width: min(920px, 100%);
    max-height: 88vh;
    overflow: auto;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 24px 80px rgba(0,0,0,0.45);
    padding: 14px;
    display: grid;
    gap: 12px;
    min-width: 0;
}

.workbench-action-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.workbench-action-modal-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--page-color-202);
}

.workbench-action-modal-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
}

.workbench-action-modal-body {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.workbench-action-modal-status {
    display: none;
    font-size: 12px;
    color: var(--page-color-202);
}

.workbench-action-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 1100px) {
    .symbol-event-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .workbench-decision-command-row {
        grid-template-columns: 1fr;
    }

    .workbench-decision-command-row button,
    .workbench-decision-inline-actions button,
    .workbench-action-modal-actions button {
        width: 100%;
    }

    .workbench-action-modal {
        padding: 8px;
        align-items: stretch;
    }

    .workbench-action-modal-dialog {
        max-height: calc(100vh - 16px);
    }

    .workbench-action-modal-head,
    .workbench-action-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}


/* Left panel header stabilization */
.decision-context .dm-left-table thead th,
.decision-context #dm-portfolio-panel table thead th {
    height: 44px;
    min-height: 44px;
    vertical-align: middle;
    line-height: 1.15;
    white-space: normal;
}

.decision-context .dm-left-table thead th > *,
.decision-context #dm-portfolio-panel table thead th > * {
    display: inline-block;
    max-width: 100%;
    line-height: 1.15;
    white-space: normal;
}


/* Simulation layout controls */
.dm-left-panel-card {
    min-height: var(--dm-left-panel-min-height);
    grid-column: span 1;
}

.dm-context-panel-card {
    min-height: var(--dm-context-panel-min-height);
    grid-column: span 1;
}

.dm-panel-slot {
    min-width: 0;
}

.dm-context-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1.15fr) minmax(280px, 0.85fr);
    gap: 10px;
    margin-bottom: 10px;
    align-items: stretch;
}

.dm-fear-greed-card {
    min-height: var(--dm-fg-card-min-height);
}

.dm-context-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-content: stretch;
    align-items: stretch;
}

.dm-context-card-grid .kpi-card {
    min-height: 0;
    height: 100%;
}

.dm-fg-card-body {
    display: grid;
    grid-template-columns: minmax(220px, 1.05fr) minmax(150px, 0.95fr);
    gap: 12px;
    align-items: center;
}

.dm-fg-gauge-wrap {
    position: relative;
    min-height: var(--dm-fg-gauge-min-height);
}

.dm-decision-assist-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.dm-decision-assist-item {
    min-height: 88px;
    border: 1px solid var(--page-color-198);
    border-radius: 10px;
    background: var(--page-color-199);
    padding: 12px;
}

.dm-placeholder-block {
    min-height: var(--dm-placeholder-min-height);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    padding: 20px;
}

.dm-chart-placeholder {
    min-height: var(--dm-chart-placeholder-min-height);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding: 18px;
}

.dm-placeholder-centered {
    min-height: var(--dm-placeholder-centered-min-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-table-shell {
    height: var(--dm-table-shell-height);
    overflow: auto;
    border: 1px solid var(--page-color-198);
    border-radius: 10px;
}

.dm-reset-button {
    background: var(--page-color-185);
    color: var(--page-color-044);
    border: 1px solid var(--page-color-186);
    border-radius: 8px;
    padding: 4px 10px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 18px;
    line-height: 1;
}

@media (max-width: 1500px) {
    .dm-context-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .dm-decision-assist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1240px) {
    .dm-fg-card-body {
        grid-template-columns: minmax(0, 1fr);
    }
    .dm-context-card-grid,
    .dm-decision-assist-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.dm-decision-assist-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dm-decision-assist-state {
    font-size: 12px;
    color: var(--page-color-197);
    white-space: nowrap;
}

@media (max-width: 1240px) {
    .dm-decision-assist-header {
        flex-direction: column;
    }
    .dm-decision-assist-state {
        white-space: normal;
    }
}


.dm-context-panel-card .panel-card-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-top: 12px;
}

.dm-context-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dm-context-tab {
    border: 1px solid var(--page-color-203);
    border-radius: 10px;
    padding: 8px 12px;
    background: var(--page-color-187);
    color: var(--page-color-050);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.dm-context-tab.is-active {
    background: var(--page-color-049);
}

.dm-context-tab-panels {
    flex: 1 1 auto;
    min-height: 0;
}

.dm-context-tab-panel {
    display: none;
    min-height: 0;
}

.dm-context-tab-panel.is-active {
    display: block;
}

.dm-context-scroll {
    max-height: var(--dm-context-scroll-max-height);
    min-height: var(--dm-context-scroll-min-height);
    overflow: auto;
    padding-right: 4px;
}

.dm-summary-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 14px;
}

.dm-context-module-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

@media (max-width: 1180px) {
    .dm-summary-top-grid,
    .dm-context-module-grid {
        grid-template-columns: 1fr;
    }
    .dm-context-scroll {
        min-height: auto;
        max-height: none;
    }
}


/* Simulation explainer summary */
.dm-summary-scroll {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dm-summary-facts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

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

.dm-summary-fact-card {
    min-height: 84px;
    border-radius: 12px;
    border: 1px solid var(--page-color-186);
    background: var(--page-color-204);
    padding: 12px;
    display: grid;
    gap: 8px;
    align-content: start;
}
.dm-summary-fact-card.is-positive {
    border-color: var(--page-color-323);
    background: var(--page-color-279);
}
.dm-summary-fact-card.is-negative {
    border-color: var(--app-color-051);
    background: var(--app-color-052);
}
.dm-summary-fact-card.is-neutral {
    border-color: var(--app-color-053);
    background: var(--app-color-054);
}
.dm-summary-fact-value {
    font-size: 15px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--page-color-202);
    word-break: break-word;
}
.dm-summary-hero-card,
.dm-summary-action-card,
.dm-summary-module-card {
    background: linear-gradient(180deg, var(--app-color-055) 0%, var(--app-color-056) 100%);
}
.dm-summary-hero-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}
.dm-summary-hero-title {
    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--page-color-202);
    margin-top: 4px;
}
.dm-summary-hero-copy {
    margin-top: 8px;
    color: var(--app-color-022);
    font-size: 13px;
    line-height: 1.5;
}
.dm-summary-status-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--app-color-057);
    border: 1px solid var(--app-color-058);
    color: var(--page-color-044);
    font-size: 12px;
    font-weight: 600;
}
.dm-summary-action-total {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}
.dm-summary-action-bar {
    width: 100%;
    min-height: 38px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    background: var(--page-color-189);
    border: 1px solid var(--page-color-186);
}
.dm-summary-action-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: var(--muted);
    font-size: 12px;
}
.dm-summary-action-segment {
    min-width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--page-color-202);
    white-space: nowrap;
}
.dm-summary-action-segment.is-positive {
    background: linear-gradient(90deg, var(--page-color-246) 0%, var(--app-color-059) 100%);
}
.dm-summary-action-segment.is-negative {
    background: linear-gradient(90deg, var(--page-color-284) 0%, var(--app-color-060) 100%);
}
.dm-summary-action-segment.is-neutral {
    background: linear-gradient(90deg, var(--app-color-061) 0%, var(--app-color-062) 100%);
}
.dm-summary-action-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}
.dm-summary-action-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--app-color-022);
    font-size: 12px;
}
.dm-summary-action-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.dm-summary-action-dot.is-positive { background: var(--app-color-063); }
.dm-summary-action-dot.is-negative { background: var(--app-color-064); }
.dm-summary-action-dot.is-neutral { background: var(--macro-zone-low); }
.dm-summary-support-grid {
    align-items: stretch;
}
.dm-summary-module-card {
    display: grid;
    gap: 12px;
}
.dm-summary-module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 1480px) {
    .dm-summary-facts-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 1240px) {
    .dm-summary-hero-head,
    .dm-summary-action-head {
        flex-direction: column;
    }
    .dm-summary-facts-grid,
    .dm-summary-module-grid,
    .dm-summary-context-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 760px) {
    .dm-summary-facts-grid,
    .dm-summary-module-grid,
    .dm-summary-context-grid {
        grid-template-columns: 1fr;
    }
    .dm-summary-hero-title {
        font-size: 24px;
    }
}


.dm-workflow-scroll {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.dm-workflow-hero-card,
.dm-workflow-queue-card {
    background: linear-gradient(180deg, var(--app-color-055) 0%, var(--app-color-056) 100%);
}
.dm-workflow-facts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.dm-workflow-tabs-shell {
    display: grid;
    gap: 12px;
}
.dm-workflow-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.dm-workflow-tab {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--page-color-203);
    background: var(--page-color-204);
    color: var(--page-color-044);
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.dm-workflow-tab:hover {
    background: var(--page-color-198);
}
.dm-workflow-tab.is-active {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px var(--app-color-065);
}
.dm-workflow-tab.is-positive {
    border-color: var(--app-color-066);
    background: var(--app-color-067);
}
.dm-workflow-tab.is-positive.is-active {
    border-color: var(--app-color-068);
    background: var(--app-color-069);
}
.dm-workflow-tab.is-negative {
    border-color: var(--page-color-280);
    background: var(--app-color-070);
}
.dm-workflow-tab.is-negative.is-active {
    border-color: var(--app-color-071);
    background: var(--app-color-072);
}
.dm-workflow-tab.is-neutral {
    border-color: var(--app-color-053);
    background: var(--app-color-054);
}
.dm-workflow-tab.is-neutral.is-active {
    border-color: var(--app-color-073);
    background: var(--app-color-074);
}
.dm-workflow-tab-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
}
.dm-workflow-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid var(--page-color-203);
    background: var(--page-color-186);
    color: var(--page-color-202);
    font-size: 11px;
    font-weight: 700;
    flex: 0 0 auto;
}
.dm-workflow-tab-count.is-positive {
    border-color: var(--page-color-228);
    background: var(--page-color-276);
}
.dm-workflow-tab-count.is-negative {
    border-color: var(--page-color-231);
    background: var(--page-color-277);
}
.dm-workflow-tab-count.is-neutral {
    border-color: var(--app-color-075);
    background: var(--macro-chart-area);
}
.dm-workflow-tab-panels {
    display: block;
}
.dm-workflow-queue-card {
    display: none;
    gap: 12px;
}
.dm-workflow-queue-card.is-active {
    display: grid;
}
.dm-workflow-queue-card.is-positive {
    border-color: var(--page-color-278);
}
.dm-workflow-queue-card.is-negative {
    border-color: var(--page-color-304);
}
.dm-workflow-queue-card.is-neutral {
    border-color: var(--app-color-076);
}
.dm-workflow-queue-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.dm-workflow-queue-summary {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--page-color-376);
}
.dm-workflow-queue-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--page-color-203);
    background: var(--page-color-189);
    color: var(--page-color-196);
    font-size: 12px;
    font-weight: 700;
}
.dm-workflow-queue-badge.is-positive {
    border-color: var(--page-color-228);
    background: var(--app-color-077);
}
.dm-workflow-queue-badge.is-negative {
    border-color: var(--page-color-231);
    background: var(--app-color-078);
}
.dm-workflow-queue-badge.is-neutral {
    border-color: var(--app-color-075);
    background: var(--app-color-057);
}
.dm-workflow-list {
    display: grid;
    gap: 10px;
}
.dm-workflow-item {
    border-radius: 12px;
    border: 1px solid var(--page-color-186);
    background: var(--page-color-204);
    padding: 12px;
    display: grid;
    gap: 8px;
}
.dm-workflow-item.is-positive {
    border-color: var(--page-color-323);
    background: var(--page-color-279);
}
.dm-workflow-item.is-negative {
    border-color: var(--app-color-051);
    background: var(--app-color-052);
}
.dm-workflow-item.is-neutral {
    border-color: var(--app-color-053);
    background: var(--app-color-054);
}
.dm-workflow-item-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
}
.dm-workflow-item-main {
    min-width: 0;
    display: grid;
    gap: 8px;
}
.dm-workflow-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.dm-workflow-item-title {
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--page-color-202);
}
.dm-workflow-item-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--page-color-203);
    background: var(--page-color-189);
    color: var(--page-color-044);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.dm-workflow-item-badge.is-positive {
    border-color: var(--app-color-079);
    background: var(--app-color-077);
}
.dm-workflow-item-badge.is-negative {
    border-color: var(--app-color-080);
    background: var(--app-color-078);
}
.dm-workflow-item-badge.is-neutral {
    border-color: var(--app-color-058);
    background: var(--app-color-057);
}
.dm-workflow-item-meta {
    font-size: 12px;
    line-height: 1.45;
    color: var(--page-color-376);
}
.dm-workflow-item-reason {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--page-color-044);
}
.dm-workflow-item-visuals {
    display: grid;
    gap: 8px;
    width: 170px;
    min-width: 170px;
}
.dm-workflow-price-shell {
    display: flex;
    justify-content: flex-end;
}
.dm-workflow-mini-chart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    min-height: 24px;
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid var(--page-color-186);
    background: var(--page-color-204);
}
.dm-workflow-mini-chart svg {
    width: 60px;
    height: 20px;
}
.dm-workflow-mini-chart-fallback {
    color: var(--page-color-044);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    background: transparent;
    padding: 0;
}
.dm-workflow-fundamentals {
    display: grid;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--page-color-186);
    background: var(--app-color-081);
}
.dm-workflow-fundamentals-empty {
    padding: 10px;
    border-radius: 10px;
    border: 1px dashed var(--page-color-203);
    background: var(--page-color-188);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}
.dm-workflow-trend-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    align-items: center;
    gap: 8px;
}
.dm-workflow-trend-label,
.dm-workflow-trend-value {
    font-size: 10px;
    font-weight: 700;
    color: var(--page-color-044);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dm-workflow-trend-value {
    text-align: right;
    color: var(--page-color-376);
}
.dm-workflow-trend-bars {
    min-width: 0;
    height: 28px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    align-items: end;
}
.dm-workflow-trend-cell {
    position: relative;
    display: flex;
    align-items: end;
    justify-content: center;
    height: 100%;
    border-radius: 6px;
    background: var(--page-color-204);
    overflow: hidden;
}
.dm-workflow-trend-cell.is-empty {
    background: var(--page-color-188);
}
.dm-workflow-trend-bar {
    width: 100%;
    min-height: 5px;
    border-radius: 6px 6px 0 0;
    background: var(--app-color-082);
}
.dm-workflow-trend-bar.is-positive {
    background: linear-gradient(180deg, var(--app-color-083) 0%, var(--app-color-059) 100%);
}
.dm-workflow-trend-bar.is-negative {
    background: linear-gradient(180deg, var(--app-color-084) 0%, var(--app-color-060) 100%);
}
.dm-workflow-trend-bar.is-neutral {
    background: linear-gradient(180deg, var(--app-color-085) 0%, var(--app-color-086) 100%);
}
.dm-workflow-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid var(--page-color-186);
    background: var(--page-color-204);
    color: var(--page-color-202);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}
.dm-workflow-link:hover {
    background: var(--page-color-234);
}
@media (max-width: 1240px) {
    .dm-workflow-facts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dm-workflow-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .dm-workflow-queue-head,
    .dm-workflow-item-top {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    .dm-workflow-item-visuals {
        width: 100%;
        min-width: 0;
        grid-template-columns: 84px minmax(0, 1fr);
        align-items: start;
    }
    .dm-workflow-price-shell {
        justify-content: flex-start;
    }
}
@media (max-width: 760px) {
    .dm-workflow-facts-grid,
    .dm-workflow-tabs {
        grid-template-columns: 1fr;
    }
    .dm-workflow-item-visuals {
        grid-template-columns: 1fr;
    }
    .dm-workflow-trend-row {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 6px;
    }
}

/* Decision score bars + compact workflow overrides */
.dm-decision-scroll {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dm-decision-hero-card,
.dm-decision-module-card,
.dm-decision-stack-card {
    background: linear-gradient(180deg, var(--app-color-055) 0%, var(--app-color-056) 100%);
}

.dm-decision-hero-head {
    align-items: flex-start;
    gap: 14px;
}

.dm-decision-balance-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--page-color-203);
    background: var(--page-color-187);
    color: var(--page-color-044);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.dm-decision-balance-chip.is-positive {
    border-color: var(--page-color-228);
    background: var(--app-color-087);
}

.dm-decision-balance-chip.is-negative {
    border-color: var(--page-color-231);
    background: var(--app-color-088);
}

.dm-decision-balance-chip.is-neutral {
    border-color: var(--app-color-089);
    background: var(--app-color-090);
}

.dm-decision-score-shell {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.dm-decision-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dm-decision-score-label,
.dm-decision-score-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--page-color-044);
}

.dm-decision-score-value {
    color: var(--page-color-202);
}

.dm-decision-score-track {
    position: relative;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--page-color-186);
    background: var(--page-color-189);
}

.dm-decision-score-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.dm-decision-score-fill.is-positive {
    background: linear-gradient(90deg, var(--app-color-091) 0%, var(--app-color-092) 100%);
}

.dm-decision-score-fill.is-negative {
    background: linear-gradient(90deg, var(--app-color-093) 0%, var(--app-color-094) 100%);
}

.dm-decision-stack-list {
    display: grid;
    gap: 10px;
}

.dm-decision-stack-item {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--page-color-186);
    background: var(--page-color-204);
    display: grid;
    gap: 7px;
}

.dm-decision-stack-item.is-positive {
    border-color: var(--app-color-066);
    background: var(--page-color-279);
}

.dm-decision-stack-item.is-negative {
    border-color: var(--page-color-280);
    background: var(--app-color-052);
}

.dm-decision-stack-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dm-decision-stack-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--page-color-202);
}

.dm-decision-stack-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: var(--page-color-202);
    background: var(--page-color-186);
}

.dm-decision-stack-score.is-positive {
    background: var(--page-color-278);
}

.dm-decision-stack-score.is-negative {
    background: var(--page-color-304);
}

.dm-decision-stack-detail {
    font-size: 12px;
    line-height: 1.5;
    color: var(--app-color-022);
}

.dm-workflow-tabs {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.dm-workflow-tab {
    padding: 10px 12px;
    border-radius: 12px;
    position: relative;
}

.dm-workflow-tab:hover {
    background: var(--app-color-095);
    border-color: var(--page-color-200);
    box-shadow: 0 8px 20px var(--app-color-096);
}

.dm-workflow-tab.is-active {
    transform: none;
    box-shadow: inset 0 0 0 1px var(--page-color-186), 0 8px 20px var(--app-color-096);
}

.dm-workflow-tab-label {
    font-size: 11px;
    letter-spacing: 0.02em;
}

.dm-workflow-queue-card {
    padding: 14px;
}

.dm-workflow-list {
    gap: 8px;
}

.dm-workflow-item,
.dm-workflow-item.is-positive,
.dm-workflow-item.is-negative,
.dm-workflow-item.is-neutral {
    border-color: var(--page-color-186);
    background: var(--page-color-204);
}

.dm-workflow-item {
    padding: 10px 12px;
    gap: 10px;
}

.dm-workflow-item-top {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.dm-workflow-item-headline {
    min-width: 0;
}

.dm-workflow-symbol-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
    text-decoration: none;
    color: inherit;
}

.dm-workflow-symbol-trigger:hover .dm-symbol-code,
.dm-workflow-symbol-trigger:hover .dm-workflow-symbol-meta {
    color: var(--page-color-202);
}

.dm-workflow-symbol-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.dm-workflow-symbol-headline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.dm-workflow-symbol-meta {
    min-width: 0;
    font-size: 12px;
    color: var(--page-color-300);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-workflow-item-visuals {
    display: grid;
    grid-template-columns: minmax(108px, 0.9fr) minmax(0, 3fr);
    align-items: stretch;
    gap: 10px;
    width: auto;
    min-width: 0;
}

.dm-workflow-price-shell {
    display: flex;
    align-items: stretch;
    justify-content: center;
    min-width: 108px;
}

.dm-workflow-mini-chart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.dm-workflow-mini-chart svg {
    width: 100%;
    height: 56px;
}

.dm-workflow-fundamentals {
    display: grid;
    grid-template-columns: repeat(3, minmax(108px, 1fr));
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
}

.dm-workflow-fundamentals-empty {
    min-width: 170px;
    padding: 8px 10px;
}

.dm-workflow-trend-row {
    grid-template-columns: 1fr;
    gap: 5px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--page-color-186);
    background: var(--app-color-097);
}

.dm-workflow-trend-label,
.dm-workflow-trend-value {
    font-size: 10px;
    letter-spacing: 0.04em;
}

.dm-workflow-trend-value {
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    color: var(--page-color-376);
}

.dm-workflow-trend-bars {
    height: 22px;
}

.dm-workflow-item-reason {
    font-size: 12px;
    line-height: 1.45;
    color: var(--app-color-098);
}

@media (max-width: 1460px) {
    .dm-decision-hero-head,
    .dm-workflow-item-top {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .dm-workflow-item-visuals {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 980px) {
    .dm-workflow-fundamentals {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .dm-workflow-fundamentals-empty {
        width: 100%;
        min-width: 0;
    }
}


.dm-structure-module-grid {
    align-items: start;
}

.dm-structure-card {
    display: grid;
    gap: 12px;
}

.dm-structure-card-body {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.dm-structure-sector-row,
.dm-structure-delta-row {
    border: 1px solid var(--page-color-186);
    border-radius: 12px;
    background: var(--page-color-204);
    padding: 10px 12px;
    display: grid;
    gap: 8px;
}

.dm-structure-sector-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dm-structure-sector-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--page-color-202);
    min-width: 0;
}

.dm-structure-sector-values {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--app-color-022);
    font-size: 11px;
    white-space: nowrap;
}

.dm-structure-compare-bars {
    display: grid;
    gap: 6px;
}

.dm-structure-compare-line {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.dm-structure-compare-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--page-color-376);
}

.dm-structure-compare-track {
    position: relative;
    display: block;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--page-color-198);
}

.dm-structure-compare-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.dm-structure-compare-fill.is-current {
    background: linear-gradient(90deg, var(--app-color-099) 0%, var(--app-color-100) 100%);
}

.dm-structure-compare-fill.is-target {
    background: linear-gradient(90deg, var(--app-color-101) 0%, var(--app-color-059) 100%);
}

.dm-structure-delta-value {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.dm-structure-delta-value.is-good {
    color: var(--macro-zone-neutral);
}

.dm-structure-delta-value.is-watch {
    color: var(--app-color-031);
}

.dm-structure-delta-value.is-alert {
    color: var(--page-color-363);
}

.dm-structure-delta-track-shell {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: var(--page-color-198);
    overflow: hidden;
}

.dm-structure-delta-track-shell.is-good {
    background: var(--app-color-087);
}

.dm-structure-delta-track-shell.is-watch {
    background: var(--app-color-102);
}

.dm-structure-delta-track-shell.is-alert {
    background: var(--app-color-078);
}

.dm-structure-delta-zero {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--page-color-287);
    transform: translateX(-0.5px);
}

.dm-structure-delta-bar {
    position: absolute;
    top: 0;
    bottom: 0;
}

.dm-structure-delta-bar.is-positive {
    left: 50%;
}

.dm-structure-delta-bar.is-negative {
    right: 50%;
}

.dm-structure-delta-bar.is-good {
    background: linear-gradient(90deg, var(--app-color-083) 0%, var(--app-color-059) 100%);
}

.dm-structure-delta-bar.is-watch {
    background: linear-gradient(90deg, var(--app-color-103) 0%, var(--app-color-104) 100%);
}

.dm-structure-delta-bar.is-alert {
    background: linear-gradient(90deg, var(--app-color-105) 0%, var(--app-color-106) 100%);
}

@media (max-width: 980px) {
    .dm-structure-sector-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .dm-structure-sector-values {
        white-space: normal;
    }
}


/* Workflow follow-up compactness + alignment fixes */
.dm-workflow-facts-grid .dm-summary-fact-card {
    min-height: 58px;
    padding: 9px 12px;
    gap: 4px;
}

.dm-workflow-facts-grid .dm-summary-fact-value {
    font-size: 14px;
    line-height: 1.15;
}

.dm-context-tabs {
    align-items: center;
}

.dm-context-tab {
    min-height: 0;
    justify-content: center;
}

.dm-workflow-item {
    gap: 6px;
}

.dm-workflow-item-headline {
    display: grid;
    gap: 0;
}

.dm-workflow-item-meta {
    margin-bottom: 6px;
}

.dm-workflow-item-reason {
    margin-top: 6px;
    padding-left: 38px;
    font-size: 12px;
    line-height: 1.25;
    color: var(--page-color-049);
}


.dm-trigger-scroll {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dm-trigger-focus-card,
.dm-trigger-table-card {
    background: linear-gradient(180deg, var(--app-color-055) 0%, var(--app-color-056) 100%);
}

.dm-trigger-table-shell {
    margin-top: 12px;
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--page-color-186);
    border-radius: 12px;
    background: var(--page-color-188);
}

.dm-trigger-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.dm-trigger-table th,
.dm-trigger-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--page-color-198);
    vertical-align: top;
    text-align: left;
}

.dm-trigger-table th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    background: var(--page-color-188);
    position: sticky;
    top: 0;
    z-index: 1;
}

.dm-trigger-table-row:hover {
    background: var(--page-color-204);
}

.dm-trigger-table-col-logo { width: 54px; }
.dm-trigger-table-col-symbol { width: 88px; }
.dm-trigger-table-col-company { width: 180px; }
.dm-trigger-table-col-headline { min-width: 260px; }
.dm-trigger-table-col-values { min-width: 240px; }

.dm-trigger-symbol {
    font-size: 13px;
    font-weight: 700;
    color: var(--page-color-202);
}

.dm-trigger-company,
.dm-trigger-conclusion {
    font-size: 12px;
    line-height: 1.5;
    color: var(--app-color-022);
}

.dm-trigger-headline-cell { display: grid; gap: 6px; }

.dm-trigger-headline-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    justify-content: space-between;
}

.dm-trigger-event-link {
    color: var(--page-color-202);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}

.dm-trigger-event-link:hover {
    color: var(--page-color-044);
    text-decoration: underline;
}

.dm-trigger-event-link.is-static {
    text-decoration: none;
    cursor: default;
}

.dm-trigger-meta {
    font-size: 11px;
    line-height: 1.45;
    color: var(--muted);
}

.dm-trigger-class-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--page-color-203);
    background: var(--page-color-189);
    color: var(--page-color-044);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.dm-trigger-class-badge.is-positive {
    border-color: var(--app-color-079);
    background: var(--app-color-077);
    color: var(--page-color-109);
}

.dm-trigger-class-badge.is-neutral {
    border-color: var(--app-color-075);
    background: var(--app-color-057);
    color: var(--page-color-098);
}

.dm-trigger-class-badge.is-negative {
    border-color: var(--app-color-080);
    background: var(--app-color-078);
    color: var(--page-color-115);
}

.dm-trigger-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dm-trigger-value-chip {
    display: inline-grid;
    gap: 3px;
    padding: 7px 9px;
    border-radius: 10px;
    border: 1px solid var(--page-color-186);
    background: var(--page-color-187);
    min-width: 92px;
}

.dm-trigger-value-chip-label {
    font-size: 10px;
    line-height: 1.2;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dm-trigger-value-chip-value {
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--page-color-202);
}

.dm-trigger-focus-card {
    height: 150px;
    min-height: 150px;
    flex: 0 0 150px;
    overflow: visible;
}

.dm-trigger-facts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    height: 58px;
    min-height: 58px;
    align-items: stretch;
    flex: 0 0 auto;
}

.dm-trigger-facts-grid .dm-summary-fact-card {
    min-height: 58px;
    height: 58px;
    padding: 10px 12px;
    gap: 4px;
    overflow: visible;
}

.dm-trigger-facts-grid .dm-summary-fact-value {
    font-size: 14px;
    line-height: 1.15;
}

.dm-trigger-focus-card .dm-summary-hero-title {
    margin-top: 2px;
    margin-bottom: 0;
}

.dm-context-window-control {
    display: inline-flex;
    align-items: center;
    margin-right: 2px;
}

.dm-context-window-select {
    appearance: none;
    -webkit-appearance: none;
    min-height: 34px;
    border: 1px solid var(--page-color-316);
    border-radius: 10px;
    padding: 8px 30px 8px 12px;
    background:
        linear-gradient(45deg, transparent 50%, var(--app-color-107) 50%) calc(100% - 16px) 14px / 6px 6px no-repeat,
        linear-gradient(135deg, var(--app-color-107) 50%, transparent 50%) calc(100% - 11px) 14px / 6px 6px no-repeat,
        var(--page-color-187);
    color: var(--page-color-196);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.dm-context-window-select:hover,
.dm-context-window-select:focus-visible {
    border-color: var(--app-color-108);
    background-color: var(--page-color-381);
    outline: none;
}

.dm-context-window-select option {
    background: var(--page-color-042);
    color: var(--page-color-196);
}


/* Phase 10A.7: keep Simulation Explainer tabs typographically identical to the left Simulation View tabs. */
.dm-context-panel-card .dm-context-tab {
    font: inherit !important;
    letter-spacing: normal !important;
}
