/* ==========================================================================
   Arrayline — application styles.
   Neutral platform palette: dark slate sidebar, blue accent, soft cards,
   coloured status pills. One stylesheet, no framework. Each company's own
   brand colour is applied to its documents, never to this shell.
   ========================================================================== */

:root {
    --ink: #111c2b;
    --ink-2: #1a2739;
    --paper: #f3f5f7;
    --card: #ffffff;
    --border: #dfe4e9;
    --text: #14181d;
    --muted: #5d6773;
    --faint: #98a2ad;
    --accent: #1f6feb;
    --accent-dark: #1858c4;
    --amber: #d98a0b;
    --amber-dark: #b87409;
    --blue: #3b7bd4;
    --green: #1f9d6b;
    --red: #d64545;
    --purple: #9b59b6;
    --grey: #8a97a5;
    --shadow: 0 1px 2px rgba(20, 24, 29, .06), 0 1px 3px rgba(20, 24, 29, .08);
    --shadow-lg: 0 10px 30px rgba(20, 24, 29, .18);
    --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--paper);
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
a { color: var(--blue); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.center { text-align: center; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mb12 { margin-bottom: 12px; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }

/* ---------- boot / loading ---------- */
.boot {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.bolt-big { font-size: 34px; color: var(--accent); }

/* ---------- app shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 232px;
    flex: 0 0 232px;
    background: var(--ink);
    color: #cfd6de;
    display: flex;
    flex-direction: column;
    padding: 14px 10px;
    gap: 4px;
    /* The menu stays put while a long page scrolls: without this the sidebar was as tall as the page, so the navigation (and Sign out) scrolled away. */
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; flex: 0 0 auto; }
.bname { color: #fff; font-weight: 700; font-size: 15px; }
.btag { color: #7d8794; font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.nav-group-label {
    color: #6b7480; font-size: 10.5px; text-transform: uppercase;
    letter-spacing: .07em; padding: 12px 8px 4px; font-weight: 700;
}
.nav a {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 9px; border-radius: 9px;
    color: #cfd6de; font-size: 13.5px; text-decoration: none;
}
.nav a:hover { background: var(--ink-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav a .ic { width: 17px; text-align: center; opacity: .9; }
.badge-count {
    margin-left: auto; background: var(--red); color: #fff;
    border-radius: 999px; padding: 0 6px; font-size: 11px; font-weight: 700;
}
.nav a.active .badge-count { background: #fff; color: var(--accent-dark); }

.sidebar-foot {
    margin-top: auto; padding: 10px 8px 4px;
    border-top: 1px solid #262c34; color: #8b95a1; font-size: 12px;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px; background: var(--card);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.page-title { font-weight: 700; font-size: 15px; }
.hamburger { display: none; }

.search { display: flex; align-items: center; gap: 6px; background: var(--paper);
    border: 1px solid var(--border); border-radius: 9px; padding: 4px 9px; }
.search input { border: none; background: transparent; outline: none; width: 190px; font-size: 13px; }

.content { padding: 18px; flex: 1; }

.mobile-nav { display: none; }

/* ---------- page furniture ---------- */
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.detail-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card + .card { margin-top: 16px; }
/* Cards side by side in a grid are spaced by the grid's gap: the stacking margin above would push every right-hand card 16px lower than its neighbour. */
.grid-2 > .card + .card, .grid-3 > .card + .card, .form-grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.card-body { padding: 14px; }
.card-body.tight { padding: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full, .field.full { grid-column: 1 / -1; }

/* ---------- pipeline ---------- */
.pipeline { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pipe-step {
    flex: 1; min-width: 130px; background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 11px 13px; cursor: pointer; box-shadow: var(--shadow);
}
.pipe-step:hover { border-color: var(--accent); }
.pipe-step .pl { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.pipe-step .pv { font-size: 22px; font-weight: 700; }
.pipe-step .pm { color: var(--muted); font-size: 12px; min-height: 16px; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--grey);
    border-radius: var(--radius); padding: 11px 13px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.stat .value { font-size: 20px; font-weight: 700; }
.stat .foot { color: var(--muted); font-size: 11.5px; }
.stat.blue { border-left-color: var(--blue); }
.stat.green { border-left-color: var(--green); }
.stat.amber { border-left-color: var(--amber); }
.stat.red { border-left-color: var(--red); }
.stat.grey { border-left-color: var(--grey); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl, table.li-table { width: 100%; border-collapse: collapse; }
.tbl th, .li-table th {
    text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); font-weight: 700; padding: 8px 12px;
    border-bottom: 1px solid var(--border); background: #fafbfc; white-space: nowrap;
}
.tbl td, .li-table td { padding: 9px 12px; border-bottom: 1px solid #eef1f4; vertical-align: middle; }
.tbl tbody tr:last-child td, .li-table tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: #fafbfc; }
.li-table td { padding: 5px 6px; }
.li-table input, .li-table select { width: 100%; }

/* Per-line cost/markup/margin — sits under the description input rather than adding its own
   table columns, so a long description or a narrow (mobile) viewport just wraps this onto
   its own line instead of forcing the whole table wider. Each label+input is its own
   inline-flex "pair" so a cramped cell wraps whole pairs onto their own line rather than
   splitting a label from its input. */
.li-margin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin-top: 4px; }
.li-margin-pair { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.li-table .li-margin-row input.li-margin-input { width: 56px; padding: 2px 4px; font-size: 12px; }

/* A named part/section header or subtotal row within the line editor — a light band so a
   part's lines read as visually grouped without needing a nested table. */
.li-section-row td { background: #fafbfc; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.li-section-row input[type="text"] { width: auto; min-width: 140px; }

.totals { margin-top: 10px; margin-left: auto; width: 260px; }
.trow { display: flex; justify-content: space-between; padding: 3px 0; }
.trow.grand { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; font-weight: 700; font-size: 15px; }

/* ---------- pills ---------- */
.pill {
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
    padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
    background: #eef1f4; color: #4a5560;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { background: #e4f6ee; color: #14714c; }
.pill.blue { background: #e8f0fb; color: #2a5da4; }
.pill.amber { background: #fdf1dc; color: #96620a; }
.pill.red { background: #fbe8e8; color: #a32e2e; }
.pill.purple { background: #f2e8f7; color: #6f3d88; }
.pill.grey { background: #eef1f4; color: #4a5560; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 6px; justify-content: center;
    padding: 7px 13px; border-radius: 9px; border: 1px solid var(--border);
    background: var(--card); color: var(--text); font-size: 13px; font-weight: 600;
    cursor: pointer; text-decoration: none; font-family: inherit;
}
.btn:hover { background: #f7f9fa; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #bf3a3a; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eef1f4; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 11.5px; color: var(--faint); }
input, select, textarea {
    font-family: inherit; font-size: 13.5px; color: var(--text);
    padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px;
    background: var(--card); outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 111, 235, .18); }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: auto; }
.inline-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--text); }
.validation-message, .field-error { color: var(--red); font-size: 12px; }

/* ---------- modal ---------- */
.modal-back {
    position: fixed; inset: 0; background: rgba(20, 24, 29, .55);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 34px 14px; z-index: 200; overflow-y: auto;
}
.modal {
    background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg);
    width: 100%; max-width: 520px; max-height: calc(100vh - 68px); display: flex; flex-direction: column;
}
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-head h3 { flex: 1; }
.modal-body { padding: 16px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal .close { background: none; border: none; font-size: 19px; cursor: pointer; color: var(--muted); }

/* ---------- toasts ---------- */
.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 400;
    display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
    background: var(--ink); color: #fff; padding: 9px 15px; border-radius: 999px;
    font-size: 13px; box-shadow: var(--shadow-lg); pointer-events: auto; max-width: 90vw;
}
.toast.good { background: var(--green); }
.toast.bad { background: var(--red); }

/* ---------- misc blocks ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .big { font-size: 30px; margin-bottom: 8px; opacity: .5; }

.note-item { border-left: 3px solid var(--border); padding: 7px 11px; margin-bottom: 7px; background: #fafbfc; border-radius: 0 8px 8px 0; }
.note-item .meta { color: var(--faint); font-size: 11.5px; margin-top: 2px; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 5px 12px; font-size: 13.5px; }
.kv .k { color: var(--muted); }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 8px 13px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-dark); border-bottom-color: var(--accent); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); }

.sig-pad { width: 100%; height: 150px; border: 1px dashed var(--border); border-radius: 9px; background: #fff; touch-action: none; }

.month-chart { display: flex; align-items: flex-end; gap: 10px; height: 170px; }
.month-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.month-bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; }
.month-bar { width: 16px; border-radius: 3px 3px 0 0; min-height: 1px; }
.month-bar.primary { background: var(--blue); }
.month-bar.paid { background: var(--green); }
.month-label { font-size: 11px; color: var(--faint); padding-top: 5px; }

.bar-row { margin-bottom: 9px; }
.bar-row .bar-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 3px; }
.bar-track { height: 8px; background: var(--paper); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); }
.bar-fill.neg { background: var(--red); }

.offline-chip { background: #fdf1dc; color: #96620a; border: 1px solid #f0d9ae;
    padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--ink); padding: 20px; }
.auth-mark { width: 64px; height: 64px; border-radius: 16px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 34px; margin-bottom: 14px; }
.auth-name { color: #fff; font-size: 20px; font-weight: 700; margin-bottom: 22px; }
.auth-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 26px; }

/* ---------- blazor error ---------- */
#blazor-error-ui {
    background: #fdf1dc; color: #96620a; bottom: 0; display: none; left: 0;
    padding: 10px 14px; position: fixed; width: 100%; z-index: 1000; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 14px; top: 10px; }

/* ---------- print ---------- */
.print-only { display: none; }
@media print {
    .sidebar, .topbar, .mobile-nav, .no-print, .toast-wrap { display: none !important; }
    .print-only { display: block; }
    .content { padding: 0; }
    .card { border: none; box-shadow: none; }
    /* reports: whole tables on the paper, a card never split across pages, colours kept for the pills and bars */
    .table-wrap { overflow: visible; }
    .report-table, .report-charts .card, .stat { break-inside: avoid; }
    .report-table .tbl th, .report-table .tbl td { padding: 4px 8px; font-size: 11px; }
    .chart-box.scroll { overflow: visible; }
    .chart-box.scroll svg { width: 100%; }
    .stat, .pill, .chart-box svg, .total-row td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* ---------- dashboard and reports (step O1) ---------- */
.dash-warn { border-color: #f0d9ae; background: #fffaf0; }
.dash-warn + .grid-2 { margin-top: 16px; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-item { display: flex; gap: 12px; padding: 9px 14px; border-bottom: 1px solid #eef1f4; align-items: flex-start; }
.dash-item:last-child { border-bottom: none; }
.dash-tag { flex: 0 0 104px; font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 1px; }
.dash-item.urgent .dash-tag { color: var(--red); }
.dash-main { min-width: 0; overflow-wrap: anywhere; }
.dash-text { font-weight: 600; }
.dash-more { padding: 8px 14px; border-top: 1px solid #eef1f4; }
.dash-list-card .empty { padding: 22px 16px; }
.total-row td, tfoot.total-row td { font-weight: 700; background: #fafbfc; border-top: 2px solid var(--border); }
.report-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-print-head { margin-bottom: 12px; }
.report-print-head h2 { margin-bottom: 2px; }
.chart-box.scroll { overflow-x: auto; }
.chart-box.scroll svg { width: auto; max-width: none; }
.tabs a.tab { text-decoration: none; display: inline-block; }
@media (max-width: 900px) {
    .report-filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    /* a chart of many months keeps a readable size and scrolls sideways inside its card, instead of shrinking its labels to nothing */
    .chart-box.many { overflow-x: auto; }
    .chart-box.many svg { min-width: 560px; }
    .report-filter-grid { grid-template-columns: 1fr; }
    .dash-item { flex-direction: column; gap: 2px; }
    .dash-tag { flex: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
    .totals { width: 100%; }
}

@media (max-width: 760px) {
    .sidebar { display: none; }
    .hamburger { display: inline-flex; }
    .topbar .search { display: none; }
    .content { padding: 12px 12px 76px; }
    .kv { grid-template-columns: 1fr; gap: 1px 0; }
    .kv .k { margin-top: 7px; }

    .mobile-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        background: var(--card); border-top: 1px solid var(--border);
        padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); z-index: 50;
    }
    .mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
        font-size: 10.5px; color: var(--muted); padding: 4px 0; text-decoration: none; }
    .mobile-nav a.active { color: var(--accent-dark); font-weight: 700; }
    .mobile-nav a .ic { font-size: 16px; }

    .drawer-back { position: fixed; inset: 0; background: rgba(20,24,29,.5); z-index: 90; }
    .drawer { position: fixed; top: 0; bottom: 0; left: 0; width: 250px; background: var(--ink);
        z-index: 100; padding: 14px 10px; overflow-y: auto; }

    /* ---------- responsive list rows: status visible without opening the item ----------
       A wide multi-column table has nowhere to put a rightmost "Status" column on a phone —
       it either scrolls off-screen or gets so cramped it's unreadable, so the only way to
       see a quote's status was to open it. Turning each <tr> into a flex row
       (via `order`, not by changing markup or column count, so desktop's <table> layout is
       completely untouched above this breakpoint) puts the title and status pill on the same
       first line — status right there at a glance — with every other column dropping to its
       own compact line below. Opt-in per table via `tbl-responsive`; the two cells that get
       promoted onto that first line are tagged `mc-title` / `mc-status`, everything else
       needs no markup change at all. */
    .tbl-responsive thead { display: none; }
    .tbl-responsive, .tbl-responsive tbody { display: block; width: 100%; }
    .tbl-responsive tbody tr {
        display: flex; flex-wrap: wrap; align-items: flex-start;
        gap: 3px 10px; padding: 12px; border-bottom: 1px solid #eef1f4;
    }
    .tbl-responsive tbody tr:last-child { border-bottom: none; }
    .tbl-responsive td {
        display: block; order: 3; flex: 1 1 100%;
        padding: 0; border: none; text-align: left;
        font-size: 12.5px; color: var(--muted);
    }
    .tbl-responsive td.mc-title {
        /* flex-basis 0 (not auto) so a long title's natural width can't push flex-wrap into
           starting a whole new line for the status pill — the pill must always land on the
           title's own first line. Overflow truncates a too-long single-line title instead of
           wrapping it (the full text is one tap away); a naturally multi-line cell, like
           a name-plus-contact block, still renders both of its own lines fine since
           white-space:nowrap only stops in-line text from wrapping, not a nested <div> from
           starting its own line. */
        order: 1; flex: 1 1 0; min-width: 0;
        font-weight: 700; font-size: 13.5px; color: var(--text);
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .tbl-responsive td.mc-status { order: 2; flex: 0 0 auto; }
    /* A name whose end is what tells two rows apart (the tariff library's plans) wraps instead of being cut off. */
    .tbl-responsive td.mc-title.mc-wrap { white-space: normal; overflow: visible; text-overflow: clip; }
    /* A cell that carries a data-label says what it is on a phone, where the column headings are gone ("Owner: Us", "To do: 6 open"). */
    .tbl-responsive td[data-label]::before { content: attr(data-label) ": "; color: var(--faint); }
    /* Card headers wrap on a phone, so a search box, filters, a count and a button never push each other off the screen. */
    .card-head { flex-wrap: wrap; }
}

/* ---------- catalogue ---------- */
.faint-row td { color: var(--faint); }
.rates { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.rate-card { border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--card); }
.rate-head { display: flex; flex-direction: column; gap: 1px; }
.tier-row { display: grid; grid-template-columns: 54px 1fr 40px 1fr; align-items: center; gap: 6px; }
.tier-row input { min-width: 0; }
.kv > div { min-width: 0; overflow-wrap: anywhere; }

/* ---------- organisation switcher (top bar) ---------- */
.org-switch {
    max-width: 220px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--text);
    font-size: 13px;
}

/* ==========================================================================
   Step A2: workflow, survey, energy, tariffs
   ========================================================================== */

.grow { flex: 1 1 140px; min-width: 0; }
.section-gap { margin-top: 16px; }
.hint { font-size: 11.5px; color: var(--faint); }
.field-error { color: var(--red); font-size: 12px; }
.field-warn { color: var(--amber-dark); font-size: 12px; }
.req { color: var(--red); }
.card-head.clickable { cursor: pointer; user-select: none; }
.chev { color: var(--muted); }
.mb12 { margin-bottom: 12px; }
.save-bar { position: sticky; bottom: 62px; background: var(--paper); padding: 8px 0; z-index: 10; }

/* ---------- chips ---------- */
.row-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #eef1f4; color: #33404c; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }
.chip-x { border: none; background: transparent; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); padding: 0 0 0 2px; }
.chip-btn { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text); }
.chip-btn:hover { background: #f7f9fa; }
.chip-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-btn:disabled { opacity: .55; cursor: not-allowed; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; }

/* ---------- workflow stage bar ---------- */
.stage-bar { display: flex; gap: 0; overflow-x: auto; align-items: stretch; padding-bottom: 2px; }
.stage-bar.other { gap: 6px; align-items: center; flex-wrap: wrap; overflow: visible; }
.stage-step {
    flex: 1 0 auto; min-width: 104px; padding: 9px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    border: 1px solid var(--border); background: var(--card); color: var(--muted); margin-left: -1px;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
    padding-left: 22px; padding-right: 20px;
}
.stage-bar .stage-step:first-child { margin-left: 0; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 14px; }
.stage-bar.other .stage-step { flex: 0 0 auto; min-width: 0; clip-path: none; border-radius: 999px; padding: 5px 14px; margin-left: 0; }
.stage-step:hover:not(:disabled) { background: #f4f7fa; }
.stage-step:disabled { cursor: default; }
.stage-step.past { background: #eef6f1; color: #2c6e4f; }
.stage-step.active { color: #fff; border-color: transparent; background: var(--grey); }
.stage-step.active.blue { background: var(--blue); }
.stage-step.active.amber { background: var(--amber); }
.stage-step.active.green { background: var(--green); }
.stage-step.active.red { background: var(--red); }
.stage-step.active.purple { background: var(--purple); }

/* ---------- action checklist ---------- */
.action-list { display: flex; flex-direction: column; }
.action-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 150px 140px 32px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eef1f4; }
.action-row.done .action-title { text-decoration: line-through; color: var(--faint); }
.action-title { border-color: transparent; background: transparent; padding: 3px 6px; font-weight: 600; }
.action-title:hover, .action-title:focus { background: var(--card); border-color: var(--border); }
.action-row select, .action-row input[type=date] { padding: 5px 7px; font-size: 12.5px; }
.overdue { color: var(--red); font-weight: 600; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- kanban ---------- */
.view-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kanban-col { flex: 0 0 260px; background: #e9edf1; border-radius: var(--radius); padding: 8px; min-height: 120px; border-top: 3px solid var(--grey); }
.kanban-col.blue { border-top-color: var(--blue); }
.kanban-col.amber { border-top-color: var(--amber); }
.kanban-col.green { border-top-color: var(--green); }
.kanban-col.red { border-top-color: var(--red); }
.kanban-col.purple { border-top-color: var(--purple); }
.kanban-col.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kanban-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 8px; font-weight: 700; font-size: 13px; }
.kanban-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.kanban-card:active { cursor: grabbing; }
.kanban-card .title { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.kanban-card .sub { color: var(--muted); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.kanban-card select { margin-top: 8px; font-size: 12px; padding: 4px 6px; }
.kanban-card .badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.kanban-empty { color: var(--faint); font-size: 12px; padding: 6px; }

/* ---------- survey ---------- */
.survey-section .card-head h3 { font-size: 14px; }
.record-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fcfdfe; }
.record-name { max-width: 180px; font-weight: 700; }
.plane-tabs { margin-bottom: 4px; }
.issue-list { border-left: 3px solid var(--amber); padding: 6px 12px; background: #fffaf0; border-radius: 0 8px 8px 0; }
.photo-block { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); }
.photo-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); }
.photo img { width: 100%; height: 110px; object-fit: cover; display: block; }
.photo figcaption { display: flex; gap: 2px; align-items: center; padding: 4px; }
.photo figcaption input { font-size: 12px; padding: 3px 6px; }

/* ---------- energy ---------- */
.usage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.load-row { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #eef1f4; }
.load-row input[type=number] { width: 84px; }
.load-row input:not([type=number]) { flex: 1 1 130px; min-width: 100px; }
.load-row select { width: 84px; }
.interval-box .note-item { margin-bottom: 8px; }
.usage-chart .month-chart { height: 190px; gap: 6px; }
.usage-chart .month-col { min-width: 0; }
.usage-chart .month-value { font-size: 10px; white-space: nowrap; }
.usage-chart .month-bars { width: 100%; justify-content: center; }
.usage-chart .month-bar { width: 42%; max-width: 22px; }
.month-bar.paid { background: var(--green); }
.usage-chart .legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; background: var(--grey); }
.swatch.primary { background: var(--blue); }
.swatch.paid { background: var(--green); }
.day-chart { display: flex; align-items: flex-end; gap: 3px; height: 100px; }
.day-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.day-bar { width: 100%; background: var(--blue); border-radius: 2px 2px 0 0; min-height: 1px; }
.day-label { font-size: 10px; color: var(--faint); height: 14px; }

/* ---------- tariffs ---------- */
.tariff-period { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #fcfdfe; }
.tariff-period .head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tariff-period .head input.name { flex: 1 1 200px; font-weight: 700; }
.tier-line { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 6px; }
.tier-line input { width: 96px; }
.schedule-block { border-left: 3px solid var(--blue); padding: 6px 10px; margin-top: 8px; background: #f6f9fd; border-radius: 0 8px 8px 0; }
.day-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.hour-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; margin-top: 4px; }
.hour-cell { border: 1px solid var(--border); background: var(--card); border-radius: 5px; padding: 4px 0; font: inherit; font-size: 11px; cursor: pointer; text-align: center; color: var(--muted); }
.hour-cell.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.date-range-row { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 4px; }
.date-range-row select { width: 84px; padding: 4px 6px; font-size: 12.5px; }
.date-range-row input { width: 60px; padding: 4px 6px; font-size: 12.5px; }
.schedule-text { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check-ok { color: var(--green); }
.tariff-check { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--border); background: #f6fbf8; }
.tariff-check.bad { background: #fdf3f3; border-color: #f1c9c9; }
.tariff-check.warn { background: #fffaf0; border-color: #f0d9ae; }

@media (max-width: 760px) {
    .action-row { grid-template-columns: 22px minmax(0, 1fr) 32px; }
    .action-row .action-who, .action-row .action-due { grid-column: 2 / 3; }
    .stage-step { min-width: 92px; padding-left: 18px; padding-right: 16px; font-size: 12.5px; }
    .kanban-col { flex-basis: 78vw; }
    .hour-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
    .usage-chart .month-value { display: none; }
    .save-bar { bottom: 58px; }
}

/* Filter bars: controls keep their natural width instead of each taking a full row. */
.filter-bar select { width: auto; max-width: 190px; }
.filter-bar input.tag-filter { width: 110px; }
.filter-bar .search input, .card-head .search input { width: 250px; }
@media (max-width: 760px) {
    .filter-bar select { flex: 1 1 140px; max-width: none; }
    .filter-bar input.tag-filter { flex: 1 1 110px; }
    /* The list searches stay on a phone (only the top bar's own search is dropped there): full width, above the filters. */
    .filter-bar .search, .card-head .search { flex: 1 1 100%; }
    .filter-bar .search input, .card-head .search input { width: 100%; flex: 1; }
}

/* ---------- systems, strings and results (step S1) ---------- */
.sys-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sys-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; font: inherit; cursor: pointer;
    background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; min-width: 150px; max-width: 100%; }
.sys-chip:hover { border-color: var(--accent); }
.sys-chip.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31, 111, 235, .18); }
.sys-chip.archived { opacity: .65; }
.sys-chip .small { color: var(--muted); }

.design-tbl td { vertical-align: top; }
.design-tbl input, .design-tbl select { min-width: 74px; }
.design-tbl td:nth-child(1) input { min-width: 120px; }
.design-tbl td:nth-child(2) select { min-width: 190px; }
.layout-cell { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.layout-cell input { width: 62px; min-width: 0; }
.form-grid.excl-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; align-items: start; }
.form-grid.excl-row .field:last-child { padding-top: 20px; }
@media (max-width: 600px) { .form-grid.excl-row { grid-template-columns: 1fr; } .form-grid.excl-row .field:last-child { justify-self: end; } }
.layout-cell label.mini { display: flex; flex-direction: column; gap: 1px; font-size: 11px; color: var(--muted, #5b6573); }
.layout-cell label.mini span { line-height: 1.1; white-space: nowrap; }
.layout-cell label.mini input { width: 92px; min-width: 76px; }
.layout-cell select { width: auto; max-width: 200px; }

.inverter-block { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: #fcfdfe; }
.inverter-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.inverter-head select { flex: 1 1 240px; width: auto; min-width: 0; max-width: 100%; }
.inverter-head .qty, .other-row .qty { width: 72px; }
.string-grid { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.string-row { display: grid; grid-template-columns: 76px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) 56px 36px; gap: 8px; align-items: center; }
.string-row.head { align-items: end; }
.string-row .num { text-align: right; }
.other-row { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid #eef1f4; }
.battery-row { padding-bottom: 8px; border-bottom: 1px solid #eef1f4; margin-bottom: 8px; }

.check-report { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-top: 10px; background: #f6fbf8; }
.check-report.warn { background: #fffaf0; border-color: #f0d9ae; }
.check-report.bad { background: #fdf3f3; border-color: #f1c9c9; }
.check-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.check-list { list-style: none; margin: 6px 0 0; padding: 0; }
.check-line { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; font-size: 13px; }
.check-line .mark { flex: 0 0 18px; text-align: center; font-weight: 700; }
.check-line.bad .mark { color: var(--red); }
.check-line.warn .mark { color: var(--amber-dark); }
.check-line.ok .mark { color: var(--green); }
/* The engineer's design card (step R1): one box for an east-west pair or a ground array no certificate covers. */
.engineer-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-top: 12px; background: var(--card); }
.engineer-card.needed { border-color: var(--amber); }
.engineer-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.engineer-read { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 8px 0 0; font-size: 13px; }
.engineer-read dt { color: var(--muted); }
.engineer-read dd { margin: 0; overflow-wrap: anywhere; }
.check-passes { margin-top: 6px; }
.check-passes summary { cursor: pointer; }

.chart-box svg { width: 100%; height: auto; display: block; }
.results-tbl td, .results-tbl th { padding: 7px 10px; }
.results-tbl tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: none; background: #fafbfc; }
.assumptions summary { cursor: pointer; }

@media (max-width: 900px) {
    .string-row { grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr) 52px 36px; }
    .string-row > :nth-child(2) { grid-column: 2 / 4; }
}

@media (max-width: 760px) {
    /* The wide editing tables become one card per row, each cell captioned by its data-label. */
    .design-tbl thead, .results-tbl thead { display: none; }
    .design-tbl, .design-tbl tbody, .design-tbl tfoot, .results-tbl, .results-tbl tbody, .results-tbl tfoot { display: block; width: 100%; }
    .design-tbl tbody tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--border); }
    .design-tbl td { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-items: center; padding: 4px 0; border: none; }
    .design-tbl td::before { content: attr(data-label); font-size: 11.5px; font-weight: 700; color: var(--muted); }
    .design-tbl td[data-label=""]::before { content: none; }
    .design-tbl td .hint { grid-column: 2; }
    .design-tbl td > .layout-cell, .design-tbl td > input, .design-tbl td > select { min-width: 0; }
    .results-tbl tbody tr, .results-tbl tfoot tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 8px 12px; border-bottom: 1px solid #eef1f4; }
    .results-tbl td { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; border: none; font-size: 12.5px; background: none; }
    .results-tbl td::before { content: attr(data-label); color: var(--muted); font-size: 11.5px; }
    .results-tbl td:first-child { grid-column: 1 / -1; font-weight: 700; }
    .results-tbl td:first-child::before { content: none; }
    .string-row { grid-template-columns: 1fr 1fr; }
    .string-row.head { display: none; }
    .string-row > :nth-child(2) { grid-column: 1 / -1; }
    .string-row > span[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); }
    .string-row { padding: 8px 0; border-bottom: 1px solid #eef1f4; }
    .sys-chip { flex: 1 1 100%; }
}

/* ---------- bill of materials and pricing (step S2) ---------- */
.bom-group { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.bom-group > summary { cursor: pointer; padding: 9px 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.bom-group[open] > summary { border-bottom: 1px solid var(--border); }
.bom-group .table-wrap { padding: 0; }
.why-row td { background: #fafbfc; }
.why { padding: 8px 4px; font-size: 13px; }
.check-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-bottom: 4px; }
.split-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px solid #eef1f4; font-size: 13px; }
.run-row { padding: 8px 12px; border-bottom: 1px solid #eef1f4; }
.run-row:last-child { border-bottom: none; }
.run-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.results-tbl tr.total-row td { font-weight: 700; border-top: 2px solid var(--border); background: #fafbfc; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.band-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.band-grid .field label { font-size: 11.5px; }
.licensed-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: var(--card); }
@media (max-width: 760px) {
    .results-tbl tr.total-row td { border-top: none; }
    .bom-group > summary { padding: 8px 10px; }
}

/* ==========================================================================
   The proposal as a web page (step S3): the customer's link and the company's preview.
   The company's colour arrives as --pp-accent on .pp-layout; everything else is the
   platform's tokens. Phone first: one column, the side panel on top and a fixed
   "Review and accept" bar at the bottom.
   ========================================================================== */
.pp-shell { min-height: 100vh; background: var(--paper); padding: 18px 14px 96px; }
.pp-layout { --pp-accent: #1f6feb; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; max-width: 1180px; margin: 0 auto; align-items: start; }
.pp-staff-preview { margin-top: 16px; }
.pp-staff-preview .pp-layout { max-width: none; }
.pp-main { min-width: 0; }
.pp-side { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 14px; }
.pp-side-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.pp-side-card h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pp-side-card h4:not(:first-child) { margin-top: 14px; }
.pp-preview { background: #fdf1dc; color: #96620a; border-radius: 8px; padding: 6px 9px; font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.pp-choices { display: flex; flex-direction: column; gap: 6px; }
.pp-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); cursor: pointer; font: inherit; color: var(--text); }
.pp-choice small { color: var(--muted); }
.pp-choice:hover { border-color: var(--pp-accent); }
.pp-choice.on { border-color: var(--pp-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pp-accent) 25%, transparent); font-weight: 600; }
.pp-side-total { display: flex; flex-direction: column; margin: 14px 0 10px; }
.pp-side-total span { font-size: 12px; color: var(--muted); }
.pp-side-total strong { font-size: 26px; color: var(--pp-accent); font-weight: 600; }
.pp-side-total small { color: var(--muted); }
.pp-rep { display: flex; flex-direction: column; gap: 2px; word-break: break-word; }

.pp-cover, .pp-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.pp-section { margin-top: 16px; }
.pp-cover { padding: 0 0 22px; overflow: hidden; }
.pp-cover > *:not(.pp-hero):not(.pp-hero-bar) { margin-left: 22px; margin-right: 22px; }
.pp-hero { width: 100%; height: 200px; object-fit: cover; display: block; }
.pp-hero-bar { height: 10px; background: var(--pp-accent); }
.pp-cover-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-top: 16px; flex-wrap: wrap; }
.pp-logo { max-height: 54px; max-width: 220px; object-fit: contain; }
.pp-logo-text { font-size: 22px; font-weight: 700; color: var(--pp-accent); }
.pp-cover-meta { text-align: right; }
.pp-title { text-align: center; font-size: 28px; font-weight: 400; margin: 18px 22px 6px; }
.pp-for { text-align: center; }
.pp-greeting { margin-top: 18px; margin-bottom: 8px; }
.pp-signoff { margin-top: 14px; }

.pp-section h2, .pp-cover h2 { text-align: center; font-size: 24px; font-weight: 400; margin: 0 0 14px; }
.pp-h2-gap { margin-top: 26px !important; }
.pp-section h3.center { font-weight: 500; font-size: 15px; }
.pp-sub { text-align: center; font-size: 19px; font-weight: 400; margin: 20px 0 10px; }
.pp-sub.left { text-align: left; font-size: 16px; margin: 6px 0; }
.pp-list { margin: 0 0 8px; padding-left: 20px; }
.pp-notice { margin-top: 16px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; }
.pp-notice.good { background: #e4f6ee; color: #14714c; }
.pp-notice.warn { background: #fdf1dc; color: #96620a; }

.pp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); }
.pp-kpi { text-align: center; padding: 0 8px; border-left: 1px solid var(--border); }
.pp-kpi:first-child { border-left: none; }
.pp-kpi-value { font-size: 32px; font-weight: 300; line-height: 1.15; }
.pp-kpi-value small { font-size: 13px; }
.pp-kpi-label { font-size: 12.5px; margin-top: 3px; }
.pp-kpi.hi .pp-kpi-value, .pp-kpi.hi .pp-kpi-label { color: var(--pp-accent); }
.pp-design { margin: 18px 0 0; text-align: center; }
.pp-design img { width: 100%; max-width: 900px; height: auto; max-height: 640px; object-fit: contain; border-radius: 10px; }
.pp-chart svg { width: 100%; height: auto; display: block; }
.pp-design .pp-credit { margin-top: 4px; font-size: 11px; color: var(--muted); }
.pp-design .pp-chart { max-width: 720px; margin: 0 auto; }
.pp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; }
.pp-card { display: flex; gap: 10px; justify-content: space-between; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.pp-card h4 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.pp-card-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; align-items: flex-start; }
.pp-card-text .btn { margin-top: 8px; }
.pp-strong { font-weight: 700; }
.pp-card-img { width: 84px; height: 120px; object-fit: contain; flex: 0 0 auto; }

.pp-perf { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; }
.pp-big { text-align: center; }
.pp-big div { font-size: 38px; font-weight: 300; }
.pp-env { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.pp-env-box { border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.pp-env-box h4 { font-weight: 500; margin-bottom: 8px; }
.pp-env-row { display: flex; gap: 8px; justify-content: space-around; }
.pp-env-row div { display: flex; flex-direction: column; flex: 1; font-size: 11.5px; }
.pp-env-row strong { font-size: 20px; font-weight: 400; }
.pp-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 640px; margin: 0 auto; }
.pp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.pp-sunpath { max-width: 420px; margin: 0 auto; }
.pp-months th, .pp-months td { padding: 5px 4px; font-size: 12px; }
.pp-total td { font-weight: 700; background: var(--paper); }
.pp-two > div { min-width: 0; }

.pp-table th { white-space: normal; text-align: center; font-size: 11px; background: color-mix(in srgb, var(--pp-accent) 10%, #fff); }
.pp-table td { text-align: center; padding: 6px 8px; }
/* "Compare your options" (step S2): a table on a laptop, one card for each option on a phone. */
.pp-compare th.left, .pp-compare td.left { text-align: left; }
.pp-compare td { vertical-align: middle; }
.pp-compare tr.pp-rec td { background: color-mix(in srgb, var(--pp-accent) 9%, #fff); }
.pp-tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--pp-accent); letter-spacing: .02em; }
.pp-compare-cards { display: none; }
.pp-compare-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.pp-compare-card.pp-rec { border-color: var(--pp-accent); background: color-mix(in srgb, var(--pp-accent) 6%, #fff); }
.pp-compare-card h4 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.pp-compare-card dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 0; }
.pp-compare-card dt { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.pp-compare-card dd { margin: 0; text-align: right; font-weight: 600; }
.pp-compare-card dd small { display: block; font-weight: 400; color: var(--muted); }
.pp-tariff { margin-top: 16px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pp-tariff-head { background: #d9dde2; padding: 10px 12px; font-weight: 700; }
.pp-tariff-group { background: var(--paper); padding: 8px 12px; font-weight: 700; }
.pp-tariff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border); }

.pp-equation { display: flex; align-items: flex-start; justify-content: center; gap: 12px; text-align: center; flex-wrap: wrap; margin: 6px 0 12px; }
.pp-equation > div { display: flex; flex-direction: column; }
.pp-equation strong { font-size: 32px; font-weight: 300; }
.pp-equation .op { font-size: 26px; align-self: center; }
.pp-equation .hi, .pp-equation .hi strong { color: var(--pp-accent); }
.pp-quote { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pp-quote-summary { padding: 10px 12px; }
.pp-quote-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--border); }
.pp-quote-row.shaded { background: var(--paper); font-weight: 700; }
.pp-quote-row small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.pp-disclosures { margin-top: 16px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.pp-disc-group { margin-top: 10px; }
.pp-disc-group h4 { font-size: 13.5px; margin: 0 0 3px; }
.pp-disc-group p { margin: 2px 0; }
.pp-excl { margin: 2px 0 0; padding-left: 18px; }
.pp-milestone { font-weight: 400; }
.pp-howtopay { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: var(--paper); text-align: left; }
.pp-howtopay h4 { font-size: 13.5px; margin: 0 0 4px; }
.pp-account { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 4px 0 0; font-size: 13.5px; }
.pp-account dt { color: var(--muted); }
.pp-account dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.pp-accept-card { margin-top: 18px; border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.pp-accept-card h3 { font-size: 20px; font-weight: 400; margin-bottom: 8px; }
.pp-foot { text-align: center; padding: 22px 8px 6px; }
.pp-bottom-bar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--card); border-top: 1px solid var(--border); box-shadow: 0 -4px 14px rgba(20, 24, 29, .12); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); align-items: center; justify-content: space-between; gap: 12px; }
.pp-bottom-bar > div { display: flex; flex-direction: column; }
.pp-bottom-bar strong { font-size: 18px; }
.pp-dead { max-width: 480px; margin: 12vh auto; text-align: center; padding: 0 16px; color: var(--muted); }
.pp-dead .big { font-size: 40px; opacity: .5; }

@media (max-width: 900px) {
    .pp-layout { grid-template-columns: 1fr; }
    /* the side panel sits BELOW the page on a phone (the cover letter comes first); the option choosers move up to just after the letter (.pp-picker-inline) and leave the side panel (.pp-picker-side) */
    .pp-side { position: static; }
    .pp-picker-side { display: none; }
    .pp-bottom-bar { display: flex; }
}
@media (max-width: 640px) {
    .pp-shell { padding: 10px 10px 90px; }
    .pp-cover, .pp-section { padding: 16px 14px; }
    .pp-cover { padding: 0 0 16px; }
    .pp-cover > *:not(.pp-hero):not(.pp-hero-bar) { margin-left: 14px; margin-right: 14px; }
    .pp-title { font-size: 22px; margin-left: 14px; margin-right: 14px; }
    .pp-kpis { grid-template-columns: 1fr 1fr; row-gap: 14px; }
    .pp-kpi:nth-child(odd) { border-left: none; }
    .pp-perf { grid-template-columns: 1fr; }
    .pp-env, .pp-two, .pp-tiles { grid-template-columns: 1fr; }
    .pp-env-row { flex-wrap: wrap; }
    .pp-tariff-row, .pp-quote-row { grid-template-columns: 1fr; gap: 2px; }
    .pp-equation strong { font-size: 26px; }
    .pp-hero { height: 140px; }
    .pp-compare-wide { display: none; }
    .pp-compare-cards { display: grid; gap: 10px; }
}

/* ---------- design studio: the map (step D1) ---------- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--card); }
.seg button { font: inherit; font-weight: 600; font-size: 13px; padding: 7px 14px; border: 0; background: transparent; color: var(--muted); cursor: pointer; min-height: 36px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--accent); color: #fff; }
.seg button:disabled { opacity: .55; cursor: not-allowed; }
.design-switch { margin-bottom: 14px; }

.studio { display: flex; flex-direction: column; gap: 12px; }
.studio .card + .card { margin-top: 0; }
.studio-search { position: relative; }
.studio-hits { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.studio-hits li + li { border-top: 1px solid var(--border); }
.studio-hit { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; font: inherit; color: var(--text); background: transparent; border: 0; padding: 10px 12px; cursor: pointer; min-height: 44px; }
.studio-hit:hover, .studio-hit:focus-visible { background: #eef3fb; outline: none; }
.studio-confirm { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31, 111, 235, .15); }
.studio-stage { position: relative; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #dfe5ea; }
.studio-map { position: relative; width: 100%; height: clamp(340px, 64vh, 680px); }
.studio-note { position: absolute; left: 10px; top: 10px; max-width: calc(100% - 70px); padding: 6px 10px; border-radius: 8px; background: rgba(17, 28, 43, .82); color: #fff; font-size: 12.5px; pointer-events: none; z-index: 2; }
.studio-note.warn { background: rgba(163, 46, 46, .92); }
.studio-attrib { position: absolute; left: 0; bottom: 0; z-index: 3; max-width: calc(100% - 110px); padding: 3px 8px; background: rgba(255, 255, 255, .85); color: #1a2739; font-size: 11.5px; line-height: 1.35; border-top-right-radius: 8px; }
.studio-attrib a { color: #1858c4; margin-left: 4px; }
.studio-pin { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; background: var(--red); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); transform: rotate(-45deg); }
.studio-building { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 4px; border: 1px solid var(--border); border-radius: 10px; background: #fff8e6; }
.studio-roofs { list-style: none; margin: 12px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.studio-roofs li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; }
.studio-tools .btn, .studio .btn { min-height: 38px; }
.maplibregl-ctrl-group button { min-width: 36px; min-height: 36px; }

@media (max-width: 760px) {
    .studio-map { height: clamp(300px, 58vh, 520px); }
    .studio-attrib { font-size: 11px; max-width: calc(100% - 96px); }
}

/* ---------- design studio: the roof editor (step D2) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.studio-building-card .studio-building { margin-bottom: 0; }
.studio-system select { min-height: 38px; max-width: 260px; }
.studio-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.studio-toolbar .btn { min-height: 40px; }
.studio-toolbar-gap { flex: 1 1 8px; }
.studio-tabs { display: flex; flex-wrap: wrap; max-width: 100%; }
.studio-tabs button { flex: 1 1 auto; }
.studio-roofs li { padding: 0; }
.studio-roofs li.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31, 111, 235, .18); }
.studio-roof-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; min-height: 44px; padding: 9px 12px; text-align: left; font: inherit; color: var(--text); background: transparent; border: 0; cursor: pointer; }
.studio-roof-pick:hover, .studio-roof-pick:focus-visible { background: #eef3fb; outline: none; }
.studio-edges { display: flex; flex-direction: column; gap: 6px; }
.studio-edge { display: grid; grid-template-columns: 14px minmax(120px, 1fr) minmax(130px, 200px) auto; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 10px; }
.studio-edge.active { border-color: var(--accent); background: #f2f7ff; }
.studio-edge select { min-height: 40px; }
.studio-edge-pick { font: inherit; text-align: left; color: var(--text); background: transparent; border: 0; padding: 8px 4px; min-height: 44px; cursor: pointer; }
.studio-edge .setback { white-space: nowrap; }
.edge-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); background: #ffffff; }
.edge-gutter { background: #1f6feb; }
.edge-flatgutter { background: #0ca5b0; }
.edge-ridge { background: #d64545; }
.edge-hip { background: #e8590c; }
.edge-valley { background: #9b59b6; }
.edge-rake { background: #1f9d6b; }
.edge-shared { background: #8a97a5; }
.studio-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.nudge { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 12px; }
.nudge > div { display: flex; gap: 6px; }
.nudge .btn { min-width: 52px; min-height: 44px; font-size: 16px; }

@media (max-width: 760px) {
    .studio-edge { grid-template-columns: 14px 1fr; }
    .studio-edge select { grid-column: 1 / -1; }
    .studio-edge .setback { grid-column: 1 / -1; }
    .studio-toolbar .btn { flex: 1 1 calc(33% - 8px); }
}

/* ---------- design studio: the design image (step D3) ---------- */
.studio-image { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }
.studio-image-thumb { width: min(100%, 280px); aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); border-radius: 10px; background: #dfe5ea; }
.studio-image-text { flex: 1 1 220px; min-width: 0; }
.design-pictures { list-style: none; margin: 0; padding: 0; }
.design-pictures li { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; padding: 12px 14px; }
.design-pictures li + li { border-top: 1px solid var(--border); }
.design-picture-thumb { width: min(100%, 240px); aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); border-radius: 10px; background: #dfe5ea; }
.design-picture-thumb.empty-thumb { display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 12.5px; }
.design-picture-body { flex: 1 1 240px; min-width: 0; }
.studio-capture-note { margin-top: 8px; }
@media (max-width: 760px) {
    .studio-toolbar .studio-zoom-btn { flex: 1 1 calc(50% - 8px); }
    .studio-toolbar .studio-capture-btn { flex: 1 1 100%; }
    .studio-image-thumb, .design-picture-thumb { width: 100%; }
    .design-pictures li { padding: 12px; }
}
.design-pictures .btn { min-height: 40px; }

/* Smart site data (step L2): the Site data tab of the studio. */
.studio-site .studio-heat-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.studio-site .studio-heat-bar { display: inline-block; width: 160px; max-width: 40vw; height: 12px; border-radius: 6px; border: 1px solid var(--border); }
.studio-site-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.studio-site-charts > div { min-width: 0; }
.site-chart { background: #fff; border-radius: 10px; border: 1px solid var(--border); padding: 6px; max-width: 520px; margin: 0 auto; }
.site-chart svg { display: block; width: 100%; height: auto; }
.studio-detect { margin-top: 8px; }
/* ---------- install calendar (step O2) ---------- */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cal-views { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.cal-views button { border: 0; background: var(--card); padding: 6px 13px; min-height: 38px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.cal-views button + button { border-left: 1px solid var(--border); }
.cal-views button.active { background: var(--accent); color: #fff; }
.cal-nav { display: inline-flex; gap: 6px; }
.cal-nav .btn { min-height: 38px; min-width: 40px; }
.cal-title { font-weight: 700; font-size: 16px; flex: 1 1 160px; min-width: 0; }
.cal-layers { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-layer { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; min-height: 36px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--card); cursor: pointer; }
.cal-layer.on { color: var(--text); border-color: var(--accent); background: #f2f7ff; }
.cal-layer input { width: auto; margin: 0; }
.cal-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 260px)); gap: 10px; }
.cal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--grey); flex: 0 0 auto; }
.cal-dot.blue { background: var(--blue); }
.cal-dot.green { background: var(--green); }
.cal-dot.amber { background: var(--amber); }
.cal-dot.red { background: var(--red); }
.cal-dot.purple { background: var(--purple); }
.cal-busy { opacity: .6; transition: opacity .15s; }

/* month grid */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); background: var(--card); border-radius: var(--radius); overflow: hidden; margin-top: 16px; }
.cal-dow { padding: 6px 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-day { position: relative; min-height: 112px; padding: 4px 5px 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.cal-day.other { background: #fafbfc; }
.cal-day.other .cal-daynum { color: var(--faint); }
.cal-day.today { background: #f2f7ff; }
.cal-day.today .cal-daynum { background: var(--accent); color: #fff; }
.cal-daynum { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text); min-width: 26px; min-height: 26px; border-radius: 999px; cursor: pointer; }
.cal-daynum:hover { background: #eef1f4; }
.cal-day.today .cal-daynum:hover { background: var(--accent-dark); }
.cal-count { display: none; }
.cal-more { border: 0; background: transparent; padding: 2px 4px; font: inherit; font-size: 11.5px; color: var(--blue); cursor: pointer; }
.cal-chip { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--grey); background: #eef1f4; border-radius: 5px; padding: 2px 6px; margin-top: 2px; font: inherit; font-size: 11.5px; line-height: 1.35; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal-chip .t { font-weight: 700; margin-right: 5px; }
.cal-chip.blue, .cal-card.blue { border-left-color: var(--blue); background: #e8f0fb; }
.cal-chip.green, .cal-card.green { border-left-color: var(--green); background: #e4f6ee; }
.cal-chip.amber, .cal-card.amber { border-left-color: var(--amber); background: #fdf1dc; }
.cal-chip.red, .cal-card.red { border-left-color: var(--red); background: #fbe8e8; }
.cal-chip.purple, .cal-card.purple { border-left-color: var(--purple); background: #f2e8f7; }
.cal-chip.movable, .cal-card.movable { cursor: grab; }
.cal-chip:focus-visible, .cal-card:focus-visible, .cal-row:focus-visible, .cal-daynum:focus-visible, .cal-more:focus-visible, .cal-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-drop { outline: 2px dashed var(--accent); outline-offset: -2px; background: #eaf2ff; }

/* week and day */
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.cal-dayview { margin-top: 16px; }
.cal-col { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; min-height: 180px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cal-col.today { border-color: var(--accent); background: #f8fbff; }
.cal-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cal-daylink { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; text-transform: inherit; letter-spacing: inherit; font-weight: 700; }
.cal-card { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--grey); background: #eef1f4; border-radius: 7px; padding: 6px 8px; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; overflow-wrap: anywhere; }
.cal-card .when { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.cal-card .what { font-weight: 600; }
.cal-card .more { font-size: 11.5px; color: var(--muted); }
.cal-add { margin-top: auto; border: 1px dashed var(--border); background: transparent; border-radius: 7px; min-height: 32px; color: var(--faint); font: inherit; font-size: 16px; cursor: pointer; }
.cal-add:hover { color: var(--accent); border-color: var(--accent); }

/* agenda */
.cal-agenda { margin-top: 16px; }
.cal-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 11px 14px; min-height: 52px; border: 0; border-bottom: 1px solid #eef1f4; background: transparent; font: inherit; text-align: left; color: var(--text); cursor: pointer; }
.cal-row:last-child { border-bottom: none; }
.cal-row:hover { background: #fafbfc; }
.cal-time { flex: 0 0 62px; font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.cal-row .cal-dot { margin-top: 5px; }
.cal-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; overflow-wrap: anywhere; }
.cal-rowtitle { font-weight: 600; }

@media (max-width: 900px) {
    .cal-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    /* a phone: the month is a grid of day numbers with a count (tap a day to open it), the week stacks, and every control is thumb-sized */
    .cal-views { width: 100%; }
    .cal-views button { flex: 1 1 0; min-height: 44px; padding: 6px 4px; }
    .cal-nav { width: 100%; }
    .cal-nav .btn { flex: 1 1 0; min-height: 44px; }
    .cal-layer { min-height: 44px; }
    .cal-day { min-height: 56px; padding: 2px; }
    .cal-daynum { min-width: 32px; min-height: 32px; }
    .cal-chips, .cal-more { display: none; }
    .cal-count { display: inline-block; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 0 6px; margin-left: 2px; }
    .cal-week { grid-template-columns: minmax(0, 1fr); }
    .cal-col { min-height: 0; }
    .cal-card, .cal-add { min-height: 44px; }
}
@media print {
    .cal-bar, .cal-add { display: none !important; }
    .cal-chip, .cal-card, .cal-dot, .cal-day.today, .cal-col.today { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .cal-chip { white-space: normal; }
    .cal-day { min-height: 90px; }
}

.cal-options > summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); min-height: 36px; display: flex; align-items: center; }
@media (min-width: 761px) {
    .cal-options > summary { display: none; }
}

/* ---- single-line diagram (step S1): the A4 landscape drawing scrolls sideways on a phone instead of shrinking to nothing ---- */
.sld-sheet, .pp-sld { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.sld-sheet svg, .pp-sld svg { display: block; width: 100%; min-width: 760px; height: auto; }
.sld-words { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.sld-words .wide { grid-column: 1 / -1; }
.sld-words textarea { min-height: 96px; }
@media (max-width: 760px) {
    .sld-words { grid-template-columns: minmax(0, 1fr); }
}
@media print {
    .sld-sheet { border: 0; }
    .sld-sheet svg { min-width: 0; }
}
/* the hand edits under the drawing (step S1, migration EditableSld): the editor on a desktop, a plain list of the edits on a phone and for anyone who may only read */
.sld-edit-item { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--card); }
.sld-edit-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.sld-e { display: inline-flex; flex: none; width: 16px; height: 16px; border-radius: 50%; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #b45309; background: #fbd38d; border: 1px solid #b45309; }
.sld-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.sld-form .wide { grid-column: 1 / -1; }
.sld-form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sld-edited-row td { background: #fffaf0; }
.ml8 { margin-left: 8px; }
.sld-edit-list.phone-only { display: none; }
@media (max-width: 760px) {
    .sld-form { grid-template-columns: minmax(0, 1fr); }
    .sld-edit-ui { display: none; }
    .sld-edit-list.phone-only { display: block; }
}

/* ---- battery control schemes (step S2): strategy cards, the schedule editor and the weekday x hour grid ---- */
.bs-strategy { border: 1px solid var(--border); border-radius: 10px; margin-top: 10px; background: var(--card); overflow: hidden; }
.bs-strategy-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #fafbfc; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.bs-strategy-head input { flex: 1 1 160px; min-width: 0; }
.bs-strategy-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; }
.bs-strategy-body .full { grid-column: 1 / -1; }
.bs-pick, .bs-rules { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px 8px; margin: 0; min-width: 0; }
.bs-pick legend, .bs-rules legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.bs-pick { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.bs-checks { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 6px; }
.bs-when { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bs-says { padding: 8px 12px 10px; color: var(--muted); font-size: 12.5px; border-top: 1px dashed var(--border); }
.bs-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-weight: 700; font-size: 12px; color: #fff; flex: 0 0 auto; }
.bs-errors, .bs-warnings, .bs-summary { border-radius: 8px; padding: 9px 12px; margin-top: 10px; font-size: 13px; }
.bs-errors { background: #fbe8e8; color: #7d2323; }
.bs-warnings { background: #fdf1dc; color: #6f4707; }
.bs-summary { background: #f3f6fa; }
.bs-errors ul, .bs-warnings ul, .bs-summary ul, .bs-lines { margin: 4px 0 0; padding-left: 18px; }
.bs-builtin { border-bottom: 1px solid var(--border); }
.bs-builtin > summary { padding: 11px 14px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.bs-builtin-body { padding: 0 14px 12px; }
.bs-builtin-body p { margin: 0 0 6px; }

.bs-sched { border-top: 1px dashed var(--border); padding: 12px; background: #fcfdfe; display: grid; gap: 14px; }
.bs-sec h4 { font-size: 13px; margin-bottom: 6px; }
.bs-range { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.bs-range select { width: auto; }
.bs-range input[type=number] { width: 64px; }
.bs-tool { display: grid; gap: 8px; margin-bottom: 10px; }
.bs-hours-pick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bs-hours-pick select { width: auto; }

/* The weekday x hour grid. Cells are placed by two custom properties, so the same markup is laid out days down and hours across on a wide screen and turned on its
   side (hours down, days across) on a phone, where 24 columns would not fit. */
.bs-grid { --bs-cell: 26px; display: grid; gap: 2px; grid-template-columns: 46px repeat(24, minmax(var(--bs-cell), 1fr)); grid-template-rows: auto repeat(7, 30px); min-width: 0; }
.bs-corner { grid-column: 1; grid-row: 1; }
.bs-head { font: inherit; font-size: 11px; color: var(--muted); background: transparent; border: 0; border-radius: 4px; padding: 0; text-align: center; display: flex; align-items: center; justify-content: center; }
button.bs-head { cursor: pointer; }
button.bs-head:hover:not(:disabled) { background: #eef1f4; }
.bs-hour { grid-column: calc(var(--h) + 2); grid-row: 1; }
.bs-day { grid-column: 1; grid-row: calc(var(--d) + 2); justify-content: flex-start; padding-left: 4px; font-weight: 600; font-size: 12px; }
.bs-cell { grid-column: calc(var(--h) + 2); grid-row: calc(var(--d) + 2); border: 1px solid var(--border); border-radius: 4px; background: #fff; padding: 0; min-height: 28px; cursor: pointer; font: inherit; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.bs-cell:hover:not(:disabled) { border-color: var(--accent); }
.bs-cell.on { background: var(--accent); border-color: var(--accent-dark); }
.bs-cell:focus-visible, .bs-head:focus-visible { outline: 3px solid #f2b705; outline-offset: 1px; position: relative; z-index: 1; }
.bs-cell:disabled { cursor: default; }
.bs-key { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; font-size: 12px; margin-top: 8px; color: var(--text); }
.bs-swatch { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--border); border-radius: 3px; background: #fff; vertical-align: -2px; }
.bs-swatch.on { background: var(--accent); border-color: var(--accent-dark); }

/* The picture of which strategy wins where: a colour per strategy, with its number in the cell. */
.bs-cover-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.bs-cover-head select { width: auto; }
.bs-cov-cell { cursor: default; color: #fff; font-weight: 700; }
.bs-c0 { background: #1f6feb; } .bs-c1 { background: #1f9d6b; } .bs-c2 { background: #9b59b6; } .bs-c3 { background: #b87409; }
.bs-c4 { background: #d64545; } .bs-c5 { background: #1a8a9a; } .bs-c6 { background: #5d6773; } .bs-c7 { background: #8a5a2b; }
.bs-cell.bs-idle, .bs-swatch.bs-idle { background: repeating-linear-gradient(45deg, #f3f5f7, #f3f5f7 4px, #e3e7eb 4px, #e3e7eb 8px); color: var(--muted); }
.bs-cov-cell.bs-mixed { box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #111c2b; }

@media (max-width: 760px) {
    .bs-strategy-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .bs-strategy-body { grid-template-columns: minmax(0, 1fr); }
    .bs-grid { grid-template-columns: 38px repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(24, 30px); }
    .bs-hour { grid-column: 1; grid-row: calc(var(--h) + 2); justify-content: flex-start; padding-left: 4px; }
    .bs-day { grid-column: calc(var(--d) + 2); grid-row: 1; justify-content: center; padding-left: 0; }
    .bs-cell { grid-column: calc(var(--d) + 2); grid-row: calc(var(--h) + 2); }
    .bs-cell, .bs-head, button.bs-head { min-height: 30px; }
}

/* ---------- design studio: the 3D roof view (step V1) ---------- */
.r3d-wrap.r3d-hidden { display: none; }
.r3d-host { position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 240px; max-height: 72vh; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #dfe6ee; box-shadow: var(--shadow); touch-action: none; }
.r3d-host:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.r3d-host.r3d-detached { max-height: none; min-height: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.r3d-canvas { display: block; width: 100%; height: 100%; outline: none; }
.r3d-compass { position: absolute; top: 10px; right: 10px; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .88); color: var(--text); box-shadow: var(--shadow); pointer-events: none; }
.r3d-compass-dial { width: 100%; height: 100%; }
.r3d-compass-dial svg { display: block; width: 100%; height: 100%; }
.r3d-credit { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 3px 8px; font-size: 11px; line-height: 1.35; color: #14181d; background: rgba(255, 255, 255, .88); border-radius: 6px; pointer-events: none; }
.r3d-status { position: absolute; left: 10px; top: 10px; max-width: calc(100% - 84px); padding: 5px 10px; font-size: 12.5px; font-weight: 600; color: var(--text); background: rgba(255, 255, 255, .92); border-radius: 8px; box-shadow: var(--shadow); pointer-events: none; }
.r3d-layers { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.r3d-layers .inline-check { min-height: 32px; }
@media (max-width: 760px) {
    .r3d-host { min-height: 220px; max-height: 60vh; }
    .r3d-tools .btn { flex: 1 1 calc(50% - 8px); min-height: 44px; }
    .r3d-compass { width: 44px; height: 44px; top: 8px; right: 8px; }
    .r3d-credit { font-size: 9px; padding: 2px 6px; line-height: 1.3; }
}
@media print {
    .r3d-panel .r3d-host, .r3d-tools, .r3d-layers { display: none !important; }
}


/* ---------- polish pass (P1) ---------- */

/* Filter controls in a card header keep their natural width instead of each taking a full row (Tasks, Orders, Proposals and the like). */
.card-head > select, .card-head > .field > select { width: auto; max-width: 220px; }
.card-head > input[type=search], .card-head > input[type=text] { width: auto; min-width: 160px; }
@media (max-width: 760px) {
    .card-head > select { flex: 1 1 140px; max-width: none; }
    .card-head > input[type=search], .card-head > input[type=text] { flex: 1 1 100%; max-width: none !important; }
}
/* Short labels never break onto two lines inside a toolbar. */
.card-head .btn, .card-head .inline-check, .card-head .small.faint { white-space: nowrap; }


/* ---------- polish pass (P2) ---------- */

/* A chart drawn twice by the engine (a laptop width and a phone width): the phone's replaces the laptop's on a narrow screen, so labels stay about 11 px wherever it is read. */
.rchart .rc-narrow { display: none; }
@media (max-width: 760px) {
    .rchart .rc-wide { display: none; }
    .rchart .rc-narrow { display: block; }
}
@media print {
    .rchart .rc-wide { display: block; }
    .rchart .rc-narrow { display: none; }
}

/* A numeric column's heading sits over its numbers: ".right" alone loses to ".tbl th { text-align: left }". */
.tbl th.right, .li-table th.right { text-align: right; }
.tbl th.center, .li-table th.center { text-align: center; }
.nw { white-space: nowrap; }

/* A table that scrolls sideways shows a shadow on the edge that has more. */
.table-wrap {
    background:
        linear-gradient(to right, var(--card) 30%, rgba(255, 255, 255, 0)) left center / 36px 100% no-repeat local,
        linear-gradient(to left, var(--card) 30%, rgba(255, 255, 255, 0)) right center / 36px 100% no-repeat local,
        radial-gradient(farthest-side at 0 50%, rgba(20, 24, 29, .16), rgba(20, 24, 29, 0)) left center / 12px 100% no-repeat scroll,
        radial-gradient(farthest-side at 100% 50%, rgba(20, 24, 29, .16), rgba(20, 24, 29, 0)) right center / 12px 100% no-repeat scroll;
}

/* The online proposal: the cover picture, the drawn component icon, whole totals. */
.pp-hero-art { line-height: 0; }
.pp-hero-art svg { display: block; width: 100%; height: auto; max-height: 200px; }
.pp-card-icon { flex: 0 0 56px; width: 56px; }
.pp-card-icon svg { display: block; width: 100%; height: auto; }
.pp-quote-row.total > div:first-child { font-weight: 700; }
.pp-env-row strong { white-space: nowrap; }
.pp-sunpath .chart-box { max-width: 420px; margin: 0 auto; }

@media (max-width: 900px) {
    /* The bar fixed to the bottom of the screen already shows the price and the Accept button, so the side panel does not open the page with them as well. */
    .pp-layout.has-bar .pp-when-no-bar { display: none; }
}
@media (max-width: 600px) {
    /* the sum Utility Bill Savings - Net System Cost = Net Savings stacks, each figure whole */
    .pp-equation { flex-direction: column; align-items: center; gap: 2px; }
    .pp-equation .op { line-height: 1; }
    .pp-equation strong { white-space: nowrap; }
}

/* Phone: a responsive table's description is one full-width line (its pills sit after the words, not as stretched flex items beside them). */
@media (max-width: 760px) {
    .results-tbl td[data-label="Description"] { display: block; grid-column: 1 / -1; }
    .results-tbl td[data-label="Description"]::before { content: none; }
    .results-tbl td[data-label="Description"] .pill { margin-left: 6px; vertical-align: middle; }
    /* an icon button is a real target: at least 40 x 40 px, with a visible edge */
    .btn.ghost.sm[aria-label], .chip-x { min-width: 40px; min-height: 40px; font-size: 18px; line-height: 1; }
    .btn.ghost.sm[aria-label] { border-color: var(--border); }
}

/* The menu's icons are one monochrome line set in the link's own colour. */
.nav-svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a .ic { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; opacity: .9; }
.mobile-nav a .ic { width: 22px; height: 22px; font-size: inherit; }
.mobile-nav a .nav-svg { width: 21px; height: 21px; }

/* teal: engaged (a proposal viewed, an order confirmed, a project being sold) */
.pill.teal { background: #dff3f5; color: #176a74; }
.kanban-col.teal { border-top-color: #1a8a9a; }
.stage-step.active.teal { background: #1a8a9a; }
.cal-dot.teal { background: #1a8a9a; }
.stat.teal { border-left-color: #1a8a9a; }
.id { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* tiles fill their rows: 8 are 4 and 4, 6 are 3 and 3 (instead of 6 and 2 at laptop width) */
@media (min-width: 901px) {
    .stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .stats.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* the text under a group's heading sits inside the card, not against its border */
.bom-group > .small, .bom-group > .mb12 { padding: 8px 12px 0; }
.pricing-views { max-width: 100%; }
@media (max-width: 760px) { .pricing-views { display: flex; } .pricing-views button { flex: 1 1 0; padding: 7px 6px; font-size: 12.5px; } }

.btn.danger-outline { background: transparent; border-color: var(--red); color: var(--red); }
.btn.danger-outline:hover { background: #fdf3f3; }
.danger-zone { border-color: #f1c9c9; }

/* a file picker is a button, not the browser's "Choose File / No file chosen" control */
.file-pick { position: relative; cursor: pointer; overflow: hidden; }
.file-pick input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.file-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.bs-desc { font-weight: 400; white-space: normal; }

/* Site pictures (step B2): a plan or drone picture placed under the studio's map. */
.studio-imagery { margin-top: 12px; }
.studio-imagery-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.studio-imagery-head h4 { margin: 0; }
.studio-image-row { border-top: 1px solid var(--border); padding: 10px 0; }
.studio-image-row.editing { background: #fff8e1; margin: 0 -8px; padding: 10px 8px; border-radius: 8px; }
.studio-image-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.studio-image-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.studio-opacity { display: inline-flex; align-items: center; gap: 6px; }
.studio-opacity input[type=range] { width: 140px; max-width: 40vw; }
.studio-register { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-top: 10px; }
.studio-pick { position: relative; display: inline-block; max-width: 100%; margin-top: 8px; border: 1px solid var(--border); border-radius: 6px; line-height: 0; }
.studio-pick-img { display: block; max-width: 100%; max-height: 60vh; width: auto; height: auto; cursor: crosshair; touch-action: manipulation; }
.studio-pin-a, .studio-pin-b { position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%; background: #e8590c; color: #fff; font: 600 12px/22px system-ui, sans-serif; text-align: center; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); pointer-events: none; }
.studio-pin-b { background: #1f6feb; }

/* the payment option modal's milestone rows: each one reads as its own group, also on a phone where the fields stack */
.ms-row { padding: 12px 0; border-top: 1px solid var(--border); }
.hint + .ms-row { border-top: 0; padding-top: 6px; }

/* the document upload block at the top of the Documents card */
.doc-upload { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }

/* a hint that is a warning (amber, like the other warnings) */
.hint.warn-text, .field .hint.warn-text { color: var(--amber-dark); }

@media (max-width: 760px) {
    /* The map studio's tools are one strip that scrolls sideways, and its views a scrolling segmented control: five rows of buttons used to push the map off the first screen. */
    .studio-toolbar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-bottom: 4px; }
    .studio-toolbar .btn, .studio-toolbar .studio-zoom-btn, .studio-toolbar .studio-capture-btn { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; }
    .studio-toolbar-gap { display: none; }
    .studio-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
    .studio-tabs button { flex: 0 0 auto; white-space: nowrap; }
}

/* existing solar (step A1): the Energy tab's card, the system-type chip and the existing-system block of the results */
.ex-array { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 12px; background: var(--card); }
.ex-array .readonly-value { padding: 8px 10px; background: #f7f9fa; border: 1px solid var(--border); border-radius: 6px; font-weight: 600; }
.hint.warn { color: #8a5a00; }
.ex-preview .stats { margin-bottom: 8px; }
.kind-chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: #f7f9fa; white-space: nowrap; }
.kind-chip.add-on { color: #1d5c8f; border-color: #b9d6ee; background: #eef6fc; }
.kind-chip.battery-only { color: #6a3d9a; border-color: #d9c8ee; background: #f6f0fc; }
.existing-card { border: 1px dashed var(--border); border-radius: 8px; padding: 12px; background: #fbfcfd; }
.pp-existing { border: 1px solid var(--border); border-radius: 8px; padding: 4px 16px 10px; margin: 16px 0; }

/* A tab strip that does not fit wraps onto a second row on a laptop, so no tab is hidden off the edge; on a phone it scrolls, with a fade at the right edge to show there is more. */
@media (min-width: 901px) { .tabs { flex-wrap: wrap; overflow-x: visible; } }
@media (max-width: 900px) { .tabs { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 18px; } }

/* payment receipts and email templates (step P1): a receipt row sits under its payment; the preview of an email is drawn on a white sheet as a customer's mail reader would show it */
.tbl tr.sub-row td { background: #f9fafb; border-top: 0; padding-top: 4px; padding-bottom: 4px; }
.email-preview { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; background: #ffffff; color: #1b1f23; max-width: 640px; line-height: 1.5; }
.email-preview p { margin: 0 0 10px; }
.email-preview ul { margin: 0 0 10px; padding-left: 20px; }

/* ---------- the online proposal, step P2: the interactive 3D view, polish ---------- */
.pp-picker-inline { display: none; margin: 0 0 14px; }
@media (max-width: 900px) { .pp-picker-inline { display: block; } }
.pp-picker-inline h4:not(:first-child) { margin-top: 14px; }
.pp-3d-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; margin-top: 10px; }
.pp-3d-note { margin-top: 6px; text-align: center; }
.pp-static.is-off { display: none; }
.pp-3d-box { text-align: left; }
.pp-3d-box .r3d-host { margin-top: 0; }
.pp-3d-tools { justify-content: center; }
@media print {
    /* a printout keeps the picture: the view, its buttons and the choosers have nothing to say on paper */
    .pp-3d-box, .pp-3d-offer, .pp-3d-note, .pp-picker-inline { display: none !important; }
    .pp-static.is-off { display: block !important; }
}

/* a model code (LR7-54HVD-475M) is read as one word: it never breaks at a hyphen */
.pp-code { white-space: nowrap; }

/* the bill of materials: every group's table has the same columns at the same widths, so the figures line up from one group to the next */
.bom-table { table-layout: fixed; width: 100%; }
.bom-table col.c-part { width: 17%; }
.bom-table col.c-qty { width: 70px; }
.bom-table col.c-unit { width: 76px; }
.bom-table td:nth-child(4), .bom-table th:nth-child(4) { overflow-wrap: normal; }
.bom-table col.c-supplier { width: 19%; }
.bom-table col.c-cost { width: 104px; }
.bom-table td.nw { white-space: normal; overflow-wrap: anywhere; }
.bom-table td, .bom-table th { overflow-wrap: anywhere; }
@media (max-width: 760px) {
    /* on a phone each line is a card (the responsive table's own rules): the shared widths do not apply */
    .bom-table { table-layout: auto; }
    .bom-table colgroup { display: none; }
}
.est-flag { margin-left: 6px; vertical-align: middle; }
/* on a phone every row of summary tiles (a window's, the BOM's, the Price tab's) sits two by two, not one under another: a card is too narrow for two 165 px tiles, so the grid would stack them */
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .stat { padding: 9px 10px; } .stat .value { font-size: 18px; overflow-wrap: anywhere; } }
.pp-credits { font-size: 11px; }
/* a small ghost button standing alone in a form cell (Remove line) keeps its own width at the left instead of stretching and centring its words */
.form-grid .field > .btn.ghost.sm { align-self: flex-start; width: auto; margin-bottom: 8px; }
.mb4 { margin-bottom: 4px; }
/* on a phone the engineer card's read-only lines stack (the longest label would otherwise leave the value a sliver of the width) */
@media (max-width: 600px) { .engineer-read { grid-template-columns: 1fr; gap: 0; } .engineer-read dt { margin-top: 6px; } }

/* each manual microinverter-kit line is a bordered card headed "Line 1" with its Remove button at the right, so one line never reads as the heading of the next */
.mlpe-card { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 2px; margin-bottom: 10px; background: var(--card); }
.mlpe-card-head { display: flex; align-items: center; margin-bottom: 4px; }

/* the dashboard on a phone: what needs doing (overdue payments) comes first, and the figures are two swipeable rows instead of five screens of tiles */
@media (max-width: 600px) {
    .dash-body { display: flex; flex-direction: column; }
    .dash-body > .dash-attention { order: -1; margin-top: 0; margin-bottom: 12px; }
    .dash-body > .stats { grid-template-columns: none; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
    .dash-body > .stats > .stat { scroll-snap-align: start; }
}
