/* LeadershipPal — dark interview UI */
:root {
    --bg: #0b0e14;
    --bg-panel: #12161f;
    --bg-panel-alt: #171c27;
    --border: #2a3142;
    --text: #e6e8ee;
    --text-dim: #8a92a5;
    --accent: #5eb0ff;
    --danger: #ff6b6b;
    --good: #4ade80;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    display: flex;
    flex-direction: column;
}

header {
    display: none;   /* header removed; content uses the reclaimed space */
}
.header-left, .header-right, .model-badge, .stats-inline, .status-badge { display: none; }
.header-left { display: flex; align-items: baseline; gap: 10px; }
header h1 { margin: 0; font-size: 20px; color: var(--accent); letter-spacing: 0.3px; }
.subtitle { color: var(--text-dim); font-size: 13px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.model-badge { font: 11px/1 ui-monospace, monospace; padding: 4px 8px; background: var(--bg-panel-alt); border: 1px solid var(--border); border-radius: 4px; color: var(--text-dim); }
.stats-inline { font-size: 12px; color: var(--text-dim); }
.status-badge { font-size: 12px; padding: 3px 8px; border-radius: 4px; }
.status-badge.connected { background: rgba(74, 222, 128, 0.15); color: var(--good); }
.status-badge.disconnected { background: rgba(255, 107, 107, 0.15); color: var(--danger); }

.main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 320px 1fr 320px 320px;
    gap: 10px;
    padding: 10px;
    min-height: 0;
}

.col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}
.col-1 .decision-panel,
.col-2 .coach-panel,
.col-3 .analysis-panel { flex: 1; min-height: 0; }
.col-4 .quotes-panel { flex: 1 1 auto; min-height: 120px; }
.col-4 .transcript-panel { flex: 1 1 auto; min-height: 120px; }
.col-4 .history-panel { max-height: 240px; flex: 0 0 auto; }

.hidden-slot { display: none; }

