﻿/* Token | Credit Estimate — global styles (CE dark theme) */

:root {
    --bg:          #0f1117;
    --bg-card:     #181b23;
    --bg-sidebar:  #13151d;
    --bg-input:    #1e2130;
    --border:      #262a36;
    --text:        #e1e4eb;
    --text-muted:  #8b8fa3;
    --primary:     #5b8af5;
    --primary-dim: #3d6ae0;
    --success:     #34d399;
    --warning:     #fbbf24;
    --danger:      #f87171;
    --radius:      8px;
    --radius-lg:   12px;
    --shadow:      0 2px 8px rgba(0,0,0,.35);
    --font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono:        "SF Mono", "Fira Code", "Cascadia Code", monospace;
    --sidebar-w:   240px;
    --nav-h:       52px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--text); }
code {
    font-family: var(--mono);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1px 5px;
}

/* ── Top Navigation ─────────────────────────────────────────────────── */
.top-nav {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--nav-h); padding: 0 16px;
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 200;
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 8px; }
.nav-center { display: flex; align-items: center; gap: 4px; }

.brand {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 1rem; color: var(--text);
    white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--primary); }
.brand i { color: var(--primary); font-size: 1rem; }
.brand-text { font-size: .95rem; }

.sidebar-toggle {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: .95rem;
    padding: 6px 8px; border-radius: var(--radius);
    display: flex; align-items: center;
    transition: background .15s, color .15s;
}
.sidebar-toggle:hover { background: var(--bg-input); color: var(--text); }

.nav-link {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: var(--radius);
    font-size: .85rem; color: var(--text-muted);
    transition: background .15s, color .15s;
    background: none; border: none; cursor: pointer;
    white-space: nowrap;
}
.nav-link:hover { background: var(--bg-input); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--primary); background: rgba(91,138,245,.1); }

.version-pill {
    font-size: .68rem; padding: 2px 8px; border-radius: 10px;
    background: var(--bg-input); color: var(--text-muted);
    display: inline-flex; align-items: center; gap: 5px;
    white-space: nowrap;
}
.icon-btn {
    color: var(--text-muted); font-size: .95rem;
    padding: 5px 8px; border-radius: var(--radius);
    display: flex; align-items: center;
    transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-input); color: var(--text); text-decoration: none; }

/* Dropdown */
.nav-dropdown { position: relative; }
.dd-arrow { font-size: .55rem; transition: transform .2s; margin-left: 2px; }
.nav-dropdown.open .dd-arrow,
.nav-dropdown:focus-within .dd-arrow { transform: rotate(180deg); }
.dropdown-menu {
    display: none; position: absolute; top: calc(100% + 4px); right: 0;
    min-width: 200px; padding: 6px 0;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); z-index: 300;
}
.nav-dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 16px; font-size: .85rem; color: var(--text-muted);
    transition: background .1s, color .1s;
}
.dropdown-menu a:hover { background: var(--bg-input); color: var(--text); text-decoration: none; }
.dropdown-menu a i { width: 16px; text-align: center; font-size: .8rem; color: var(--primary); }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 0; }

/* ── App Body Layout ────────────────────────────────────────────────── */
.app-body {
    display: flex;
    min-height: calc(100vh - var(--nav-h));
}

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 10px 0 24px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width .2s ease, min-width .2s ease;
}
.sidebar.collapsed {
    width: 54px;
    min-width: 54px;
    overflow: visible;
}
.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .section-label,
.sidebar.collapsed .section-arrow,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .section-links { display: none !important; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 8px 4px; }
.sidebar.collapsed .section-toggle { justify-content: center; padding: 8px 6px; }
.sidebar.collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }

.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 14px 6px 16px; margin-bottom: 4px;
}
.sidebar-title {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-muted);
}
.sidebar-collapse-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: .75rem; padding: 4px 5px;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
    display: flex; align-items: center;
}
.sidebar-collapse-btn:hover { background: var(--bg-input); color: var(--text); }

.sidebar-section { margin-bottom: 2px; }

.section-toggle {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 5px 16px; min-height: 32px;
    background: none; border: none; color: var(--text-muted);
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; cursor: pointer; text-align: left;
    transition: background .15s, color .15s;
}
.section-toggle:hover { background: var(--bg-input); color: var(--text); }
.section-toggle-icon { color: var(--primary); width: 16px; text-align: center; font-size: .75rem; }
.section-label { flex: 1; }
.section-arrow { font-size: .55rem; color: var(--text-muted); transition: transform .2s; }
.section-toggle[aria-expanded="true"] .section-arrow { transform: rotate(90deg); }
.section-links { padding: 2px 0 4px; }
.section-toggle[aria-expanded="false"] + .section-links { display: none; }

