/* IBV LBO — Dealroom design language.
   Tokens + components per docs/lbo-app-build-plan.md §Design language
   (Direction B, chosen 2026-09-04; reference canvas "IBV LBO App UI").
   Chart SERIES colors live in apps/lbo/charts.py (validated steps);
   this file carries the chrome. */

.lbo-app {
    --lbo-ink: #222222;
    --lbo-muted: #75705F;
    --lbo-faint: #8F8974;
    --lbo-rule: #ECE8DE;
    --lbo-hairline: #F2EFE6;
    --lbo-cream: #FFFCF1;
    --lbo-cream-tint: #FAF8F0;
    --lbo-amber: #FBB504;
    --lbo-amber-tint: #FDF3D7;
    --lbo-amber-border: #F3DFA0;
    --lbo-amber-ink: #7A5B04;
    --lbo-red: #DD000F;
    --lbo-green: #12855A;
    --lbo-green-tint: #E4F2EA;
    --lbo-green-border: #BFE0CF;
    --lbo-green-ink: #0D5C3E;
    --lbo-rail: #1F1D18;
    --lbo-rail-soft: #35311F;
    --lbo-rail-rule: #3A3628;
    --lbo-rail-text: #CFC9B6;
    --lbo-rail-faint: #8F8974;
    --lbo-input-ink: #1D5FBF;
    --lbo-input-border: #B9CBE8;
    /* W38: Bitbucket-style typography — system stack, semibold titles,
       sentence case; Red Hat retired from the LBO app. */
    --lbo-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --lbo-text: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    display: flex;
    min-height: calc(100vh - 120px);
    background: #FFFFFF;
    color: var(--lbo-ink);
    font-family: var(--lbo-text);
    font-size: 14px;
    line-height: 1.5;
}

/* ---------------------------------------------------------------- rail */
.lbo-app { --lbo-rail-w: 232px; align-items: flex-start; }
.lbo-rail {
    width: var(--lbo-rail-w);
    /* W148 — the rail stays put; only the content scrolls. */
    position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #3A3628 transparent;
    flex-shrink: 0;
    background: var(--lbo-rail);
    color: var(--lbo-cream);
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 26px 0 22px;
}
.lbo-rail-brand { padding: 0 24px; display: flex; flex-direction: column; gap: 3px; }
.lbo-rail-brand .wordmark {
    font-family: var(--lbo-display); font-weight: 700; font-size: 16px;
    color: var(--lbo-cream); text-decoration: none;
}
.lbo-rail-brand .wordmark span { font-weight: 300; }
.lbo-rail-app {
    font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--lbo-rail-faint);
}
.lbo-rail-group { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.lbo-rail-label {
    font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--lbo-rail-faint); padding: 6px 12px;
}
.lbo-rail a.lbo-rail-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 6px; border-left: 3px solid transparent;
    color: var(--lbo-rail-text); font-size: 13.5px; text-decoration: none;
}
.lbo-rail a.lbo-rail-item:hover { background: #2A271C; color: var(--lbo-cream); }
.lbo-rail a.lbo-rail-item.active {
    background: var(--lbo-rail-soft); color: var(--lbo-cream);
    font-weight: 600; border-left-color: var(--lbo-amber);
}
.lbo-rail-foot {
    margin-top: auto; padding: 14px 24px 0; border-top: 1px solid var(--lbo-rail-rule);
    font-size: 12px; color: var(--lbo-rail-text);
}

/* ---------------------------------------------------------------- main */
.lbo-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.lbo-topbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    min-height: 56px; padding: 10px 32px; border-bottom: 1px solid var(--lbo-rule);
}
.lbo-breadcrumb { font-size: 13px; color: var(--lbo-muted); }
.lbo-breadcrumb a { color: var(--lbo-muted); text-decoration: none; }
.lbo-breadcrumb a:hover { color: var(--lbo-ink); }
.lbo-breadcrumb strong { color: var(--lbo-ink); font-weight: 600; }
.lbo-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lbo-body { padding: 26px 32px 42px; display: flex; flex-direction: column; gap: 22px; }

/* --------------------------------------------------------------- type */
.lbo-h1 {
    margin: 0; font-family: var(--lbo-display); font-weight: 600;
    font-size: 24px; letter-spacing: -0.005em;
}
.lbo-h1 .sub { font-size: 15px; color: var(--lbo-muted); font-weight: 400; font-family: var(--lbo-text); }
.lbo-eyebrow {
    font-size: 14px; letter-spacing: 0; text-transform: none;
    font-weight: 600; color: #1C1B17;
}
.lbo-eyebrow .note { font-weight: 400; text-transform: none; letter-spacing: 0;
    font-size: 12px; color: var(--lbo-faint); margin-left: 8px; }
.lbo-muted { color: var(--lbo-muted); }
.lbo-faint { color: var(--lbo-faint); }
.lbo-num, .lbo-table td, .lbo-kpi .value { font-variant-numeric: tabular-nums; }
.lbo-display-num { font-family: var(--lbo-display); font-weight: 500; font-size: 22px; }

/* ---------------------------------------------------------- intro block */
.lbo-intro {
    border-left: 3px solid var(--lbo-amber);
    background: var(--lbo-cream-tint);
    padding: 12px 16px; font-size: 13px; color: #55503F;
    display: flex; flex-direction: column; gap: 4px; border-radius: 0 6px 6px 0;
}
.lbo-intro .status-line { font-size: 12px; color: var(--lbo-faint); }

/* --------------------------------------------------------------- chips */
.lbo-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
    font-weight: 600; border-radius: 999px; padding: 5px 12px;
    border: 1px solid var(--lbo-rule); color: var(--lbo-ink);
    background: #FFFFFF; white-space: nowrap;
}
.lbo-chip.amber { background: var(--lbo-amber-tint); border-color: var(--lbo-amber-border); color: var(--lbo-amber-ink); }
.lbo-chip.green { background: var(--lbo-green-tint); border-color: var(--lbo-green-border); color: var(--lbo-green-ink); }
.lbo-chip.grey  { background: #F4F2EC; border-color: #E5E1D3; color: var(--lbo-muted); }
.lbo-chip.plain { font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 12px; }
.lbo-badge-seeded {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--lbo-amber-ink); background: var(--lbo-amber-tint);
    border: 1px dashed var(--lbo-amber-border); border-radius: 4px; padding: 2px 8px;
}
.lbo-badge-live {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--lbo-green-ink); background: var(--lbo-green-tint);
    border: 1px solid var(--lbo-green-border); border-radius: 4px; padding: 2px 8px;
}

/* ---------------------------------------------------------------- KPI */
.lbo-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.lbo-kpi {
    border: 1px solid var(--lbo-rule); border-radius: 8px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 3px; background: #FFFFFF;
}
.lbo-kpi .label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lbo-faint); }
.lbo-kpi .value { font-family: var(--lbo-display); font-weight: 500; font-size: 21px; }
.lbo-kpi .value .aside { font-size: 13px; color: var(--lbo-muted); }

/* -------------------------------------------------------------- panels */
.lbo-grid { display: grid; gap: 20px; }
.lbo-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lbo-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .lbo-grid.cols-2, .lbo-grid.cols-3 { grid-template-columns: 1fr; } }
.lbo-panel {
    border: 1px solid var(--lbo-rule); border-radius: 8px;
    padding: 18px 20px; background: #FFFFFF;
    display: flex; flex-direction: column; gap: 13px; min-width: 0;
}
.lbo-panel-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lbo-panel-head .spacer { margin-left: auto; }
.lbo-divider { height: 1px; background: var(--lbo-hairline); border: 0; margin: 0; }

