/* ===================================================
   XELINTEL — VP of AI Interview Reference
   Dark executive theme · Inter + JetBrains Mono
   =================================================== */

:root {
    --bg:        #0d1117;
    --surface:   #151b23;
    --surface2:  #1c2333;
    --border:    #2a3140;
    --text:      #c9d1d9;
    --text-dim:  #8b949e;
    --accent:    #58a6ff;
    --accent2:   #7ee787;
    --accent3:   #d2a8ff;
    --accent4:   #f0883e;
    --mark-bg:   rgba(88,166,255,0.12);
    --mark-text: #79c0ff;
    --tabs-h:    26px;
    --pills-h:   28px;
}

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

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    flex-direction: column;
}

/* ── SECTION TABS ────────────────────────────────── */

#sectionTabs {
    position: sticky;
    top: 0; left: 0; right: 0;
    min-height: var(--tabs-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 2px 10px;
    z-index: 100;
}

.section-tab {
    background: transparent;
    color: var(--text-dim);
    border: none;
    padding: 0 14px;
    height: var(--tabs-h);
    font: 600 11.5px/var(--tabs-h) 'Inter', sans-serif;
    letter-spacing: 0.6px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s;
}
.section-tab:hover { color: var(--text); }
.section-tab.active {
    color: var(--accent);
}

/* ── SEARCH BOX (inline) ────────────────────────── */

.search-box {
    position: absolute;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 10px;
    height: 22px;
    flex-shrink: 0;
}
.search-box svg { color: var(--text-dim); flex-shrink: 0; }
.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font: 400 12px 'Inter', sans-serif;
    width: 140px;
}
.search-box input::placeholder { color: var(--text-dim); opacity: .7; }

/* ── SUBTOPIC PILLS ──────────────────────────────── */

#subtopicBar {
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 12px;
    z-index: 99;
}

.subtopic-pill {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2px 12px;
    font: 500 10.5px 'Inter', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.subtopic-pill:hover {
    color: var(--text);
    border-color: var(--text-dim);
}
.subtopic-pill.active {
    background: var(--accent);
    color: #0d1117;
    border-color: var(--accent);
    font-weight: 600;
}

/* ── CONTENT PANEL ───────────────────────────────── */

#contentPanel {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px 40px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
#contentPanel::-webkit-scrollbar { width: 6px; }
#contentPanel::-webkit-scrollbar-track { background: transparent; }
#contentPanel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.topic-content {
    display: none;
    max-width: 1100px;
    margin: 0 auto;
    animation: fadeIn .2s ease;
}
.topic-content.visible {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 0 36px;
}
/* Questions tab — no sidebar, center content (only the main Questions subtab) */
[data-topic="questions-core"].topic-content.visible {
    grid-template-columns: 1fr;
    max-width: 820px;
}
[data-topic="questions-core"] .section-label {
    margin-top: 0.4rem;
    margin-bottom: 0;
}
[data-topic="questions-core"] ul {
    margin-top: 0.15rem;
    margin-bottom: 0.25rem;
}
.topic-content > :not(.phrase-block) {
    grid-column: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── SECTION HEADINGS ────────────────────────────── */

.section-label {
    font: 600 13px 'Inter', sans-serif;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 24px 0 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.topic-content .section-label:first-child { margin-top: 0; }

/* ── BULLET LISTS ────────────────────────────────── */

.topic-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
}

.topic-content ul li {
    position: relative;
    padding: 6px 0 6px 18px;
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.65;
    border-bottom: 1px solid rgba(42,49,64,0.4);
}
.topic-content ul li:last-child { border-bottom: none; }

.topic-content ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 11px;
    top: 8px;
}

.topic-content ul li strong {
    color: #e6edf3;
    font-weight: 600;
}

/* ── KEY PHRASES BLOCK ───────────────────────────── */

/* ── FULL RESPONSE BLOCK ─────────────────────────── */