.sidebar-link {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 14px 5px 34px;
    font-size: .83rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-height: 30px; transition: background .12s, color .12s;
}
.sidebar-link:hover,
.sidebar-link.active { color: var(--primary); background: var(--bg-input); text-decoration: none; }
.sidebar-link.active { font-weight: 600; border-left: 2px solid var(--primary); }
.sidebar-link i { width: 15px; text-align: center; font-size: .75rem; flex-shrink: 0; }

/* ── Main Content ───────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
    max-width: 1200px;
}

/* ── Cards & Panels ─────────────────────────────────────────────────── */
.page-hero, .panel, .card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.page-hero {
    padding: 24px 28px;
    margin-bottom: 24px;
}
.page-hero h1 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700; margin: 0 0 6px; line-height: 1.2;
}
.page-hero .eyebrow {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--text-muted); margin-bottom: 6px;
}
.page-hero .hero-desc {
    color: var(--text-muted); font-size: .9rem; margin: 0;
}
.model-overview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: .875rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ── AI Agents Section ─────────────────────────────────────────────── */
.ai-agents-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid #7c3aed;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    margin-bottom: 20px;
    overflow: hidden;
}
.ai-agents-toggle {
    width: 100%; display: flex; align-items: center; gap: 9px;
    padding: 13px 18px; background: transparent; border: none;
    cursor: pointer; font-family: inherit; text-align: left;
    color: var(--text); font-size: .88rem; font-weight: 600;
    transition: background .15s;
}
.ai-agents-toggle:hover { background: rgba(124,58,237,.05); }
.ai-agents-toggle i:first-child { color: #7c3aed; font-size: .95rem; }
.ai-agents-toggle span:first-of-type { flex: 1; }
.ai-agents-count {
    font-size: .67rem; background: rgba(124,58,237,.12); color: #7c3aed;
    padding: 2px 7px; border-radius: 8px; font-weight: 700;
}
.ai-agents-chevron { font-size: .62rem; color: var(--text-muted); transition: transform .2s; }
.ai-agents-body {
    padding: 0 18px 18px;
    border-top: 1px solid var(--border);
}
.ai-agents-intro {
    font-size: .8rem; color: var(--text-muted); line-height: 1.6;
    padding: 12px 0 14px; border-bottom: 1px dashed var(--border); margin-bottom: 14px;
}
.ai-agents-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (max-width: 800px) { .ai-agents-grid { grid-template-columns: 1fr; } }
.ai-agent-card {
    display: flex; align-items: flex-start; gap: 11px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 11px 13px;
    transition: border-color .15s, background .15s;
    position: relative;
}
.ai-agent-card:hover { border-color: #7c3aed; }
.ai-agent-card.selected { border-color: #7c3aed; background: rgba(124,58,237,.06); }

/* Checkbox overlay — sits at top-left of card */
.agent-select-cb {
    position: absolute; top: 8px; left: 8px;
    width: 16px; height: 16px; cursor: pointer; z-index: 1;
    accent-color: #7c3aed;
}
.ai-agent-check-label {
    position: absolute; inset: 0; cursor: pointer; border-radius: var(--radius);
}
.ai-agents-grid .ai-agent-icon { margin-left: 18px; }

/* Tier badges */
.agent-tier-badge {
    display: inline-block; font-size: .62rem; font-weight: 700;
    padding: 1px 6px; border-radius: 4px; letter-spacing: .04em;
    flex-shrink: 0; margin-right: 4px;
}
.tier-S  { background: #dcfce7; color: #166534; }
.tier-M  { background: #dbeafe; color: #1e40af; }
.tier-L  { background: #ffedd5; color: #9a3412; }
.tier-XL { background: #f3e8ff; color: #6b21a8; }

/* Stats row below the description */
.ai-agent-stats {
    display: flex; align-items: center; gap: 6px;
    font-size: .68rem; color: var(--text-muted);
    margin-top: 5px; flex-wrap: wrap;
}
.agent-stat-text { color: var(--text-muted); }

/* Footer summary row */
.ai-agents-footer {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0 2px; margin-top: 12px;
    border-top: 1px dashed var(--border);
    flex-wrap: wrap;
}
.ai-agents-total-label { font-size: .78rem; color: var(--text-muted); margin-left: auto; }
.ai-agents-total-value { font-size: .85rem; font-weight: 700; color: var(--primary); }

/* Agent estimate sub-section labels */
.agent-est-sub-label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-muted);
    border-bottom: 1px solid var(--border); padding-bottom: 4px;
    margin: 6px 0 6px;
}
.agent-est-sub-note { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: .72rem; }
.ai-agent-icon {
    width: 30px; height: 30px; border-radius: var(--radius);
    background: rgba(124,58,237,.1); display: flex; align-items: center;
    justify-content: center; flex-shrink: 0;
}
.ai-agent-icon i { color: #7c3aed; font-size: .82rem; }
.ai-agent-content { flex: 1; min-width: 0; }
.ai-agent-title { font-size: .82rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.ai-agent-desc { font-size: .74rem; color: var(--text-muted); line-height: 1.55; }

/* ── Security Panel ──────────────────────────────────────────────────── */
.security-panel {
    padding: 18px 20px 20px; overflow-y: auto; max-height: calc(100vh - 200px);
}
.encrypt-option-list { display: flex; flex-direction: column; gap: 0; }
.encrypt-option {
    display: grid; grid-template-columns: 20px 1fr auto;
    grid-template-rows: auto auto;
    align-items: center; gap: 0 8px;
    padding: 9px 10px; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 5px; background: var(--bg-input);
    transition: border-color .15s, background .15s;
}
.encrypt-option:has(input:checked) { border-color: var(--primary); background: rgba(99,102,241,.05); }
.encrypt-option input { grid-column: 1; grid-row: 1 / span 2; accent-color: var(--primary); cursor: pointer; }
.encrypt-label { grid-column: 2; grid-row: 1; font-size: .82rem; font-weight: 600; color: var(--text); }
.encrypt-mult  { grid-column: 3; grid-row: 1; font-size: .75rem; font-weight: 700;
                 color: var(--primary); background: rgba(99,102,241,.1);
                 padding: 1px 7px; border-radius: 4px; white-space: nowrap; }
.encrypt-note  { grid-column: 2 / span 2; grid-row: 2; font-size: .69rem; color: var(--text-muted); margin-top: 2px; }

/* File types */
.file-type-hint { font-size: .76rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
.file-type-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; margin-bottom: 8px; }
.file-type-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(124,58,237,.1); border: 1px solid rgba(124,58,237,.25);
    color: #7c3aed; font-size: .75rem; font-weight: 600;
    padding: 2px 8px 2px 9px; border-radius: 20px;
}
.file-type-tag-remove {
    background: none; border: none; color: #7c3aed; font-size: .8rem;
    cursor: pointer; padding: 0; line-height: 1; opacity: .7;
}
.file-type-tag-remove:hover { opacity: 1; }
.file-type-input-row { display: flex; gap: 6px; margin-bottom: 8px; }
.file-type-input {
    flex: 1; padding: 5px 9px; font-size: .8rem; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-input); color: var(--text);
}
.file-type-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 4px; }
.file-type-preset-label { font-size: .7rem; color: var(--text-muted); }
.file-type-preset-btn {
    font-size: .7rem; font-family: monospace; padding: 2px 7px;
    border: 1px solid var(--border); border-radius: 4px;
    background: var(--bg-input); color: var(--text-muted); cursor: pointer;
    transition: border-color .12s, color .12s;
}
.file-type-preset-btn:hover { border-color: #7c3aed; color: #7c3aed; }
.hero-meta { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.hero-icon { font-size: 2.5rem; color: var(--primary); opacity: .9; }

.panel { padding: 20px 22px; }
.panel-label {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-muted); margin-bottom: 10px;
}
.card { padding: 18px 20px; }

/* ── Home grid ──────────────────────────────────────────────────────── */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.model-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-decoration: none; color: var(--text);
    transition: border-color .2s, transform .15s, box-shadow .2s;
    display: flex; flex-direction: column; gap: 8px;
    cursor: pointer;
}
.model-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91,138,245,.15);
    text-decoration: none; color: var(--text);
}
.model-card-header { display: flex; align-items: center; gap: 12px; }
.model-card-icon {
    width: 44px; height: 44px; border-radius: var(--radius);
    background: rgba(91,138,245,.12); border: 1px solid rgba(91,138,245,.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--primary); flex-shrink: 0;
}
.model-card-name { font-weight: 700; font-size: .95rem; }
.model-card-full { font-size: .78rem; color: var(--text-muted); }
.model-card-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.model-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border);
}
.model-card-stat { font-size: .72rem; color: var(--text-muted); }
.model-card-stat strong { color: var(--primary); font-weight: 700; }
.model-card-cat {
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-muted);
    background: var(--bg-input); padding: 2px 7px; border-radius: 8px;
}