/* -------------------------------------------------------------- tables */
.lbo-table-wrap { overflow-x: auto; }
.lbo-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lbo-table th {
    font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
    font-weight: 600; color: var(--lbo-faint); text-align: right;
    padding: 7px 10px; border-bottom: 1px solid #DED8C6; white-space: nowrap;
}
.lbo-table th:first-child, .lbo-table td:first-child { text-align: left; }
.lbo-table td {
    padding: 8px 10px; border-bottom: 1px solid var(--lbo-hairline);
    text-align: right; color: #55503F; white-space: nowrap;
}
.lbo-table td.line-label { color: var(--lbo-ink); }
.lbo-table tr.total td { border-top: 1px solid #DED8C6; font-weight: 600; color: var(--lbo-ink); }
.lbo-table tr.subtle td { color: var(--lbo-faint); }
.lbo-table tr.indent td:first-child { padding-left: 24px; }
.lbo-table tr.highlight td { background: var(--lbo-cream-tint); }
.lbo-tag-derived {
    font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
    color: #9B9488; margin-left: 6px;
}

/* Inputs — the web equivalent of blue cells (boxed white, blue ink). */
.lbo-input-box {
    display: inline-block; border: 1.5px solid var(--lbo-input-border);
    background: #FFFFFF; color: var(--lbo-input-ink); font-weight: 600;
    border-radius: 5px; padding: 3px 10px; font-variant-numeric: tabular-nums;
}
.lbo-legend {
    display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
    border-top: 1px solid var(--lbo-hairline); padding-top: 10px;
    font-size: 12px; color: var(--lbo-muted);
}
.lbo-legend .swatch-input {
    display: inline-block; width: 24px; height: 15px;
    border: 1.5px solid var(--lbo-input-border); background: #FFFFFF; border-radius: 4px;
    vertical-align: -2px; margin-right: 6px;
}

/* -------------------------------------------------------------- checks */
.lbo-checks { display: flex; flex-direction: column; }
.lbo-check {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; border-bottom: 1px solid var(--lbo-hairline); font-size: 13px;
}
.lbo-check:last-child { border-bottom: 0; }
.lbo-check .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.lbo-check .dot.pass { background: var(--lbo-green); }
.lbo-check .dot.fail { background: var(--lbo-red); }
.lbo-check .dot.pending { background: #C9C2AC; }
.lbo-check .rule { flex-grow: 1; color: #55503F; }
.lbo-check .value { font-weight: 600; font-variant-numeric: tabular-nums; }
.lbo-check .value.fail { color: var(--lbo-red); }
.lbo-check .basis { font-size: 11.5px; color: var(--lbo-faint); min-width: 80px; text-align: right; }

/* ------------------------------------------------------------- buttons */
.lbo-btn-primary {
    display: inline-block; background: var(--lbo-red); color: #FFFFFF;
    font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
    border: 0; border-radius: 4px; padding: 11px 20px; cursor: pointer; text-decoration: none;
}
.lbo-btn-primary:hover { background: #B8000C; }
.lbo-btn-ghost {
    display: inline-block; border: 1px solid #C9C2AC; color: var(--lbo-ink); background: #FFFFFF;
    font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500;
    border-radius: 4px; padding: 10px 20px; cursor: pointer; text-decoration: none;
}
.lbo-btn-ghost:hover { border-color: var(--lbo-ink); }
a.lbo-link { color: var(--lbo-red); text-decoration: none; font-weight: 500; }
a.lbo-link:hover { color: #A8000B; }

/* -------------------------------------------------------- company cards */
.lbo-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
a.lbo-company-card {
    border: 1px solid var(--lbo-rule); border-radius: 8px; padding: 16px 18px;
    display: flex; flex-direction: column; gap: 10px; text-decoration: none;
    color: var(--lbo-ink); background: #FFFFFF;
}
a.lbo-company-card:hover { border-color: #C9C2AC; }
.lbo-programme-strip {
    display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
    padding: 6px 0 2px;
}
.lbo-programme-strip .name { font-family: var(--lbo-display); font-weight: 600; font-size: 17px; }
/* W12/W16/W17: programme page — section heading, narrative, market stats. */
.lbo-h2 {
    font-family: var(--lbo-display); font-weight: 600; font-size: 16px;
    margin: 24px 0 2px;
}
.lbo-narrative-p { margin: 0 0 10px; font-size: 14px; line-height: 1.65; }
.lbo-narrative-p strong { font-weight: 600; }
/* W37: stat tiles distribute evenly across the full panel width. */
.lbo-market-points {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px 28px; margin: 12px 0 4px;
}
.lbo-market-point { display: flex; flex-direction: column; gap: 2px; }
.lbo-market-point .lbo-display-num { font-size: 22px; }
.lbo-market-point .lbo-faint { font-size: 12px; }

/* W21: workbook-style financial tables — fixed shared columns, sections
   flowing down, dark header band, highlighted LTM column. */
.lbo-fin-table {
    width: 100%; table-layout: fixed; border-collapse: collapse;
    font-size: 13px; font-variant-numeric: tabular-nums;
    margin-bottom: 22px;
}
.lbo-fin-table col.lbl { width: 30%; }
.lbo-fin-table col.ltm { background: #FFF7E0; }
.lbo-fin-table thead th {
    background: #1F1D18; color: var(--lbo-cream);
    font-size: 12px; text-transform: none; letter-spacing: 0.02em;
    font-weight: 600; padding: 8px 10px; text-align: right;
}
.lbo-fin-table thead th.lbl { text-align: left; }
.lbo-fin-table thead th.ltm { color: var(--lbo-amber); }
.lbo-fin-table td {
    padding: 6px 10px; text-align: right;
    border-bottom: 1px solid var(--lbo-hairline);
}
.lbo-fin-table td.lbl { text-align: left; color: var(--lbo-ink); }
.lbo-fin-table tr.k-strong td { font-weight: 600; background: #FAF8F1; }
.lbo-fin-table tr.k-strong td.ltm, .lbo-fin-table tr.k-strongdays td.ltm { background: #FBF0D0; }
.lbo-fin-table tr.k-strongdays td { font-weight: 600; background: #FAF8F1; }
.lbo-fin-table tr.k-pct td { color: var(--lbo-muted); font-size: 12px; }
.lbo-fin-table tr.k-pct td.lbl { padding-left: 22px; }
.lbo-fin-table tr.k-money td.lbl, .lbo-fin-table tr.k-days td.lbl { padding-left: 22px; }

/* W20: auto-extracted company logo in Basic facts. */
.lbo-company-logo {
    max-height: 52px; max-width: 200px; display: block;
    margin: 2px 0 10px; object-fit: contain;
}
/* W27: real programme logo in the identity band / page header. */
.lbo-programme-logo {
    height: 44px; max-width: 150px; display: block; object-fit: contain;
}
/* W25/W28: tiny legend dots inside one-pager band cells. */
.lbo-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    margin-right: 3px; vertical-align: baseline;
}
/* W26/W29: plan headline + badge. */
.lbo-plan-badge {
    display: inline-block; margin: 4px 0 2px;
    background: #FBF0D0; color: #6B5200;
    border: 1px solid #E8D48A; border-radius: 999px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; padding: 4px 12px;
}
.lbo-plan-headline { margin: 10px 0 4px; }
.lbo-plan-headline .h {
    font-family: var(--lbo-display); font-weight: 600; font-size: 19px;
    line-height: 1.35;
}
.lbo-plan-headline .s { margin-top: 6px; font-size: 14px; color: var(--lbo-muted); }
/* W34: companies funnel by stage. */
.lbo-funnel { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.lbo-funnel-stage {
    flex: 1 1 0; min-width: 130px;
    background: var(--lbo-cream);
    border: 1px solid var(--lbo-rule); border-radius: 8px;
    padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.lbo-funnel-stage.passed { background: #F7F5EE; opacity: 0.72; }
.lbo-funnel-stage .stage-head {
    display: flex; align-items: baseline; justify-content: space-between;
    border-bottom: 1px solid var(--lbo-hairline); padding-bottom: 5px;
}
.lbo-funnel-stage .stage-name {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.09em; color: var(--lbo-muted);
}
.lbo-funnel-stage .stage-count {
    font-family: var(--lbo-display); font-size: 17px; font-weight: 500;
}
.lbo-funnel-stage .stage-company {
    font-size: 13px; color: var(--lbo-ink); text-decoration: none;
    display: flex; justify-content: space-between; gap: 8px;
}
.lbo-funnel-stage .stage-company:hover { color: var(--lbo-amber-ink); }
.lbo-funnel-stage .stage-company .eq { color: var(--lbo-muted); font-variant-numeric: tabular-nums; }
.lbo-funnel-stage .stage-empty { color: #C9C2AC; font-size: 13px; }
.lbo-funnel-arrow {
    align-self: center; color: #C9C2AC; font-size: 17px; flex: 0 0 auto;
    min-width: 10px; text-align: center;
}

/* W29: value-creation list. */
.lbo-vc-list { margin: 4px 0 2px; padding-left: 20px; font-size: 13.5px; line-height: 1.7; }
.lbo-vc-list li { margin-bottom: 4px; }

/* W15: home-page programme identity band — mark + name/thesis + CTA. */
.lbo-programme-band {
    display: flex; align-items: center; gap: 16px;
    background: var(--lbo-cream);
    border: 1px solid var(--lbo-rule); border-radius: 10px;
    padding: 16px 18px;
}
.lbo-programme-band .lbo-programme-mark { flex: 0 0 auto; display: block; }
.lbo-programme-band-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lbo-programme-band-text .name {
    font-family: var(--lbo-display); font-weight: 600; font-size: 17px; line-height: 1.2;
}
.lbo-programme-band-text p { margin: 0; font-size: 13.5px; color: var(--lbo-muted); max-width: 66ch; }
.lbo-programme-band .lbo-btn-primary { margin-left: auto; flex: 0 0 auto; align-self: center; }
@media (max-width: 900px) {
    .lbo-programme-band { flex-wrap: wrap; }
    .lbo-programme-band .lbo-btn-primary { margin-left: 0; }
}
.lbo-mini-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--lbo-muted); }
.lbo-mini-stats strong { color: var(--lbo-ink); font-variant-numeric: tabular-nums; }
.lbo-card-byline {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid var(--lbo-hairline);
  font-size: 11.5px; letter-spacing: 0.02em; color: var(--lbo-muted);
}

/* ------------------------------------------------------------ one-pager */
.lbo-band { display: flex; gap: 2px; }
.lbo-band-label {
    width: 86px; flex-shrink: 0; background: #F4EFDD; border-radius: 6px 0 0 6px;
    display: flex; align-items: center; justify-content: center;
}
.lbo-band-label span {
    font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; font-weight: 700;
    color: #55503F; writing-mode: vertical-rl; transform: rotate(180deg);
}
.lbo-band-cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; flex-grow: 1; }
.lbo-band-cells.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lbo-band-cells.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }  /* W99 */
@media (max-width: 1100px) { .lbo-band-cells, .lbo-band-cells.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lbo-band-cell { border: 1px solid #E5E1D3; display: flex; flex-direction: column; min-width: 0; background: #FFFFFF; }
.lbo-band-cell .head {
    font-size: 12px; font-weight: 700; text-align: center; padding: 9px 8px;
    border-bottom: 1px solid #E5E1D3;
}
.lbo-band-cell .body {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; flex-grow: 1; padding: 13px 10px; text-align: center;
}
.lbo-band-cell .big { font-family: var(--lbo-display); font-weight: 300; font-size: 24px; font-variant-numeric: tabular-nums; }
.lbo-band-cell .small { font-size: 11px; color: var(--lbo-muted); }
.lbo-status-banner {
    font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 700;
    color: var(--lbo-red);
}
.lbo-slide-tag {
    background: var(--lbo-ink); color: var(--lbo-cream);
    font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
    padding: 7px 20px 7px 14px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}

/* --------------------------------------------------------------- misc */
.lbo-headline { font-size: 14.5px; color: #55503F; max-width: 880px; }
.lbo-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 13px; }
.lbo-kv dt { color: var(--lbo-faint); }
.lbo-kv dd { margin: 0; color: var(--lbo-ink); font-variant-numeric: tabular-nums; }
.lbo-footnote { font-size: 11.5px; color: var(--lbo-faint); border-top: 1px solid var(--lbo-rule); padding-top: 12px; }

/* Fix pass (Phase 1 visual review) */
.lbo-band-cell .lbo-table td { padding: 5px 6px; }
.lbo-band-cell .lbo-table td:first-child { white-space: normal; text-align: left; }
.lbo-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.lbo-chip.tiny { font-size: 9.5px; padding: 3px 8px; letter-spacing: 0.08em; }

/* Standalone document chrome (W4) */
body.lbo-doc { margin: 0; background: #FFFFFF; min-height: 100vh;
    display: flex; flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
.lbo-doc .lbo-app { flex-grow: 1; min-height: calc(100vh - 46px); }
.lbo-doc-footer {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; padding: 13px 32px; border-top: 1px solid #ECE8DE;
    font-size: 12px; color: #8F8974; background: #FFFFFF;
}
.lbo-doc-footer a { color: #DD000F; text-decoration: none; font-weight: 500; }
.lbo-doc-footer a:hover { color: #A8000B; }

/* Rail programme tree (W1) */
.lbo-rail-tree { padding: 0 12px; }
.lbo-rail-tree summary {
    list-style: none; cursor: pointer; display: flex; align-items: center;
    gap: 7px; padding: 7px 12px; font-size: 10px; letter-spacing: 0.18em;
    text-transform: uppercase; color: #8F8974; user-select: none;
}
.lbo-rail-tree summary::-webkit-details-marker { display: none; }
.lbo-rail-tree summary::before {
    content: ''; width: 0; height: 0; border-left: 5px solid #8F8974;
    border-top: 4px solid transparent; border-bottom: 4px solid transparent;
    transition: transform 0.15s ease;
}
.lbo-rail-tree[open] summary::before { transform: rotate(90deg); }
.lbo-rail-tree .lbo-rail-item.sub { padding-left: 24px; font-size: 13px; }

/* Rail foot + sign out */
.lbo-rail-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lbo-signout {
    background: none; border: 0; padding: 0; cursor: pointer;
    color: #8F8974; font-size: 11.5px; letter-spacing: 0.08em;
    text-transform: uppercase; font-family: inherit;
}
.lbo-signout:hover { color: #FFFCF1; }

/* Flags (W3) */
.lbo-flag { display: inline-flex; line-height: 0; cursor: default; }

/* Access screen (W4) — deliberately minimal */
body.lbo-access-doc { background: #1F1D18; }
body.lbo-access-doc .lbo-doc-footer {
    background: #1F1D18; border-top-color: #3A3628; color: #8F8974;
}
body.lbo-access-doc .lbo-doc-footer a { color: #CFC9B6; }
body.lbo-access-doc .lbo-doc-footer a:hover { color: #FFFCF1; }
.lbo-access {
    flex-grow: 1; display: flex; flex-direction: column;
    min-height: calc(100vh - 46px);
}
.lbo-access-top {
    display: flex; justify-content: flex-end; padding: 22px 32px;
}
.lbo-access-top a {
    color: #CFC9B6; text-decoration: none; font-size: 12px;
    letter-spacing: 0.14em; text-transform: uppercase;
}
.lbo-access-top a:hover { color: #FFFCF1; }
.lbo-access-card {
    margin: auto; width: 340px; max-width: calc(100vw - 48px);
    display: flex; flex-direction: column; gap: 18px;
    padding-bottom: 12vh;
}
.lbo-access-mark {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700; font-size: 26px; color: #FFFCF1; letter-spacing: 0.01em;
}
.lbo-access-mark span { font-weight: 300; }
.lbo-access-card form { display: flex; flex-direction: column; gap: 14px; }
.lbo-access-field { display: flex; flex-direction: column; gap: 6px; }
.lbo-access-field span {
    font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
    color: #8F8974;
}
.lbo-access-field input {
    background: #2A271C; border: 1px solid #3A3628; border-radius: 6px;
    padding: 12px 14px; color: #FFFCF1; font-size: 14px;
    font-family: inherit; outline: none;
}
.lbo-access-field input:focus { border-color: #FBB504; }
.lbo-access-error {
    font-size: 12.5px; color: #FFFCF1; background: #5A1218;
    border: 1px solid #8A2028; border-radius: 6px; padding: 9px 12px;
}
.lbo-access-help { font-size: 12.5px; color: #8F8974; margin: 0; }

/* Design tokens repeated on the standalone document root so components
   used outside .lbo-app (e.g. the access screen's button) resolve. */
body.lbo-doc {
    --lbo-ink: #222222; --lbo-muted: #75705F; --lbo-faint: #8F8974;
    --lbo-rule: #ECE8DE; --lbo-hairline: #F2EFE6; --lbo-cream: #FFFCF1;
    --lbo-cream-tint: #FAF8F0; --lbo-amber: #FBB504;
    --lbo-amber-tint: #FDF3D7; --lbo-amber-border: #F3DFA0;
    --lbo-amber-ink: #7A5B04; --lbo-red: #DD000F; --lbo-green: #12855A;
    --lbo-green-tint: #E4F2EA; --lbo-green-border: #BFE0CF;
    --lbo-green-ink: #0D5C3E; --lbo-input-ink: #1D5FBF;
    --lbo-input-border: #B9CBE8;
}

/* W5 — IBV logo placement */
.lbo-logo { height: 22px; width: auto; display: block; }
.lbo-logo.small { height: 16px; }
.lbo-access-mark img { height: 34px; width: auto; display: block; margin-bottom: 10px; }
.lbo-doc-footer .footer-brand { display: inline-flex; align-items: center; gap: 10px; }
.lbo-doc-footer img.logo-on-light { display: block; height: 15px; width: auto; }
.lbo-doc-footer img.logo-on-dark { display: none; height: 15px; width: auto; }
body.lbo-access-doc .lbo-doc-footer img.logo-on-light { display: none; }
body.lbo-access-doc .lbo-doc-footer img.logo-on-dark { display: block; }
.lbo-rail-brand img { height: 20px; width: auto; display: block; margin-bottom: 2px; }

/* W8 — rail foot / footer polish + responsive shell */
.lbo-rail-foot {
    margin-top: auto; padding: 12px 24px 0; border-top: 1px solid var(--lbo-rail-rule);
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    font-size: 12px; color: var(--lbo-rail-text);
}
.lbo-rail-foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
    .lbo-app { flex-direction: column; }
    .lbo-rail { width: 100%; padding: 16px 0; gap: 14px; }
    .lbo-rail-foot { padding-top: 10px; }
    .lbo-topbar, .lbo-body { padding-left: 18px; padding-right: 18px; }
    .lbo-doc-footer { padding: 12px 18px; }
    .lbo-band { flex-direction: column; }
    .lbo-band-label { width: 100%; border-radius: 6px 6px 0 0; padding: 8px 0; }
    .lbo-band-label span { writing-mode: horizontal-tb; transform: none; }
}

/* W7 — home card reference table */
.lbo-card-grid.wide { grid-template-columns: repeat(auto-fill, minmax(470px, 1fr)); }
.lbo-card-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.lbo-card-table th {
    font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600;
    color: var(--lbo-faint); text-align: right; padding: 4px 6px;
    border-bottom: 1px solid #DED8C6; white-space: nowrap;
}
.lbo-card-table th:first-child { text-align: left; }
.lbo-card-table td {
    padding: 5px 6px; border-bottom: 1px solid var(--lbo-hairline);
    text-align: right; color: #55503F; white-space: nowrap;
}
.lbo-card-table tr:last-child td { border-bottom: 0; }
.lbo-card-table td:first-child { text-align: left; color: var(--lbo-ink); }
/* The trailing note/source column wraps instead of clipping at the card edge. */
.lbo-card-table td:last-child { white-space: normal; }
.lbo-light { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.lbo-light.green { background: #12855A; }
.lbo-light.amber { background: #FBB504; }
.lbo-light.red { background: #DD000F; }
.lbo-light.grey { background: #C9C2AC; }

/* W6 — programme terms rendering */
.lbo-steps { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lbo-steps td { padding: 7px 8px; border-bottom: 1px solid var(--lbo-hairline); vertical-align: top; }
.lbo-steps td.n { color: var(--lbo-faint); width: 22px; }
.lbo-steps td.rule-text { color: #55503F; white-space: normal; }
.lbo-flag-note { font-size: 11.5px; color: var(--lbo-amber-ink); background: var(--lbo-amber-tint);
    border: 1px dashed var(--lbo-amber-border); border-radius: 5px; padding: 7px 10px; }

/* W5 alignment fixes */
.lbo-access-mark { display: flex; align-items: center; gap: 12px; }
.lbo-access-mark img { margin-bottom: 0; }
.lbo-rail-brand .wordmark { display: inline-flex; align-items: center; gap: 8px; }


/* W56: table headers read as headers — ink, not faint. */
.lbo-table thead th { color: #1C1B17; }

/* W39: row hover highlight on every table type. */
.lbo-table tbody tr:hover td,
.lbo-fin-table tbody tr:hover td,
.lbo-steps tbody tr:hover td,
.lbo-card-table tbody tr:hover td {
    background: #FBF3DC;
}

/* W45/W46/W47: compact tile tables. */
.lbo-table.compact td, .lbo-table.compact th { padding: 4px 8px; font-size: 12.5px; }
.lbo-table.compact .line-label { font-size: 12.5px; }

/* W46: basis toggle. */
.lbo-basis-toggle { display: flex; align-items: center; gap: 4px; }
.lbo-basis-toggle button {
    font: inherit; font-size: 11.5px; font-weight: 600;
    padding: 3px 9px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--lbo-rule); background: #FFFFFF; color: var(--lbo-muted);
}
.lbo-basis-toggle button.on {
    background: var(--lbo-amber-tint); border-color: var(--lbo-amber-border);
    color: var(--lbo-amber-ink);
}

/* W41/W42: funnel aggregate text + downside column. */
.lbo-funnel-stage .stage-aggregate { font-size: 12px; color: var(--lbo-muted); line-height: 1.5; }
.lbo-table td.downside, .lbo-table th.downside { color: var(--lbo-faint); background: #FAF9F4; }

/* W50 + W56: tile icons — larger, darker, readable. */
.lbo-tile-icon {
    vertical-align: -3px; margin-right: 7px; color: #55503F;
    width: 17px; height: 17px; stroke-width: 1.7;
}
/* W56: tile heads left-aligned, 14px full ink (Bitbucket contrast). */
.lbo-band-cell .head {
    display: flex; align-items: center; justify-content: flex-start;
    gap: 0; font-size: 14px; font-weight: 600; color: #1C1B17;
}
.lbo-panel-head .lbo-tile-icon { vertical-align: -2.5px; }


/* W58: tile mini key-value rows — values in ink, labels muted. */
.lbo-mini-kv {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 12px; width: 100%; font-size: 12.5px; text-align: left;
    border-bottom: 1px solid var(--lbo-hairline); padding-bottom: 3px;
}
.lbo-mini-kv span { color: var(--lbo-muted); }
.lbo-mini-kv strong { color: #1C1B17; font-weight: 600; font-size: 13px; text-align: right; }

/* W62: company rail — context card + section labels. */
.lbo-rail-company {
    margin: 0 12px; padding: 12px 14px; border-radius: 8px;
    background: var(--lbo-rail-soft); border-left: 3px solid var(--lbo-amber);
    display: flex; flex-direction: column; gap: 3px;
}
.lbo-rail-company .prog {
    font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--lbo-rail-faint);
}
.lbo-rail-company .name { font-size: 15px; font-weight: 700; color: var(--lbo-cream); }
.lbo-rail-company .chip {
    align-self: flex-start; margin-top: 3px;
    font-size: 9.5px; font-weight: 600; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--lbo-amber);
    border: 1px solid #5C532E; border-radius: 999px; padding: 2px 8px;
}
.lbo-rail-section {
    display: block; padding: 6px 12px 3px; font-size: 11.5px;
    font-weight: 700; color: var(--lbo-amber);
    border-left: 3px solid var(--lbo-amber); margin-left: 9px;
    line-height: 1.2;
}
.lbo-rail-pending {
    display: block; padding: 4px 12px 4px 24px; font-size: 12px;
    color: var(--lbo-rail-faint); font-style: italic;
}

/* W53/W66: programme marks in the rail tree — cream glyphs (IBV
   logo-on-dark treatment) or a real symbol on a light chip. */
.lbo-rail-tree summary { display: flex; align-items: center; gap: 8px; }
.lbo-rail-mark { display: inline-flex; align-items: center; flex: 0 0 auto; margin-right: 2px; }
.lbo-rail-mark svg { width: 19px; height: 19px; }
.lbo-rail-primary .lbo-rail-mark { margin-right: 8px; }
.lbo-rail-mark .chip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; background: var(--lbo-cream);
    border-radius: 5px; padding: 2px;
}
.lbo-rail-mark .chip img { max-width: 100%; max-height: 100%; object-fit: contain; }


/* W64: metric benchmark line ("vs analyzed"). */
.lbo-bm {
    width: 100%; text-align: left; font-size: 11px; line-height: 1.45;
    color: #7A6A33; background: #FDF8E8; border-radius: 4px;
    padding: 3px 7px; margin-top: -1px;
}

/* W69–W71: LBO summary (Direction B — tabbed dossier). */
.lbo-chip.red { background: #FBEBEC; border-color: #EFC2C6; color: #A8000B; }
.lbo-scope {
    border: 1px solid var(--lbo-amber-border); border-radius: 10px;
    background: #FFFEFA; padding: 0 20px 20px;
    display: flex; flex-direction: column; gap: 16px;
}
.lbo-scope-band {
    margin: 0 -20px; padding: 7px 20px;
    background: var(--lbo-amber-tint);
    border-bottom: 1px solid var(--lbo-amber-border);
    border-radius: 9px 9px 0 0;
    font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
    font-weight: 600; color: var(--lbo-amber-ink);
}
/* W83: the controls must read as controls — bolder pills and tabs. */
.lbo-scenario-pills { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.lbo-scenario-pills .pill {
    font: inherit; font-size: 12.5px; font-weight: 600;
    padding: 7px 14px; border-radius: 999px; cursor: pointer;
    border: 1.5px solid #C9C2AC; background: #FFFFFF; color: var(--lbo-ink);
    box-shadow: 0 1px 2px rgba(34, 34, 34, 0.07);
}
.lbo-scenario-pills .pill:hover { border-color: var(--lbo-ink); }
.lbo-scenario-pills .pill.on {
    background: var(--lbo-amber); border-color: var(--lbo-amber);
    color: #1C1B17; font-weight: 700;
}
.lbo-scenario-pills .pill.pending {
    color: #B9B29B; cursor: not-allowed; border-style: dashed;
    border-width: 1px; box-shadow: none;
}
.lbo-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--lbo-rule); }
.lbo-tab {
    font: inherit; background: none; border: 0; cursor: pointer;
    padding: 10px 18px; font-size: 14px; font-weight: 600;
    color: var(--lbo-muted); border-bottom: 3px solid transparent;
    margin-bottom: -2px; border-radius: 6px 6px 0 0;
}
.lbo-tab:hover { color: #1C1B17; background: #FBF3DC; }
.lbo-tab.on { color: #1C1B17; font-weight: 700; border-bottom-color: var(--lbo-amber); background: var(--lbo-amber-tint); }
.lbo-view-toggle button {
    font-size: 12.5px; padding: 6px 14px;
    border: 1.5px solid #C9C2AC; color: var(--lbo-ink);
    box-shadow: 0 1px 2px rgba(34, 34, 34, 0.07);
}
.lbo-view-toggle button:hover { border-color: var(--lbo-ink); }
.lbo-view-toggle button.on {
    background: var(--lbo-amber); border-color: var(--lbo-amber);
    color: #1C1B17; font-weight: 700;
}
.lbo-tabpane, .lbo-view { display: flex; flex-direction: column; gap: 20px; }
.lbo-tabpane[hidden], .lbo-view[hidden] { display: none; }
.lbo-sense {
    width: 100%; border-collapse: collapse; font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}
.lbo-sense th {
    font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
    font-weight: 600; color: #1C1B17; padding: 6px 9px;
    border-bottom: 1px solid #DED8C6; text-align: center; white-space: nowrap;
}
.lbo-sense th.rl, .lbo-sense td.rl { text-align: left; }
.lbo-sense td {
    padding: 7px 10px; text-align: center;
    border: 1px solid var(--lbo-hairline); color: #55503F;
}
.lbo-sense td.rl { color: var(--lbo-ink); font-weight: 600; border-left: 0; white-space: nowrap; }
.lbo-sense td.pending { color: #C9C2AC; }
.lbo-sense td.sel {
    outline: 2px solid #222222; outline-offset: -2px;
    font-weight: 700; color: #1C1B17; background: var(--lbo-amber-tint);
}

/* W73: collapsible programme bands on the portfolio home. */
.lbo-card-grid[hidden] { display: none; }
.lbo-band-toggle {
    font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid #C9C2AC; border-radius: 999px;
    background: #FFFFFF; color: var(--lbo-ink); padding: 8px 14px;
    flex: 0 0 auto; white-space: nowrap;
}
.lbo-band-toggle:hover { border-color: var(--lbo-ink); }
.lbo-band-toggle::after {
    content: ''; width: 0; height: 0;
    border-top: 5px solid var(--lbo-muted);
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    transition: transform 0.15s ease;
}
.lbo-band-toggle.open::after { transform: rotate(180deg); }

/* W75/W80/W82: workbook statement grid — era columns, both views. */
.lbo-wb { font-size: 12px; }
.lbo-wb td, .lbo-wb thead th { padding: 4px 8px; }
.lbo-wb col.era-past { background: #F5F3EB; }
.lbo-wb col.era-ltm { background: #FFF7E0; }
.lbo-wb thead th.era-past { color: #B9B29B; }
.lbo-wb thead th.era-ltm { color: var(--lbo-amber); }
/* W79/W89: the Cash flow EBITDA rows render lighter than the other
   section rows (Exit EBITDA keeps the full dark treatment). */
.lbo-wb tr.wb-headlight td { background: #EDE9DC; color: #55503F; font-weight: 600; }
.lbo-wb tr.wb-headlight td.lbl { color: #55503F; }
.lbo-wb tbody tr.wb-headlight:hover td { background: #EDE9DC; }

/* W87: hovering a statement row magnifies it — +2px and bold — so a
   line can be read across the many numbers. */
.lbo-wb tbody tr:hover td { font-size: 14px; font-weight: 700; }
.lbo-wb tbody tr.wb-pct:hover td { font-size: 13px; font-weight: 700; }

/* W102: the magic-tooltip marker before a line's name. */
.lbo-tipmark {
    display: inline-flex; vertical-align: -2px; margin-right: 6px;
    color: #8F8974; cursor: help;
}
.lbo-wb tr.wb-head .lbo-tipmark, .lbo-wb tr.wb-headlight .lbo-tipmark { color: inherit; }

/* W105: the marked cell (e.g. the year a bullet falls due). */
.lbo-wb td.due { background: var(--lbo-amber-tint); font-weight: 700; color: #1C1B17; }

/* W108: sensitivity heat — red (worse) → green (better), warm-tinted. */
.lbo-sense td.hg0 { background: #F6D6D8; }
.lbo-sense td.hg1 { background: #F7E4D2; }
.lbo-sense td.hg2 { background: #F7EFCB; }
.lbo-sense td.hg3 { background: #E3EDD0; }
.lbo-sense td.hg4 { background: #CFE5D3; }

/* W92: cash at close (CMO). */
.lbo-cmo-basis[hidden] { display: none; }
.lbo-cmo-basis { display: flex; flex-direction: column; gap: 16px; }
/* W110: inline defined terms carry their tooltip on a dotted underline. */
.lbo-deftip { border-bottom: 1px dotted #8F8974; cursor: help; }

/* W107: the revenue panel grid — bars share the strips' columns. */
.lbo-revgrid th, .lbo-revgrid td { text-align: center; }
.lbo-revgrid th.lbl, .lbo-revgrid td.lbl { text-align: left; width: 84px; }
.lbo-revgrid tr.bars td { vertical-align: bottom; padding-bottom: 2px; }
.rg-wrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 128px; }
.rg-val { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.rg-bar { width: 52px; background: #4A4438; border-radius: 2px 2px 0 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.rg-bar.last { background: #C98A0B; }
.rg-band { background: #1F1D18; display: flex; align-items: center; justify-content: center; }
.rg-band span { color: #FFFCF1; font-size: 9px; font-weight: 600; white-space: nowrap; }
.lbo-wb tr.wb-head td { background: #35311F; color: var(--lbo-cream); font-weight: 600; }
.lbo-wb tr.wb-head td.lbl { color: var(--lbo-cream); }
.lbo-wb tbody tr.wb-head:hover td { background: #35311F; }
.lbo-wb tr.wb-pct td { color: var(--lbo-muted); font-size: 11px; }
.lbo-wb tr.wb-pct td.lbl, .lbo-wb tr.wb-sub td.lbl { padding-left: 20px; }
.lbo-wb tr.wb-good td { background: var(--lbo-green-tint); font-weight: 600; }
.lbo-wb tbody tr.wb-good:hover td { background: var(--lbo-green-tint); }

/* W63: promoted portfolio links in the company rail. */
.lbo-rail-primary { margin-top: -8px; }
.lbo-rail-primary a.lbo-rail-item {
    font-size: 14px; font-weight: 600; color: var(--lbo-cream);
}

/* W122: the gross → net returns bridge on the LBO summary exit tab. */
.lbo-brg { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.lbo-brg .lbl { width: 108px; flex-shrink: 0; color: #55503F; }
.lbo-brg .track { flex: 1; min-width: 0; }
.lbo-brg .bar { display: block; height: 13px; border-radius: 2px; min-width: 2px; }
.lbo-brg .val { font-variant-numeric: tabular-nums; font-weight: 600; width: 52px; text-align: right; flex-shrink: 0; }

/* ------------------------------------------------------------------ */
/* W124 / W127 — rail: three sections per programme, icons on every    */
/* entry, Chrome-style collapse (icon-only rail, state in localStorage) */
/* ------------------------------------------------------------------ */
.lbo-rail { transition: width 0.15s ease; }
.lbo-rail-brand { position: relative; }
.lbo-rail-brand .wordmark { display: inline-flex; align-items: center; gap: 6px; }
.lbo-rail-toggle {
    position: absolute; top: -4px; right: 14px;
    font: inherit; background: none; border: 0; cursor: pointer; padding: 6px;
    color: var(--lbo-rail-faint); border-radius: 6px; line-height: 0;
}
.lbo-rail-toggle:hover { color: var(--lbo-cream); background: #2A271C; }
.lbo-rail-ico { flex: 0 0 auto; width: 18px; height: 18px; }
.lbo-rail a.lbo-rail-item .lbo-rail-ico,
.lbo-rail summary.lbo-rail-item .lbo-rail-ico { color: var(--lbo-rail-faint); }
.lbo-rail a.lbo-rail-item:hover .lbo-rail-ico,
.lbo-rail a.lbo-rail-item.active .lbo-rail-ico,
.lbo-rail summary.lbo-rail-item:hover .lbo-rail-ico { color: var(--lbo-amber); }
.lbo-rail-item .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Companies — a collapsible menu inside the programme tree (W124). */
.lbo-rail-companies { display: flex; flex-direction: column; gap: 2px; }
.lbo-rail-companies > summary { list-style: none; cursor: pointer; user-select: none; }
.lbo-rail-companies > summary::-webkit-details-marker { display: none; }
.lbo-rail summary.lbo-rail-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 6px; border-left: 3px solid transparent;
    color: var(--lbo-rail-text); font-size: 13px;
}
.lbo-rail summary.lbo-rail-item:hover { background: #2A271C; color: var(--lbo-cream); }
.lbo-rail-tree summary.lbo-rail-item.sub {
    padding-left: 24px; font-size: 13px; letter-spacing: 0; text-transform: none;
    color: var(--lbo-rail-text); gap: 10px;
}
.lbo-rail-tree .lbo-rail-companies > summary::before { display: none; }
.lbo-rail summary.lbo-rail-item .count {
    margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--lbo-rail-faint);
    border: 1px solid var(--lbo-rail-rule); border-radius: 999px; padding: 0 7px; line-height: 16px;
}
.lbo-rail summary.lbo-rail-item::after {
    content: ''; width: 0; height: 0; margin-left: 4px;
    border-top: 4px solid var(--lbo-rail-faint);
    border-left: 3.5px solid transparent; border-right: 3.5px solid transparent;
    transition: transform 0.15s ease;
}
.lbo-rail-companies[open] > summary.lbo-rail-item::after { transform: rotate(180deg); }
.lbo-rail-tree .lbo-rail-item.sub2 { padding-left: 38px; font-size: 12.5px; }
/* Company chip: stored logo on a light square, else a two-letter monogram. */
.lbo-rail-cochip {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 26px; height: 26px; border-radius: 6px; background: var(--lbo-cream); overflow: hidden;
}
.lbo-rail-cochip img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 2px; }
.lbo-rail-cochip .mono {
    font-size: 10px; font-weight: 700; letter-spacing: 0.04em; color: var(--lbo-rail);
    font-family: var(--lbo-display);
}
.lbo-rail-cochip.small { width: 20px; height: 20px; border-radius: 4px; }
.lbo-rail-cochip.small .mono { font-size: 8.5px; }
.lbo-rail-company { position: relative; }
.lbo-rail-company .lbo-rail-cochip { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; }
.lbo-rail-company .prog, .lbo-rail-company .name { padding-right: 40px; }
.lbo-rail-pending { display: flex; align-items: center; gap: 10px; }
.lbo-rail-pending .lbo-rail-ico { color: var(--lbo-rail-faint); opacity: 0.6; }
.lbo-rail-section .txt { display: inline; }
.lbo-signout {
    display: inline-flex; align-items: center; gap: 6px;
    font: inherit; font-size: 12px; color: var(--lbo-rail-text); background: none;
    border: 0; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px;
}
.lbo-signout .lbo-rail-ico { display: none; }
.lbo-signout:hover { color: var(--lbo-cream); }

/* Collapsed state — icons only, ~56px wide (Luis's reference: Chrome). */
.lbo-app.rail-collapsed .lbo-rail { width: 60px; gap: 16px; padding: 18px 0 16px; }
.lbo-app.rail-collapsed .txt { display: none !important; }
.lbo-app.rail-collapsed .lbo-rail-brand { padding: 0; align-items: center; gap: 10px; }
.lbo-app.rail-collapsed .lbo-rail-brand .wordmark img { width: 26px; height: auto; }
.lbo-app.rail-collapsed .lbo-rail-toggle { position: static; }
.lbo-app.rail-collapsed .lbo-rail-toggle .lbo-rail-ico { transform: scaleX(-1); }
.lbo-app.rail-collapsed .lbo-rail-group,
.lbo-app.rail-collapsed .lbo-rail-tree { padding: 0 8px; }
.lbo-app.rail-collapsed .lbo-rail a.lbo-rail-item,
.lbo-app.rail-collapsed .lbo-rail summary.lbo-rail-item,
.lbo-app.rail-collapsed .lbo-rail-tree .lbo-rail-item.sub,
.lbo-app.rail-collapsed .lbo-rail-tree .lbo-rail-item.sub2,
.lbo-app.rail-collapsed .lbo-rail-tree summary.lbo-rail-item.sub {
    justify-content: center; padding: 9px 0; gap: 0; border-left-width: 0;
}
.lbo-app.rail-collapsed .lbo-rail a.lbo-rail-item.active { box-shadow: inset 3px 0 0 var(--lbo-amber); }
.lbo-app.rail-collapsed .lbo-rail summary.lbo-rail-item::after,
.lbo-app.rail-collapsed .lbo-rail summary.lbo-rail-item .count { display: none; }
.lbo-app.rail-collapsed .lbo-rail-tree > summary { justify-content: center; padding: 6px 0; gap: 0; }
.lbo-app.rail-collapsed .lbo-rail-tree > summary::before { display: none; }
.lbo-app.rail-collapsed .lbo-rail-mark { margin: 0; }
/* Group headings become thin amber ticks. */
.lbo-app.rail-collapsed .lbo-rail-label,
.lbo-app.rail-collapsed .lbo-rail-section {
    display: block; width: 18px; height: 0; padding: 0; margin: 6px auto 4px;
    border-left: 0; border-top: 2px solid var(--lbo-amber); overflow: hidden;
}
.lbo-app.rail-collapsed .lbo-rail-label { border-top-color: var(--lbo-rail-rule); }
.lbo-app.rail-collapsed .lbo-rail-pending { justify-content: center; padding: 6px 0; }
.lbo-app.rail-collapsed .lbo-rail-company {
    margin: 0 8px; padding: 6px; align-items: center; border-left-width: 0; border-radius: 8px;
}
.lbo-app.rail-collapsed .lbo-rail-company .lbo-rail-cochip { position: static; width: 32px; height: 32px; }
.lbo-app.rail-collapsed .lbo-rail-primary { margin-top: 0; }
.lbo-app.rail-collapsed .lbo-rail-foot { padding: 10px 0 0; justify-content: center; }
.lbo-app.rail-collapsed .lbo-signout .lbo-rail-ico { display: block; color: var(--lbo-rail-faint); }
.lbo-app.rail-collapsed .lbo-signout:hover .lbo-rail-ico { color: var(--lbo-cream); }
@media (max-width: 900px) {
    .lbo-app.rail-collapsed .lbo-rail { width: 100%; }
    .lbo-rail-toggle { display: none; }
}

/* ------------------------------------------------------------------ */
/* W123 — programme page: sticky section navigation + back to top       */
/* ------------------------------------------------------------------ */
.lbo-secnav {
    position: sticky; top: 0; z-index: 6;
    display: flex; gap: 4px; flex-wrap: wrap;
    margin: -8px -32px 0; padding: 8px 32px 0;
    background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(4px);
    border-bottom: 2px solid var(--lbo-rule);
}
.lbo-secnav a {
    font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: none;
    padding: 9px 16px; color: var(--lbo-muted); border-bottom: 3px solid transparent;
    margin-bottom: -2px; border-radius: 6px 6px 0 0; white-space: nowrap;
}
.lbo-secnav a:hover { color: #1C1B17; background: #FBF3DC; }
.lbo-secnav a.on { color: #1C1B17; font-weight: 700; border-bottom-color: var(--lbo-amber); background: var(--lbo-amber-tint); }
.lbo-sec { display: flex; flex-direction: column; gap: 22px; scroll-margin-top: 62px; }
.lbo-sec > .lbo-h2 { margin-bottom: -8px; }
.lbo-totop {
    position: fixed; right: 28px; bottom: 28px; z-index: 7;
    display: inline-flex; align-items: center; gap: 6px;
    font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--lbo-ink); background: #FFFFFF; border: 1px solid #C9C2AC; border-radius: 999px;
    padding: 9px 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(34, 34, 34, 0.12);
    opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease;
}
.lbo-totop.show { opacity: 1; transform: none; pointer-events: auto; }
.lbo-totop:hover { border-color: var(--lbo-ink); }
@media (max-width: 900px) { .lbo-secnav { margin: -8px -18px 0; padding: 8px 18px 0; } }

/* W125 — portfolio home: three controls per programme band. */
.lbo-band-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lbo-programme-band .lbo-band-actions .lbo-btn-primary { margin-left: 0; }
@media (max-width: 900px) { .lbo-band-actions { margin-left: 0; } }

/* W126 — Debt terms page: lender cards, tranche table, covenant levels. */
.lbo-lenders { display: flex; gap: 14px; flex-wrap: wrap; }
.lbo-lender {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px;
    border: 1px solid var(--lbo-rule); border-radius: 8px; background: #FFFFFF; min-width: 220px;
}
.lbo-lender-mark {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 72px; height: 44px; border-radius: 8px; background: #FFFFFF;
    border: 1px solid var(--lbo-hairline); overflow: hidden;
}
.lbo-lender-mark img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 5px; }
.lbo-lender-mark .mono { font-family: var(--lbo-display); font-weight: 700; font-size: 14px; color: var(--lbo-ink); letter-spacing: 0.04em; }
.lbo-lender-text { display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.lbo-lender-text .lbo-faint { font-size: 11.5px; }
.lbo-debt-table td { white-space: normal; vertical-align: top; }
.lbo-debt-table th:not(:first-child), .lbo-debt-table td:not(:first-child) { min-width: 180px; }
.lbo-confirm { color: var(--lbo-amber-ink); background: var(--lbo-amber-tint); border-radius: 4px; padding: 1px 6px; }
.lbo-cov-level { display: block; }
.lbo-facts { margin: 10px 0 0; padding-left: 18px; font-size: 12.5px; color: #55503F; display: flex; flex-direction: column; gap: 4px; }

/* W128 — Method 3 panel: perimeter banner, plain-word legend, numbers. */
.lbo-m3-banner {
    font-size: 12px; padding: 8px 12px; border-radius: 6px; line-height: 1.5;
}
.lbo-m3-banner.green { background: var(--lbo-green-tint); color: var(--lbo-green-ink); border: 1px solid var(--lbo-green-border); }
.lbo-m3-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: #55503F; margin-top: -4px; }
.lbo-m3-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lbo-m3-legend i { display: inline-block; width: 12px; height: 9px; border-radius: 2px; }
.lbo-m3-legend i.line { width: 16px; height: 0; border-top: 2.2px solid #1F1D18; border-radius: 0; }
.lbo-m3-assumptions { line-height: 1.6; }
.lbo-m3-verdict { color: var(--lbo-ink); line-height: 1.55; }
.lbo-m3-numbers summary { cursor: pointer; font-size: 12px; color: var(--lbo-muted); user-select: none; }
.lbo-m3-numbers summary:hover { color: var(--lbo-ink); }
.lbo-m3-numbers .lbo-table-wrap { margin-top: 8px; }
.lbo-rail-tree .lbo-rail-companies .lbo-rail-pending { padding-left: 38px; }

/* W130 — colour rules (registry: apps/lbo/colour_rules.py). The colour is
   the whole signal: no icon, no tooltip. */
.lbo-fin-table td.tone-red, .lbo-wb td.tone-red { color: var(--lbo-red); font-weight: 600; }
.lbo-fin-table td.tone-green, .lbo-wb td.tone-green { color: var(--lbo-green); font-weight: 600; }

/* W132/W133 — returns headline: MoM / IRR said, tooltip on the number. */
.lbo-ret { display: inline-flex; align-items: baseline; gap: 8px; cursor: help; }
.lbo-ret .lbo-tipmark { align-self: center; }
.lbo-ret-lbl { display: inline-flex; flex-direction: column; font-size: 12.5px; color: #75705F; font-weight: 400; line-height: 1.25; font-family: var(--lbo-text); }
.lbo-ret-lbl .who { font-weight: 600; color: #1C1B17; font-size: 12px; }
.lbo-brg[title] { cursor: help; }

/* W136 — section breaks on the programme pages: numbered eyebrow (CSS
   counter), 22px title, descriptor, amber tick + hairline, more air. */
.lbo-body { counter-reset: lbosec; }
.lbo-sec-head {
    position: relative; margin-top: 22px; padding: 18px 0 0 16px;
    border-top: 1px solid var(--lbo-rule);
    display: flex; flex-direction: column; gap: 2px;
}
.lbo-sec-head::before {
    content: ''; position: absolute; left: 0; top: 22px; bottom: 2px; width: 3px;
    background: var(--lbo-amber); border-radius: 2px;
}
.lbo-sec-head .num { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--lbo-amber-ink); font-weight: 700; }
.lbo-sec-head .num::before { counter-increment: lbosec; content: "Section " counter(lbosec, decimal-leading-zero); }
.lbo-sec-head .title { font-size: 22px; margin: 0; line-height: 1.2; }
.lbo-sec-head .desc { font-size: 13px; color: var(--lbo-muted); }
.lbo-sec > .lbo-sec-head { margin-bottom: -4px; }
.lbo-sec:first-of-type > .lbo-sec-head { margin-top: 4px; border-top: 0; }

/* W139 — Debt terms: one comparison table (instruments as columns, the
   field registry as rows) + side tables with identical columns. */
.lbo-debt-cmp th.term, .lbo-debt-cmp td.term { text-align: left; width: 26%; min-width: 220px; }
.lbo-debt-cmp th.inst { text-align: left; vertical-align: top; padding: 10px 10px 12px; }
.lbo-debt-cmp .inst-name { font-family: var(--lbo-display); font-weight: 600; font-size: 15px; color: var(--lbo-ink); letter-spacing: 0; text-transform: none; }
.lbo-debt-cmp .inst-contract { font-size: 11.5px; color: var(--lbo-muted); letter-spacing: 0; text-transform: none; font-weight: 400; margin-bottom: 8px; }
.lbo-debt-cmp .inst-lenders { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.lbo-lender-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--lbo-ink); }
.lbo-lender-chip .mark {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 56px; height: 30px; border-radius: 6px; background: #FFFFFF; border: 1px solid var(--lbo-hairline); overflow: hidden;
}
.lbo-lender-chip .mark img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 3px; }
.lbo-lender-chip .mark .mono { font-family: var(--lbo-display); font-weight: 700; font-size: 11px; color: var(--lbo-ink); }
.lbo-lender-chip .txt .lbo-faint { font-size: 11px; }
.lbo-debt-cmp td.val { text-align: left; white-space: normal; vertical-align: top; font-variant-numeric: tabular-nums; }
.lbo-debt-cmp td.val.none { color: #C9C2AC; }
.lbo-debt-cmp tr.grp td {
    padding: 14px 8px 5px; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
    font-weight: 700; color: var(--lbo-amber-ink); border-bottom: 1px solid #DED8C6; background: transparent;
}
.lbo-debt-cmp tr.blank td { color: #B9B29B; }
.lbo-debt-side-name { font-size: 12.5px; font-weight: 600; color: var(--lbo-ink); margin-bottom: 6px; }

/* W141 — Method 3 as one panel: inputs left, chart right. */
.lbo-m3-grid { grid-template-columns: minmax(280px, 1fr) minmax(0, 1.6fr); gap: 22px; align-items: start; }
.lbo-m3-left, .lbo-m3-right { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lbo-m3-left .lbo-panel-head { display: none; }
@media (max-width: 1100px) { .lbo-m3-grid { grid-template-columns: 1fr; } }
.lbo-cmo-basis .lbo-sec-head { margin-top: 8px; }
.lbo-cmo-basis .lbo-sec:first-of-type .lbo-sec-head { border-top: 0; margin-top: 0; padding-top: 6px; }

/* W148 — rail scrollbar (WebKit) + W152 — resize handle. */
.lbo-rail::-webkit-scrollbar { width: 6px; }
.lbo-rail::-webkit-scrollbar-thumb { background: #3A3628; border-radius: 3px; }
.lbo-rail-resizer {
    position: absolute; top: 0; right: 0; width: 6px; height: 100%;
    cursor: col-resize; z-index: 3; background: transparent;
}
.lbo-rail-resizer:hover, .lbo-rail-resizer.on { background: var(--lbo-amber); opacity: 0.85; }
.lbo-app.rail-collapsed .lbo-rail { width: 60px; }
body.lbo-resizing { cursor: col-resize; user-select: none; }
body.lbo-resizing .lbo-rail { transition: none; }
@media (max-width: 900px) {
    .lbo-rail { position: static; height: auto; overflow: visible; width: 100%; }
    .lbo-rail-resizer { display: none; }
}
/* W142 — icons inside the home band buttons. */
.lbo-btn-ico { display: inline-flex; align-items: center; gap: 8px; }
.lbo-btn-ico .lbo-rail-ico { width: 16px; height: 16px; color: currentColor; }
.lbo-band-toggle .lbo-rail-ico { width: 16px; height: 16px; color: var(--lbo-muted); }

/* W143 — unit column; W143 polish — lender chips stay inside their column. */
.lbo-debt-cmp th.unit, .lbo-debt-cmp td.unit { text-align: left; width: 64px; color: var(--lbo-muted); font-size: 12px; white-space: nowrap; }
.lbo-debt-cmp th.unit { font-size: 9.5px; }
.lbo-debt-cmp th.inst { max-width: 320px; }
.lbo-debt-cmp .inst-lenders { max-width: 100%; }
.lbo-lender-chip { max-width: 100%; min-width: 0; }
.lbo-lender-chip .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* W154 — the editable management P&L. */
.lbo-pnl-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.lbo-pnl-toolbar .spacer { margin-left: auto; }
.lbo-pnl-toolbar #pnl-status.err { color: var(--lbo-red); }
.lbo-pnl-edit th.drag, .lbo-pnl-edit td.drag { width: 22px; color: #C9C2AC; cursor: grab; text-align: center; font-size: 12px; letter-spacing: -2px; }
.lbo-pnl-edit th.lbl, .lbo-pnl-edit td.lbl { text-align: left; min-width: 220px; }
.lbo-pnl-edit th.tag, .lbo-pnl-edit td.tag { text-align: left; width: 120px; }
.lbo-pnl-edit th.alloc, .lbo-pnl-edit td.alloc { text-align: left; width: 120px; white-space: nowrap; }
.lbo-pnl-edit th.act, .lbo-pnl-edit td.act { width: 64px; text-align: right; }
.lbo-pnl-edit td.num { text-align: right; font-variant-numeric: tabular-nums; }
.lbo-pnl-edit td.num .m { display: block; font-size: 10.5px; color: var(--lbo-faint); font-weight: 400; }
.lbo-pnl-edit tr.sec td { padding: 14px 8px 5px; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--lbo-amber-ink); border-bottom: 1px solid #DED8C6; }
.lbo-pnl-edit tr.sec td .hint { font-weight: 400; letter-spacing: 0; text-transform: none; color: #C9C2AC; margin-left: 8px; font-size: 11px; }
.lbo-pnl-edit tr.sec.over td, .lbo-pnl-edit tr.line.over td { background: var(--lbo-amber-tint); }
.lbo-pnl-edit tr.line { cursor: grab; }
.lbo-pnl-edit tr.line.dragging { opacity: 0.45; }
.lbo-pnl-edit tr.line.replaced td { color: #B9B29B; }
.lbo-pnl-edit tr.subtotal td { color: var(--lbo-muted); font-size: 12px; border-bottom: 1px solid #DED8C6; }
.lbo-pnl-edit tr.total td { background: var(--lbo-cream-tint); }
.lbo-pnl-edit tr.total.cm td { background: var(--lbo-green-tint); }
.lbo-pnl-edit tr.total.ebitda td { background: var(--lbo-amber-tint); }
.lbo-pnl-edit .edit { display: inline-block; min-width: 40px; color: var(--lbo-input-ink); border-bottom: 1px dashed var(--lbo-input-border); padding: 0 2px; outline: none; }
.lbo-pnl-edit .edit:focus { background: #EEF4FF; border-bottom-color: var(--lbo-input-ink); }
.lbo-pnl-edit select, .lbo-pnl-edit input[type=number] { font: inherit; font-size: 12px; color: var(--lbo-input-ink); border: 1px solid var(--lbo-input-border); border-radius: 4px; padding: 2px 4px; background: #FFFFFF; }
.lbo-pnl-edit input[type=number] { width: 56px; }
.lbo-pnl-edit button.lnk { font: inherit; font-size: 11.5px; color: var(--lbo-red); background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.lbo-pnl-edit tr.alloc-editor td { background: #F7F5EE; font-size: 12px; color: #55503F; }
.lbo-pnl-recon td.num { text-align: right; font-variant-numeric: tabular-nums; }
.lbo-pnl-recon tr.diff td { border-bottom: 2px solid var(--lbo-rule); }
.lbo-pnl-recon td.tone-red { color: var(--lbo-red); font-weight: 600; }
.lbo-pnl-recon td.tone-green { color: var(--lbo-green); font-weight: 600; }

/* W157 — jump links between count rows and schedule tables. */
a.lbo-jump { color: var(--lbo-red); text-decoration: none; font-weight: 600; }
a.lbo-jump:hover { text-decoration: underline; }
.lbo-jump-back {
    font: inherit; font-size: 11.5px; color: var(--lbo-muted); background: #FFFFFF;
    border: 1px solid #C9C2AC; border-radius: 999px; padding: 3px 10px; cursor: pointer;
}
.lbo-jump-back:hover { color: var(--lbo-ink); border-color: var(--lbo-ink); }
.lbo-debt-cmp tr.lbo-flash td { background: var(--lbo-amber-tint); transition: background 0.4s ease; }
.lbo-debt-cmp tr { scroll-margin-top: 70px; }
.lbo-panel[id^="tbl-"] { scroll-margin-top: 16px; }

/* W158 — how the price is paid. */
.lbo-paid td { white-space: normal; vertical-align: top; font-size: 12px; }
.lbo-paid th:nth-child(2), .lbo-paid td:nth-child(2), .lbo-paid th:nth-child(3), .lbo-paid td:nth-child(3) { text-align: right; white-space: nowrap; }
.lbo-paid th:nth-child(4), .lbo-paid td:nth-child(4), .lbo-paid th:nth-child(5), .lbo-paid td:nth-child(5), .lbo-paid th:nth-child(6), .lbo-paid td:nth-child(6) { text-align: left; }

/* W161 — statutory base two-state toggle reuses the basis-toggle look. */
.lbo-view-state { margin-left: 8px; }
/* W163 — per-section add actions. */
.lbo-pnl-edit tr.sec td .adds { float: right; display: inline-flex; gap: 12px; letter-spacing: 0; text-transform: none; font-weight: 500; }
.lbo-pnl-edit tr.sec td .adds button.lnk { font-size: 11.5px; color: var(--lbo-amber-ink); text-decoration: none; border: 1px dashed var(--lbo-amber-border); border-radius: 999px; padding: 1px 9px; background: #FFFFFF; }
.lbo-pnl-edit tr.sec td .adds button.lnk:hover { background: var(--lbo-amber-tint); }
/* W164 — the unsaved state is unmistakable. */
#pnl-editor-panel { transition: border-color 0.15s ease, box-shadow 0.15s ease; }
#pnl-editor-panel.dirty { border: 2px solid var(--lbo-amber); box-shadow: 0 0 0 4px var(--lbo-amber-tint); }
.lbo-pnl-dirtybar {
    position: sticky; top: 0; z-index: 5; margin: -18px -18px 12px; padding: 10px 18px;
    background: var(--lbo-amber); color: #1C1B17; font-size: 13px; border-radius: 8px 8px 0 0;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.lbo-pnl-dirtybar .msg { flex: 1; }
.lbo-pnl-changes { font-size: 12px; }
.lbo-pnl-changes summary { cursor: pointer; font-weight: 600; }
.lbo-pnl-changes ul { margin: 6px 0 0; padding-left: 18px; columns: 2; column-gap: 24px; }
.lbo-pnl-changes li { margin: 2px 0; }
.lbo-pnl-savedbar { margin: -8px 0 10px; padding: 8px 12px; border-radius: 6px; background: var(--lbo-green-tint); color: var(--lbo-green-ink); font-size: 12.5px; font-weight: 600; transition: opacity 0.8s ease; }
.lbo-pnl-savedbar.fade { opacity: 0; }
#pnl-save.attention { background: var(--lbo-red); box-shadow: 0 0 0 3px #FBEBEC; position: relative; }
#pnl-save.attention::after { content: ''; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--lbo-amber); border: 2px solid #FFFFFF; }
#pnl-recon-badge.dim { opacity: 0.55; }
.lbo-pnl-edit tr.line.changed td.drag { color: var(--lbo-amber); }
.lbo-pnl-edit tr.line.changed { box-shadow: inset 3px 0 0 var(--lbo-amber); }
.lbo-pnl-edit td.chg .edit, .lbo-pnl-edit td.chg select, .lbo-pnl-edit td.chg button.lnk { border-bottom: 2px dotted var(--lbo-amber) !important; }
.lbo-pnl-edit td.chg { background: var(--lbo-amber-tint); cursor: help; }
.lbo-legend .swatch-changed { display: inline-block; width: 12px; height: 9px; background: var(--lbo-amber-tint); border-bottom: 2px dotted var(--lbo-amber); vertical-align: -1px; margin-right: 6px; }
.lbo-chip.tiny { font-size: 9.5px; padding: 1px 7px; }

/* Fix: author display rules must not resurrect [hidden] elements (the
   unsaved bar / Discard showed with "0 changes" — W167). */
.lbo-app [hidden], .lbo-pnl-dirtybar[hidden], .lbo-btn-ghost[hidden], .lbo-btn-primary[hidden], .lbo-basis-toggle[hidden] { display: none !important; }
/* W169 — the last-3-FY average column. */
.lbo-stat-table th.avg, .lbo-stat-table td.avg { border-left: 2px solid var(--lbo-rule); background: var(--lbo-cream-tint); }

/* W166 — framed sub-panels (Fixed at close) — reusable for dense panels. */
.lbo-subgrid { gap: 16px; }
.lbo-subpanel { border: 1.5px solid #8F8974; border-radius: 10px; overflow: hidden; background: #FFFFFF; display: flex; flex-direction: column; }
.lbo-subpanel-wide { grid-column: 1 / -1; }
.lbo-subpanel-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 9px 14px; background: var(--lbo-cream); border-bottom: 1.5px solid #8F8974; }
.lbo-subpanel-head .title { font-family: var(--lbo-display); font-weight: 600; font-size: 13.5px; color: var(--lbo-ink); }
.lbo-subpanel-head .desc { font-size: 11.5px; color: var(--lbo-muted); }
.lbo-subpanel-head .spacer { margin-left: auto; }
.lbo-subpanel-body { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.lbo-paid th.fund, .lbo-paid td.fund { text-align: right; white-space: nowrap; border-left: 1px solid var(--lbo-hairline); }
.lbo-paid td.total-cell { font-weight: 600; }
.lbo-paid td.tone-red { color: var(--lbo-red); font-weight: 700; }

/* W169 — valuation-basis rows: bold on a cream band; avg column; % rows. */
.lbo-pnl-edit tr.subtotal.basis td { background: var(--lbo-cream-tint); color: var(--lbo-ink); font-size: 12.5px; border-top: 1px solid #DED8C6; border-bottom: 1px solid #DED8C6; }
.lbo-pnl-edit tr.subtotal.basis td.num strong { font-weight: 600; }
.lbo-pnl-edit tr.pctrow td { color: var(--lbo-faint); font-size: 11.5px; }
.lbo-pnl-edit th.avg, .lbo-pnl-edit td.avg, .lbo-pnl-recon th.avg, .lbo-pnl-recon td.avg { border-left: 2px solid var(--lbo-rule); background: #FBFAF6; }
.lbo-pnl-edit tr.total.basis td.avg { background: inherit; }
.lbo-pnl-edit .basis-chip { vertical-align: 1px; margin-left: 6px; }
.lbo-pnl-recon td .m { display: block; font-size: 10.5px; color: var(--lbo-faint); font-weight: 400; }
.lbo-pnl-recon td.tone-red .m { color: var(--lbo-red); }
.lbo-mgmt-state { margin-left: 6px; }

/* W171 — grouped statutory balance sheet + average column in the workbook table. */
.lbo-fin-table tr.k-group td { padding: 12px 8px 4px; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--lbo-amber-ink); border-bottom: 1px solid #DED8C6; background: #FFFFFF; }
.lbo-fin-table tr.k-memo td { color: var(--lbo-faint); font-size: 12px; }
.lbo-fin-table tr.k-memo td.lbl { padding-left: 26px; }
.lbo-fin-table tr.k-check td { color: var(--lbo-muted); font-size: 12px; border-top: 2px solid var(--lbo-rule); }
.lbo-fin-table tr.k-check td.tone-red { color: var(--lbo-red); font-weight: 600; }
.lbo-fin-table td.avg { border-left: 2px solid var(--lbo-rule); background: #FBFAF6; }
.lbo-fin-table thead th.avg { border-left: 2px solid var(--lbo-rule); color: var(--lbo-cream); }

/* W173 — BS adjustments editor + adjusted view. */
#bs-editor-panel.dirty { border: 2px solid var(--lbo-amber); box-shadow: 0 0 0 4px var(--lbo-amber-tint); }
.lbo-bs-edit td.deriv .edit.small { font-size: 12px; color: var(--lbo-input-ink); min-width: 0; max-width: 300px; display: block; white-space: normal; line-height: 1.35; }
.lbo-bs-edit th.lbl, .lbo-bs-edit td.lbl { min-width: 160px; white-space: normal; }
.lbo-bs-adjusted td.num { text-align: right; font-variant-numeric: tabular-nums; }
.lbo-bs-adjusted th.avg, .lbo-bs-adjusted td.avg { border-left: 2px solid var(--lbo-rule); background: #FBFAF6; }
.lbo-bs-adjusted tr.total td { background: var(--lbo-cream-tint); }

/* W174 — commercial inputs: one vertical table per block. */
#co-editor-panel.dirty { border: 2px solid var(--lbo-amber); box-shadow: 0 0 0 4px var(--lbo-amber-tint); }
.lbo-co-block { margin-top: 14px; }
.lbo-co-head { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--lbo-amber-ink); padding: 6px 8px 4px; border-bottom: 1px solid #DED8C6; }
.lbo-co-table { table-layout: fixed; width: 100%; }
.lbo-co-table thead th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.lbo-co-table th.lbl, .lbo-co-table td.lbl { min-width: 0; white-space: normal; }
.lbo-co-table td.note .edit.small { font-size: 12px; color: var(--lbo-input-ink); display: block; min-width: 0; white-space: normal; line-height: 1.35; }
.lbo-co-table td.note .edit.small:empty { min-height: 14px; }
.lbo-co-table tr.line.derived td { color: var(--lbo-muted); }
.lbo-co-table td.derived .m { display: block; font-size: 10px; color: var(--lbo-faint); }
.lbo-co-table td .unit { font-size: 11px; color: var(--lbo-faint); margin-left: 2px; }
.lbo-co-table th.avg, .lbo-co-table td.avg { border-left: 2px solid var(--lbo-rule); background: #FBFAF6; }
.lbo-co-table tr.subtotal td { color: var(--lbo-muted); font-size: 12px; border-top: 2px solid var(--lbo-rule); }
.lbo-co-table tr.subtotal td.tone-red { color: var(--lbo-red); font-weight: 600; }


/* W177 — no double lines: a table's last body row never draws its own rule; the panel edge does. */
.lbo-app table tbody tr:last-child > td { border-bottom: 0; }
.lbo-table tr.filler td { border-bottom: 0; height: 33px; padding: 0; }
/* W178 — the €K column of How the price is paid carries the bold and the row check. */
.lbo-paid th.amt, .lbo-paid td.amt { font-weight: 600; color: var(--lbo-ink); }
/* W179 — offer components by basis. */
.lbo-components { table-layout: fixed; width: 100%; }
.lbo-components th { white-space: normal; font-size: 10px; line-height: 1.2; vertical-align: bottom; padding: 5px 6px; }
.lbo-components td { padding: 5px 6px; }
.lbo-components td.line-label { white-space: normal; }
.lbo-components th.basis, .lbo-components td.basis { border-left: 1px solid var(--lbo-hairline); }
.lbo-components col.lbl { width: 34%; } .lbo-components col.pct { width: 14%; }
.lbo-components th.basis .lbo-light { margin-right: 5px; }
.lbo-components tr.lbo-faint td { color: var(--lbo-faint); }
/* W180 — the amber tier: worth a look, not yet above the threshold. */
.lbo-pnl-recon td.tone-amber, .lbo-paid td.tone-amber, .lbo-fin-table td.tone-amber, .lbo-wb td.tone-amber { color: var(--lbo-amber-ink); font-weight: 600; }
.lbo-pnl-recon td.tone-amber .m { color: var(--lbo-amber-ink); }
.lbo-pnl-recon td.unit { white-space: nowrap; }
.lbo-pnl-recon tr.diff-k td { border-bottom: 0; }


/* W175 — Settings → Multiple calculation. */
.lbo-btn-gear { padding: 9px 10px; border-radius: 999px; }
.lbo-btn-gear .lbo-rail-ico { width: 16px; height: 16px; }
.lbo-mc-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lbo-mc-step { background: var(--lbo-cream-tint); border: 1px solid var(--lbo-hairline); border-radius: 6px; padding: 10px 12px; }
.lbo-mc-step .k { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--lbo-amber-ink); }
.lbo-mc-step .v { font-weight: 600; margin-top: 2px; }
.lbo-mc-step .d { color: var(--lbo-muted); font-size: 12px; margin-top: 2px; }
.lbo-mc-table th.test, .lbo-mc-table td.test-l { border-left: 2px solid var(--lbo-rule); }
.lbo-mc-table th.sub { font-size: 10px; color: var(--lbo-faint); background: var(--lbo-cream-tint); }
.lbo-mc-table tr.total td { font-weight: 700; border-top: 2px solid var(--lbo-rule); background: var(--lbo-cream-tint); }
.lbo-mc-table tr.quiet td { color: var(--lbo-muted); font-size: 12px; }
.lbo-mc-table tr.unpriced td { color: var(--lbo-faint); }
.lbo-mc-table .mult { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.lbo-pts { display: inline-block; min-width: 24px; text-align: center; border-radius: 3px; padding: 1px 5px; font-weight: 600; font-size: 11.5px; }
.lbo-pts.hi { background: var(--lbo-green-tint); color: var(--lbo-green-ink); }
.lbo-pts.mid { background: var(--lbo-amber-tint); color: var(--lbo-amber-ink); }
.lbo-pts.lo { background: #FDECEC; color: var(--lbo-red); }
.lbo-pts.nd { background: var(--lbo-cream-tint); color: var(--lbo-faint); font-weight: 500; }
.lbo-grade { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 4px; font-weight: 700; font-size: 12px; background: var(--lbo-ink); color: #fff; vertical-align: middle; }
.lbo-mc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .lbo-mc-cards { grid-template-columns: 1fr; } .lbo-mc-steps { grid-template-columns: 1fr; } }
.lbo-mc-card { border: 1px solid var(--lbo-rule); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: #fff; min-width: 0; }
.lbo-mc-card.unpriced { background: var(--lbo-cream-tint); }
.lbo-mc-card .ct { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lbo-mc-card .ct .w { margin-left: auto; color: var(--lbo-muted); font-size: 12px; white-space: nowrap; }
.lbo-mc-card .edit { display: inline-block; min-width: 34px; color: var(--lbo-input-ink); border-bottom: 1px dashed var(--lbo-input-border); padding: 0 2px; outline: none; }
.lbo-mc-card .edit:focus { background: #EEF4FF; border-bottom-color: var(--lbo-input-ink); }
.lbo-mc-card .edit.chg { background: var(--lbo-amber-tint); }
.lbo-mc-card .edit.lbl { min-width: 120px; font-weight: 600; color: var(--lbo-ink); }
.lbo-mc-card .edit.note { display: block; font-size: 12px; white-space: normal; min-width: 0; }
.lbo-mc-ladder { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; font-size: 12.5px; align-items: center; }
.lbo-mc-ladder .h { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lbo-faint); font-weight: 700; }
.lbo-mc-ladder .num { text-align: right; }
.lbo-mc-card .lnk { background: none; border: 0; padding: 0; color: var(--lbo-input-ink); font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; cursor: pointer; }
.lbo-mc-card .lnk.rm { color: var(--lbo-red); font-weight: 500; }
.lbo-mc-card select { font: inherit; font-size: 12px; color: var(--lbo-input-ink); border: 1px solid var(--lbo-input-border); border-radius: 4px; background: #fff; padding: 1px 4px; }
.lbo-mc-delta { display: inline-flex; gap: 10px; font-size: 12px; color: var(--lbo-muted); }
.lbo-mc-delta .up { color: var(--lbo-green-ink); font-weight: 600; } .lbo-mc-delta .dn { color: var(--lbo-red); font-weight: 600; }
.lbo-mc-defects { display: flex; flex-direction: column; gap: 6px; }
.lbo-mc-defects .d { display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: 12.5px; color: var(--lbo-muted); }
.lbo-mc-defects .d .k { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--lbo-amber-ink); padding-top: 2px; }
#mc-panel.dirty { border: 2px solid var(--lbo-amber); box-shadow: 0 0 0 4px var(--lbo-amber-tint); }
.lbo-mc-table td .edit { display: inline-block; min-width: 40px; color: var(--lbo-input-ink); border-bottom: 1px dashed var(--lbo-input-border); padding: 0 2px; outline: none; text-align: right; }
.lbo-mc-table td .edit:focus { background: #EEF4FF; }
.lbo-mc-table td .edit.chg { background: var(--lbo-amber-tint); }

/* W184 — the merged entry-multiple table. */
.lbo-basis th.sub { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--lbo-muted); font-size: 11px; border-bottom: 1px solid var(--lbo-rule); }
.lbo-basis tr.total td strong { font-size: 13.5px; }

/* W187 — Price: the EV once, the bases as rows. */
.lbo-ev-line { font-size: 15px; display: flex; align-items: baseline; gap: 8px; }
.lbo-ev-line strong { font-size: 20px; letter-spacing: -0.01em; }
#price-basis-table td .mult { font-size: 14px; }
#price-basis-table .lbo-light { margin: 0; }

/* W188–W191 — the Price working area, calendar, versions, position. */
.lbo-input-area { background: #FFFDF6; border: 1.5px dashed var(--lbo-amber-border); }
.lbo-input-area.dirty { border: 2px solid var(--lbo-amber); box-shadow: 0 0 0 4px var(--lbo-amber-tint); }
.lbo-input-eyebrow { color: var(--lbo-amber-ink); }
.lbo-of-ev { font-size: 15px; display: flex; align-items: baseline; gap: 8px; }
.lbo-of-ev .edit { font-size: 20px; font-weight: 700; min-width: 90px; color: var(--lbo-input-ink); border-bottom: 1px dashed var(--lbo-input-border); padding: 0 4px; outline: none; text-align: right; display: inline-block; }
.lbo-of-ev .edit:focus { background: #EEF4FF; }
.lbo-of-table th.act, .lbo-of-table td.act { width: 70px; }
.lbo-of-table td.lbl .edit.small { font-size: 12px; display: block; white-space: normal; min-width: 0; }
.lbo-of-calendar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; margin-top: 8px; }
@media (max-width: 1100px) { .lbo-of-calendar { grid-template-columns: 1fr; } }
.lbo-of-left, .lbo-of-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbo-eyebrow.small { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--lbo-amber-ink); }
.lbo-chip.tiny { font-size: 9.5px; padding: 2px 7px; }
.lbo-chip.red { color: var(--lbo-red); background: #FDECEC; border-color: #F5C2C2; }
.lnk { background: none; border: 0; padding: 0; color: var(--lbo-input-ink); font: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; cursor: pointer; }
.lnk.rm { color: var(--lbo-red); font-weight: 500; }
.lnk.small { font-size: 11px; }
.lbo-of-save { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding: 10px 12px; background: var(--lbo-amber-tint); border: 1px solid var(--lbo-amber-border); border-radius: 6px; }
.lbo-of-save label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lbo-muted); font-weight: 600; }
.lbo-of-save label.grow { flex: 1; min-width: 200px; }
.lbo-of-save input, .lbo-of-save select { font: inherit; font-size: 13px; letter-spacing: 0; text-transform: none; padding: 6px 8px; border: 1px solid var(--lbo-input-border); border-radius: 4px; color: var(--lbo-ink); background: #fff; }
.lbo-of-actions { white-space: nowrap; display: flex; gap: 10px; justify-content: flex-end; }
#of-calendar select, #of-components select { font: inherit; font-size: 12px; color: var(--lbo-input-ink); border: 1px solid var(--lbo-input-border); border-radius: 4px; background: #fff; padding: 1px 4px; max-width: 220px; }

/* W185 — Scenarios. */
.lbo-mc-card.basecase { border-color: var(--lbo-amber-border); background: #FFFDF6; }
.lbo-sc-shocks th, .lbo-sc-shocks td { padding: 4px 6px; font-size: 12px; }
.lbo-sc-shocks select { font: inherit; font-size: 12px; color: var(--lbo-input-ink); border: 1px solid var(--lbo-input-border); border-radius: 4px; background: #fff; padding: 1px 4px; max-width: 200px; }
.lbo-sc-shocks .edit { display: inline-block; min-width: 30px; color: var(--lbo-input-ink); border-bottom: 1px dashed var(--lbo-input-border); padding: 0 2px; outline: none; text-align: right; }
.lbo-sc-shocks .edit:focus { background: #EEF4FF; }
.lbo-sc-table td.tone-green { color: var(--lbo-green-ink); font-weight: 600; }
.lbo-sc-table td.tone-red { color: var(--lbo-red); font-weight: 600; }
.lbo-sc-table tr.quiet td { padding-top: 10px; border-bottom: 1px solid #DED8C6; }
#sc-pick, #sc-company { font: inherit; font-size: 12.5px; color: var(--lbo-ink); border: 1px solid var(--lbo-input-border); border-radius: 4px; background: #fff; padding: 4px 6px; max-width: 320px; }

/* W192 — Financing afresh. */
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.sw.cash, .seg.cash { background: #8FB89A; } .sw.equity, .seg.equity { background: var(--lbo-amber); } .sw.debt, .seg.debt { background: #5B6B8A; }
.lbo-fn-matrix th.test, .lbo-fn-matrix td.test-l { border-left: 2px solid var(--lbo-rule); }
.lbo-fn-matrix td.fn-cell { vertical-align: top; min-width: 120px; }
.lbo-fn-matrix td.fn-cell .amt { font-weight: 600; margin-bottom: 3px; }
.lbo-fn-matrix td.fn-cell .sp { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 12px; }
.lbo-fn-matrix td.fn-cell .edit { display: inline-block; min-width: 56px; color: var(--lbo-input-ink); border-bottom: 1px dashed var(--lbo-input-border); padding: 0 2px; outline: none; text-align: right; }
.lbo-fn-matrix td.fn-cell .edit:focus { background: #EEF4FF; }
.lbo-fn-matrix td.tone-red .amt { color: var(--lbo-red); }
.lbo-fn-bar { display: flex; height: 8px; width: 120px; background: var(--lbo-hairline); border-radius: 4px; overflow: hidden; }
.lbo-fn-bar .seg { display: block; height: 100%; }
.lbo-fn-stack { display: flex; justify-content: center; padding: 8px 0; }
.lbo-fn-stackbar { width: 160px; height: 220px; display: flex; flex-direction: column-reverse; border-radius: 6px; overflow: hidden; border: 1px solid var(--lbo-rule); }
.lbo-fn-stackbar .seg { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 10.5px; color: #1F1D18; padding: 2px 4px; min-height: 14px; }
.lbo-fn-stackbar .seg.debt { color: #fff; }
.lbo-fn-debt th.test, .lbo-fn-debt td.test-l { border-left: 1px solid var(--lbo-hairline); }

/* round-16 visual pass fixes */
.lbo-of-left, .lbo-of-right { overflow-x: auto; }
.lbo-of-left td:last-child { white-space: normal; }
.lbo-sc-shocks-wrap { overflow-x: auto; }
.lbo-sc-shocks select { max-width: 150px; }
.lbo-fn-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .lbo-fn-grid { grid-template-columns: 1fr; } }

#sc-cards { grid-template-columns: 1fr; }
.lbo-sc-shocks select { max-width: 215px; }
.lbo-of-left .lbo-chip.tiny { white-space: nowrap; }


/* W204 — the "worth a look" tier is a visible orange pill; red gets the same pill so the tiers read alike. */
:root { --lbo-orange: #C4520F; --lbo-orange-tint: #FDE9DA; --lbo-red-tint: #FDECEC; }
.lbo-app td.tone-amber, .lbo-app .lbo-pnl-recon td.tone-amber, .lbo-app .lbo-fin-table td.tone-amber, .lbo-app .lbo-wb td.tone-amber, .lbo-app .lbo-paid td.tone-amber, .lbo-app .lbo-sc-table td.tone-amber, .lbo-app .lbo-co-table tr.subtotal td.tone-amber {
    color: var(--lbo-orange); font-weight: 700; background: var(--lbo-orange-tint); border-radius: 4px; }
.lbo-app td.tone-red, .lbo-app .lbo-pnl-recon td.tone-red, .lbo-app .lbo-fin-table td.tone-red, .lbo-app .lbo-wb td.tone-red, .lbo-app .lbo-paid td.tone-red, .lbo-app .lbo-sc-table td.tone-red, .lbo-app .lbo-co-table tr.subtotal td.tone-red {
    color: var(--lbo-red); font-weight: 700; background: var(--lbo-red-tint); border-radius: 4px; }
.lbo-app .lbo-pnl-recon td.tone-amber .m { color: var(--lbo-orange); }
.lbo-app .lbo-chip.amber { color: var(--lbo-orange); background: var(--lbo-orange-tint); border-color: #F3C9A8; }
.lbo-tone-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--lbo-muted); }
.lbo-tone-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.lbo-tone-legend .dot.red { background: var(--lbo-red); } .lbo-tone-legend .dot.orange { background: var(--lbo-orange); }

/* W206 — one readable type scale for every dense and editable table. */
.lbo-app .lbo-table td, .lbo-app .lbo-table.compact td, .lbo-app .lbo-pnl-edit td, .lbo-app .lbo-fin-table td, .lbo-app .lbo-wb td, .lbo-app .lbo-mc-table td, .lbo-app .lbo-sc-table td, .lbo-app .lbo-co-table td, .lbo-app .lbo-fn-matrix td { font-size: 13.5px; }
.lbo-app .lbo-table th, .lbo-app .lbo-table.compact th, .lbo-app .lbo-pnl-edit th, .lbo-app .lbo-fin-table thead th, .lbo-app .lbo-wb th, .lbo-app .lbo-mc-table th, .lbo-app .lbo-co-table th { font-size: 11.5px; }
.lbo-app .lbo-table .m, .lbo-app .lbo-table .small, .lbo-app .lbo-pnl-edit .small, .lbo-app .small, .lbo-app .lbo-faint.small { font-size: 12px; }
.lbo-app .lbo-footnote { font-size: 12.5px; }
.lbo-app .lbo-pnl-edit .edit, .lbo-app .lbo-mc-card .edit, .lbo-app .lbo-sc-shocks .edit, .lbo-app .lbo-of-table .edit, .lbo-app .lbo-fn-matrix td.fn-cell .edit, .lbo-app .lbo-mc-table td .edit { font-size: 13.5px; min-height: 30px; line-height: 30px; padding: 0 4px; }
.lbo-app select { font-size: 13.5px; min-height: 30px; }
.lbo-app .lbo-light { width: 12px; height: 12px; box-shadow: 0 0 0 1px rgba(0,0,0,0.18); display: inline-block; border-radius: 50%; }
.lbo-app .lbo-chip { font-size: 11.5px; padding: 4px 10px; } .lbo-app .lbo-chip.tiny { font-size: 10.5px; }
.lbo-app .lnk { font-size: 12.5px; min-height: 36px; display: inline-flex; align-items: center; }
.lbo-app .lbo-legend { font-size: 12.5px; }
.lbo-app .lbo-sc-shocks th, .lbo-app .lbo-sc-shocks td { font-size: 13px; }

/* W207 — the offer working area: what · how much · when. */
.lbo-of-table th.what, .lbo-of-table td.what { min-width: 300px; white-space: normal; }
.lbo-of-table th.when, .lbo-of-table td.when { min-width: 260px; white-space: normal; vertical-align: top; }
.lbo-of-table td { vertical-align: top; }
.lbo-of-what { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lbo-of-what select.type { font: inherit; font-size: 13px; font-weight: 600; color: var(--lbo-input-ink); border: 1px solid var(--lbo-input-border); border-radius: 4px; background: #fff; padding: 3px 6px; }
.lbo-of-what .edit.lbl { font-weight: 600; min-width: 120px; }
.lbo-of-terms { margin-top: 4px; color: var(--lbo-muted); line-height: 1.9; white-space: normal; }
.lbo-of-terms select { font: inherit; font-size: 12.5px; color: var(--lbo-input-ink); border: 1px solid var(--lbo-input-border); border-radius: 4px; background: #fff; padding: 1px 4px; max-width: 220px; }
.lbo-of-terms .edit { min-width: 30px; }
.lbo-of-inst { display: flex; flex-direction: column; gap: 3px; }
.lbo-of-inst .ln { display: grid; grid-template-columns: minmax(96px, auto) minmax(70px, auto) 1fr; gap: 8px; align-items: center; }
.lbo-of-inst .ln .w { color: var(--lbo-ink); }
.lbo-of-inst .ln .a { text-align: right; font-variant-numeric: tabular-nums; }
.lbo-of-inst .ln .n { font-size: 12px; white-space: normal; }
.lbo-of-inst .ln.fixed .w { color: var(--lbo-muted); }
.lbo-of-inst .ln.foot { border-top: 1px dashed var(--lbo-hairline); padding-top: 3px; margin-top: 2px; font-size: 12px; color: var(--lbo-muted); }
.lbo-of-inst .ln.foot.tone-red { color: var(--lbo-red); background: none; font-weight: 600; }
.lbo-of-inst select { font: inherit; font-size: 12.5px; color: var(--lbo-input-ink); border: 1px solid var(--lbo-input-border); border-radius: 4px; background: #fff; padding: 1px 4px; }
.lbo-of-inst .lnk.rm.small { font-size: 14px; line-height: 1; justify-self: start; }
.lbo-of-costs { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--lbo-hairline); }
.lbo-of-costs-table td select { font: inherit; font-size: 12.5px; color: var(--lbo-input-ink); border: 1px solid var(--lbo-input-border); border-radius: 4px; background: #fff; padding: 1px 4px; }
.lbo-pos-basis button { min-height: 30px; }

/* W208 — the funding matrix: three labelled lines per cell, the share beside each amount. */
.lbo-fn-matrix td.fn-cell { min-width: 232px; padding: 8px 10px; }
.lbo-fn-matrix td.fn-cell .amt { font-weight: 700; margin-bottom: 4px; font-size: 13.5px; }
.lbo-fn-matrix .ln { display: grid; grid-template-columns: 18px minmax(86px, auto) minmax(64px, 1fr) 52px; gap: 6px; align-items: center; text-align: left; font-size: 12.5px; color: var(--lbo-ink); padding: 1px 0; }
.lbo-fn-matrix .ln .ico { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; color: var(--lbo-muted); }
.lbo-fn-matrix .ln .ico .lbo-rail-ico { width: 16px; height: 16px; display: block; }
.lbo-fn-matrix .ln .ico svg { width: 16px; height: 16px; display: block; }
.lbo-fn-matrix .ln .wd { color: var(--lbo-muted); white-space: nowrap; }
.lbo-fn-matrix .ln .sh { text-align: right; color: var(--lbo-muted); font-variant-numeric: tabular-nums; }
.lbo-fn-matrix .ln.empty .wd, .lbo-fn-matrix .ln.empty .sh { color: var(--lbo-faint); }
.lbo-fn-matrix .ln .edit { display: inline-block; min-width: 64px; text-align: right; }
.lbo-fn-matrix .ln.fixedln { grid-template-columns: 18px 1fr; color: var(--lbo-ink); font-weight: 600; }
.lbo-fn-matrix .fn-foot { margin-top: 4px; padding-top: 3px; border-top: 1px dashed var(--lbo-hairline); font-size: 12px; color: var(--lbo-muted); text-align: right; }
.lbo-fn-matrix .fn-foot.bad { color: var(--lbo-red); font-weight: 700; }
.lbo-fn-matrix td.fn-cell.tone-red { background: var(--lbo-red-tint); color: var(--lbo-ink); font-weight: 400; }
.lbo-fn-matrix td.fn-cell.fixed { background: #FAF8F0; }
.lbo-fn-matrix tr.fn-src td.line-label .ln { grid-template-columns: 18px auto; display: inline-grid; }
.lbo-fn-matrix th.test, .lbo-fn-matrix td.test-l { border-left: 2px solid var(--lbo-rule); }
#fn-su .ln { display: inline-grid; grid-template-columns: 18px auto; gap: 6px; align-items: center; }
#fn-su .ln .ico svg, #fn-su .ln .ico .lbo-rail-ico { width: 16px; height: 16px; display: block; color: var(--lbo-muted); }
.lbo-fn-stackbar .seg.vendor { background: #C9A86A; } .lbo-fn-stackbar .seg.rollover { background: #E7C86A; }
.sw.vendor, .seg.vendor { background: #C9A86A; } .sw.rollover, .seg.rollover { background: #E7C86A; }

/* W199 — the edit link on read-only blocks. */
.lbo-edit-link { font-size: 12.5px; color: var(--lbo-input-ink); text-decoration: none; font-weight: 600; letter-spacing: 0.02em; margin-left: auto; min-height: 36px; display: inline-flex; align-items: center; padding: 0 6px; }
.lbo-edit-link:hover { text-decoration: underline; }
.lbo-subpanel-head .lbo-edit-link { margin-left: auto; min-height: 0; }

/* W195 — Deals done: four periods per deal, the multiples derived. */
.lbo-dd-table th.period, .lbo-dd-table td.period { border-left: 1px solid var(--lbo-hairline); }
.lbo-dd-table th.mult, .lbo-dd-table td.mult { border-left: 2px solid var(--lbo-rule); }
.lbo-dd-table th.sub { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 11px; }
.lbo-dd-table td.lbl select { display: block; margin-top: 3px; font: inherit; font-size: 12px; color: var(--lbo-input-ink); border: 1px solid var(--lbo-input-border); border-radius: 4px; background: #fff; padding: 1px 4px; max-width: 200px; }
.lbo-dd-table td .edit.small { display: block; min-width: 120px; white-space: normal; }
.lbo-dd-table td .edit[data-ph]:empty::before { content: attr(data-ph); color: var(--lbo-faint); }
.lbo-dd-table tr.dup td { opacity: 0.6; }
.lbo-dd-table td .m { font-size: 11.5px; }

/* W205 — adjustments folded into the statutory BS table. */
.lbo-fin-table tr.k-adj td { color: var(--lbo-input-ink); font-size: 12.5px; background: #FBFDFF; }
.lbo-fin-table tr.k-adj td.lbl { padding-left: 34px; font-style: normal; }
.lbo-fin-table tr.k-adj td.lbl::before { content: '+ '; color: var(--lbo-faint); }
.lbo-fin-table tr.k-adjline td { font-weight: 700; color: var(--lbo-ink); border-bottom: 1px solid #DED8C6; }
.lbo-fin-table tr.k-adjline td.lbl { padding-left: 22px; }

/* W203 — the scenario bar stays put while the statements scroll; compact when stuck. */
.lbo-scenario-bar { position: sticky; top: 0; z-index: 30; background: #FFFFFF; display: flex; flex-direction: column; gap: 12px; padding: 8px 0 10px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; transition: box-shadow .15s; }
.lbo-scenario-bar.stuck { box-shadow: 0 6px 14px -10px rgba(0,0,0,0.35); border-bottom: 1px solid var(--lbo-rule); }
.lbo-scenario-bar .lbo-scope-band { margin: 0; }
.lbo-scenario-bar.stuck .lbo-scope-band, .lbo-scenario-bar.stuck .lbo-scenario-convention, .lbo-scenario-bar.stuck .lbo-kpi .label { display: none; }
.lbo-scenario-bar.stuck { flex-direction: row; align-items: center; gap: 18px; flex-wrap: wrap; padding: 6px 8px; }
.lbo-scenario-bar.stuck .lbo-panel-head { flex: 1 1 auto; min-width: 0; margin: 0; }
.lbo-scenario-bar.stuck .lbo-scenario-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.lbo-scenario-bar.stuck .lbo-panel-head > .lbo-link, .lbo-scenario-bar.stuck .lbo-panel-head > .lbo-badge-seeded, .lbo-scenario-bar.stuck .lbo-panel-head > .lbo-badge-live { display: none; }
.lbo-scenario-bar.stuck .lbo-kpi-row { display: flex; gap: 14px; flex-wrap: wrap; flex: 0 1 auto; }
.lbo-scenario-bar.stuck .lbo-kpi { flex-direction: row; align-items: baseline; gap: 6px; padding: 2px 0; border: 0; background: none; box-shadow: none; }
.lbo-scenario-bar.stuck .lbo-kpi .value { font-size: 14px; font-weight: 600; }
.lbo-scenario-bar.stuck .lbo-kpi .value .aside { font-size: 11.5px; }
.lbo-scenario-bar.stuck .lbo-kpi .short { display: inline; }
.lbo-scenario-bar .lbo-kpi .short { display: none; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lbo-faint); }
.lbo-scenario-pills a.pill { text-decoration: none; display: inline-flex; align-items: center; min-height: 34px; }
.lbo-scenario-sentinel { height: 1px; margin-top: -1px; }

/* W202 — Covenant EBITDA & tests. */
.lbo-cov-table td.tone-red, .lbo-cov-table td.tone-green { font-weight: 600; }
.lbo-cov-table td .thr { display: block; font-size: 11.5px; color: var(--lbo-faint); font-weight: 400; }
.lbo-cov-table td .hr { display: block; font-size: 11.5px; color: var(--lbo-muted); font-weight: 400; }
.lbo-cov-def { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--lbo-muted); }

/* W200 — the scenario's shock table on the checks tab; the battery verdicts. */
.lbo-shocks-table td { white-space: normal; }
.lbo-battery .lbo-check .rule a { color: inherit; text-decoration: none; }
.lbo-battery .lbo-check.on .rule { font-weight: 700; }

/* W194 — the tablet (≤ 1180 px) and the phone (≤ 640 px). */
.lbo-table-wrap { position: relative; background:
    linear-gradient(to right, #FFFFFF 30%, rgba(255,255,255,0)) left / 32px 100% no-repeat,
    linear-gradient(to left, #FFFFFF 30%, rgba(255,255,255,0)) right / 32px 100% no-repeat,
    linear-gradient(to right, rgba(0,0,0,0.10), rgba(0,0,0,0)) left / 14px 100% no-repeat,
    linear-gradient(to left, rgba(0,0,0,0.10), rgba(0,0,0,0)) right / 14px 100% no-repeat;
    background-attachment: local, local, scroll, scroll; }
@media (max-width: 1180px) {
    .lbo-topbar { padding: 10px 16px; }
    .lbo-body { padding: 18px 16px 34px; gap: 18px; }
    .lbo-programme-band { flex-wrap: wrap; }
    .lbo-programme-band .lbo-programme-band-text { flex: 1 1 60%; }
    .lbo-programme-band .lbo-band-actions { flex: 1 1 100%; margin-left: 0; justify-content: flex-start; }
    .lbo-grid.cols-3, .lbo-grid.cols-2, .lbo-subgrid, .lbo-card-grid, .lbo-card-grid.wide, .lbo-mc-cards, .lbo-fn-grid, .lbo-m3-grid { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
    .lbo-subpanel-wide, .lbo-subgrid .lbo-subpanel-wide { grid-column: 1 / -1; }
    .lbo-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lbo-band-cells, .lbo-band-cells.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lbo-fin-table, .lbo-wb { table-layout: auto; width: max-content; min-width: 100%; }
    .lbo-fin-table col.lbl, .lbo-components col.lbl { width: auto; }
    .lbo-fin-table th, .lbo-fin-table td, .lbo-wb th, .lbo-wb td { min-width: 88px; }
    .lbo-fin-table th.lbl, .lbo-fin-table td.lbl, .lbo-wb th.lbl, .lbo-wb td.lbl { position: sticky; left: 0; z-index: 2; background: #FFFFFF; min-width: 180px; max-width: 240px; white-space: normal; box-shadow: 4px 0 6px -4px rgba(0,0,0,0.18); }
    .lbo-fin-table tr.k-strong td.lbl, .lbo-fin-table tr.k-strongdays td.lbl { background: #FAF8F1; }
    .lbo-fin-table tr.k-adj td.lbl { background: #FBFDFF; }
    .lbo-wb tbody tr.wb-head td.lbl, .lbo-wb tbody tr.wb-total td.lbl { background: #FAF8F1; }
    .lbo-app .lbo-btn-primary, .lbo-app .lbo-btn-ghost, .lbo-app .lbo-band-toggle, .lbo-app .lbo-tab, .lbo-app .lbo-basis-toggle button, .lbo-app .lbo-view-toggle button { min-height: 40px; }
    .lbo-app .lbo-chip { min-height: 28px; display: inline-flex; align-items: center; }
    .lbo-app .lbo-pnl-edit .edit, .lbo-app .lbo-mc-card .edit, .lbo-app .lbo-sc-shocks .edit, .lbo-app .lbo-of-table .edit, .lbo-app .lbo-fn-matrix .edit { padding: 3px 6px; min-height: 32px; line-height: 26px; }
    .lbo-app select { min-height: 32px; }
    .lbo-scenario-pills .pill { min-height: 38px; }
    .lbo-mc-steps { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
    .lbo-of-calendar { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .lbo-app { flex-direction: column; }
    .lbo-rail, .lbo-app.rail-collapsed .lbo-rail { position: static; width: 100%; height: auto; padding: 10px 12px; gap: 8px; overflow: visible; }
    .lbo-rail-brand { flex-direction: row; align-items: center; gap: 12px; padding: 0; }
    .lbo-app .lbo-rail-brand .lbo-rail-toggle { display: inline-flex; margin-left: auto; position: static; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; }
    .lbo-app .lbo-rail-brand .lbo-rail-toggle .lbo-rail-ico { transform: none; }
    .lbo-app .lbo-rail .lbo-rail-company, .lbo-app .lbo-rail .lbo-rail-group, .lbo-app .lbo-rail .lbo-rail-tree, .lbo-app .lbo-rail .lbo-rail-foot { display: none; }
    .lbo-app.rail-open .lbo-rail .lbo-rail-company, .lbo-app.rail-open .lbo-rail .lbo-rail-group, .lbo-app.rail-open .lbo-rail .lbo-rail-tree, .lbo-app.rail-open .lbo-rail .lbo-rail-foot { display: flex; }
    .lbo-app.rail-open .lbo-rail .lbo-rail-tree { display: block; }
    .lbo-app.rail-open .lbo-rail .txt, .lbo-app.rail-collapsed.rail-open .txt { display: inline !important; }
    .lbo-app.rail-open .lbo-rail-company { position: relative; }
    .lbo-main { width: 100%; }
    .lbo-topbar { padding: 8px 12px; min-height: 0; }
    .lbo-topbar-right { margin-left: 0; width: 100%; }
    .lbo-body { padding: 14px 12px 28px; gap: 14px; }
    .lbo-h1 { font-size: 20px; }
    .lbo-grid.cols-3, .lbo-grid.cols-2, .lbo-subgrid, .lbo-card-grid, .lbo-card-grid.wide, .lbo-mc-cards, .lbo-fn-grid, .lbo-m3-grid, .lbo-kpi-row, .lbo-band-cells, .lbo-band-cells.cols-3, .lbo-mc-steps { grid-template-columns: 1fr; }
    .lbo-panel-head { flex-wrap: wrap; }
    .lbo-scenario-bar.stuck { flex-direction: column; align-items: stretch; gap: 6px; }
    .lbo-scenario-bar.stuck .lbo-kpi-row { display: flex; gap: 10px; overflow-x: auto; flex-wrap: nowrap; }
    .lbo-of-what { flex-direction: column; align-items: flex-start; }
    .lbo-fin-table th.lbl, .lbo-fin-table td.lbl, .lbo-wb th.lbl, .lbo-wb td.lbl { min-width: 140px; max-width: 180px; }
}

/* W209 / W210 — the entry-multiple table's € column and divisor row; the share rows of the payment matrix. */
.lbo-components col.amt { width: 11%; } .lbo-components col.pct { width: 10%; }
.lbo-components td.amt, .lbo-components th.num:nth-child(2) { font-weight: 600; }
.lbo-components tr.divisor td { border-top: 1px dashed var(--lbo-hairline); font-size: 12.5px; padding-top: 6px; }
.lbo-components tr.divisor td .m { font-size: 11px; }
.lbo-paid tr.share td { font-size: 12px; border-top: 0; padding-top: 2px; }
.lbo-paid td.amt .m { font-weight: 400; font-size: 11.5px; }
