/* Portfolio + project pages. Builds on site.css tokens and components. */

/* ---------- Labels (what kind of work is this?) ---------- */
.label-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap;
}
.label-badge::before { font-size: 13px; }
.label-completed { color: #7ee2a8; border-color: rgba(126, 226, 168, .5); background: rgba(126, 226, 168, .08); }
.label-completed::before { content: "✓"; }
.label-case { color: #9ec5ff; border-color: rgba(158, 197, 255, .5); background: rgba(158, 197, 255, .08); }
.label-case::before { content: "🔒"; }
.label-personal { color: #d7b4ff; border-color: rgba(215, 180, 255, .5); background: rgba(215, 180, 255, .08); }
.label-personal::before { content: "★"; }
.label-demo { color: var(--accent-soft); border-color: rgba(242, 169, 0, .5); background: rgba(242, 169, 0, .08); }
.label-demo::before { content: "◆"; }
.label-soon { color: var(--muted); border-color: var(--border); background: transparent; }
.label-soon::before { content: "…"; }

.legend-labels { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0 0 28px; padding: 0; list-style: none; }
.legend-labels li { display: flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: 14px; }

.tool-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tool-tags li { font-family: var(--mono); font-size: 12px; color: var(--text-soft); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }

/* ---------- Portfolio hero ---------- */
.portfolio-hero h1 { font-size: clamp(36px, 5.4vw, 62px); }

/* ---------- Featured demos ---------- */
.featured { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
    display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--text);
    background: var(--card); border: 1px solid var(--border); border-radius: 18px;
    transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.feature:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.feature-art { height: 190px; position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: #0c1828; }
.feature-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.feature-body h3 { margin: 0; font-size: 22px; }
.feature-body p { margin: 0; color: var(--text-soft); font-size: 16px; }
.feature-body .go { margin-top: auto; color: var(--accent-soft); font-weight: 700; }

/* Mini preview art (pure CSS, decorative) */
.art-report { display: grid; grid-template-columns: 54px 1fr; height: 100%; }
.art-report .pane { border-right: 1px solid var(--line); padding: 12px 8px; display: grid; gap: 6px; align-content: start; }
.art-report .pane i { height: 10px; border-radius: 3px; background: #1c2d47; }
.art-report .pane i:nth-child(2) { background: var(--accent); }
.art-report .canvas { padding: 12px; display: grid; grid-template-rows: 28px 1fr; gap: 10px; }
.art-report .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.art-report .cards i { border-radius: 4px; background: #13233a; border-top: 2px solid var(--accent); }
.art-report .bars { display: flex; align-items: flex-end; gap: 8px; }
.art-report .bars i { flex: 1; border-radius: 3px 3px 0 0; background: #3d5a85; height: var(--h); transition: height .6s var(--ease); }
.art-report .bars i:nth-child(3) { background: var(--accent); }
.feature:hover .art-report .bars i { height: var(--h2); }

.art-excel { padding: 14px; height: 100%; display: grid; grid-template-rows: 22px 1fr; gap: 8px; }
.art-excel .ribbon { display: flex; gap: 6px; align-items: center; }
.art-excel .ribbon i { width: 40px; height: 10px; border-radius: 3px; background: #1c2d47; }
.art-excel .ribbon b { margin-left: auto; font-size: 11px; font-family: var(--mono); color: var(--on-accent); background: #1f9d55; padding: 3px 8px; border-radius: 4px; }
.art-excel .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; align-content: start; }
.art-excel .grid i { height: 16px; background: #13233a; transition: background .4s; }
.art-excel .grid i:nth-child(-n+4) { background: #1f6f43; }
.feature:hover .art-excel .grid i:nth-child(4n) { background: rgba(242, 169, 0, .45); }

.art-check { padding: 18px; height: 100%; display: grid; grid-template-columns: 90px 1fr; gap: 16px; align-items: center; }
.art-check .ring { width: 90px; height: 90px; border-radius: 50%; background: conic-gradient(var(--accent) 0 72%, #1c2d47 72% 100%); display: grid; place-items: center; }
.art-check .ring b { width: 68px; height: 68px; border-radius: 50%; background: #0c1828; display: grid; place-items: center; font-family: var(--mono); font-size: 20px; color: var(--text); }
.art-check ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-soft); }
.art-check li::before { content: "● "; color: #ff8a8a; }
.art-check li.ok::before { color: #7ee2a8; }

/* ---------- Toolbelt ---------- */
.toolbelt { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.tool {
    display: flex; flex-direction: column; gap: 10px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
}
.tool h3 { font-size: 18px; margin: 0; }
.tool p { margin: 0; color: var(--text-soft); font-size: 15px; }
.tool-demo {
    margin-top: auto; min-height: 92px; border-radius: var(--radius-sm); background: #0c1828; border: 1px solid var(--line);
    padding: 10px; font-family: var(--mono); font-size: 12px; color: var(--text-soft); position: relative; overflow: hidden;
}
.tool-try {
    font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; align-self: flex-start;
    color: var(--accent-soft); background: transparent; border: 1px solid rgba(242, 169, 0, .5); border-radius: 999px; padding: 7px 14px; min-height: 38px;
}
.tool-try:hover { background: rgba(242, 169, 0, .1); }
/* Power BI micro demo */
.td-bi { display: grid; grid-template-columns: 1fr; gap: 6px; }
.td-bi .slicer { display: flex; gap: 4px; }
.td-bi .slicer span { padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; }
.td-bi .slicer span.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.td-bi .mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 44px; }
.td-bi .mini-bars i { flex: 1; background: #3d5a85; border-radius: 2px 2px 0 0; transition: height .5s var(--ease); }
/* Power Query micro demo */
.td-pq div { white-space: pre; transition: color .3s; }
.td-pq.is-on div { color: #9eeefb; }
/* DAX micro demo */
.td-dax .f { color: var(--muted); }
.td-dax .n { font-size: 26px; font-weight: 800; color: var(--text); font-family: var(--font); margin-top: 6px; }
/* VBA micro demo */
.td-vba .rows { display: grid; gap: 3px; }
.td-vba .rows i { height: 10px; background: #1c2d47; border-radius: 2px; transition: background .3s, width .3s; width: var(--w); }
.td-vba.is-on .rows i { background: #1f6f43; width: 100%; }
.td-vba.is-on .rows i:last-child { background: var(--accent); }
/* Python micro demo */
.td-py .files { display: flex; gap: 4px; flex-wrap: wrap; transition: opacity .4s; }
.td-py .files i { width: 14px; height: 18px; border-radius: 2px; background: #3d5a85; }
.td-py .out { position: absolute; inset: 10px; display: grid; gap: 3px; opacity: 0; transition: opacity .4s; }
.td-py .out i { height: 10px; background: #1f6f43; border-radius: 2px; }
.td-py.is-on .files { opacity: 0; }
.td-py.is-on .out { opacity: 1; }

/* ---------- Gallery ---------- */
.gallery-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.only-live { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--text-soft); cursor: pointer; }
.only-live input { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.project .project-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.project .tool-tags { margin-top: auto; }
.project-link { display: inline-block; margin-top: 14px; font-weight: 700; text-decoration: none; }
.project-link::after { content: " →"; }
a.project { text-decoration: none; color: var(--text); }
.preview.live { background: radial-gradient(400px 200px at 20% 0%, rgba(242, 169, 0, .12), transparent 70%), #0c1828; }
.preview.live .art-report, .preview.live .art-excel, .preview.live .art-check { position: absolute; inset: 0; }
.preview.live .sk-live { position: absolute; top: 12px; right: 12px; font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--on-accent); background: #7ee2a8; padding: 3px 9px; border-radius: 999px; z-index: 1; }

/* ---------- Compare (Power BI vs web) ---------- */
.compare-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.compare-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.compare-table th, .compare-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 16px; }
.compare-table thead th { background: #0c1828; font-size: 15px; color: var(--accent-soft); }
.compare-table tbody th { color: var(--text); width: 22%; }
.compare-table td { color: var(--text-soft); }
.compare-table tr:last-child th, .compare-table tr:last-child td { border-bottom: 0; }

/* ---------- Project page ---------- */
.work-hero { padding: clamp(40px, 6vw, 72px) 0 24px; }
.work-hero .crumbs { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.work-hero .crumbs a { color: var(--text-soft); }
.work-hero h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -.03em; margin: 14px 0 14px; }
.work-hero .lede { font-size: clamp(17px, 2vw, 20px); color: var(--text-soft); max-width: 760px; }
.work-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.demo-note { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.work-body { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.work-body > * { min-width: 0; }
.work-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.work-block h2 { font-size: 22px; margin-bottom: 10px; color: var(--text); }
.work-block p, .work-block li { color: var(--text-soft); font-size: 16px; }
.work-block ul { padding-left: 20px; margin: 0; display: grid; gap: 6px; }
.work-block.wide { grid-column: 1 / -1; }
.build-steps { list-style: none; padding: 0 !important; counter-reset: bs; display: grid; grid-template-columns: repeat(5, 1fr) !important; gap: 10px !important; }
.build-steps li { counter-increment: bs; background: #0c1828; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; font-size: 15px !important; }
.build-steps li::before { content: "0" counter(bs); display: block; font-family: var(--mono); font-weight: 800; color: var(--accent); margin-bottom: 6px; }
.build-steps b { display: block; color: var(--text); margin-bottom: 4px; }
.code-block {
    font-family: var(--mono); font-size: 14px; line-height: 1.6; color: #d6e2f2; background: #0a1626;
    border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; white-space: pre; margin: 12px 0 0;
}
.code-block .c { color: #6f86a3; }
.code-block .k { color: #b47cf0; }
.code-block .s { color: #ffcc4d; }
.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related a { display: block; padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); text-decoration: none; color: var(--text); font-weight: 700; }
.related a:hover { border-color: var(--accent); }
.related span { display: block; font-weight: 400; color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- Report frame (Power BI-style recreation) ---------- */
.report {
    border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #0d1a2c;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.report-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: #0a1626; border-bottom: 1px solid var(--line); }
.report-top .title { font-weight: 800; font-size: 16px; }
.report-top .note { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.report-body { display: grid; grid-template-columns: 210px 1fr; min-height: 520px; }
.filter-pane { border-right: 1px solid var(--line); padding: 14px; background: #0b1729; display: grid; gap: 18px; align-content: start; }
.filter-pane h3 { font-size: 13px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.slicer { display: grid; gap: 4px; }
.slicer button {
    font: inherit; font-size: 14px; text-align: left; cursor: pointer; color: var(--text-soft);
    background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 7px 10px; min-height: 36px;
    display: flex; align-items: center; gap: 8px;
}
.slicer button::before { content: ""; width: 14px; height: 14px; border: 2px solid #4a6286; border-radius: 3px; flex: none; }
.slicer button[aria-pressed="true"] { color: var(--text); background: rgba(242, 169, 0, .1); }
.slicer button[aria-pressed="true"]::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px #0b1729; }
.slicer button:hover { border-color: var(--border); }
.clear-filters { font: inherit; font-size: 13px; color: var(--accent-soft); background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.report-canvas { padding: 16px; display: grid; gap: 14px; align-content: start; min-width: 0; position: relative; }
.report-page[hidden] { display: none; }
.report-page { display: grid; gap: 14px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi-card { background: #112139; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; border-top: 3px solid var(--accent); }
.kpi-card small { display: block; color: var(--muted); font-size: 13px; }
.kpi-card b { display: block; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0; }
.kpi-card .delta { font-size: 13px; color: var(--text-soft); }
.kpi-card .delta.up::before { content: "▲ "; color: #7ee2a8; }
.kpi-card .delta.down::before { content: "▼ "; color: #ff8a8a; }
.visual-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
.visual { background: #112139; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; min-width: 0; position: relative; }
.visual-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.visual-head h4 { margin: 0; font-size: 15px; }
.visual .hint { font-size: 13px; color: var(--muted); margin: -2px 0 10px; }
.focus-btn {
    width: 32px; height: 32px; flex: none; display: grid; place-items: center; cursor: pointer;
    color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 6px; font-size: 16px; line-height: 1;
}
.focus-btn:hover, .focus-btn:focus-visible { color: var(--text); border-color: var(--border); }
.report.is-focus .report-page > *:not(.is-focused):not(:has(.is-focused)), .report.is-focus .visual-row > .visual:not(.is-focused) { display: none; }
.report.is-focus .visual-row { grid-template-columns: 1fr; }
.report.is-focus .visual.is-focused { min-height: 420px; }
.report-tabs { display: flex; gap: 2px; padding: 0 12px; background: #0a1626; border-top: 1px solid var(--line); overflow-x: auto; }
.report-tabs button {
    font: inherit; font-size: 14px; color: var(--muted); background: transparent; border: 0; border-top: 3px solid transparent;
    padding: 10px 16px; cursor: pointer; white-space: nowrap; min-height: 44px;
}
.report-tabs button[aria-selected="true"] { color: var(--text); border-top-color: var(--accent); background: #0d1a2c; }

/* Bars (HTML) */
.hbars { display: grid; gap: 8px; }
.hbar {
    display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; width: 100%;
    font: inherit; font-size: 14px; color: inherit; text-align: left; background: transparent; border: 0; padding: 2px 0; border-radius: 6px;
}
button.hbar { cursor: pointer; }
button.hbar:hover .hbar-fill { filter: brightness(1.2); }
.hbar-label { color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { position: relative; height: 24px; }
.hbar-fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 0 4px 4px 0; transition: width .6s var(--ease), opacity .3s; }
.hbar-val { position: absolute; top: 50%; transform: translateY(-50%); padding-left: 8px; font-family: var(--mono); font-size: 13px; color: var(--text); white-space: nowrap; transition: left .6s var(--ease); }
.hbar.is-dim .hbar-fill { opacity: .3; }
.hbar.is-selected .hbar-label { color: var(--accent-soft); font-weight: 700; }

/* Line chart (SVG) */
.line-chart { position: relative; min-height: 220px; }
.line-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.line-chart .grid { stroke: #22344f; stroke-width: 1; }
.line-chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--mono); }
.line-chart .series { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .series.primary { stroke: var(--accent); }
.line-chart .series.compare { stroke: #7f93ad; stroke-dasharray: 5 5; }
.line-chart .dot { stroke: #112139; stroke-width: 2; }
.line-chart .dot.primary { fill: var(--accent); }
.line-chart .cross { stroke: #4a6286; stroke-width: 1; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--accent); }
.sw.compare { background: repeating-linear-gradient(90deg, #7f93ad 0 5px, transparent 5px 9px); }
.chart-tip {
    position: absolute; z-index: 5; pointer-events: none; min-width: 140px;
    background: #0a1626; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: var(--text-soft);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.chart-tip b { color: var(--text); display: block; margin-bottom: 4px; }
.chart-tip div { display: flex; align-items: center; gap: 6px; }

.data-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table thead th { background: #0a1626; color: var(--muted); font-weight: 600; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tr.total td { font-weight: 800; color: var(--text); background: #0f1e33; }
.data-table tr.is-selected td { background: rgba(242, 169, 0, .1); }

/* ---------- Excel window (VBA demo) ---------- */
.app-window { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #0d1a2c; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.app-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #0a1626; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-soft); flex-wrap: wrap; }
.app-dots { display: flex; gap: 6px; }
.app-dots i { width: 11px; height: 11px; border-radius: 50%; background: #2a3d59; }
.app-title { font-family: var(--mono); }
.app-badge { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.xl-ribbon { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: #102036; border-bottom: 1px solid var(--line); }
.xl-ribbon .tabs { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-right: auto; }
.xl-ribbon .tabs b { color: var(--text); border-bottom: 2px solid #1f9d55; }
.xl-run { background: #1f9d55; color: #fff; }
.xl-run:hover { background: #26b363; }
.xl-split { display: grid; grid-template-columns: 1.25fr .75fr; min-height: 420px; }
.xl-split > * { min-width: 0; }
.xl-sheet { overflow: auto; border-right: 1px solid var(--line); position: relative; min-height: 380px; }
.xl-grid { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; width: 100%; }
.xl-grid th, .xl-grid td { border: 1px solid #1d2e47; padding: 6px 8px; height: 30px; white-space: nowrap; transition: background .4s, color .4s; }
.xl-grid thead th { background: #0f1d31; color: var(--muted); font-weight: 600; font-size: 12px; text-align: center; position: sticky; top: 0; }
.xl-grid tbody th { background: #0f1d31; color: var(--muted); font-weight: 600; font-size: 12px; width: 34px; text-align: center; }
.xl-grid td { color: var(--text-soft); }
.xl-grid tr.hdr td { font-weight: 800; color: var(--text); }
.xl-grid tr.hdr.styled td { background: #1f6f43; color: #fff; }
.xl-grid td.num { text-align: right; }
.xl-grid tr.flash td { background: rgba(242, 169, 0, .16); }
.xl-grid tr.total td { font-weight: 800; color: var(--text); border-top: 2px solid #1f9d55; }
.xl-grid tr.blank td { background: rgba(255, 138, 138, .06); }
.xl-tabs { display: flex; gap: 2px; padding: 0 8px; background: #0a1626; border-top: 1px solid var(--line); }
.xl-tabs button { font: inherit; font-size: 13px; color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 8px 14px; cursor: pointer; min-height: 38px; }
.xl-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: #1f9d55; background: #0d1a2c; }
.xl-tabs button[hidden] { display: none; }
.xl-summary { padding: 16px; display: grid; gap: 14px; }
.xl-summary[hidden] { display: none; }
.vba-pane { display: grid; grid-template-rows: auto 1fr auto; background: #0a1626; }
.vba-head { padding: 10px 14px; font-family: var(--mono); font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.vba-code { max-height: 340px; margin: 0; padding: 10px 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; overflow: auto; counter-reset: ln; }
.vba-code span { display: block; padding: 0 14px 0 44px; position: relative; white-space: pre; color: #c9d6e8; transition: background .3s; }
.vba-code span::before { counter-increment: ln; content: counter(ln); position: absolute; left: 10px; width: 24px; text-align: right; color: #45597a; }
.vba-code span.cm { color: #6f86a3; }
.vba-code span.is-running { background: rgba(242, 169, 0, .16); }
.vba-code span.is-running::after { content: "◀"; position: absolute; right: 10px; color: var(--accent); }
.vba-steps { list-style: none; margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; }
.vba-steps li { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.vba-steps li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #2d4262; flex: none; }
.vba-steps li.is-running { color: var(--text); }
.vba-steps li.is-running::before { border-color: var(--accent); }
.vba-steps li.is-done { color: var(--text-soft); }
.vba-steps li.is-done::before { background: #1f9d55; border-color: #1f9d55; }
.xl-status { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 12px; background: #0a1626; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.xl-toast {
    position: absolute; right: 14px; bottom: 14px; z-index: 3; display: flex; gap: 10px; align-items: center;
    background: #112139; border: 1px solid #1f9d55; color: var(--text); padding: 10px 14px; border-radius: 10px; font-size: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: bubble-in .35s var(--ease);
}
.xl-toast[hidden] { display: none; }

/* ---------- Reconciliation ---------- */
.recon-controls { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: end; padding: 16px; background: #0a1626; border-bottom: 1px solid var(--line); }
.recon-controls label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: var(--text-soft); }
.recon-controls output { font-family: var(--mono); color: var(--accent-soft); }
.recon-controls input[type="range"] { width: 200px; accent-color: var(--accent); }
.recon-controls select { font: inherit; font-size: 15px; color: var(--text); background: #0c1828; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
.recon-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px; }
.recon-tables > * { min-width: 0; }
.recon-tables h3 { font-size: 15px; margin: 0 0 8px; display: flex; justify-content: space-between; gap: 8px; }
.recon-tables h3 small { font-family: var(--mono); font-weight: 400; color: var(--muted); }
.recon-table td.st { white-space: nowrap; text-align: left; font-weight: 700; font-size: 13px; }
.recon-table th:nth-child(2), .recon-table td:nth-child(2), .recon-table th:last-child { text-align: left; white-space: normal; }
.st-match { color: #7ee2a8; }
.st-amount { color: var(--accent-soft); }
.st-missing { color: #ff9c9c; }
.recon-table tr.r-match td { background: rgba(126, 226, 168, .06); }
.recon-table tr.r-amount td { background: rgba(242, 169, 0, .08); }
.recon-table tr.r-missing td { background: rgba(255, 99, 99, .08); }
.recon-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0 16px 16px; }
.recon-findings { margin: 0; padding: 0 16px 18px; list-style: none; display: grid; gap: 8px; }
.recon-findings li { background: #0c1828; border-left: 3px solid #ff7a7a; border-radius: 6px; padding: 10px 12px; font-size: 15px; color: var(--text-soft); }
.recon-findings li.amt { border-left-color: var(--accent); }
.recon-findings li.warn { border-left-color: var(--logo-cyan); }
.recon-findings b { color: var(--text); }

/* ---------- Health check ---------- */
.drop {
    display: grid; place-items: center; gap: 10px; text-align: center; padding: 34px 20px;
    border: 2px dashed var(--border); border-radius: 14px; background: #0c1828; transition: border-color .2s, background .2s;
}
.drop.is-over { border-color: var(--accent); background: rgba(242, 169, 0, .06); }
.drop p { margin: 0; color: var(--text-soft); }
.drop .small { font-size: 14px; color: var(--muted); }
.drop-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hc-report[hidden] { display: none; }
.hc-report { display: grid; gap: 16px; margin-top: 20px; }
.hc-top { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.hc-score { width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--score-color, var(--accent)) calc(var(--score, 0) * 1%), #1c2d47 0); }
.hc-score b { width: 108px; height: 108px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 34px; font-weight: 800; line-height: 1; text-align: center; }
.hc-score b small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.hc-top h3 { font-size: 22px; margin-bottom: 6px; }
.hc-top p { margin: 0 0 4px; color: var(--text-soft); }
.hc-issues { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hc-issue { background: var(--card); border: 1px solid var(--border); border-left: 4px solid #ff7a7a; border-radius: 10px; padding: 14px 16px; }
.hc-issue.ok { border-left-color: #7ee2a8; }
.hc-issue.minor { border-left-color: var(--accent); }
.hc-issue h4 { margin: 0 0 4px; font-size: 16px; display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.hc-issue h4 span { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 400; }
.hc-issue p { margin: 0 0 6px; color: var(--text-soft); font-size: 15px; }
.hc-issue .ex { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-soft); background: rgba(34, 211, 238, .07); border: 1px solid rgba(34, 211, 238, .3); border-radius: 10px; padding: 12px 14px; margin-top: 14px; }

/* ---------- Case study (this website) ---------- */
.case-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.case-features a, .case-features div { display: block; background: #0c1828; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; text-decoration: none; color: var(--text-soft); font-size: 15px; }
.case-features a:hover { border-color: var(--accent); }
.case-features b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .featured { grid-template-columns: 1fr; max-width: 620px; }
    .toolbelt { grid-template-columns: repeat(2, 1fr); }
    .report-body { grid-template-columns: 1fr; }
    .filter-pane { border-right: 0; border-bottom: 1px solid var(--line); grid-template-columns: 1fr 1fr; }
    .slicer.inline { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .xl-split { grid-template-columns: 1fr; }
    .xl-sheet { border-right: 0; border-bottom: 1px solid var(--line); }
    .work-body, .related, .case-features { grid-template-columns: 1fr; }
    .build-steps { grid-template-columns: 1fr 1fr !important; }
    .hc-issues { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .kpi-row, .recon-summary { grid-template-columns: 1fr 1fr; }
    .visual-row, .recon-tables { grid-template-columns: 1fr; }
    .filter-pane { grid-template-columns: 1fr; gap: 12px; }
    .slicer { display: flex; flex-wrap: wrap; gap: 6px; }
    .slicer button { border-color: var(--border); padding: 6px 12px; min-height: 40px; }
    .slicer button::before { display: none; }
    .slicer button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-soft); }
    .hc-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .toolbelt { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .kpi-card b { font-size: 22px; }
    .hbar { grid-template-columns: 84px 1fr; font-size: 13px; }
    .build-steps { grid-template-columns: 1fr !important; }
    .recon-controls input[type="range"] { width: 100%; }
    .recon-controls label { width: 100%; }
}


/* Dark scrollbars inside the fake app windows and tables */
.vba-code, .xl-sheet, .data-table-wrap, .compare-wrap, .report-tabs { scrollbar-color: #2d4262 #0a1626; scrollbar-width: thin; }

/* ---------- Real-life scenario (top of every project page) ---------- */
.scenario { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; align-items: stretch; }
.scenario > * { min-width: 0; }
.scenario-story { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: start; }
.scenario-avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: var(--on-accent); background: linear-gradient(135deg, var(--accent-soft), var(--logo-orange)); }
.scenario-story h2 { font-size: 22px; margin: 0 0 8px; color: var(--text); }
.scenario-story p { color: var(--text-soft); margin: 0 0 10px; }
.scenario-story .fine { font-size: 13px; color: var(--muted); margin: 0; }
.ba { display: grid; grid-template-rows: 1fr 1fr; gap: 12px; }
.ba > div { border-radius: var(--radius); padding: 16px 18px; border: 1px solid; }
.ba h3 { font-size: 13px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 8px; }
.ba ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 15px; color: var(--text-soft); }
.ba .before { border-color: rgba(255, 138, 138, .35); background: rgba(255, 99, 99, .05); }
.ba .before h3 { color: #ff9c9c; }
.ba .after { border-color: rgba(126, 226, 168, .35); background: rgba(126, 226, 168, .05); }
.ba .after h3 { color: #7ee2a8; }
.try-it { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; font-weight: 700; color: var(--accent-soft); }
.try-it::before { content: "\25BC"; font-size: 12px; }

/* ---------- Variance bars ---------- */
.divbars { display: grid; gap: 8px; }
.divbar { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 10px; width: 100%; font: inherit; font-size: 14px; color: inherit; text-align: left; background: transparent; border: 0; padding: 2px 0; }
button.divbar { cursor: pointer; }
.divbar-track { position: relative; height: 24px; }
.divbar-zero { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: #4a6286; }
.divbar-fill { position: absolute; top: 0; height: 100%; width: 0; border-radius: 4px; transition: width .6s var(--ease), opacity .3s; }
.divbar-fill.good { background: #3fae76; }
.divbar-fill.bad { background: #e2595a; }
.divbar-val { position: absolute; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 12.5px; color: var(--text); white-space: nowrap; }
.divbar-val.right { padding-left: 8px; }
.divbar-val.left { padding-right: 8px; }
.divbar.is-dim .divbar-fill { opacity: .3; }
.divbar.is-selected .hbar-label { color: var(--accent-soft); font-weight: 700; }

/* ---------- Transaction macro extras ---------- */
.xl-grid tr.hdr td.raw { color: #ffb38a; font-style: italic; }
.xl-grid tr.flag td { background: rgba(255, 214, 10, .22); color: var(--text); }
.xl-grid td.neg { color: #ff9c9c; }
.xl-msgbox { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(4, 10, 20, .55); }
.xl-msgbox[hidden] { display: none; }
.xl-msgbox-box { width: min(380px, 92%); background: #f3f4f6; color: #111; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .55); overflow: hidden; font-family: "Segoe UI", system-ui, sans-serif; }
.xl-msgbox-title { background: #fff; padding: 8px 12px; font-size: 13px; border-bottom: 1px solid #ddd; }
.xl-msgbox-body { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 18px 16px 10px; font-size: 15px; line-height: 1.45; }
.xl-msgbox-body .ic { width: 36px; height: 36px; border-radius: 50%; background: #f2a900; color: #111; display: grid; place-items: center; font-weight: 800; font-size: 20px; }
.xl-msgbox-body p { margin: 0 0 6px; }
.xl-msgbox-foot { display: flex; justify-content: flex-end; padding: 10px 16px 16px; }
.xl-msgbox-foot button { font: inherit; font-size: 14px; min-width: 88px; min-height: 34px; border: 1px solid #0f6cbd; background: #0f6cbd; color: #fff; border-radius: 4px; cursor: pointer; }
.xl-msgbox-foot button:focus-visible { outline: 3px solid #f2a900; outline-offset: 2px; }
.app-window { position: relative; }

/* ---------- Power Query editor ---------- */
.pq-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: #102036; border-bottom: 1px solid var(--line); }
.pq-formula { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: #0a1626; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; color: #c9d6e8; overflow-x: auto; white-space: nowrap; }
.pq-formula b { color: var(--muted); font-style: italic; }
.pq-split { display: grid; grid-template-columns: 1fr 260px; min-height: 380px; }
.pq-split > * { min-width: 0; }
.pq-table-wrap { overflow: auto; border-right: 1px solid var(--line); }
#pq-table td.null { color: #6f86a3; font-style: italic; }
#pq-table td.changed { background: rgba(34, 211, 238, .14); color: #9eeefb; }
#pq-table td.spaces { box-shadow: inset 0 -2px 0 rgba(255, 179, 138, .7); }
.pq-steps { background: #0b1729; padding: 14px; }
.pq-steps h3 { font-size: 13px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.pq-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pq-steps li { display: flex; align-items: center; gap: 8px; border-radius: 6px; padding: 2px 6px; }
.pq-steps li.is-selected { background: rgba(242, 169, 0, .14); }
.pq-steps li.is-off button { text-decoration: line-through; color: var(--muted); }
.pq-steps input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.pq-steps button { font: inherit; font-size: 14px; color: var(--text-soft); background: none; border: 0; text-align: left; cursor: pointer; padding: 8px 2px; min-height: 36px; flex: 1; }
.pq-steps li.is-selected button { color: var(--text); font-weight: 700; }
.pq-steps .tip { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.pq-refresh-note { margin: 0; padding: 10px 12px; background: rgba(34, 211, 238, .08); border-top: 1px solid rgba(34, 211, 238, .3); font-size: 14px; color: #9eeefb; }
.pq-refresh-note[hidden] { display: none; }

/* ---------- Invoice extractor ---------- */
.inv-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 10px 12px; background: #102036; border-bottom: 1px solid var(--line); }
.inv-tabs button { font: inherit; font-size: 13px; font-family: var(--mono); color: var(--muted); background: transparent; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; cursor: pointer; min-height: 36px; }
.inv-tabs button[aria-selected="true"] { color: var(--text); border-color: var(--accent); background: rgba(242, 169, 0, .1); }
.inv-split { display: grid; grid-template-columns: 1.1fr .9fr; }
.inv-split > * { min-width: 0; }
.inv-doc { background: #1a2638; padding: 20px; border-right: 1px solid var(--line); }
.inv-paper { background: #fbfbf8; color: #222; border-radius: 4px; padding: 22px 24px; font-family: Georgia, "Times New Roman", serif; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); min-height: 360px; }
.inv-paper .p-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.inv-paper .p-head small { display: block; color: #666; font-size: 12px; margin-top: 2px; }
.inv-paper .p-vendor { font-size: 18px; }
.inv-paper .p-title { font-size: 22px; letter-spacing: .1em; color: #555; font-weight: 700; }
.inv-paper .p-head.b .p-title { font-size: 16px; }
.inv-paper .p-box { border-collapse: collapse; font-size: 13px; }
.inv-paper .p-box td { border: 1px solid #ccc; padding: 3px 8px; }
.inv-paper .p-from { font-size: 13px; color: #444; margin-bottom: 12px; }
.inv-paper .p-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: #444; margin-bottom: 14px; }
.inv-paper .p-lines { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.inv-paper .p-lines th { text-align: left; border-bottom: 2px solid #333; padding: 4px; }
.inv-paper .p-lines td { border-bottom: 1px solid #ddd; padding: 5px 4px; }
.inv-paper .r { text-align: right; }
.inv-paper .p-totals { margin-left: auto; width: min(240px, 100%); font-size: 13px; display: grid; gap: 4px; }
.inv-paper .p-totals div { display: flex; justify-content: space-between; }
.inv-paper .p-totals .grand { border-top: 2px solid #333; padding-top: 4px; font-size: 15px; }
.inv-paper .p-foot { color: #888; font-size: 12px; margin: 18px 0 0; }
.inv-paper .is-found { outline: 2px solid rgba(15, 108, 189, .55); outline-offset: 2px; border-radius: 2px; background: rgba(15, 108, 189, .06); transition: outline-color .3s, background .3s; }
.inv-paper .is-reading { outline-color: #f2a900; background: rgba(242, 169, 0, .25); }
.inv-side { padding: 18px; display: grid; gap: 12px; align-content: start; }
.inv-fields { display: grid; gap: 6px; }
.inv-field { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 10px; border-radius: 8px; background: #0c1828; border: 1px solid var(--line); font-size: 14px; transition: border-color .3s; }
.inv-field .k { color: var(--muted); }
.inv-field .v { color: var(--text-soft); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.inv-field.is-filled { border-color: rgba(126, 226, 168, .45); }
.inv-field.is-filled .v { color: var(--text); }
.inv-check { border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.inv-check[hidden] { display: none; }
.inv-check.ok { background: rgba(126, 226, 168, .08); border: 1px solid rgba(126, 226, 168, .4); color: #b9f0cf; }
.inv-check.bad { background: rgba(255, 99, 99, .08); border: 1px solid rgba(255, 138, 138, .45); color: #ffc4c4; }
.inv-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-actions .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.inv-sheet { padding: 0 16px 16px; }
.inv-sheet h3 { font-size: 15px; margin: 14px 0 8px; }
.inv-empty { color: var(--muted); font-size: 14px; padding: 12px; border: 1px dashed var(--border); border-radius: 8px; text-align: center; }
.inv-empty[hidden] { display: none; }
#inv-sheet tr.flag td { background: rgba(255, 99, 99, .08); }

/* ---------- Batch processor ---------- */
.bp-split { display: grid; grid-template-columns: 1fr 1fr; }
.bp-split > * { min-width: 0; }
.bp-files { overflow: auto; border-right: 1px solid var(--line); max-height: 440px; }
.bp-files tr.is-running td { background: rgba(242, 169, 0, .1); }
.bp-files td.st { text-align: left; font-weight: 700; font-size: 13px; }
.bp-console { display: grid; grid-template-rows: auto 1fr; background: #060d18; }
.bp-progress { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bp-bar { height: 10px; border-radius: 999px; background: #13233a; overflow: hidden; }
.bp-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--logo-cyan), var(--accent)); transition: width .3s; }
.bp-log { margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: #b9c8de; overflow: auto; max-height: 380px; min-height: 260px; }
.bp-log .ok { color: #7ee2a8; }
.bp-log .warn { color: var(--accent-soft); }
.bp-log .err { color: #ff9c9c; }
.bp-log .dim { color: #6f86a3; }
.bp-results { padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); }
.bp-results[hidden] { display: none; }
.bp-results > * { min-width: 0; }
.bp-results h3 { font-size: 15px; margin: 0 0 10px; }
.bp-attention { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.bp-attention li { background: #0c1828; border-left: 3px solid #ff7a7a; border-radius: 6px; padding: 10px 12px; font-size: 14px; color: var(--text-soft); }
.bp-attention b { color: var(--text); font-family: var(--mono); font-size: 13px; }

/* ---------- Health check summary ---------- */
.hc-plain { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 18px 20px; }
.hc-plain h4 { margin: 0 0 10px; font-size: 18px; }
.hc-plain ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; color: var(--text-soft); }
.hc-plain b { color: var(--text); }
.hc-plain p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.hc-good { background: rgba(126, 226, 168, .05); border: 1px solid rgba(126, 226, 168, .3); border-radius: var(--radius); padding: 14px 18px; }
.hc-good[hidden] { display: none; }
.hc-good h4 { margin: 0 0 8px; font-size: 16px; color: #7ee2a8; }
.hc-good ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.hc-good li { font-size: 14px; color: var(--text-soft); background: #0c1828; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.hc-good li::before { content: "\2713  "; color: #7ee2a8; font-weight: 800; }

@media (max-width: 1000px) {
    .scenario, .pq-split, .inv-split, .bp-split, .bp-results { grid-template-columns: 1fr; }
    .ba { grid-template-rows: auto; }
    .pq-table-wrap, .inv-doc, .bp-files { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 520px) {
    .scenario-story { grid-template-columns: 1fr; }
    .divbar { grid-template-columns: 92px 1fr; font-size: 13px; }
    .inv-paper { padding: 16px; font-size: 13px; }
    .inv-field { grid-template-columns: 90px 1fr; }
}

/* Iris on project pages: smaller, beside the intro */
.work-hero .mascot { width: min(230px, 100%); }
.work-hero .hero-grid { grid-template-columns: 1.4fr .6fr; }
@media (max-width: 760px) {
    .work-hero .hero-grid { grid-template-columns: 1fr; }
    .work-hero .mascot-stage { order: 0; flex-direction: row; gap: 12px; align-items: center; }
    .work-hero .mascot { width: 110px; flex: none; }
    .work-hero .bubble { margin: 0; text-align: left; }
    .work-hero .bubble::before { top: 50%; left: -9px; transform: translateY(-50%) rotate(-45deg); }
    .work-hero .poke-hint { display: none; }
}

/* Variance bars on phones: label + value on one line, bar underneath */
.divbar-text { display: none; }
@media (max-width: 600px) {
    .divbar { grid-template-columns: 1fr; gap: 4px; }
    .divbar .hbar-label { display: flex; justify-content: space-between; gap: 10px; white-space: normal; }
    .divbar-text { display: inline; font-family: var(--mono); font-size: 12.5px; color: var(--text); white-space: nowrap; }
    .divbar-val { display: none; }
    .divbar-track { height: 16px; }
}

/* Toolbelt captions + mini sheet */
.tool-caption { margin: 0; font-size: 14px; color: var(--accent-soft) !important; min-height: 2.9em; }
.td-vba .mini-sheet { display: grid; gap: 2px; }
.td-vba .mini-sheet span { white-space: pre; padding: 1px 4px; border-radius: 2px; transition: background .3s, color .3s; min-height: 16px; }
.td-vba.is-on .mini-sheet span.h { background: #1f6f43; color: #fff; }
.td-vba.is-on .mini-sheet span.t { border-top: 1px solid #1f9d55; color: var(--text); font-weight: 700; }
.td-py .out b { font-family: var(--mono); font-size: 11px; color: #7ee2a8; margin-bottom: 2px; }

/* Reconciliation statement + row pairing */
.recon-table tr.is-pair td { background: rgba(242, 169, 0, .2) !important; color: var(--text); }
.recon-table tr[data-pair] { cursor: pointer; }
.rec-statement { margin: 0 16px 16px; padding: 18px; border-radius: 12px; background: #0a1626; border: 1px solid var(--border); }
.rec-statement[hidden] { display: none; }
.rec-statement h3 { margin: 0 0 12px; font-size: 16px; }
.rec-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rec-col { background: #0f1e33; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.rec-col h4 { margin: 0 0 4px; font-size: 13px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rec-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text-soft); }
.rec-line b { font-family: var(--mono); font-weight: 600; color: var(--text); white-space: nowrap; }
.rec-line.adj span { padding-left: 12px; }
.rec-line.total { border-top: 1px solid var(--border); padding-top: 6px; font-weight: 800; color: var(--text); }
.rec-result { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; font-weight: 700; }
.rec-result.ok { background: rgba(126, 226, 168, .1); color: #7ee2a8; border: 1px solid rgba(126, 226, 168, .4); }
.rec-result.bad { background: rgba(242, 169, 0, .1); color: var(--accent-soft); border: 1px solid rgba(242, 169, 0, .4); }
@media (max-width: 760px) { .rec-cols { grid-template-columns: 1fr; } }

/* Third line series (last year) + report notes */
.line-chart .series.ly { stroke: #22d3ee; stroke-dasharray: 2 5; }
.sw.ly { background: repeating-linear-gradient(90deg, #22d3ee 0 3px, transparent 3px 7px); }
.report-note h5 { margin: 0 0 6px; font-size: 16px; color: var(--accent-soft); }
.report-note p { margin: 0 0 10px; color: var(--text-soft); font-size: 15px; }
.report-note .mini-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.report-note .mini-stats span { font-family: var(--mono); font-size: 12.5px; background: #0c1828; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; color: var(--text); }
.report-note ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.report-note li button { width: 100%; text-align: left; font: inherit; font-size: 14px; color: var(--text-soft); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 6px 8px; cursor: pointer; display: grid; grid-template-columns: 52px 1fr; gap: 8px; }
.report-note li button:hover, .report-note li button:focus-visible { border-color: var(--border); color: var(--text); }
.report-note li b { font-family: var(--mono); color: var(--accent-soft); font-size: 13px; }
.report-note .insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.report-note .insights li { background: #0c1828; border-left: 3px solid var(--accent); border-radius: 6px; padding: 9px 12px; font-size: 14.5px; color: var(--text-soft); }
.report-note .insights li.warn { border-left-color: #ff7a7a; }
.report-note .insights li.good { border-left-color: #7ee2a8; }
.report-note .insights b { color: var(--text); }
.vs-rows { display: grid; gap: 12px; }
.vs-row { display: grid; grid-template-columns: 1fr; gap: 4px; }
.vs-row .top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text-soft); }
.vs-row .top b { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.vs-row .top b.over { color: #ff9c9c; }
.vs-row .top b.under { color: #7ee2a8; }
.vs-row .bar { height: 9px; border-radius: 0 4px 4px 0; background: #6f86a3; transition: width .6s var(--ease); }
.vs-row .bar.actual { background: var(--accent); }
.vs-row .bar.actual.over { background: #e2595a; }
.vs-legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-soft); margin-bottom: 10px; flex-wrap: wrap; }
.vs-legend i { display: inline-block; width: 14px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* Power Query guided walkthrough */
.pq-guide { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; justify-content: space-between; padding: 16px; background: linear-gradient(135deg, rgba(242, 169, 0, .1), rgba(34, 211, 238, .05)); border-bottom: 1px solid var(--line); }
.pq-guide-text { flex: 1 1 380px; min-width: 0; }
.pq-step-no { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.pq-guide h4 { margin: 4px 0 4px; font-size: 19px; }
.pq-guide p { margin: 0; color: var(--text-soft); font-size: 15px; }
.pq-guide-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pq-steps li { padding: 0; }
.pq-steps li button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 6px; }
.pq-steps li button:disabled { cursor: default; color: #4f6482; }
.pq-steps .ck { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #2d4262; flex: none; display: grid; place-items: center; font-size: 11px; }
.pq-steps li.is-done .ck { background: var(--accent); border-color: var(--accent); }
.pq-steps li.is-done .ck::after { content: "¹3"; color: var(--on-accent); font-weight: 800; }
.pq-steps li.is-pending .ck { border-style: dashed; }

/* ---------- Budget categorizer (Streamlit-style) ---------- */
.st-layout { display: grid; grid-template-columns: 250px 1fr; min-height: 520px; }
.st-layout > * { min-width: 0; }
.st-side { background: #0b1729; border-right: 1px solid var(--line); padding: 16px; display: grid; gap: 12px; align-content: start; }
.st-side h3 { margin: 0; font-size: 13px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.st-side .btn { width: 100%; justify-content: flex-start; }
.st-side .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.st-side .fine { font-size: 13px; color: var(--muted); margin: 0; }
.st-dict { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.st-dict li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 6px; border-radius: 4px; background: #0f1e33; color: var(--text-soft); }
.st-dict li code { font-family: var(--mono); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-dict li.new { background: rgba(126, 226, 168, .1); }
.st-dict li.new code { color: #7ee2a8; }
.st-main { padding: 16px; display: grid; gap: 14px; align-content: start; }
.st-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.st-metrics div { background: #112139; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.st-metrics small { display: block; color: var(--muted); font-size: 13px; }
.st-metrics b { display: block; font-size: 26px; font-weight: 800; }
.st-metrics span { font-size: 12.5px; color: var(--text-soft); }
.st-alert { background: rgba(242, 169, 0, .1); border: 1px solid rgba(242, 169, 0, .45); color: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 14.5px; }
.st-alert[hidden] { display: none; }
.st-alert b { color: var(--text); }
#cat-table td.muted { color: var(--muted); text-align: left; }
#cat-table tr.needs td { background: rgba(242, 169, 0, .07); }
#cat-table td:nth-child(2) { text-align: left; font-family: var(--mono); font-size: 12.5px; white-space: normal; }
#cat-table td:last-child { text-align: left; }
#cat-table select { font: inherit; font-size: 14px; color: var(--text); background: #0c1828; border: 1px solid var(--accent); border-radius: 6px; padding: 6px 8px; min-height: 36px; }
.cat-chip { display: inline-block; font-size: 13px; border-radius: 999px; padding: 3px 10px; border: 1px solid var(--border); white-space: nowrap; }
.cat-chip.auto { color: #9eeefb; border-color: rgba(34, 211, 238, .4); }
.cat-chip.taught { color: #7ee2a8; border-color: rgba(126, 226, 168, .45); }
.cat-chip.wait { color: var(--muted); border-style: dashed; }
.st-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-charts > * { min-width: 0; }

/* ---------- Sports scraper ---------- */
.sp-top { display: grid; grid-template-columns: 1fr 1fr; }
.sp-top > * { min-width: 0; }
.sp-dash { padding: 16px; display: grid; gap: 14px; border-top: 1px solid var(--line); }
.sp-dash[hidden] { display: none; }
.sp-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.sp-controls label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sp-controls select { font: inherit; font-size: 15px; color: var(--text); background: #0c1828; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
.sp-stats { display: flex; flex-wrap: wrap; gap: 6px; }
[data-stat][aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sp-two { display: grid; grid-template-columns: 1.3fr .7fr; gap: 12px; }
.sp-two > * { min-width: 0; }

/* ---------- Trading signals ---------- */
.tr-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; padding: 16px; background: #0a1626; border-bottom: 1px solid var(--line); align-items: end; }
.tr-controls label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--text-soft); }
.tr-controls output { font-family: var(--mono); color: var(--accent-soft); font-weight: 600; }
.tr-controls input[type="range"] { width: 100%; accent-color: var(--accent); }
.tr-controls .check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.tr-controls .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.tr-panels { padding: 12px 16px; display: grid; gap: 4px; }
.tr-panel-title { font-size: 13px; color: var(--muted); margin: 8px 0 2px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.tr-panel-title i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 4px; }
#tr-price svg, #tr-rsi svg, #tr-macd-chart svg { display: block; width: 100%; height: auto; }
#tr-price .grid, #tr-rsi .grid, #tr-macd-chart .grid { stroke: #22344f; }
#tr-price .axis, #tr-rsi .axis, #tr-macd-chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
#trading .series { fill: none; stroke-linejoin: round; }
#trading .series.primary { stroke: var(--accent); }
#trading .series.compare { stroke: #7f93ad; }
#trading .series.ly { stroke: #22d3ee; stroke-dasharray: 4 4; stroke-width: 1.5; }
#trading .series.rsi { stroke: #b47cf0; stroke-width: 1.8; }
#trading .band { fill: rgba(242, 169, 0, .06); }
#trading .mk-buy { fill: #3fae76; stroke: #0d1a2c; stroke-width: 1; }
#trading .mk-sell { fill: #e2595a; stroke: #0d1a2c; stroke-width: 1; }
#trading .h-up { fill: rgba(63, 174, 118, .65); }
#trading .h-down { fill: rgba(226, 89, 90, .65); }
.tr-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; padding: 0 16px 14px; }
.tr-results b.pos { color: #7ee2a8; }
.tr-results b.neg { color: #ff9c9c; }
.tr-trades { padding: 0 16px 16px; }
.tr-disclaimer { margin: 0 16px 16px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: #0c1828; font-size: 13.5px; color: var(--text-soft); }

@media (max-width: 1000px) {
    .st-layout, .sp-top, .sp-two, .st-charts { grid-template-columns: 1fr; }
    .st-side { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 520px) { .st-metrics { grid-template-columns: 1fr 1fr; } }

/* Bars on phones: value goes under the bar so long labels never overflow */
@media (max-width: 600px) {
    .hbar { grid-template-columns: 1fr; gap: 2px; }
    .hbar-track { height: auto; display: flex; flex-direction: column; }
    .hbar-fill { height: 12px; }
    .hbar-val { position: static; transform: none; left: auto !important; padding: 3px 0 0; white-space: normal; }
}

/* ---------- Weekly ops reporter ---------- */
.wo-tabs { display: flex; gap: 2px; padding: 0 12px; background: #0a1626; border-bottom: 1px solid var(--line); overflow-x: auto; }
.wo-tabs button { font: inherit; font-size: 14.5px; color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 12px 16px; cursor: pointer; white-space: nowrap; min-height: 46px; }
.wo-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.wo-panel[hidden] { display: none; }
.wo-week { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-soft); }
.wo-week select { font: inherit; font-size: 14px; color: var(--text); background: #0c1828; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; min-height: 38px; }
.wo-log { min-height: 0 !important; max-height: 170px !important; }
.wo-out { padding: 16px; display: grid; gap: 14px; border-top: 1px solid var(--line); }
.wo-out[hidden] { display: none; }
.wo-title { margin: 0; font-size: 18px; }
.wo-cust td.now { color: var(--text); font-weight: 700; background: rgba(242, 169, 0, .06); }
.wo-cust tr.group td { background: #0a1626; color: var(--accent-soft); font-weight: 800; text-align: left; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.wo-cust td:first-child { white-space: nowrap; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; width: 52px; vertical-align: middle; }
.spark i { flex: 1; background: #3d5a85; border-radius: 1px; }
.spark i:last-child { background: var(--accent); }
.wo-notes-in { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.wo-notes-in > * { min-width: 0; }
.wo-left td, .wo-left th { text-align: left !important; white-space: normal !important; }
.wo-left tr.is-new td { background: rgba(126, 226, 168, .08); }
.wo-left tr.is-new td:first-child { box-shadow: inset 3px 0 0 #7ee2a8; }
.wo-notes-status { font-size: 14px; color: var(--accent-soft); }

/* ---------- Quote builder ---------- */
.q-layout { display: grid; grid-template-columns: .9fr 1.1fr; }
.q-layout > * { min-width: 0; }
.q-form { padding: 16px; display: grid; gap: 12px; align-content: start; border-right: 1px solid var(--line); background: #0b1729; }
.q-form label { display: grid; gap: 5px; font-size: 13.5px; font-weight: 700; color: var(--text-soft); }
.q-form input, .q-form select { font: inherit; font-size: 15px; color: var(--text); background: #0c1828; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 40px; width: 100%; }
.q-add { display: grid; grid-template-columns: 1fr 70px auto; gap: 8px; align-items: end; }
.q-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.q-lines li { display: grid; grid-template-columns: 1fr 64px 36px; gap: 8px; align-items: center; background: #0f1e33; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 14px; color: var(--text-soft); }
.q-lines input { min-height: 34px !important; padding: 4px 6px !important; }
.q-lines .rm { width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; }
.q-lines .rm:hover { color: #ff9c9c; border-color: #ff9c9c; }
.q-margin { display: grid; gap: 2px; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.q-margin.ok { background: rgba(126, 226, 168, .08); border: 1px solid rgba(126, 226, 168, .4); color: #b9f0cf; }
.q-margin.bad { background: rgba(255, 99, 99, .08); border: 1px solid rgba(255, 138, 138, .45); color: #ffc4c4; }
.q-doc { background: #1a2638; padding: 20px; }
.q-for { font-size: 13px; color: #444; margin: 0 0 12px; }
.q-log { padding: 16px; border-top: 1px solid var(--line); }
.mini { font: inherit; font-size: 12.5px; border: 1px solid var(--border); background: transparent; color: var(--text-soft); border-radius: 999px; padding: 3px 10px; cursor: pointer; min-height: 30px; }
.mini.ok { border-color: rgba(126, 226, 168, .5); color: #7ee2a8; }
.mini:hover { color: var(--text); border-color: var(--accent); }
#q-log td:last-child { text-align: left; white-space: nowrap; }

/* ---------- Invoice generator ---------- */
.ig-out { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; border-top: 1px solid var(--line); }
.ig-out > * { min-width: 0; }
.ig-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.ig-card { display: grid; gap: 2px; text-align: left; font: inherit; cursor: pointer; background: #f6f6f2; color: #222; border: 2px solid transparent; border-radius: 6px; padding: 10px; animation: bubble-in .35s var(--ease); }
.ig-card b { font-size: 12px; font-family: var(--mono); color: #0f6cbd; }
.ig-card span { font-size: 13px; }
.ig-card em { font-style: normal; font-weight: 800; font-size: 14px; }
.ig-card:hover, .ig-card.is-selected { border-color: var(--accent); }
.ig-preview .inv-paper { min-height: 0; }

/* ---------- Telegram bot ---------- */
.tg-layout { display: grid; grid-template-columns: 300px 1fr; }
.tg-layout > * { min-width: 0; }
.tg-rules { padding: 16px; display: grid; gap: 12px; align-content: start; background: #0b1729; border-right: 1px solid var(--line); }
.tg-rules h3 { margin: 0; font-size: 13px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tg-rules label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--text-soft); }
.tg-rules output { font-family: var(--mono); color: var(--accent-soft); }
.tg-rules input[type="range"] { width: 100%; accent-color: var(--accent); }
.tg-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tg-stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tg-stats div { background: #0f1e33; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.tg-stats dt { font-size: 11.5px; color: var(--muted); }
.tg-stats dd { margin: 0; font-family: var(--mono); font-size: 14px; color: var(--text); }
.tg-stats dd.pos { color: #7ee2a8; }
.tg-stats dd.neg { color: #ff9c9c; }
.tg-rules .fine { font-size: 12.5px; color: var(--muted); margin: 0; }
.tg-phone { display: grid; grid-template-rows: auto 1fr; background: #0e1621; min-height: 520px; }
.tg-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: #17212b; border-bottom: 1px solid #0b1118; }
.tg-head b { display: block; color: #fff; font-size: 15px; }
.tg-head small { color: #6d7f8f; font-size: 12.5px; }
.tg-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #2aabee, #229ed9); font-size: 20px; }
.tg-chat { padding: 14px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; max-height: 520px; background: radial-gradient(circle at 20% 20%, rgba(42, 171, 238, .05), transparent 60%), #0e1621; }
.tg-msg { display: flex; flex-direction: column; max-width: 82%; animation: bubble-in .3s var(--ease); }
.tg-msg.bot { align-self: flex-start; }
.tg-msg.me { align-self: flex-end; }
.tg-bubble { position: relative; background: #182533; color: #e9eef3; border-radius: 12px 12px 12px 4px; padding: 8px 12px 18px; font-size: 14.5px; line-height: 1.45; }
.tg-msg.me .tg-bubble { background: #2b5278; border-radius: 12px 12px 4px 12px; }
.tg-time { position: absolute; right: 10px; bottom: 4px; font-size: 11px; color: #6d7f8f; }
.tg-buttons { display: flex; gap: 4px; margin-top: 4px; }
.tg-buttons button { flex: 1; font: inherit; font-size: 14px; font-weight: 600; color: #fff; background: rgba(42, 171, 238, .22); border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer; min-height: 40px; }
.tg-buttons button:hover { background: rgba(42, 171, 238, .35); }
.tg-buttons button:disabled { opacity: .45; cursor: default; }
.tg-buttons button.chosen { opacity: 1; background: #2aabee; }

@media (max-width: 1000px) {
    .wo-notes-in, .q-layout, .ig-out, .tg-layout { grid-template-columns: 1fr; }
    .q-form, .tg-rules { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 520px) {
    .q-add { grid-template-columns: 1fr 64px; }
    .q-add .btn { grid-column: 1 / -1; }
    .tg-msg { max-width: 92%; }
}

/* ---------- What it's worth (ROI calculators) ---------- */
.roi-section { padding-top: 24px; }
.roi { display: grid; grid-template-columns: .85fr 1.15fr; gap: 32px; align-items: center; border-radius: 22px; padding: clamp(22px, 4vw, 40px);
    background: radial-gradient(520px 260px at 0% 0%, rgba(126, 226, 168, .1), transparent 70%), radial-gradient(420px 240px at 100% 100%, rgba(242, 169, 0, .1), transparent 70%), var(--card);
    border: 1px solid var(--border); }
.roi > * { min-width: 0; }
.roi-copy h2 { font-size: clamp(26px, 3.4vw, 36px); }
.roi-copy p { color: var(--text-soft); }
.roi-sentence { font-size: 18px; font-weight: 700; color: #7ee2a8 !important; }
.roi-copy .fine { font-size: 13px; color: var(--muted) !important; }
.roi-calc { display: grid; gap: 10px; }
.roi-calc label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: var(--text-soft); }
.roi-calc output { font-family: var(--mono); color: var(--accent-soft); }
.roi-calc input[type="range"] { width: 100%; accent-color: var(--accent); height: 26px; }
.roi-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.roi-results div { background: #0c1828; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.roi-results small { display: block; font-size: 12.5px; color: var(--muted); }
.roi-results b { font-size: clamp(18px, 2.2vw, 24px); font-weight: 800; font-variant-numeric: tabular-nums; }
.roi-results .hl-box { border-color: rgba(126, 226, 168, .5); background: rgba(126, 226, 168, .08); }
.roi-results .hl-box b { color: #7ee2a8; }
.value-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 26px; }
.value-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.value-card h3 { font-size: 20px; margin: 8px 0 6px; }
.value-card p { margin: 0; color: var(--text-soft); }
.value-ic { font-size: 28px; }
#value .roi-section { padding: 0; }
@media (max-width: 1000px) { .roi { grid-template-columns: 1fr; } .value-cards { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .roi-results { grid-template-columns: 1fr 1fr; } }

.roi-reset { justify-self: start; font: inherit; font-size: 13.5px; color: var(--accent-soft); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.kpi-card .delta.good { color: #7ee2a8; }
.kpi-card .delta.bad { color: #ff9c9c; }

/* Narrative: what the numbers are saying */
.report-story { background: linear-gradient(135deg, rgba(242, 169, 0, .08), rgba(34, 211, 238, .05)); border: 1px solid rgba(242, 169, 0, .3); border-radius: 10px; padding: 12px 16px; }
.report-story h4 { margin: 0 0 6px; font-size: 14px; color: var(--accent-soft); }
.report-story ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.report-story li { font-size: 14.5px; color: var(--text-soft); }
.report-story b { color: var(--text); }

/* ---------- Round 4 demos ---------- */
.bb-body { padding: 14px; display: grid; gap: 12px; }
.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.insights li { background: #0c1828; border-left: 3px solid var(--accent); border-radius: 6px; padding: 9px 12px; font-size: 14.5px; color: var(--text-soft); }
.insights li.warn { border-left-color: #ff7a7a; }
.insights li.good { border-left-color: #7ee2a8; }
.insights b { color: var(--text); }
.bb-body .fine { font-size: 13px; color: var(--muted); margin: 0; }
.neg { color: #ff9c9c; }
.pos { color: #7ee2a8; }

/* Barber timeline */
.bb-timeline { display: grid; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.bb-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; min-width: 560px; }
.bb-name { font-size: 13.5px; font-weight: 700; color: var(--text-soft); }
.bb-track { position: relative; height: 34px; background: #0a1626; border-radius: 6px; }
.bb-slot { position: absolute; top: 3px; bottom: 3px; border: 1px solid rgba(160, 185, 220, .45); border-radius: 4px; }
.bb-slot.noshow { border: 1px dashed #ff7a7a; background: repeating-linear-gradient(45deg, rgba(255, 122, 122, .12) 0 4px, transparent 4px 8px); }
.bb-act { position: absolute; top: 8px; bottom: 8px; padding: 0; border: 0; border-radius: 3px; background: var(--accent); cursor: pointer; min-width: 4px; }
.bb-act.long { background: #ff7a7a; }
.bb-act:hover, .bb-act:focus-visible { outline: 2px solid #fff; outline-offset: 1px; z-index: 1; }
.bb-axis { position: relative; height: 18px; margin-left: 72px; min-width: 488px; font-size: 11.5px; color: var(--muted); }
.bb-axis span { position: absolute; transform: translateX(-50%); }
.bb-detail { margin: 10px 0 0; font-size: 14px; color: var(--text-soft); min-height: 1.4em; }
.bb-detail b { color: var(--text); }

/* Price tracker form */
.pt-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pt-form input { font: inherit; font-size: 15px; color: var(--text); background: #0a1626; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; width: 100%; box-sizing: border-box; }
.pt-form .inv-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }

/* Trade analyzer */
.tl-sheet { padding: 10px; }
.tl-sheet .data-table th, .tl-sheet .data-table td { padding: 8px 9px; font-size: 13px; }
#tradelog .vba-steps { align-content: start; }
.bb-axis span:first-child { transform: none; }
.bb-axis span:last-child { transform: translateX(-100%); }
@media (min-width: 721px) { .bb-timeline { overflow-x: visible; } }
.tl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tl-two > * { min-width: 0; overflow-x: auto; }
.tl-sheet .chart-title { margin: 0 0 6px; font-size: 13.5px; font-weight: 700; color: var(--text-soft); }
.tl-insights { padding: 12px 14px; border-top: 1px solid var(--line); background: linear-gradient(135deg, rgba(242, 169, 0, .08), rgba(34, 211, 238, .05)); }
.tl-insights h4 { margin: 0 0 8px; font-size: 14px; color: var(--accent-soft); }
.tl-insights[hidden] { display: none; }

/* Private assistant */
.pg-lock { font-size: 12px; color: #7ee2a8; }
.pg-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 440px; }
.pg-layout > * { min-width: 0; }
.pg-side { padding: 14px; border-right: 1px solid var(--line); background: #0d1a2c; display: grid; gap: 10px; align-content: start; }
.pg-side h3 { margin: 0; font-size: 13.5px; color: var(--text-soft); }
.pg-side .fine { font-size: 12.5px; color: var(--muted); margin: 0; }
.pg-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pg-docs label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; overflow-wrap: anywhere; }
.pg-docs input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.pg-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-suggest .chip { text-align: left; font-size: 12.5px; }
.pg-main { display: grid; grid-template-rows: 1fr auto; min-height: 0; }
.pg-chat { padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 460px; }
.pg-msg { max-width: 85%; padding: 10px 13px; border-radius: 12px; font-size: 14.5px; line-height: 1.45; }
.pg-msg p { margin: 0; }
.pg-msg.me { align-self: flex-end; background: var(--accent); color: #0a1626; border-bottom-right-radius: 4px; }
.pg-msg.ai { align-self: flex-start; background: #132641; color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.pg-src { display: block; margin-top: 6px; font-size: 12.5px; color: var(--accent-soft); }
.pg-dots { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.pg-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: pgdot 1s infinite ease-in-out; }
.pg-dots i:nth-child(2) { animation-delay: .15s; }
.pg-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pgdot { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pg-dots i { animation: none; } }
.pg-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #0d1a2c; }
.pg-form input { flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--text); background: #0a1626; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 40px; }

@media (max-width: 720px) {
    .tl-two, .pt-form { grid-template-columns: 1fr; }
    .pg-layout { grid-template-columns: 1fr; }
    .pg-side { border-right: 0; border-bottom: 1px solid var(--line); }
    .pg-msg { max-width: 92%; }
}

/* Bars whose value labels don't fit beside them put the value underneath */
.hbars.is-stacked .hbar-track { height: auto; display: flex; flex-direction: column; }
.hbars.is-stacked .hbar-fill { height: 24px; }
.hbars.is-stacked .hbar-val { position: static; transform: none; left: auto !important; padding: 3px 0 0; white-space: normal; }