/* ── Model page: feature list + right column ─────────────────────── */
.model-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

/* Right column: sticky container for tabbed estimate + platform panels */
.right-column {
    position: sticky;
    top: calc(var(--nav-h) + 16px);
    display: flex;
    flex-direction: column;
    gap: 0;
    align-self: start;
}

/* Tab bar */
.right-tabs {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    background: var(--bg-input);
    flex-shrink: 0;
}
.right-tab {
    flex: 1; padding: 10px 8px;
    font-size: .78rem; font-weight: 600;
    background: transparent; border: none; cursor: pointer;
    color: var(--text-muted); display: flex; align-items: center;
    justify-content: center; gap: 6px;
    transition: background .15s, color .15s;
    font-family: inherit;
}
.right-tab:hover { background: rgba(91,138,245,.07); color: var(--text); }
.right-tab.active { background: var(--bg-card); color: var(--primary); border-bottom: 2px solid var(--primary); }
.right-tab i { font-size: .8rem; }

/* Scrollbar styling for right column panels */
.right-column::-webkit-scrollbar { width: 5px; }
.right-column::-webkit-scrollbar-track { background: transparent; }
.right-column::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* -- Tooltips ---------------------------------------------------------------- */
.tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.tooltip-wrap .tooltip-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 12px;
    font-size: .72rem;
    color: var(--text-muted);
    width: 240px;
    line-height: 1.55;
    z-index: 500;
    box-shadow: var(--shadow);
    white-space: normal;
    pointer-events: none;
    font-weight: 400;
}
.tooltip-wrap:hover .tooltip-text { display: block; }
.tooltip-icon { color: var(--text-muted); font-size: .72rem; cursor: help; display: inline-flex; align-items: center; }
.tooltip-icon:hover { color: var(--primary); }
@media (max-width: 960px) {
    .model-layout { grid-template-columns: 1fr; }
    .right-column { position: static; }
    .estimate-panel { max-height: none; }
}