/* ── Collapsible Reference Panels ─────────── */
details.ref-panel {
    margin: 8px 0 20px;
    padding: 0;
    background: rgba(88,166,255,0.04);
    border: 1px solid rgba(88,166,255,0.12);
    border-left: 3px solid rgba(139,92,246,0.5);
    border-radius: 8px;
}
details.ref-panel summary {
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    color: #a78bfa;
    letter-spacing: 0.03em;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
details.ref-panel summary::before {
    content: '\25B6';
    font-size: 0.65rem;
    transition: transform 0.2s;
}
details.ref-panel[open] summary::before {
    transform: rotate(90deg);
}
details.ref-panel summary::-webkit-details-marker { display: none; }
details.ref-panel .ref-panel-body {
    padding: 6px 18px 16px;
}
details.ref-panel .ref-panel-body ol {
    margin: 0;
    padding-left: 1.2em;
}
details.ref-panel .ref-panel-body ol li {
    margin-bottom: 10px;
    line-height: 1.65;
    color: #c9d1d9;
    font-size: 0.82rem;
}
details.ref-panel .ref-panel-body ol li strong {
    color: #e6edf3;
}

.response-block {
    margin: 8px 0 20px;
    padding: 14px 18px;
    background: rgba(88,166,255,0.04);
    border: 1px solid rgba(88,166,255,0.12);
    border-left: 3px solid rgba(88,166,255,0.3);
    border-radius: 8px;
}

.response-block .response-label {
    font: 600 11px 'Inter', sans-serif;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    opacity: 0.7;
}

.response-block p {
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.7;
    margin: 0 0 10px;
    opacity: 0.85;
}

.response-block p:last-child {
    margin-bottom: 0;
}

.phrase-block {
    grid-column: 2;
    grid-row: 1 / span 20;
    align-self: start;
    position: sticky;
    top: 0;
    margin-top: 0;
    padding: 20px 20px 24px;
    background: rgba(88,166,255,0.06);
    border: 1px solid rgba(88,166,255,0.2);
    border-radius: 10px;
    border-left: 3px solid var(--accent);
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.phrase-block h4 {
    font: 700 12px 'Inter', sans-serif;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(88,166,255,0.15);
}

.phrase-block ul { margin: 0; }

.phrase-block ul li {
    padding: 6px 0 6px 18px;
    font-size: 13.5px;
    border-bottom: none !important;
    line-height: 1.5;
}

.phrase-block mark {
    background: rgba(88,166,255,0.15);
    color: #93d0ff;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    display: inline-block;
    margin: 1px 0;
}

/* ── STRATEGY DIAGRAMS ───────────────────────────── */

.strategy-diagram {
    grid-column: 1;
    margin-top: 28px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(22,27,34,0.8);
}
.strategy-diagram h4 {
    color: var(--accent);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 16px 0;
    text-align: center;
}

/* Vision: SVG pyramid */
.vision-svg-wrap {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}
.vision-svg-wrap svg {
    max-width: 100%;
    height: auto;
}

/* Focus: three-column cards */
.focus-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
.focus-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    background: rgba(13,17,23,0.9);
    text-align: center;
}
.focus-card-title {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.focus-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.focus-card ul li {
    font-size: 11px;
    color: #c9d1d9;
    padding: 4px 0;
    border-bottom: 1px solid rgba(48,54,61,0.5);
}
.focus-card ul li:last-child { border-bottom: none; }
.focus-card ul li::before { content: none; }
.focus-card-cue {
    margin-top: 10px;
    font-size: 11px;
    font-style: italic;
    color: #58a6ff;
}

/* Value: phased timeline */
.value-timeline {
    display: flex;
    align-items: stretch;
    gap: 0;
    position: relative;
}
.value-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #238636, #f0883e);
    z-index: 0;
}
.value-phase {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    background: rgba(13,17,23,0.95);
    position: relative;
    z-index: 1;
    margin: 0 4px;
}
.value-phase-num {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}
.value-phase:nth-child(1) .value-phase-num { background: rgba(88,166,255,0.3); color: #58a6ff; }
.value-phase:nth-child(2) .value-phase-num { background: rgba(35,134,54,0.3); color: #3fb950; }
.value-phase:nth-child(3) .value-phase-num { background: rgba(240,136,62,0.3); color: #f0883e; }
.value-phase-title {
    font-size: 12px;
    font-weight: 700;
    color: #c9d1d9;
    margin-bottom: 8px;
}
.value-phase ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.value-phase ul li {
    font-size: 11px;
    color: #8b949e;
    padding: 3px 0;
    border: none;
}
.value-phase ul li::before { content: "› "; color: var(--accent); }
.value-phase-obj {
    margin-top: 8px;
    font-size: 10px;
    font-weight: 600;
    color: #58a6ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── COE DIAGRAMS ─────────────────────────────────── */

/* Governance: tiered cards */
.tier-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.tier-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    background: rgba(13,17,23,0.9);
    text-align: center;
    border-top: 3px solid var(--accent);
}
.tier-card:nth-child(1) { border-top-color: #3fb950; }
.tier-card:nth-child(2) { border-top-color: #d29922; }
.tier-card:nth-child(3) { border-top-color: #f85149; }
.tier-card-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}
.tier-card:nth-child(1) .tier-card-label { color: #3fb950; }
.tier-card:nth-child(2) .tier-card-label { color: #d29922; }
.tier-card:nth-child(3) .tier-card-label { color: #f85149; }
.tier-card-title {
    color: #c9d1d9;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}
.tier-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.tier-card ul li {
    font-size: 11px;
    color: #8b949e;
    padding: 3px 0;
    border: none;
}
.tier-card ul li::before { content: "› "; color: var(--accent); }

/* Portfolio: stage-gate flow */
.stage-gate {
    display: flex;
    align-items: stretch;
    gap: 0;
    position: relative;
}
.stage-gate::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #58a6ff, #3fb950, #d29922, #f0883e);
    z-index: 0;
}
.stage-gate-stage {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    background: rgba(13,17,23,0.95);
    position: relative;
    z-index: 1;
    margin: 0 4px;
    text-align: center;
}
.stage-gate-num {
    display: inline-block;
    width: 24px; height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}
.stage-gate-stage:nth-child(1) .stage-gate-num { background: rgba(88,166,255,0.3); color: #58a6ff; }
.stage-gate-stage:nth-child(2) .stage-gate-num { background: rgba(63,185,80,0.3); color: #3fb950; }
.stage-gate-stage:nth-child(3) .stage-gate-num { background: rgba(210,153,34,0.3); color: #d29922; }
.stage-gate-stage:nth-child(4) .stage-gate-num { background: rgba(240,136,62,0.3); color: #f0883e; }
.stage-gate-title {
    font-size: 12px;
    font-weight: 700;
    color: #c9d1d9;
    margin-bottom: 6px;
}
.stage-gate-desc {
    font-size: 10px;
    color: #8b949e;
}
.stage-gate-gate {
    font-size: 9px;
    font-weight: 600;
    color: #f85149;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

/* Five Pillars: 5-column cards */
.pillar-columns {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
.pillar-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 10px;
    background: rgba(13,17,23,0.9);
    text-align: center;
    border-bottom: 3px solid var(--accent);
    position: relative;
}
.pillar-card:nth-child(1) { border-bottom-color: #58a6ff; }
.pillar-card:nth-child(2) { border-bottom-color: #3fb950; }
.pillar-card:nth-child(3) { border-bottom-color: #d29922; }
.pillar-card:nth-child(4) { border-bottom-color: #bc8cff; }
.pillar-card:nth-child(5) { border-bottom-color: #f85149; }
.pillar-card-num {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}
.pillar-card:nth-child(1) .pillar-card-num { color: rgba(88,166,255,0.3); }
.pillar-card:nth-child(2) .pillar-card-num { color: rgba(63,185,80,0.3); }
.pillar-card:nth-child(3) .pillar-card-num { color: rgba(210,153,34,0.3); }
.pillar-card:nth-child(4) .pillar-card-num { color: rgba(188,140,255,0.3); }
.pillar-card:nth-child(5) .pillar-card-num { color: rgba(248,81,73,0.3); }
.pillar-card-title {
    font-size: 11px;
    font-weight: 700;
    color: #c9d1d9;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.pillar-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pillar-card ul li {
    font-size: 10px;
    color: #8b949e;
    padding: 2px 0;
    border: none;
}
.pillar-card ul li::before { content: "› "; color: var(--accent); }

@media (max-width: 768px) {
    .focus-columns { grid-template-columns: 1fr; }
    .value-timeline { flex-direction: column; }
    .value-timeline::before { display: none; }
    .value-phase { margin: 4px 0; }
    .vision-svg-wrap svg { width: 100%; }
    .tier-cards { grid-template-columns: 1fr; }
    .stage-gate { flex-direction: column; }
    .stage-gate::before { display: none; }
    .stage-gate-stage { margin: 4px 0; }
    .pillar-columns { grid-template-columns: repeat(2, 1fr); }
}

/* ── SEARCH OVERLAY ──────────────────────────────── */

#searchOverlay {
    position: fixed;
    top: var(--tabs-h);
    left: 0; right: 0; bottom: 0;
    background: var(--bg);
    z-index: 90;
    overflow-y: auto;
    padding: 24px 32px;
}
#searchOverlay.hidden { display: none; }

.search-result {
    padding: 14px 16px;
    margin-bottom: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s;
}
.search-result:hover {
    border-color: var(--accent);
}

.search-result .sr-tab {
    font: 600 10px 'JetBrains Mono', monospace;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.search-result .sr-subtab {
    font: 500 10px 'JetBrains Mono', monospace;
    color: var(--accent3);
    margin-left: 8px;
}

.search-result .sr-text {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

.search-result .sr-text mark {
    background: rgba(240,136,62,0.25);
    color: #ffb86c;
    padding: 1px 3px;
    border-radius: 2px;
}

.search-no-results {
    text-align: center;
    color: var(--text-dim);
    padding: 60px 0;
    font-size: 14px;
}
.search-no-results span {
    display: block;
    font-size: 32px;
    margin-bottom: 12px;
}

/* ── RESPONSIVE ──────────────────────────────────── */

@media (max-width: 900px) {
    .topic-content.visible {
        grid-template-columns: 1fr;
    }
    .phrase-block {
        grid-column: 1;
        grid-row: auto;
        position: static;
        margin-top: 16px;
    }
}

/* ── QUICK NAV FOOTER ─────────────────────────────── */
.quick-nav {
    grid-column: 1 / -1;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.quick-nav-title {
    font: 600 10px 'JetBrains Mono', monospace;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
}
.quick-nav-group {
    margin-bottom: 10px;
}
.quick-nav-tab {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
}
.quick-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
}
.quick-nav-link {
    font-size: 11px;
    color: var(--muted);
    background: rgba(48,54,61,0.4);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all .15s;
}
.quick-nav-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(88,166,255,0.08);
}
.quick-nav-link.qn-current {
    color: var(--accent);
    border-color: var(--border);
    background: rgba(88,166,255,0.12);
}

/* ── FLOATING QUICK NAV BUTTON ────────────────────── */
#floatingNavBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.45;
    transition: opacity 0.2s, background 0.2s, border-color 0.2s;
    z-index: 900;
}
#floatingNavBtn:hover {
    opacity: 1;
    background: var(--surface2);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .section-tab { padding: 0 10px; font-size: 10.5px; }
    .search-box input { width: 100px; }
    #contentPanel { padding: 16px 16px 32px; }
    .topic-content { max-width: 100%; }
}

@media (max-width: 480px) {
    .search-box { display: none; }
    .section-tab { font-size: 10px; padding: 0 8px; }
}