/* Floating voice button (bottom-right corner) */
.voice-float {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

/* Floating backend-status badge — only visible when there's a problem.
   Stacks above the voice-float button at bottom-right. */
.backend-status {
    position: fixed;
    bottom: 100px;
    right: 16px;
    z-index: 101;
    padding: 8px 14px;
    background: var(--danger);
    color: #fff;
    border-radius: 6px;
    font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.25s ease-out;
}
.backend-status[hidden] { display: none !important; }
@keyframes slideUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.mic-btn-float {
    pointer-events: auto;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--bg-panel-alt);
    border: 2px solid var(--border);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.mic-btn-float:hover { border-color: var(--accent); }
.mic-btn-float.active {
    background: var(--accent);
    color: #002b50;
    border-color: var(--accent);
    animation: pulse 1.5s infinite;
}
.mic-btn-float[disabled] { opacity: 0.4; cursor: not-allowed; }
.mic-status-float {
    pointer-events: auto;
    font: 10px/1 ui-monospace, monospace;
    color: var(--text-dim);
    background: var(--bg-panel-alt);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* Coach panel (col-2) */
.coach-panel .panel-header { gap: 10px; }
.coach-grade {
    font: 700 14px/1 -apple-system, sans-serif;
    padding: 5px 12px;
    border-radius: 4px;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    color: var(--text-dim);
    min-width: 40px;
    text-align: center;
}
.coach-grade.grade-ap, .coach-grade.grade-a { background: rgba(74, 222, 128, 0.15); color: var(--good); border-color: var(--good); }
.coach-grade.grade-b { background: rgba(94, 176, 255, 0.15); color: var(--accent); border-color: var(--accent); }
.coach-grade.grade-c { background: rgba(245, 180, 84, 0.15); color: var(--warn); border-color: var(--warn); }
.coach-grade.grade-needs-work { background: rgba(255, 107, 107, 0.15); color: var(--danger); border-color: var(--danger); font-size: 11px; padding: 7px 10px; }

.coach-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.coach-section { display: flex; flex-direction: column; gap: 6px; }
.coach-section-label {
    font: 10px/1 ui-monospace, monospace;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-dim);
}

.coach-draft {
    background: rgba(94, 176, 255, 0.06);
    border-left: 3px solid var(--accent);
    padding: 12px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}
.coach-draft .draft-text { font-size: 15px; }
.coach-draft .draft-text strong { color: #fff; }
.coach-draft .draft-beats {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
    color: var(--text-dim);
}
.coach-draft .draft-beats ul { padding-left: 18px; margin: 4px 0; }
.coach-draft .draft-beats li { margin: 2px 0; }

.coach-deficiencies {
    background: rgba(255, 107, 107, 0.05);
    border-left: 3px solid var(--danger);
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
}
.coach-deficiencies.empty { background: transparent; border-left-color: var(--border); color: var(--text-dim); }
.coach-deficiencies .deficiency-item { margin: 6px 0; }
.coach-deficiencies .deficiency-item:first-child { margin-top: 0; }
.coach-deficiencies .deficiency-quote {
    background: rgba(255, 107, 107, 0.12);
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 700;
    color: #fff;
}
.coach-deficiencies .deficiency-trap { color: var(--danger); font-weight: 600; font-size: 12px; margin-right: 6px; }
.coach-deficiencies .deficiency-fix { color: var(--text-dim); font-size: 12px; font-style: italic; margin-top: 2px; display: block; }

.coach-stream .suggestion-card { margin-bottom: 8px; }

.coach-traps-row, .coach-star-row { display: contents; }

/* Enhanced OODA two-row widget */
.ooda-phases-grid {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px dashed var(--border);
    padding-top: 8px;
}
.ooda-phase-row {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 6px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.ooda-phase-row:last-child { border-bottom: 0; }
.ooda-phase-row.active { background: rgba(94, 176, 255, 0.06); border-radius: 4px; padding: 6px 8px; }
.ooda-phase-label {
    font: 700 10px/1.3 ui-monospace, monospace;
    letter-spacing: 1px;
    color: var(--text-dim);
    padding-top: 2px;
}
.ooda-phase-row.active .ooda-phase-label { color: var(--accent); }
.ooda-phase-content { display: flex; flex-direction: column; gap: 3px; }
.ooda-line { display: grid; grid-template-columns: 62px 1fr; gap: 6px; font-size: 11px; line-height: 1.5; }
.ooda-tag {
    font: 9px/1 ui-monospace, monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 4px;
    border-radius: 3px;
    text-align: center;
    align-self: flex-start;
}
.ooda-tag-sugg { background: rgba(94, 176, 255, 0.1); color: var(--accent); }
.ooda-tag-curr { background: rgba(245, 180, 84, 0.1); color: var(--warn); }
.ooda-text { color: var(--text); font-size: 11px; }
.ooda-text.empty { color: var(--text-dim); font-style: italic; }

/* Replay banner */
.replay-banner {
    background: linear-gradient(90deg, rgba(245, 180, 84, 0.18), rgba(245, 180, 84, 0.06));
    border-bottom: 1px solid var(--warn);
    padding: 0;
    animation: slideDown 0.2s ease-out;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.replay-banner .replay-content {
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.replay-banner .replay-icon { color: var(--warn); font-size: 16px; }
.replay-banner .replay-label { flex: 1; font-size: 13px; color: var(--text); }
.replay-banner .replay-label strong { color: var(--warn); }
.btn-back-live {
    background: var(--warn);
    color: #0b0e14;
    border: 0;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}
.btn-back-live:hover { background: #ffc570; }

/* New Question button (in History panel header) */
.btn-new-question {
    background: var(--accent);
    color: #002b50;
    border: 0;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.3px;
}
.btn-new-question:hover { background: #7abfff; }

/* History panel */
.history-panel { max-height: 280px; flex-shrink: 0; }
.history-list {
    flex: 1;
    overflow-y: auto;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    font-size: 12px;
}
.history-empty {
    padding: 14px 16px;
    color: var(--text-dim);
    font-style: italic;
    line-height: 1.5;
    font-size: 12px;
}
.history-item {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    gap: 6px;
    align-items: baseline;
    padding: 8px 12px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.history-item:hover { background: rgba(255, 255, 255, 0.03); border-left-color: var(--text-dim); }
.history-item.active { background: rgba(245, 180, 84, 0.1); border-left-color: var(--warn); }
.history-item .h-num { font: 10px/1 ui-monospace, monospace; color: var(--text-dim); }
.history-item .h-label { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.history-item .h-time { font: 10px/1 ui-monospace, monospace; color: var(--text-dim); }

@media (max-width: 1400px) {
    .main-grid { grid-template-columns: 350px 1fr 340px; }
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel-alt);
}
.panel-header h2 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-dim); }
.panel-header button { background: transparent; border: 1px solid var(--border); color: var(--text-dim); padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.panel-header button:hover { color: var(--text); border-color: var(--text-dim); }

/* Suggestions hero (left) */
.suggestions-hero { min-height: 0; }
.query-input-row { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.query-input { flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.query-input:focus { outline: none; border-color: var(--accent); }
.query-btn { background: var(--accent); color: #002b50; border: 0; padding: 10px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; }
.query-btn:hover { background: #7abfff; }

.ai-response {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.response-placeholder { color: var(--text-dim); text-align: center; padding: 40px 0; }
.listening-indicator { color: var(--accent); padding: 8px 12px; background: rgba(94, 176, 255, 0.08); border-radius: 6px; border-left: 3px solid var(--accent); font-size: 13px; }

.suggestion-card {
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 14px 16px;
    animation: slideIn 0.25s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.suggestion-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.suggestion-header h3 { margin: 0; font-size: 15px; color: var(--text); }
.query-label { color: var(--text-dim); font-size: 12px; font-style: italic; }
.suggestion-body { font-size: 14px; line-height: 1.6; }
.suggestion-body p { margin: 6px 0; }
.suggestion-body strong { color: #fff; }
.suggestion-body code { background: rgba(255, 255, 255, 0.08); padding: 1px 5px; border-radius: 3px; font-size: 13px; }
.suggestion-body ul, .suggestion-body ol { padding-left: 20px; margin: 6px 0; }
.suggestion-body pre { margin: 10px 0; }
.suggestion-body pre code { background: transparent; padding: 0; }

/* Inline Mermaid diagrams in the suggestion stream */
.mermaid-diagram {
    margin: 12px 0;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-align: center;
    overflow-x: auto;
}
.mermaid-diagram svg { max-width: 100%; height: auto; }
.mermaid-diagram .mermaid-source {
    font: 11px/1.5 ui-monospace, monospace;
    color: var(--text-dim);
    white-space: pre-wrap;
    margin: 0;
    text-align: left;
    padding: 0;
    background: transparent;
}
.mermaid-diagram.mermaid-rendered .mermaid-source { display: none; }
.mermaid-error {
    font: 11px/1.5 ui-monospace, monospace;
    color: var(--danger);
    background: rgba(255, 107, 107, 0.05);
    border-left: 3px solid var(--danger);
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    white-space: pre-wrap;
    margin: 0;
    text-align: left;
}
.key-points { margin: 10px 0 6px 0; padding-left: 20px; font-size: 13px; color: var(--text-dim); }
.key-points li { margin: 3px 0; }
.suggestion-footer { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 11px; color: var(--text-dim); }
.suggestion-footer code { background: transparent; color: var(--accent); padding: 0; }

/* Sidebar (right) */
.voice-sidebar { display: flex; flex-direction: column; gap: 12px; min-height: 0; }

.voice-panel .voice-controls { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mic-btn {
    width: 68px; height: 68px; border-radius: 50%;
    background: var(--bg-panel-alt);
    border: 2px solid var(--border);
    color: var(--text);
    font-size: 26px;
    cursor: pointer;
    transition: all 0.2s;
}
.mic-btn:hover { border-color: var(--accent); }
.mic-btn.active { background: var(--accent); color: #002b50; border-color: var(--accent); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(94, 176, 255, 0.5); } 50% { box-shadow: 0 0 0 10px rgba(94, 176, 255, 0); } }
.mic-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.mic-status { color: var(--text-dim); font-size: 13px; }

.transcript-panel { flex: 1; min-height: 0; }
.transcript-display { flex: 1; overflow-y: auto; padding: 8px 14px; font-size: 13px; }
.transcript-placeholder { color: var(--text-dim); text-align: center; padding: 20px 0; }
.transcript-segment { padding: 4px 0; border-bottom: 1px solid var(--border); }
.transcript-segment.final { color: var(--text); }
.transcript-segment.interim { color: var(--text-dim); font-style: italic; }

/* Bayes calculator panel */
.bayes-panel { flex-shrink: 0; }
.bayes-panel .collapse-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 2px 10px;
    border-radius: 4px;
    cursor: pointer;
    font: 14px ui-monospace, monospace;
    line-height: 1;
}
.bayes-panel .collapse-btn:hover { color: var(--text); border-color: var(--text-dim); }

.bayes-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 460px;
    transition: max-height 0.25s ease, padding 0.25s ease;
}
.bayes-body.collapsed { max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }

.bayes-formula-block .formula-label,
.bayes-examples .formula-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 4px; }

.formula {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    flex-wrap: wrap;
}
.formula-labeled { font-size: 11px; }
.equals { color: var(--text-dim); padding: 0 2px; }
.fraction { display: inline-flex; flex-direction: column; align-items: center; }
.fraction .num { border-bottom: 1px solid var(--text-dim); padding: 0 6px 2px 6px; }
.fraction .den { padding-top: 2px; }

.bayes-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.bayes-input-row {
    display: grid;
    grid-template-columns: 1fr 80px;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    align-items: center;
}
.bayes-input-row label { font-size: 12px; color: var(--text); }
.bayes-input-row label code { color: var(--accent); background: transparent; padding: 0; font-size: 11px; margin-right: 4px; }
.bayes-input-row input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 6px;
    border-radius: 4px;
    font: 12px ui-monospace, monospace;
    text-align: right;
}
.bayes-input-row input:focus { outline: none; border-color: var(--accent); }
.bayes-input-row .input-hint {
    grid-column: 1 / -1;
    font-size: 10px;
    color: var(--text-dim);
    font-style: italic;
}

.bayes-output {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.output-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font: 12px ui-monospace, monospace;
    padding: 4px 2px;
}
.output-label { color: var(--text-dim); }
.output-label code { background: transparent; color: var(--accent); padding: 0; margin-right: 4px; }
.output-value { color: var(--text); font-weight: 600; }
.output-posterior {
    background: rgba(94, 176, 255, 0.1);
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 3px solid var(--accent);
}
.output-posterior .output-value { color: var(--accent); font-size: 14px; }

.bayes-work { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.bayes-work summary { cursor: pointer; user-select: none; padding: 4px 2px; }
.bayes-work summary:hover { color: var(--text); }
.bayes-work pre {
    font: 10px/1.6 ui-monospace, monospace;
    margin: 4px 0 0 0;
    padding: 8px 10px;
    background: var(--bg);
    border-radius: 4px;
    white-space: pre-wrap;
    color: var(--text-dim);
}

.bayes-examples { border-top: 1px solid var(--border); padding-top: 10px; }
.bayes-example-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.bayes-example-btn {
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}
.bayes-example-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ========== Frameworks panel (live AI-driven stack) ========== */
.frameworks-panel { flex: 1 1 auto; min-height: 0; }
.frameworks-panel .panel-header { gap: 10px; }
.fw-meta {
    font: 10px/1 ui-monospace, monospace;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--bg-panel-alt);
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.fw-meta.thinking { color: var(--accent); border-color: var(--accent-dim, var(--accent)); animation: pulse-meta 1.2s ease-in-out infinite; }
.fw-meta.live { color: var(--good); border-color: var(--good); }
.fw-meta.stale { color: var(--warn); border-color: var(--warn); }
.fw-meta.error { color: var(--danger); border-color: var(--danger); }
@keyframes pulse-meta { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

.frameworks-stack {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fw {
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.fw[open] { border-color: var(--accent-dim, #2b5a8c); }
.fw.fw-active { border-left: 3px solid var(--accent); }
.fw.fw-alert { border-left: 3px solid var(--danger); background: rgba(255, 107, 107, 0.04); }

.fw-summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    position: relative;
}
.fw-summary::-webkit-details-marker { display: none; }
.fw-summary::before {
    content: "▸";
    color: var(--text-dim);
    font-size: 10px;
    width: 10px;
    transition: transform 0.15s;
    display: inline-block;
}
.fw[open] > .fw-summary::before { transform: rotate(90deg); }
.fw-summary:hover { background: rgba(255, 255, 255, 0.02); }

.fw-name {
    font-weight: 600;
    color: var(--text);
    min-width: 90px;
}
.fw-state {
    flex: 1;
    font: 11px/1.3 ui-monospace, monospace;
    color: var(--accent);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fw-alert .fw-state { color: var(--danger); }

.fw-body {
    padding: 2px 12px 12px 30px;
    border-top: 1px dashed var(--border);
}
.fw-note {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
    padding-top: 8px;
}
.fw-note p { margin: 4px 0; }
.fw-note strong { color: #fff; }
.fw-note code { font-size: 11px; background: rgba(255, 255, 255, 0.06); padding: 1px 5px; border-radius: 3px; color: var(--accent); }
.fw-note ul { padding-left: 18px; margin: 4px 0; }
.fw-note blockquote {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 3px solid var(--accent);
    background: rgba(94, 176, 255, 0.06);
    color: var(--text);
    font-style: italic;
    border-radius: 0 4px 4px 0;
}
.fw-note blockquote p { margin: 0; }

/* Terminology widget — detected-term list */
.terminology-list {
    list-style: none;
    margin: 10px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
}
.term-item {
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    border-left: 3px solid var(--warn);
}
.term-header { font-size: 12px; color: var(--text); margin-bottom: 3px; }
.term-header strong { color: var(--warn); }
.term-definition { font-size: 11px; color: var(--text); line-height: 1.5; }
.term-context { font-size: 10px; color: var(--text-dim); font-style: italic; margin-top: 3px; }

/* Transcript button in the floating stack */
.transcript-btn-float {
    pointer-events: auto;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--bg-panel-alt);
    border: 2px solid var(--border);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.transcript-btn-float:hover { border-color: var(--accent); color: var(--accent); }
.transcript-btn-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: #002b50;
    font: 700 10px/1 ui-monospace, monospace;
    padding: 3px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}
.transcript-btn-count.empty { display: none; }

/* Transcript modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-overlay[hidden] { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    animation: modal-fade 0.18s ease-out;
}
.modal-dialog {
    position: relative;
    width: min(900px, 94vw);
    max-height: 86vh;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: modal-pop 0.2s ease-out;
    overflow: hidden;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel-alt);
}
.modal-header h2 {
    margin: 0;
    font-size: 14px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.3px;
}
.modal-header-actions { display: flex; gap: 8px; }
.btn-close {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.btn-close:hover { color: var(--text); border-color: var(--text-dim); }

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.modal-body .transcript-display {
    padding: 0;
    font-size: 14px;
    line-height: 1.7;
}

/* Amazon LP top-3 ranked list inside its widget */
.amazon-lp-top3 {
    list-style: none;
    margin: 10px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px dashed var(--border);
    padding-top: 10px;
}
.amazon-lp-item {
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    border-left: 3px solid var(--accent);
}
.amazon-lp-item[data-rank="2"] { border-left-color: rgba(94, 176, 255, 0.55); }
.amazon-lp-item[data-rank="3"] { border-left-color: rgba(94, 176, 255, 0.3); }

.lp-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 3px;
}
.lp-rank {
    font: 700 10px/1 ui-monospace, monospace;
    color: var(--accent);
    background: rgba(94, 176, 255, 0.12);
    padding: 3px 6px;
    border-radius: 3px;
}
.lp-principle {
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
    line-height: 1.3;
}
.lp-anchor {
    font-size: 11px;
    color: var(--text);
    line-height: 1.4;
    margin: 3px 0;
}
.lp-label {
    font: 9px/1 ui-monospace, monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-right: 4px;
}
.lp-why {
    font-size: 10px;
    color: var(--text-dim);
    font-style: italic;
    line-height: 1.4;
    margin-top: 2px;
}

/* 2x2 matrix (Eisenhower, Rumsfeld) inside a framework widget */
.matrix {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 10px;
}
.matrix-cell {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 6px;
    text-align: center;
    transition: all 0.2s;
}
.matrix-cell .q-label {
    font-weight: 700;
    font-size: 11px;
    color: var(--text);
    letter-spacing: 0.3px;
}
.matrix-cell .q-sub {
    font-size: 9px;
    color: var(--text-dim);
    margin-top: 3px;
    font-style: italic;
}
.matrix-cell.active {
    background: rgba(94, 176, 255, 0.12);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.matrix-cell.active .q-label { color: var(--accent); }

/* Bayes calculator nested inside its framework widget */
.bayes-calc {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* STAR checklist */
.star-checklist { display: flex; flex-direction: column; gap: 6px; }
.star-check {
    display: grid;
    grid-template-columns: auto 28px 1fr;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
}
.star-check:has(input:checked) { background: rgba(94, 176, 255, 0.06); border-color: var(--accent); }
.star-check input { accent-color: var(--accent); }
.star-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
}
.star-check:has(input:checked) .star-letter { background: var(--accent); color: #002b50; }
.star-col { display: flex; flex-direction: column; }
.star-word { font-size: 13px; color: var(--text); }
.star-hint { font-size: 10px; color: var(--text-dim); }

.star-status { margin-top: 8px; font-size: 12px; }
.star-status .star-done { color: var(--good); padding: 6px 8px; background: rgba(74, 222, 128, 0.08); border-radius: 4px; }
.star-status .star-warn { color: var(--accent); padding: 6px 8px; background: rgba(94, 176, 255, 0.08); border-radius: 4px; }
.star-status .star-info { color: var(--text-dim); padding: 6px 8px; }

.tool-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 8px;
}
.tool-btn:hover { color: var(--text); border-color: var(--text-dim); }

.event-log-panel { max-height: 160px; }
.event-log { flex: 1; overflow-y: auto; padding: 6px 10px; font: 11px/1.4 ui-monospace, monospace; color: var(--text-dim); }
.event-log-item { padding: 2px 0; border-bottom: 1px solid var(--border); word-break: break-all; }

@media (max-width: 1100px) {
    .main-grid { grid-template-columns: 1fr; }
    .col-left, .col-right { order: 2; }
    .col-middle { order: 1; }
    .history-panel { max-height: 200px; }
}