/* Modules & Features */
.module-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
    overflow: hidden;
}
.module-header {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 18px; cursor: pointer; user-select: none;
    transition: background .15s;
}
.module-header:hover { background: var(--bg-input); }
.module-header i.module-icon { color: var(--primary); width: 18px; text-align: center; font-size: .85rem; }
.module-name { font-weight: 600; font-size: .9rem; flex: 1; }
.module-count {
    font-size: .68rem; background: var(--bg-input); padding: 2px 7px;
    border-radius: 8px; color: var(--text-muted);
}
.module-tokens {
    font-size: .72rem; color: var(--primary); font-weight: 600;
    font-family: var(--mono); white-space: nowrap;
}
.module-chevron { font-size: .6rem; color: var(--text-muted); transition: transform .2s; }
.module-block.open .module-chevron { transform: rotate(90deg); }

/* Agent module — subtle purple tint to signal it's infrastructure, not a feature */
.module-block--agents {
    border-color: rgba(124,58,237,.35);
    background: rgba(124,58,237,.03);
}
.module-block--agents .module-header { border-bottom: 1px dashed rgba(124,58,237,.2); }
.module-block--agents .module-count  { background: rgba(124,58,237,.1); color: #7c3aed; }

.feature-list { padding: 2px 0 8px; border-top: 1px solid var(--border); }
.feature-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 9px 18px 9px 18px;
    transition: background .1s; cursor: pointer;
}
.feature-item:hover { background: rgba(91,138,245,.04); }
.feature-item input[type="checkbox"] {
    width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px;
    accent-color: var(--primary); cursor: pointer;
}
.feature-body { flex: 1; min-width: 0; }
.feature-label {
    font-size: .88rem; font-weight: 500; color: var(--text);
    cursor: pointer; line-height: 1.4;
}
.feature-desc { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.feature-tokens {
    font-size: .72rem; font-family: var(--mono);
    color: var(--text-muted); white-space: nowrap; margin-top: 2px; padding-top: 2px;
}
.feature-item.checked .feature-label { color: var(--primary); }
.feature-item.checked .feature-tokens { color: var(--primary); }
.feature-select-row {
    display: flex; gap: 8px;
    padding: 8px 18px 4px;
    border-top: 1px solid var(--border);
}

/* Estimate Panel */
.estimate-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 20px;
    max-height: calc(100vh - var(--nav-h) - 80px);
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 16px;
}
.estimate-panel-title {
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-muted);
    display: flex; align-items: center; gap: 6px;
}
.estimate-panel-title i { color: var(--primary); }

/* ── Platform & Deployment Panel ─────────────────────────────────── */
.platform-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 20px;
    max-height: calc(100vh - var(--nav-h) - 80px);
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 14px;
}
.platform-section { display: flex; flex-direction: column; }
.platform-section-label {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-muted); margin-bottom: 7px;
}
.platform-note { font-size: .7rem; color: var(--text-muted); line-height: 1.5; }

/* Deployment type buttons */
.platform-deploy-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
}
.platform-deploy-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 9px 6px; border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
    font-size: .7rem; text-align: center; background: var(--bg-input);
    color: var(--text-muted); transition: border-color .15s, color .15s, background .15s;
    font-family: inherit;
}
.platform-deploy-btn i { font-size: .9rem; }
.platform-deploy-btn:hover { border-color: var(--primary); color: var(--primary); }
.platform-deploy-btn.active {
    border-color: var(--primary); color: var(--primary);
    background: rgba(91,138,245,.08); font-weight: 600;
}

/* Provider grid */
.provider-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.provider-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 4px; border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
    font-size: .67rem; text-align: center; line-height: 1.3;
    background: var(--bg-input); color: var(--text-muted);
    transition: border-color .15s, color .15s, background .15s;
    font-family: inherit;
}
.provider-btn i { font-size: .88rem; }
.provider-btn:hover { border-color: var(--primary); color: var(--primary); }
.provider-btn.active {
    border-color: var(--primary); color: var(--primary);
    background: rgba(91,138,245,.08); font-weight: 600;
}

/* Compute pattern list */
.platform-pattern-list { display: flex; flex-direction: column; gap: 4px; }
.platform-pattern-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer;
    font-size: .78rem; background: var(--bg-input); color: var(--text-muted);
    transition: border-color .15s, color .15s, background .15s;
    font-family: inherit; text-align: left;
}
.platform-pattern-btn i { font-size: .78rem; width: 14px; text-align: center; flex-shrink: 0; }
.platform-pattern-btn:hover { border-color: var(--primary); color: var(--primary); }
.platform-pattern-btn.active {
    border-color: var(--primary); color: var(--primary);
    background: rgba(91,138,245,.08); font-weight: 600;
}

/* Infrastructure summary card */
.platform-summary {
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 13px;
}
.platform-summary-title {
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted); margin-bottom: 9px;
}
.platform-summary-row {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: .8rem; margin-bottom: 6px; color: var(--text);
}
.platform-summary-value {
    font-weight: 700; color: var(--primary);
    font-family: var(--mono); font-size: .8rem;
}
.platform-summary-note {
    font-size: .7rem; color: var(--text-muted);
    margin-top: 8px; line-height: 1.55; border-top: 1px solid var(--border);
    padding-top: 8px;
}

.estimate-total {
    text-align: center; padding: 14px 0;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg);
}
.estimate-total-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.estimate-total-value {
    font-size: 2rem; font-weight: 800; color: var(--primary);
    font-family: var(--mono); line-height: 1.1; margin: 4px 0 0;
}
.estimate-total-sub { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }

.estimate-row {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: .82rem;
}
.estimate-row-label { color: var(--text-muted); }
.estimate-row-value { font-weight: 600; color: var(--text); font-family: var(--mono); }
.estimate-row-value.accent { color: var(--primary); }
.estimate-divider { height: 1px; background: var(--border); margin: 0; }

.model-select-label { font-size: .75rem; color: var(--text-muted); margin-bottom: 5px; display: block; }
.model-select {
    width: 100%; padding: 7px 10px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: .83rem;
    cursor: pointer; outline: none;
}
.model-select:focus { border-color: var(--primary); }

.scale-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: var(--radius);
    font-size: .78rem; font-weight: 700; width: 100%; justify-content: center;
}
.scale-none     { background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border); }
.scale-small    { background: rgba(52,211,153,.1); color: var(--success); border: 1px solid rgba(52,211,153,.25); }
.scale-medium   { background: rgba(91,138,245,.1); color: var(--primary); border: 1px solid rgba(91,138,245,.25); }
.scale-large    { background: rgba(251,191,36,.1); color: var(--warning); border: 1px solid rgba(251,191,36,.25); }
.scale-enterprise{ background: rgba(248,113,113,.1); color: var(--danger); border: 1px solid rgba(248,113,113,.25); }

/* Quality badges */
.quality-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .72rem; font-weight: 700; padding: 2px 9px;
    border-radius: 20px; white-space: nowrap;
}
.quality-excellent { background: rgba(32,201,151,.15); color: #20c997; border: 1px solid rgba(32,201,151,.3); }
.quality-good      { background: rgba(91,138,245,.15);  color: var(--primary); border: 1px solid rgba(91,138,245,.3); }
.quality-standard  { background: rgba(108,117,125,.15); color: #adb5bd; border: 1px solid rgba(108,117,125,.3); }
.swe-score {
    font-size: .65rem; font-weight: 500; opacity: .8;
    border-left: 1px solid currentColor; padding-left: 6px; margin-left: 2px;
}

/* Cost breakdown */
.cost-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.cost-table td { padding: 4px 0; }
.cost-table td:last-child { text-align: right; font-family: var(--mono); color: var(--text); }
.cost-table tr.total-row td { border-top: 1px solid var(--border); padding-top: 8px; font-weight: 700; }
.cost-table tr.total-row td:last-child { color: var(--primary); }


/* -- SDLC Phase Breakdown ---------------------------------------------------- */
.sdlc-quick-set {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 8px; padding: 5px 8px;
    background: var(--bg); border-radius: var(--radius);
}
.sdlc-quick-label { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.model-select-sm {
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text); border-radius: var(--radius);
    font-size: .72rem; padding: 3px 5px; cursor: pointer; width: 100%;
}
.model-select-sm:focus { border-color: var(--primary); outline: none; }
.sdlc-phase-row { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.sdlc-phase-row:last-of-type { border-bottom: none; }
.sdlc-phase-header { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.sdlc-phase-icon { color: var(--primary); font-size: .75rem; width: 14px; flex-shrink: 0; }
.sdlc-phase-name { font-size: .76rem; font-weight: 600; flex: 1; line-height: 1.2; }
.sdlc-phase-pct { font-size: .68rem; color: var(--text-muted); font-family: var(--mono); }
.sdlc-phase-meta { display: flex; align-items: center; gap: 5px; padding-left: 19px; }
.sdlc-phase-tokens {
    font-size: .68rem; color: var(--text-muted); font-family: var(--mono);
    white-space: nowrap; min-width: 36px;
}
.sdlc-phase-cost {
    font-size: .76rem; font-weight: 600; color: var(--primary);
    font-family: var(--mono); white-space: nowrap; min-width: 48px; text-align: right;
}
.sdlc-total-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0 2px; border-top: 1px solid var(--border);
    margin-top: 5px; font-weight: 700; font-size: .82rem;
}
.sdlc-total-row span:last-child { color: var(--primary); font-family: var(--mono); }
.panel-btn-row { display: flex; gap: 8px; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: var(--radius);
    font-size: .83rem; font-weight: 600; border: none;
    cursor: pointer; transition: opacity .15s, background .15s;
    text-decoration: none; white-space: nowrap;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary {
    background: var(--bg-input); color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-secondary:hover { color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: .77rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-outline {
    background: transparent; color: var(--primary);
    border: 1px solid var(--primary);
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block; font-size: .8rem; font-weight: 600;
    color: var(--text-muted); margin-bottom: 5px;
}
.form-control {
    width: 100%; padding: 8px 12px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: .88rem;
    outline: none; transition: border-color .15s;
}
.form-control:focus { border-color: var(--primary); }
select.form-control { cursor: pointer; }

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert {
    padding: 10px 14px; border-radius: var(--radius);
    font-size: .85rem; margin-bottom: 14px;
}
.alert-danger  { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.3); color: var(--danger); }
.alert-success { background: rgba(52,211,153,.1);  border: 1px solid rgba(52,211,153,.3);  color: var(--success); }

/* ── Table ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table {
    width: 100%; border-collapse: collapse;
    font-size: .84rem;
}
.data-table th {
    text-align: left; padding: 8px 14px;
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-input); }

/* ── Tier / Vendor badges ───────────────────────────────────────────── */
.tier-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; padding: 2px 8px; border-radius: 6px;
}
.tier-flagship  { background: rgba(248,113,113,.1); color: var(--danger);  border: 1px solid rgba(248,113,113,.25); }
.tier-balanced  { background: rgba(91,138,245,.1);  color: var(--primary); border: 1px solid rgba(91,138,245,.25); }
.tier-fast      { background: rgba(52,211,153,.1);  color: var(--success); border: 1px solid rgba(52,211,153,.25); }

/* ── Login ──────────────────────────────────────────────────────────── */
.login-shell {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 32px 16px;
}
.login-card {
    width: 100%; max-width: 400px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 32px 28px;
    box-shadow: var(--shadow);
}
.login-header { text-align: center; margin-bottom: 24px; }
.login-icon {
    font-size: 2rem; color: var(--primary); margin-bottom: 10px;
}
.login-header h1 { font-size: 1.3rem; margin-bottom: 6px; }
.login-header p { color: var(--text-muted); font-size: .85rem; }

/* ── Admin AI Models page ───────────────────────────────────────────── */
.ai-model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin-top: 20px;
}
.ai-model-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 18px 20px;
}
.ai-model-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ai-model-name { font-weight: 700; font-size: .95rem; }
.ai-model-vendor { font-size: .75rem; color: var(--text-muted); margin-top: 1px; }
.ai-model-desc { font-size: .78rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.ai-model-pricing { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pricing-cell {
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 8px 10px; text-align: center;
}
.pricing-cell-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.pricing-cell-value { font-size: .95rem; font-weight: 700; font-family: var(--mono); color: var(--text); margin-top: 2px; }
.ai-context-row { font-size: .75rem; color: var(--text-muted); margin-top: 10px; }
.ai-context-row strong { color: var(--text); }

/* ── Section headers ────────────────────────────────────────────────── */
.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 16px; gap: 12px;
}
.section-head h2 { font-size: 1rem; font-weight: 700; }
.section-head p { font-size: .82rem; color: var(--text-muted); }

/* ── Utility ────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.mono { font-family: var(--mono); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

/* ── Error page ─────────────────────────────────────────────────────── */
.error-page {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center;
    min-height: 50vh; gap: 12px;
}
.error-page i { font-size: 3rem; color: var(--text-muted); }
.error-page h2 { font-size: 1.2rem; }
.error-page p { color: var(--text-muted); font-size: .9rem; }

/* ── Home: How It Works ──────────────────────────────────────────────── */
.home-how-it-works {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.hiw-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 160px;
}
.hiw-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.hiw-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
}
.hiw-body strong {
    color: var(--text-primary);
    font-size: 13px;
}
.hiw-body span {
    color: var(--text-muted);
    line-height: 1.4;
}
.hiw-arrow {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
    padding-top: 6px;
}

/* ── Home: TCE Meta-Banner ──────────────────────────────────────────── */
.tce-meta-banner {
    background: linear-gradient(135deg, #141a2e 0%, #1a1f30 100%);
    border: 1px solid rgba(91,138,245,0.30);
    border-radius: 12px;
    padding: 22px 24px;
    margin-bottom: 28px;
}
.tce-meta-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.tce-meta-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.5;
}
.tce-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.tce-meta-stat {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
}
.tce-meta-stat--accent {
    background: rgba(91,138,245,0.12);
    border-color: rgba(91,138,245,0.35);
}
.tce-meta-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.tce-meta-stat--accent .tce-meta-value {
    color: var(--primary);
}
.tce-meta-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}
.tce-meta-label small {
    color: var(--text-muted);
    opacity: 0.75;
    font-size: 10px;
}
.tce-meta-note {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-bottom: 0;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}
.tce-meta-note i {
    color: var(--primary);
    margin-top: 2px;
    flex-shrink: 0;
}

/* ── Home: Live Site Scanner ─────────────────────────────────────────── */
.scan-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 24px;
}
.scan-form {
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
}
.scan-form .form-control { flex: 1; }
.scan-error {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: rgba(248,113,113,.1);
    border: 1px solid rgba(248,113,113,.3);
    color: var(--danger);
    font-size: .85rem;
}
.scan-loading {
    margin-top: 14px;
    font-size: .85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.scan-results {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 960px) {
    .scan-results { grid-template-columns: 1fr; }
}
.scan-results-main {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
}
.scan-site-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}
.scan-site-desc {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.55;
}
.scan-feature-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.scan-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.scan-feature-item i {
    color: var(--primary);
    margin-top: 3px;
    flex-shrink: 0;
}
.scan-feature-body { flex: 1; min-width: 0; }
.scan-feature-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}
.scan-feature-tokens {
    font-size: .72rem;
    font-family: var(--mono);
    color: var(--primary);
    white-space: nowrap;
}
.scan-feature-desc {
    font-size: .76rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.5;
}
.scan-estimate-panel {
    border-radius: var(--radius-lg);
    border-top: 1px solid var(--border);
    max-height: none;
}
.scan-save-status {
    font-size: .75rem;
    text-align: center;
    padding: 6px 10px;
    border-radius: var(--radius);
}
.scan-save-ok  { background: rgba(52,211,153,.1); color: var(--success); border: 1px solid rgba(52,211,153,.3); }
.scan-save-err { background: rgba(248,113,113,.1); color: var(--danger); border: 1px solid rgba(248,113,113,.3); }

.site-type-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    margin-left: 8px;
    vertical-align: middle;
    white-space: nowrap;
}
.site-type-sm { font-size: .64rem; padding: 1px 7px; margin-left: 0; }
.site-type-saas      { background: rgba(91,138,245,.15);  color: var(--primary); border: 1px solid rgba(91,138,245,.3); }
.site-type-webapp    { background: rgba(251,191,36,.12);  color: var(--warning); border: 1px solid rgba(251,191,36,.3); }
.site-type-marketing { background: rgba(108,117,125,.12); color: #adb5bd; border: 1px solid rgba(108,117,125,.3); }

.scan-viewing-banner {
    background: rgba(91,138,245,.1);
    border: 1px solid rgba(91,138,245,.3);
    color: var(--primary);
    font-size: .78rem;
    padding: 7px 12px;
    border-radius: var(--radius);
    margin-bottom: 12px;
}

/* ── Scan history: collapsible toggle ────────────────────────────────── */
.scan-history-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    color: var(--text);
    font-size: .95rem;
    font-weight: 700;
    padding: 0;
}
.scan-history-toggle i:first-child { color: var(--primary); }
.scan-history-toggle span:first-of-type { flex: 0 0 auto; }
.scan-history-count {
    font-size: .68rem;
    font-weight: 700;
    background: var(--bg-input);
    color: var(--text-muted);
    padding: 2px 9px;
    border-radius: 10px;
    margin-right: auto;
}
.scan-history-chevron {
    font-size: .7rem;
    color: var(--text-muted);
    transition: transform .2s;
}
.scan-history-toggle[aria-expanded="true"] .scan-history-chevron { transform: rotate(90deg); }
.scan-history-body { margin-top: 14px; }

.scan-history-row,
.teardown-history-row {
    cursor: pointer;
}
.scan-history-row:hover,
.teardown-history-row:hover {
    background: var(--bg);
}
.scan-history-row:focus-visible,
.teardown-history-row:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* ── Scan methodology/limitations disclaimer ─────────────────────────── */
.scan-methodology-note {
    margin-bottom: 14px;
}
.scan-methodology-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-muted);
    font-size: .78rem;
    font-weight: 600;
    padding: 0;
}
.scan-methodology-toggle i:first-child { color: var(--text-muted); }
.scan-methodology-toggle:hover { color: var(--text); }
.scan-methodology-chevron {
    font-size: .65rem;
    transition: transform .2s;
}
.scan-methodology-toggle[aria-expanded="true"] .scan-methodology-chevron { transform: rotate(90deg); }
.scan-methodology-body {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.scan-methodology-body ul {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.scan-methodology-body li {
    font-size: .76rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.scan-methodology-body li strong { color: var(--text); }

/* ── Competitive teardown & IP-gap analysis ──────────────────────────── */
.teardown-flag-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.teardown-flag-item {
    padding: 10px 12px;
    background: rgba(251,191,36,.06);
    border: 1px solid rgba(251,191,36,.3);
    border-radius: var(--radius);
}
.teardown-flag-phrase {
    font-size: .8rem;
    font-weight: 700;
    color: var(--warning);
    text-transform: capitalize;
}
.teardown-flag-phrase i { margin-right: 4px; }
.teardown-flag-snippet {
    font-size: .76rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 5px 0;
    line-height: 1.5;
}
.teardown-flag-feature {
    font-size: .72rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.teardown-flag-suggestion {
    font-size: .78rem;
    color: var(--text);
    line-height: 1.55;
}
.teardown-flag-suggestion strong { color: var(--primary); }

.teardown-patent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.teardown-patent-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .68rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
}
.teardown-patent-chip .teardown-patent-status {
    font-weight: 500;
    opacity: .85;
}
.teardown-patent-active {
    background: rgba(248,113,113,.1);
    color: var(--danger);
    border: 1px solid rgba(248,113,113,.3);
}
.teardown-patent-expired {
    background: rgba(108,117,125,.12);
    color: #adb5bd;
    border: 1px solid rgba(108,117,125,.3);
}

/* ── Sidebar backdrop (mobile drawer overlay) ───────────────────────── */
#sidebarBackdrop {
    display: none;
    position: fixed; inset: 0; top: var(--nav-h);
    background: rgba(0,0,0,.5); z-index: 149;
    -webkit-tap-highlight-color: transparent;
}
#sidebarBackdrop.active { display: block; }

/* ── Responsive ─────────────────────────────────────────────────────── */

/* Tablet / small desktop */
@media (max-width: 960px) {
    .nav-text { display: none; }   /* nav-center links become icon-only */
}

/* Mobile */
@media (max-width: 768px) {
    .main-content { padding: 16px; }

    /* Sidebar hidden by default; hamburger opens it as a drawer */
    .sidebar {
        display: none;
        width: 280px; min-width: 280px;
        overflow-y: auto;
    }
    .sidebar.mobile-open {
        display: flex; flex-direction: column;
        position: fixed; top: var(--nav-h); left: 0; bottom: 0;
        z-index: 150;
        box-shadow: 4px 0 24px rgba(0,0,0,.45);
    }

    .home-how-it-works { flex-direction: column; gap: 14px; }
    .hiw-arrow { display: none; }
    .tce-meta-grid { grid-template-columns: repeat(2, 1fr); }

    /* Dropdown menu: open upward / stay on-screen */
    .dropdown-menu { left: auto; right: 0; }
}

/* Small phones */
@media (max-width: 600px) {
    .brand-text  { display: none; }          /* keep coin icon, drop text */
    .version-pill { display: none; }         /* drop v0.x.x and username pills */
    .nav-center  { gap: 0; }
    .nav-link    { padding: 6px 8px; }
}
