/* Heat Pump Project Tracker — app styles.
   Implements the Claude Design "Heat Pump Tracker.dc.html" handoff, vanilla CSS.
   Token-driven, no external assets (EU data residency). */
:root {
    --surface:#ffffff; --surface-2:#f7f9fc; --bg:#f4f6fb; --well:#f0f2f8; --border:#e5e8f0; --border-2:#d7dde9;
    --text:#1d2733; --muted:#6b7785;
    --primary:#5b5cf6; --primary-dark:#4748d7; --tint:#eef0ff;
    --green:#1a9d54; --amber:#d98a00; --red:#d6322c; --done:#5a4bd6; --teal:#0bb4c4;
    /* Native form controls inherit the app accent instead of the browser default blue. */
    accent-color:#5b5cf6;
    --radius:14px;
    --font:"Inter var","Inter","Aptos","Segoe UI Variable","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    --sh1:0 1px 3px rgba(16,24,40,.07),0 1px 2px rgba(16,24,40,.04);
    --sh2:0 8px 20px rgba(12,32,24,.12),0 2px 6px rgba(12,32,24,.06);
    --sh3:0 16px 40px rgba(12,32,24,.20),0 4px 12px rgba(12,32,24,.10);
    --rail:268px;

    /* ---- Mobile & touch standard (see docs/DESIGN_HANDOFF.md) ----
       Breakpoints (max-width retrofit layer): 600 / 768 / 1024 / 1280.
       These tokens are the source of truth — new components must use them. */
    --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:24px; --sp-6:32px;
    --fs-xs:11px; --fs-sm:12.5px; --fs-base:14px; --fs-md:15px; --fs-lg:18px; --fs-xl:22px;
    --fs-input:16px;      /* inputs must be >=16px on touch to stop iOS auto-zoom */
    --tap:48px;           /* preferred touch target */
    --tap-min:44px;       /* absolute floor */
    --bottomnav-h:56px;   /* phone bottom tab bar content height (+ safe-area) */
    --safe-b:env(safe-area-inset-bottom,0px);
    --safe-t:env(safe-area-inset-top,0px);
    --safe-l:env(safe-area-inset-left,0px);
    --safe-r:env(safe-area-inset-right,0px);
}
* { box-sizing:border-box; }
html,body { margin:0; padding:0; height:100%; }
body { font-family:var(--font); color:var(--text); background:linear-gradient(135deg,#edf1f6 0%,#f6f4ee 42%,#edf8f0 100%); font-size:14px; line-height:1.5; font-weight:400; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
a { color:var(--primary); text-decoration:none; }
a:hover { text-decoration:underline; }
h1,h2,h3 { margin:0; }
.muted { color:var(--muted); }
.tnum { font-variant-numeric:tabular-nums lining-nums; }
.visually-hidden { position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap; }
::-webkit-scrollbar { height:10px;width:10px; }
::-webkit-scrollbar-thumb { background:#cdd4dd;border-radius:6px;border:2px solid var(--bg); }
@keyframes toastin { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
@keyframes modalin { from{opacity:0;transform:translateX(24px)} to{opacity:1;transform:none} }
@keyframes growbar { from{width:0} }

/* ---------- Icons ---------- */
.icon { width:1.2em;height:1.2em;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:-.18em;flex:none; }
.icon-btn { display:inline-grid;place-items:center;width:34px;height:34px;border:none;background:transparent;color:var(--muted);border-radius:8px;cursor:pointer; }
.icon-btn:hover { background:var(--well);color:var(--text);text-decoration:none; }

/* ---------- App shell ---------- */
.app { display:grid;grid-template-columns:var(--rail) 1fr;grid-template-rows:70px 1fr;height:100vh;height:100dvh;width:100%;overflow:hidden;background:linear-gradient(135deg,#eef1e9 0%,#f7f6ef 44%,#eef8f0 100%); }
.app.is-rail-collapsed { --rail:92px; }
.app.is-rail-collapsed .railhide { display:none !important; }
.app.is-rail-collapsed .sidenav__item { justify-content:center; }
.app.is-rail-collapsed .brand { justify-content:center; }

.app__sidebar { grid-row:1 / span 2;margin:14px 0 14px 16px;background:rgba(255,255,255,.92);border:1px solid rgba(232,235,228,.92);border-radius:18px;display:flex;flex-direction:column;min-height:0;box-shadow:0 18px 44px rgba(25,31,46,.08);backdrop-filter:blur(14px);overflow:hidden; }
.brand { min-height:72px;display:flex;align-items:center;gap:12px;padding:0 18px;flex:none;color:#151813;font-weight:650; }
.brand:hover { text-decoration:none; }
.brand__mark { width:40px;height:40px;border-radius:12px;background:#11130f;display:grid;place-items:center;color:#b8db55;flex:none;box-shadow:0 12px 22px rgba(17,19,15,.18);font-size:15px;font-weight:750;letter-spacing:-.02em; }
.brand__txt { font-size:15px;letter-spacing:-.01em;white-space:nowrap; }
.brand__sub { color:var(--muted);font-weight:600; }
.side-search { display:flex;align-items:center;gap:8px;margin:0 16px 16px;padding:0 11px;height:38px;background:#f6f7f4;border:1px solid #ecefea;border-radius:11px;color:#92978d;flex:none; }
.side-search .icon { width:15px;height:15px; }
.side-search input { min-width:0;width:100%;border:none;background:transparent;padding:0;font:inherit;font-size:12.5px;color:#20241f; }
.side-search input:focus { outline:none;box-shadow:none;border:none; }
.sidenav { padding:0 12px 12px;display:flex;flex-direction:column;gap:4px;flex:1;min-height:0;overflow:auto; }
.sidenav__group { margin:12px 10px 6px;color:#a1a69d;font-size:10px;font-weight:650;letter-spacing:.1em;text-transform:uppercase; }
.sidenav__item { display:flex;align-items:center;gap:12px;min-height:38px;padding:0 12px;border-radius:10px;color:#545a51;font-size:13px;font-weight:520; }
.sidenav__item .icon { width:17px;height:17px;color:#8e948b; }
.sidenav__item:hover { background:#f6f7f4;text-decoration:none;color:#171b15; }
.sidenav__item:hover .icon { color:#171b15; }
.sidenav__item.active { background:#11130f;color:#fff;font-weight:650;box-shadow:0 12px 24px rgba(17,19,15,.16); }
.sidenav__item.active .icon { color:#b8db55; }
.sidenav__badge { margin-left:auto;font-size:10.5px;font-weight:600;background:#f1f2ef;color:#8b9188;border-radius:999px;padding:1px 7px; }
.sidenav__item.active .sidenav__badge { background:#fff;color:#11130f; }
.sidenav__badge--warn { background:#b3261e;color:#fff; }
.sidenav__item.active .sidenav__badge--warn { background:#fff;color:#b3261e; }
.sidenav__spacer { margin-top:auto; }
.sidenav__note { padding:10px 12px;margin:8px 6px 4px;background:var(--well);border-radius:8px;font-size:11px;color:var(--muted);line-height:1.45; }
.sidenav__note-h { font-weight:700;color:var(--text);margin-bottom:2px; }
.side-foot { flex:none;padding:10px 12px 12px;border-top:1px solid #f0f1ec; }
.side-settings { display:flex;align-items:center;gap:12px;min-height:38px;padding:0 10px;border-radius:10px;color:#6f756d;font-size:13px;font-weight:520;text-decoration:none; }
.side-settings .icon { width:17px;height:17px;color:#8e948b; }
.side-settings:hover { background:#f6f7f4;color:#171b15;text-decoration:none; }
.side-settings.active { background:#11130f;color:#fff;font-weight:650;box-shadow:0 12px 24px rgba(17,19,15,.16); }
.side-settings.active .icon { color:#b8db55; }
.side-user { display:grid;grid-template-columns:34px minmax(0,1fr);gap:8px 10px;align-items:center;margin-top:10px;padding:10px;border:1px solid #eff1eb;border-radius:14px;background:#f6f7f2; }
.side-user .avatar { width:34px;height:34px;font-size:11px; }
.side-user__meta { min-width:0;display:flex;flex-direction:column;line-height:1.2; }
.side-user b { overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#22261f; }
.side-user small { margin-top:2px;color:#7c8378;font-size:11px; }
.side-user__actions { grid-column:2;display:flex;align-items:center;gap:4px;margin-top:-2px; }
.side-user__actions .icon-btn { width:28px;height:28px;color:#7a8394;background:transparent; }
.side-user__actions .icon-btn:hover { background:#ecefea;color:#171b15;text-decoration:none; }

.app__topbar { grid-column:2;grid-row:1;margin:14px 16px 0 22px;background:rgba(255,255,255,.72);border:1px solid rgba(232,235,228,.86);border-radius:18px;display:flex;align-items:center;gap:14px;padding:0 16px;z-index:20;box-shadow:0 12px 30px rgba(31,38,56,.05);backdrop-filter:blur(12px); }
.topbar__title { font-weight:650;font-size:15px;color:#1f2638; }
.topbar__right { margin-left:auto;display:flex;align-items:center;gap:14px; }
.topsearch { display:flex;align-items:center;gap:7px;background:#f7f8fc;border:1px solid #edf0f6;border-radius:10px;padding:7px 12px;width:230px;color:var(--muted); }
.topsearch .icon { width:15px;height:15px; }
.topsearch input { border:none;background:none;font:inherit;font-size:12.5px;width:100%;padding:0;margin:0;color:var(--text); }
.topsearch input:focus { outline:none;box-shadow:none;border:none; } /* the global input:focus glow double-ringed inside the pill */
.topsearch:focus-within { border-color:#c8c9ff;background:var(--surface);box-shadow:0 0 0 3px rgba(91,92,246,.12); }

.app__main { grid-column:2;grid-row:2;overflow:auto;min-height:0;position:relative;background:transparent; }
.app__main--pad { padding:22px 26px 48px; }
.app__main--pad .stub { padding-top:30px; }
.app__scrim { display:none; }
.nav-toggle { display:none; }

/* off-canvas on small screens */
@media (max-width:860px) {
    .app { grid-template-columns:1fr; }
    .app__sidebar { position:fixed;left:0;top:0;bottom:0;width:260px;margin:12px;z-index:40;transform:translateX(calc(-100% - 16px));transition:transform .22s ease; }
    .app.is-nav-open .app__sidebar { transform:translateX(0);box-shadow:var(--sh3); }
    .app__topbar { grid-column:1;margin:10px 10px 0; } .app__main { grid-column:1; }
    .app.is-nav-open .app__scrim { display:block;position:fixed;inset:0;z-index:35;background:rgba(16,24,40,.4); }
    .topsearch { width:150px; }
}

/* Mobile & touch foundation lives at the END of this file (search
   "Mobile & touch override layer") so it wins by source order over the
   dense desktop base rules. See docs/DESIGN_HANDOFF.md. */

/* ---------- Bottom tab bar (phones only, <768px) ---------- */
.bottomnav { display:none; }
@media (max-width:767px) {
    /* The bottom bar is a GRID ROW of the 100dvh shell, not position:fixed.
       A fixed bottom bar fights iOS Safari's dynamic toolbar (dvh resizing)
       and ends up floating mid-screen with a gap below it. As a grid row it
       is always pinned to the shell's real bottom. */
    .bottomnav {
        display:flex;grid-column:1;grid-row:3;
        height:calc(var(--bottomnav-h) + var(--safe-b));
        padding-bottom:var(--safe-b);padding-left:var(--safe-l);padding-right:var(--safe-r);
        background:var(--surface);border-top:1px solid var(--border);
        box-shadow:0 -2px 10px rgba(16,24,40,.06);
    }
    .bottomnav__item {
        flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
        min-height:var(--tap-min);padding:6px 2px;
        border:none;background:none;cursor:pointer;text-decoration:none;
        color:var(--muted);font:inherit;font-size:10.5px;font-weight:600;letter-spacing:.01em;
    }
    .bottomnav__item .icon { width:22px;height:22px;stroke-width:2; }
    .bottomnav__item:hover { text-decoration:none; }
    .bottomnav__item.active { color:var(--primary); }
    .bottomnav__item.active .icon { stroke-width:2.4; }
    /* Add a third shell row for the nav; the middle row scrolls between the
       top bar and the nav (minmax(0,…) lets it shrink so overflow works). */
    .app { grid-template-rows:66px minmax(0,1fr) auto; }
}

/* ---------- Generic page bits ---------- */
.pad { padding:22px 26px 60px; }
.page-head { display:flex;align-items:center;gap:12px;margin-bottom:18px;flex-wrap:wrap; }
.page-head h1 { font-size:22px;font-weight:650;letter-spacing:0; }
.page-head__actions { margin-left:auto;display:flex;gap:8px;align-items:center; }
.card { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 10px 28px rgba(31,38,56,.05);padding:18px 20px; }
.card + .card { margin-top:16px; }
.section-label { font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);margin-bottom:10px; }

/* ---------- Buttons ---------- */
.btn { display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border-2);background:var(--surface);color:var(--text);border-radius:10px;padding:8px 14px;font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:background .12s,box-shadow .12s,transform .05s; }
.btn .icon { width:16px;height:16px; }
.btn:hover { background:var(--well);text-decoration:none; }
.btn:active { transform:translateY(1px); }
.btn:focus-visible { outline:2px solid var(--primary);outline-offset:2px; }
.btn-primary { background:#11130f;border-color:#11130f;color:#fff;box-shadow:0 8px 18px rgba(17,19,15,.14); }
.btn-primary:hover { background:#242820;border-color:#242820; }
.btn-sm { padding:6px 11px;font-size:12.5px; }
.btn-danger { color:var(--red);border-color:#f0c4c2; }
.btn-danger:hover { background:#fdeceb; }
.btn[disabled], .btn:disabled { background:var(--well);color:var(--muted);border-color:var(--border);cursor:not-allowed;box-shadow:none; }

/* ---------- Forms ---------- */
label { display:block;font-size:13px;font-weight:600; }
label > input:not([type=checkbox]), label > select, label > textarea { margin-top:4px; }
input,select,textarea { width:100%;font:inherit;font-size:12.5px;padding:8px 10px;border:1px solid var(--border-2);border-radius:8px;background:#fff;color:var(--text);transition:border-color .12s,box-shadow .12s; }
input:focus,select:focus,textarea:focus { outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(11,107,72,.18); }
input[type=checkbox] { width:16px;height:16px;accent-color:var(--primary);cursor:pointer; }
.field { display:flex;flex-direction:column;gap:5px;margin-bottom:14px; }
.field > span, .field-label { font-size:11.5px;font-weight:600; }
.form-grid { display:grid;grid-template-columns:1fr 1fr;gap:14px; }
.form-grid .full { grid-column:1 / -1; }
.inline { display:inline-flex;align-items:center;gap:8px;font-weight:500; }
.inline > input[type=checkbox] { margin:0; }
@media (max-width:640px) { .form-grid { grid-template-columns:1fr; } }
.form-actions { margin-top:16px;display:flex;gap:12px;align-items:center; }

/* ---------- Flash + toast ---------- */
.flash { padding:11px 14px;border-radius:9px;margin-bottom:16px;font-weight:500;font-size:13px; }
.flash-success { background:#e7f6ee;color:#0f6b3a;border:1px solid #b6e3c9; }
.flash-error { background:#fdeceb;color:#a32420;border:1px solid #f3c2c0; }
.flash-info { background:#eaf2ff;color:#0b4ea2;border:1px solid #c2dbff; }
.flash-warning { background:#fef6e7;color:#8a5a00;border:1px solid #f4dca0; }
.toast-box { position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:60;display:flex;flex-direction:column;align-items:stretch;gap:8px;width:min(420px,92vw); }
.toast { display:flex;align-items:center;gap:10px;padding:11px 16px;border-radius:10px;box-shadow:var(--sh3);animation:toastin .2s ease;font-size:13px;font-weight:600;text-align:left; }
.toast .icon { width:18px;height:18px;stroke-width:2.2; }
.toast-success { background:#e7f6ee;color:#0f6b3a;border:1px solid #b6e3c9; }
.toast-error { background:#fdeceb;color:#a32420;border:1px solid #f3c2c0; }
.toast-info { background:#eaf2ff;color:#0b4ea2;border:1px solid #c2dbff; }

/* ---------- Badges / pills ---------- */
.spill { font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.02em;border-radius:999px;padding:2px 8px;white-space:nowrap; }
.status-on_track { color:#1a9d54;background:#e7f6ee; } .status-at_risk { color:#d98a00;background:#fff3df; }
.status-blocked { color:#d6322c;background:#fdeceb; } .status-on_hold { color:#6b7785;background:#eef0f3; }
.status-done { color:#5a4bd6;background:#efecfb; }
.pill { display:inline-block;font-size:11px;font-weight:600;color:var(--muted);border:1px solid var(--border);border-radius:6px;padding:2px 8px;background:var(--surface); }
.pill--ok { color:#0b6b48;border-color:#bfe3d0;background:#e9f6ef; }
.pill--warn { color:#8a5a00;border-color:#f0d9a8;background:#fdf3df; }
.avatar { border-radius:50%;color:#fff;font-weight:650;display:grid;place-items:center;flex:none; }

/* ---------- Dashboard ---------- */
.dash { padding:22px 26px 60px; } /* full width — no cap; panels use the whole screen */
.dash__head { display:flex;align-items:baseline;gap:12px;margin-bottom:18px; }
.dash__head h1 { font-size:22px;font-weight:700;letter-spacing:-.02em; }
.dash__date { color:var(--muted);font-size:13px; }
.dash-sales { padding:22px 26px 52px;min-height:calc(100vh - 58px);overflow-x:hidden;background:transparent; }
.dash-sales__main { min-width:0;display:flex;flex-direction:column;gap:16px;width:min(1420px,100%);margin:0 auto; }
.dash-command__head { display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;border:1px solid rgba(229,231,223,.92);border-radius:22px;background:rgba(255,255,252,.9);box-shadow:0 16px 36px rgba(25,31,46,.06);backdrop-filter:blur(12px); }
.dash-command__crumb { color:#8c93a3;font-size:11.5px;font-weight:600;margin-bottom:7px; }
.dash-command__head h1 { margin:0;font-size:30px;line-height:1.08;font-weight:720;letter-spacing:0;color:#171929; }
.dash-command__head p { margin:7px 0 0;color:#7a8394;font-size:13px;font-weight:500; }
.dash-command__actions { display:flex;align-items:center;gap:8px;flex:none; }
.dash-command__actions span,.dash-command__actions b,.dash-command__actions a { display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:0 13px;border-radius:999px;color:#727b8d;font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap; }
.dash-command__actions a.is-active { background:#11130f;color:#fff;box-shadow:0 8px 18px rgba(17,19,15,.16); }
.dash-command__actions a { background:#fff;border:1px solid #e3e8f1;color:#24263b; }
.dash-command__actions .dash-command__create { background:#11130f;color:#fff;border-color:#11130f; }
.dash-sales__notice { display:flex;align-items:center;gap:10px;padding:10px 12px;background:#fff7ea;border:1px solid #f5d59c;border-radius:12px;color:#5f4505;text-decoration:none;font-size:12.5px;font-weight:600; }
.dash-sales__notice b { margin-left:auto;color:#5b5cf6; }
.dash-stage-board { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px; }
.dash-stage-card { display:flex;flex-direction:column;gap:12px;min-height:138px;padding:15px 16px;border:1px solid #e8eae2;border-radius:18px;background:rgba(255,255,252,.84);color:#20243a;text-decoration:none;box-shadow:0 8px 20px rgba(25,31,46,.045);transition:box-shadow .12s,transform .12s,border-color .12s; }
.dash-stage-card:nth-child(3) { border-color:#d6dcc5;background:#fffdf4; }
.dash-stage-card:hover { text-decoration:none;box-shadow:0 16px 34px rgba(25,31,46,.1);transform:translateY(-1px); }
.dash-stage-card__top { display:flex;align-items:flex-start;justify-content:space-between;gap:10px; }
.dash-stage-card__top b { min-width:0;font-size:13px;line-height:1.25;font-weight:650; }
.dash-stage-card__top strong { font-size:14px;font-weight:700;color:#20243a; }
.dash-stage-card__sub { color:#7c8596;font-size:12px;font-weight:560; }
.dash-stage-card__bar { margin-top:auto;height:7px;border-radius:999px;background:#e9edf4;overflow:hidden; }
.dash-stage-card__bar i { display:block;width:var(--pct);height:100%;border-radius:999px;background:#73836c; }
.dash-stage-card__open { color:#5f6f56;font-size:12px;font-weight:650; }
.dash-sales__cards { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px; }
.dash-sales-kpi { display:flex;flex-direction:column;gap:9px;min-height:106px;border-radius:18px;padding:15px 16px;background:rgba(255,255,252,.88);border:1px solid #e8eae2;color:#1f2638;text-decoration:none;box-shadow:0 8px 20px rgba(25,31,46,.045); }
.dash-sales-kpi:hover { text-decoration:none;box-shadow:0 12px 30px rgba(31,38,56,.08); }
.dash-sales-kpi span { width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:color-mix(in srgb,var(--accent) 18%,#f5f6ef);color:var(--accent); }
.dash-sales-kpi .icon { width:15px;height:15px;stroke-width:2.4; }
.dash-sales-kpi b { font-size:20px;line-height:1;font-weight:720; }
.dash-sales-kpi small { color:#8c93a3;font-size:11.5px;font-weight:560; }
.dash-sales__grid { display:grid;grid-template-columns:1fr 1.55fr 1fr;gap:16px;align-items:stretch; }
.dash-sales-panel { background:rgba(255,255,252,.92);border:1px solid #e8eae2;border-radius:18px;padding:16px;min-width:0;box-shadow:0 8px 20px rgba(31,38,56,.045); }
.dash-sales-panel--wide { grid-column:span 2; }
.dash-sales-panel__head { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px; }
.dash-sales-panel__head h2 { font-size:14px;font-weight:650;color:#1f2638; }
.dash-sales-panel__head a,.dash-sales-panel__head span { color:#8c93a3;font-size:11.5px;font-weight:600;text-decoration:none; }
.dash-sales-bars { height:184px;display:grid;grid-template-columns:repeat(auto-fit,minmax(58px,1fr));align-items:end;gap:12px; }
.dash-sales-bars a { height:100%;display:grid;grid-template-rows:1fr auto auto;gap:8px;text-decoration:none;color:#687184;min-width:0; }
.dash-sales-bars i { height:128px;background:#f2f4f8;border-radius:9px;display:flex;align-items:end;overflow:hidden; }
.dash-sales-bars b { display:block;width:100%;border-radius:9px 9px 0 0;min-height:6px; }
.dash-sales-bars span { font-size:10px;font-weight:800;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.dash-sales-bars strong { text-align:center;color:#1f2638;font-size:12px; }
.dash-sales-donut { display:grid;grid-template-columns:120px minmax(0,1fr);gap:14px;align-items:center; }
.dash-sales-donut .donut { width:112px;height:112px; }
.dash-sales-donut .donut__hole { inset:18px; }
.dash-sales-donut p { display:flex;align-items:center;gap:8px;margin:0 0 8px;font-size:11.5px;color:#6b7280;font-weight:700; }
.dash-sales-donut p i { width:8px;height:8px;border-radius:3px;flex:none; }
.dash-sales-donut p span { min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.dash-sales-donut p b { margin-left:auto;color:#1f2638; }
.dash-sales-spend { height:180px;display:flex;align-items:end;gap:18px;padding:4px 6px 0; }
.dash-sales-spend > div { flex:1;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr auto;gap:0 7px;height:100%;align-items:end; }
.dash-sales-spend span { grid-column:1 / -1;text-align:center;font-size:10.5px;color:#8c93a3;font-weight:560;margin-top:8px; }
.dash-sales-spend i { height:138px;background:#f2f4f8;border-radius:8px;display:flex;align-items:end;overflow:hidden; }
.dash-sales-spend b { width:100%;display:block;border-radius:8px 8px 0 0;min-height:4px; }
.dash-sales-spend .plan { background:#73836c; }
.dash-sales-spend .act { background:#b8db55; }
.dash-sales-signals,.dash-sales-alerts,.dash-sales-activity,.dash-install-list { display:flex;flex-direction:column; }
.dash-sales-signals a { display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #edf0f6;color:#1f2638;text-decoration:none; }
.dash-sales-signals span { display:flex;align-items:center;gap:8px;min-width:0;color:#697286;font-size:11.5px;font-weight:560; }
.dash-sales-signals .icon { width:14px;height:14px;flex:none; }
.dash-sales-signals b { font-size:12.5px;white-space:nowrap; }
.dash-sales-signals .is-warn b { color:#d98a00; }
.dash-sales-alerts a { display:grid;grid-template-columns:62px minmax(0,1fr);gap:8px;padding:10px 0;border-bottom:1px solid #edf0f6;text-decoration:none;align-items:center; }
.dash-sales-alerts b { font-size:12.5px; }
.dash-sales-alerts span { color:#697286;font-size:12px;font-weight:560;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.dash-install-list a { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:10px 0;border-bottom:1px solid #edf0f6;text-decoration:none;align-items:center;color:#1f2638; }
.dash-install-list span { min-width:0;display:flex;flex-direction:column;gap:2px; }
.dash-install-list b { font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.dash-install-list small { color:#8c93a3;font-size:11px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.dash-install-list strong { color:#0b6b48;font-size:11.5px;white-space:nowrap; }
.dash-sales-activity > div { display:grid;grid-template-columns:30px minmax(0,1fr);gap:10px;padding:9px 0;border-bottom:1px solid #edf0f6;align-items:center; }
.dash-sales-activity .avatar { width:30px;height:30px;font-size:10px; }
.dash-sales-activity p { min-width:0;margin:0; }
.dash-sales-activity b { display:block;font-size:12px;color:#1f2638;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.dash-sales-activity small { display:block;font-size:11px;color:#8c93a3;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px; }
@media (max-width:1260px) {
    .dash-stage-board { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .dash-sales__grid { grid-template-columns:1fr 1fr; }
    .dash-sales-panel--wide { grid-column:span 2; }
}
@media (max-width:900px) {
    .dash-sales { padding:14px 14px 76px; }
    .dash-command__head { align-items:flex-start;flex-direction:column; }
    .dash-command__head h1 { font-size:24px; }
    .dash-command__actions { width:100%;flex-wrap:wrap; }
    .dash-command__actions span,.dash-command__actions b,.dash-command__actions a { flex:1 1 auto; }
    .dash-stage-board,.dash-sales__cards,.dash-sales__grid { grid-template-columns:1fr; }
    .dash-sales-panel--wide { grid-column:auto; }
}
@media (max-width:620px) {
    .dash-sales-donut { grid-template-columns:1fr; }
    .dash-sales-bars { overflow-x:auto;grid-template-columns:repeat(5,70px); }
}
.kpi-row { display:grid;grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:14px;margin-bottom:22px; }
.kpi { display:flex;flex-direction:column;text-align:left;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:15px 16px;box-shadow:var(--sh1);color:var(--text);transition:box-shadow .12s,transform .12s,border-color .12s; }
.kpi:hover { box-shadow:var(--sh2);transform:translateY(-2px);border-color:#c9d3e0;text-decoration:none; }
.kpi:focus-visible { outline:2px solid var(--primary);outline-offset:2px; }
.kpi__top { display:flex;align-items:center;justify-content:space-between; }
.kpi__chev { color:#b6bfca; }
.kpi__val { font-size:23px;font-weight:700;letter-spacing:-.02em;margin-top:10px; }
.kpi__label { font-size:12px;color:var(--muted);margin-top:1px; }
.kpi-warn { border-color:#f1c98a;background:#fff8ec; }
.sigbanner { display:flex;align-items:center;gap:12px;margin:0 0 18px;padding:13px 16px;border:1px solid #f1c98a;background:#fff8ec;border-radius:var(--radius);color:var(--text);box-shadow:var(--sh1); }
.sigbanner:hover { text-decoration:none;box-shadow:var(--sh2); }
.sigbanner--warn { border-color:#e7b0ab;background:#fdeceb; }
.sigbanner__txt { font-size:14px; }
.sigbanner__cta { margin-left:auto;font-size:13px;font-weight:600;color:var(--primary);white-space:nowrap; }
.grid-2col { display:grid;grid-template-columns:1.45fr 1fr;gap:16px;margin-bottom:16px;min-width:0; }
@media (max-width:980px) { .grid-2col { grid-template-columns:1fr; } }
.panel { background:rgba(255,255,252,.92);border:1px solid #e8eae2;border-radius:18px;box-shadow:0 8px 20px rgba(31,38,56,.045);padding:18px 20px;min-width:0; }
.panel__head { display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:14px; }
.panel__head h2 { font-size:14px;font-weight:650;color:#1f2638; }
.panel__hint { font-size:11.5px;color:#8c93a3;font-weight:560; }

/* Tickets dashboard — status kanban */
.tk-board { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start; }
.tk-board__col { background:rgba(255,255,255,.55);border:1px solid var(--border);border-radius:14px;padding:12px;min-height:120px; }
.tk-board__head { display:flex;align-items:center;justify-content:space-between;font-size:12.5px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.02em;margin-bottom:10px; }
.tk-card { display:block;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:10px 12px;margin-bottom:9px;color:var(--text);box-shadow:0 3px 10px rgba(31,38,56,.04);transition:box-shadow .12s,transform .12s; }
.tk-card:last-child { margin-bottom:0; }
.tk-card:hover { text-decoration:none;box-shadow:0 8px 18px rgba(31,38,56,.09);transform:translateY(-1px); }
.tk-card--change { border-left:3px solid var(--primary); }
.tk-card__subject { font-weight:650;line-height:1.3; }
.tk-card__meta { display:flex;gap:6px;flex-wrap:wrap;margin-top:7px; }
.tk-card__sub { font-size:12px;color:var(--muted);margin-top:6px; }
@media (max-width:800px){ .tk-board { grid-template-columns:1fr; } }

/* Partner-activity feed (Activity page) */
.act-feed { list-style:none;margin:0;padding:0; }
.act-item { display:flex;gap:12px;align-items:flex-start;padding:12px 16px;border-top:1px solid var(--border); }
.act-item:first-child { border-top:0; }
.act-item__icon { flex:0 0 auto;width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:var(--well);color:var(--muted); }
.act-item__icon .icon { width:16px;height:16px; }
.act-item--request .act-item__icon { background:var(--tint);color:var(--primary); }
.act-item__body { display:block;min-width:0;color:var(--text); }
.act-item__body:hover { text-decoration:none; }
.act-item__title { display:block;font-weight:560;line-height:1.3; }
.act-item__meta { display:block;font-size:12px;color:var(--muted);margin-top:2px; }

/* Topbar notification bell + dropdown */
.bell { position:relative;display:flex; }
.bell__btn { position:relative; }
.bell__dot { position:absolute;top:-2px;right:-2px;min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:#d6322c;color:#fff;font-size:10px;font-weight:700;line-height:16px;text-align:center; }
.bell__panel { position:absolute;top:calc(100% + 8px);right:0;width:340px;max-width:88vw;background:var(--surface);border:1px solid var(--border);border-radius:14px;box-shadow:0 18px 40px rgba(31,38,56,.18);z-index:60;overflow:hidden; }
.bell__panel[hidden] { display:none; }
.bell__head { display:flex;justify-content:space-between;align-items:center;padding:11px 14px;border-bottom:1px solid var(--border);font-weight:650;font-size:13px; }
.bell__head a { font-size:12.5px;font-weight:600;color:var(--primary); }
.bell__list { max-height:60vh;overflow-y:auto; }
.bell__row { display:block;padding:10px 14px;border-top:1px solid var(--border);color:var(--text); }
.bell__row:first-child { border-top:0; }
.bell__row:hover { background:var(--well);text-decoration:none; }
.bell__row b { display:block;font-weight:560;font-size:13px;line-height:1.3; }
.bell__row small { color:var(--muted);font-size:11.5px; }

/* WIP horizontal bars */
.hbars { display:flex;flex-direction:column;gap:9px; }
.hbar { display:grid;grid-template-columns:150px 1fr 26px;align-items:center;gap:10px;border:none;background:none;cursor:pointer;padding:5px 6px;border-radius:9px;text-align:left;width:100%; }
.hbar:hover { background:var(--well); }
.hbar__l { font-size:11.5px;color:#697286;font-weight:520;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.hbar__track { height:18px;background:var(--well);border-radius:5px;overflow:hidden; }
.hbar__fill { display:block;height:100%;border-radius:5px;animation:growbar .6s cubic-bezier(.22,1,.36,1); }
.hbar__v { font-size:12.5px;font-weight:650;text-align:right; }

/* Donut */
.donut-wrap { display:flex;align-items:center;gap:18px; }
.donut { position:relative;width:128px;height:128px;flex:none;border-radius:50%; }
.donut__hole { position:absolute;inset:20px;background:var(--surface);border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center; }
.donut__total { font-size:22px;font-weight:700;line-height:1; }
.donut__cap { font-size:10.5px;color:var(--muted); }
.legend { display:flex;flex-direction:column;gap:6px;flex:1;min-width:0; }
.legend__row { display:flex;align-items:center;gap:8px;font-size:12px; }
.legend__dot { width:9px;height:9px;border-radius:3px;flex:none; }
.legend__row span.l { white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.legend__row .c { margin-left:auto;font-weight:700;color:var(--muted); }

/* Deadline alerts */
.alerts__head { display:flex;align-items:center;gap:8px;margin-bottom:6px; }
.alerts__head h2 { font-size:15px;font-weight:600; }
.alert-row { width:100%;display:flex;align-items:center;gap:12px;border:none;border-bottom:1px solid var(--border);background:none;cursor:pointer;padding:11px 4px;text-align:left; }
.alert-row:hover { background:var(--well); }
.alert-row__d { display:flex;align-items:center;gap:7px;width:104px;flex:none; }
.alert-row__dot { width:10px;height:10px;border-radius:50%;flex:none; }
.alert-row__days { font-weight:700;font-size:13px; }
.alert-row__main { flex:1;min-width:0; }
.alert-row__client { display:block;font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.alert-row__sub { display:block;font-size:11.5px;color:var(--muted); }
.alert-row__notified { font-size:10px;font-weight:700;color:var(--muted);background:var(--well);border-radius:999px;padding:2px 7px;display:flex;align-items:center;gap:4px; }

/* Recent activity */
.activity { display:flex;flex-direction:column; }
.activity__row { display:flex;gap:10px;padding:9px 0;border-bottom:1px solid var(--border); }
.activity__row:last-child { border-bottom:none; }
.activity__av { width:26px;height:26px;font-size:10.5px; }
.activity__txt { min-width:0;flex:1;font-size:12.5px;line-height:1.4; }
.activity__txt b { font-weight:600; }
.activity__meta { font-size:11.5px;color:var(--muted); }

/* ---------- Projects ---------- */
.proj-screen { display:flex;flex-direction:column;height:100%;min-height:0; }
.proj-toolbar { padding:18px 26px 0;flex:none; }
.proj-toolbar__top { display:flex;align-items:center;gap:12px;margin-bottom:12px;padding:14px 16px;border:1px solid rgba(224,228,238,.9);border-radius:18px;background:rgba(255,255,255,.82);box-shadow:0 12px 30px rgba(25,31,46,.06);backdrop-filter:blur(10px); }
.proj-toolbar__top h1 { font-size:26px;font-weight:650;letter-spacing:0; }
.proj-count { color:var(--muted);font-size:13px;font-weight:520; }
.seg { display:flex;background:#f2f4fa;border:1px solid #e7ebf3;border-radius:999px;padding:4px; }
.seg.ho-tabs { display:inline-flex;width:max-content;max-width:100%;flex-wrap:nowrap;overflow-x:auto;vertical-align:top; }
.seg.ho-tabs a { flex:none;white-space:nowrap; }
.seg a { display:flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;border-radius:999px;padding:7px 13px;color:var(--muted); }
.seg a .icon { width:15px;height:15px; }
.seg a.active { background:#11130f;color:#fff;box-shadow:0 8px 18px rgba(17,19,15,.16); }
.seg a:hover { text-decoration:none; }
.proj-toolbar .filters-wrap { display:block;margin-bottom:10px;padding:12px 14px 0;border:1px solid rgba(224,228,238,.88);border-radius:18px;background:rgba(255,255,255,.74);box-shadow:0 10px 24px rgba(25,31,46,.05); }
.filters { display:flex;flex-wrap:wrap;gap:10px;align-items:end;padding-bottom:14px; }
.filters label { display:flex;flex-direction:column;gap:4px; }
.filters .fl { font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--muted); }
.filters select { font-size:12.5px;min-width:128px;cursor:pointer;background:#fbfcff;border-color:#dce2ed;border-radius:10px; }
/* Filters disclosure — desktop shows filters inline (toggle hidden); on phones
   the mobile override layer collapses them into a tappable "Filters" summary. */
.filters-wrap > .filters-summary { display:none; }
.filters-wrap:not([open]) > .filters { display:flex; }
.chips { display:flex;flex-wrap:wrap;gap:7px;padding-bottom:14px; }
.chip { display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600;background:var(--tint);color:var(--primary);border:none;border-radius:999px;padding:4px 6px 4px 11px;cursor:pointer; }
.chip .icon { width:13px;height:13px; }

.board-controls { display:flex;justify-content:flex-end;padding:0 26px 8px; }
.board { flex:1;min-height:0;overflow-x:auto;overflow-y:hidden;padding:6px 26px 28px; }
.board.is-hide-empty .kcol--empty { display:none; }
.kcol.kcol--searchhidden { display:none; }   /* column with no matches during a live search */
.board__inner { display:flex;gap:12px;height:100%;align-items:stretch;min-width:max-content; }
.kcol { flex:0 0 300px;min-width:300px;display:flex;flex-direction:column;background:rgba(255,255,255,.58);border:1px dashed #dfe4ee;border-radius:18px;padding:12px;max-height:100%;outline:2px dashed transparent;outline-offset:-3px;transition:background .12s,outline-color .12s,box-shadow .12s; }
.kcol:nth-child(1) { background:#f8fbfe; }
.kcol:nth-child(2) { background:#fffbff; }
.kcol:nth-child(3) { background:#fff9df; }
.kcol:nth-child(4) { background:#fffafa; }
.kcol:nth-child(5) { background:#f1f4ff; }
.kcol.is-dropzone { outline-color:var(--primary);background:var(--tint);box-shadow:0 0 0 4px rgba(91,92,246,.08); }
.kcol__head { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;padding:4px 6px 12px;flex:none;align-items:start; }
.kcol__title { display:flex;align-items:center;gap:7px;min-width:0; }
.kcol__dot { width:7px;height:7px;border-radius:50%;flex:none; }
.kcol__label { font-size:12.5px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#23243a; }
.kcol__value { grid-column:2;grid-row:1;font-size:12px;font-weight:650;color:#24263b; }
.kcol__count { grid-column:1 / -1;justify-self:start;margin-left:14px;font-size:11px;font-weight:520;color:var(--muted);background:transparent;border:none;border-radius:0;padding:0;min-width:0;text-align:left; }
.kcol__list { display:flex;flex-direction:column;gap:10px;overflow-y:auto;overflow-x:hidden;flex:1;min-height:0;padding:0 2px 2px; }
.kcard { background:rgba(255,255,255,.96);border:1px solid #edf0f6;border-radius:14px;padding:14px 14px 13px;box-shadow:0 8px 22px rgba(25,31,46,.07);cursor:pointer;transition:box-shadow .12s,transform .12s,border-color .12s; }
.kcard:hover { box-shadow:0 14px 30px rgba(25,31,46,.11);transform:translateY(-1px);border-color:#d9dfea; }
.kcard:focus-visible { outline:2px solid var(--primary);outline-offset:2px; }
.kcard.is-dragging { opacity:.4; } .kcard.is-pending { opacity:.55;pointer-events:none; }
.kcard__top { display:flex;align-items:start;justify-content:space-between;gap:8px; }
.kcard__title { font-size:13.5px;font-weight:650;line-height:1.28;color:#171929; }
.kcard__sub { font-size:11.5px;color:var(--muted);margin-top:4px;line-height:1.35;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden; }
.kcard__install { display:inline-flex;align-items:center;gap:5px;margin-top:7px;font-size:11.5px;font-weight:600;color:#0b6b48;background:#e8fbf2;border:1px solid #b9ecd2;border-radius:999px;padding:3px 9px;width:max-content;max-width:100%; }
.kcard__install .icon { width:12px;height:12px;flex:none; }
.kcard__install span { white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
/* Facts wrap instead of crushing: on narrow cards the (wider) subsidy box drops to its own full-width row. */
.kcard__facts { display:flex;flex-wrap:wrap;gap:6px;margin-top:10px; }
.kfact { flex:1 1 84px;min-width:84px;background:#f8f9fd;border:1px solid #eef1f7;border-radius:10px;padding:6px 8px; }
.kcard__facts .kfact:nth-child(3) { min-width:132px; }
.kfact__k { display:block;font-size:9.5px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.kfact__v { font-size:12.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.kcard__deadline { display:flex;align-items:center;gap:6px;margin-top:9px;font-size:11.5px;font-weight:600;border-radius:7px;padding:4px 8px; }
.kcard__deadline .icon { width:12px;height:12px;stroke-width:2.4; } .kcard__deadline b { margin-left:auto; }
.kcard__tbars { display:flex;flex-direction:column;gap:6px;margin-top:11px; }
.ktbar { display:grid;grid-template-columns:fit-content(42%) 1fr 34px;align-items:center;gap:8px; }
.ktbar__n { font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.ktbar__track { height:6px;background:#eceff5;border-radius:99px;overflow:hidden; }
.ktbar__track span { display:block;height:100%;border-radius:99px; }
.ktbar__c { font-size:10.5px;font-weight:700;color:var(--muted);text-align:right; }
.kcard__foot { display:flex;align-items:center;gap:7px;margin-top:12px;padding-top:10px;border-top:1px solid #eef1f7; }
.kcard__owner { width:24px;height:24px;font-size:10px; }
.kcard__owner-name { font-size:11.5px;font-weight:500;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0; }
.kcard__solution { font-size:10px; }
.kcol__empty { text-align:center;color:#aeb6c0;font-size:12px;padding:16px 8px; }
.kcol__add { display:flex;align-items:center;justify-content:center;min-height:34px;margin-top:2px;border:1px dashed color-mix(in srgb, var(--primary) 45%, #dfe4ee);border-radius:12px;background:rgba(255,255,255,.55);color:var(--primary);font-size:12.5px;font-weight:600;text-decoration:none; }
.kcol__add:hover { text-decoration:none;background:#fff;border-color:var(--primary); }
/* 1080p-class screens (incl. Windows 125% scaling → ~1536px viewports): tighter chrome so columns get the width. */
@media (max-width:1719px) {
    .board { padding:6px 18px 22px; }
    .board-controls { padding:0 18px 8px; }
    .board__inner { gap:10px; }
    .app__main--pad { padding:18px 18px 44px; }
}
/* Small screens: swipe through columns with snap instead of crushing them. */
@media (max-width:860px) {
    .board { scroll-snap-type:x proximity; }
    .kcol { min-width:min(300px,86vw);scroll-snap-align:start; }
}

.ptable-wrap { flex:1;min-height:0;overflow:auto;padding:4px 24px 28px; }
.ptable { width:100%;border-collapse:collapse;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden; }
.ptable th { text-align:left;padding:10px 14px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);border-bottom:1px solid var(--border); }
.ptable th.r, .ptable td.r { text-align:right; }
.ptable td { padding:11px 14px;font-size:12.5px;border-top:1px solid var(--border); }
.ptable tbody tr { cursor:pointer; }
.ptable tbody tr:hover { background:var(--well); }

/* ---------- Subsidy two-pane ---------- */
.sub-head { padding:22px 26px 0; }
/* Tracker view sits in the full-bleed subsidy main; give it the same gutter as .sub-head. */
.sub-track { padding:16px 26px 48px; }
/* Rail is a <details> — display:flex can't bound its content (browser wraps head+list in an
   anonymous box), so drop the 100%-height independent scroll and let the page scroll as one;
   align-items:stretch keeps both panes' backgrounds the same height. */
.sub-screen { display:flex;align-items:stretch;min-height:0;padding-left:26px; }
.sub-screen--embed { padding-left:0; }               /* card iframe: no rail, no gutter */
.sub-screen--embed .sub-form { padding:14px 16px 30px; }
.sub-rail { width:268px;flex:none;border:1px solid #e8eae2;border-radius:18px;background:rgba(255,255,252,.9);display:flex;flex-direction:column;box-shadow:0 8px 20px rgba(25,31,46,.045);overflow:hidden;margin-right:16px; }
/* The rail is a <details>; on desktop it's an always-open pane (toggle hidden,
   content shown even when closed). The mobile layer turns it into a collapsed
   "Applications" picker so the form gets the screen. */
.sub-rail > .sub-rail__toggle { display:none; }
.sub-rail:not([open]) > .sub-rail__head { display:block; }
.sub-rail:not([open]) > .sub-rail__list { display:block; }
.sub-rail__head { padding:16px 16px 10px;flex:none; }
.sub-rail__head h1 { font-size:16px;font-weight:650;margin-bottom:2px;color:#1f2638; }
.sub-rail__list { flex:1;overflow-y:auto;padding:0 10px 12px; }
.sub-rail__item { display:block;width:100%;text-align:left;border:none;border-radius:10px;padding:10px 11px;margin-bottom:4px;cursor:pointer;background:none;font:inherit;text-decoration:none;color:inherit; }
.sub-rail__item:hover { background:#f6f7f4; }
.sub-rail__item.active { background:#11130f;color:#fff;box-shadow:0 10px 20px rgba(17,19,15,.12); }
.sub-rail__item-top { display:flex;align-items:center;gap:7px; }
.sub-rail__dot { width:9px;height:9px;border-radius:50%;flex:none; }
.sub-rail__client { font-size:12.5px;font-weight:560;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.sub-rail__item.active .sub-rail__client,.sub-rail__item.active .sub-rail__sub { color:#fff; }
.sub-rail__days { font-size:11px;font-weight:600; }
.sub-rail__sub { font-size:11px;color:var(--muted);margin-top:3px;padding-left:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.sub-rail__sub--client { color:#1f2638;font-weight:560;margin-top:2px; }
.sub-form { flex:1;min-width:0;overflow-y:auto;padding:22px 28px 60px; }
.subdocs { display:flex;flex-direction:column;gap:8px; }
.subdoc { display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px;border:1px solid #e5e9ef;border-radius:12px;margin:0;background:rgba(255,255,252,.9); }
.subdoc.is-signed { border-color:#cfe7dc;background:var(--tint); }
.subdoc__n { flex:none;width:22px;height:22px;border-radius:50%;display:inline-grid;place-items:center;font-size:12px;font-weight:700;background:var(--well);color:var(--muted); }
.subdoc.is-signed .subdoc__n { background:var(--primary);color:#fff; }
.subdoc__label { flex:1;min-width:170px;font-size:13px;font-weight:560;display:flex;flex-direction:column;gap:1px; }
.subdoc__file { font-size:11.5px;font-weight:500; }
.subdoc__date { display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);white-space:nowrap; }
.subdoc__fileinput { font-size:11px;max-width:160px; }
.subsidy-empty { max-width:420px;margin:34px auto;text-align:center;padding:28px 26px;border:1px solid var(--border-2);border-radius:14px;background:var(--surface); }
.subsidy-empty__badge { display:inline-block;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--primary);background:var(--tint);border:1px solid #cfe7dc;border-radius:999px;padding:4px 12px;margin-bottom:14px; }
.subsidy-empty__h { font-size:16px;font-weight:700;margin:0 0 8px; }
.subsidy-empty__p { font-size:13px;color:var(--muted);line-height:1.55;margin:0 0 18px; }
.zusage-doc { display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px;padding:9px 12px;border:1px dashed var(--border-2);border-radius:9px;background:var(--surface); }
.zusage-doc.is-missing { border-color:#f0c4c2;background:#fdeceb; }
.zusage-doc__k { flex:1;min-width:180px;font-size:12.5px;font-weight:600; }
.zusage-doc__warn { font-size:11px;font-weight:700;color:var(--red);white-space:nowrap; }
.warnbox.warnbox--miss { border-color:#f0c4c2;background:#fdeceb; }
.sub-form__inner { max-width:760px; }
.sub-form__title { display:flex;align-items:baseline;gap:10px;margin-bottom:6px; }
.sub-form__title h1 { font-size:22px;font-weight:650;letter-spacing:0;color:#171929; }
.sub-form__site { font-size:13px;color:var(--muted);margin-bottom:20px; }
.sub-sect { background:rgba(255,255,252,.92);border:1px solid #e8eae2;border-radius:18px;box-shadow:0 8px 20px rgba(31,38,56,.045);padding:18px 20px;margin-bottom:16px; }
.sub-sect h2 { font-size:14px;font-weight:650;margin-bottom:14px;color:#1f2638; }
.pipeline { display:flex;flex-wrap:wrap;gap:5px; }
.pstep { font-size:11px;font-weight:560;padding:4px 9px;border-radius:999px;white-space:nowrap;background:#f1f3f0;color:#697286; }
.pstep.done { background:#e7f6ee;color:#0f6b3a; }
.pstep.current { background:var(--primary);color:#fff;font-weight:700; }
.pstep.terminal { background:#fdeceb;color:var(--red);font-weight:700; }
.gatebox { background:#fdeceb;border:1px solid #f3c2c0;border-radius:var(--radius);padding:14px 16px;margin-bottom:16px; }
.gatebox__h { display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700;color:#a32420;margin-bottom:8px; }
.gatebox ul { margin:0;padding-left:24px;display:flex;flex-direction:column;gap:6px; }
.gatebox li { font-size:12.5px;color:#8a1f1c;line-height:1.5; }
.warnbox { display:flex;gap:9px;background:#fff3df;border:1px solid #f1c98a;border-radius:var(--radius);padding:12px 15px;margin-bottom:16px; }
.warnbox span { font-size:12.5px;color:#8a5a00;line-height:1.5; }
.dates3 { display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px; }
.dates3 .dl { font-size:11px;color:var(--muted);margin-bottom:3px; } .dates3 .dv { font-size:13px;font-weight:600; }
.dlwell { display:flex;align-items:center;gap:12px;background:var(--well);border-radius:9px;padding:12px 14px;margin-top:16px; }
.dlwell__dot { width:12px;height:12px;border-radius:50%;flex:none; }
.dlwell__cap { font-size:11px;color:var(--muted); } .dlwell__v { font-size:14px;font-weight:700; }
.calc { display:grid;grid-template-columns:1.1fr 1fr;gap:20px; }
@media (max-width:720px) { .calc { grid-template-columns:1fr; } .dates3 { grid-template-columns:1fr; } }
.calc__toggles { display:flex;flex-direction:column;gap:11px; }
.toggle { display:flex;align-items:center;justify-content:space-between;gap:9px;cursor:pointer;font-size:12.5px;font-weight:500;padding:8px 11px;border:1px solid #e5e9ef;border-radius:10px;background:#fff; }
.toggle.on { background:var(--tint);border-color:#b5ddca; }
.toggle__pct { font-weight:700;color:var(--muted); } .toggle.on .toggle__pct { color:var(--primary); }
.calc__out { display:flex;flex-direction:column;gap:10px; }
.calc__tiles { display:grid;grid-template-columns:1fr 1fr;gap:10px; }
.calc__tile { border-radius:12px;padding:12px 13px; }
.calc__tile.pct { background:var(--tint); } .calc__tile.zus { background:#e7f6ee; }
.calc__tile .k { font-size:11px;font-weight:560; } .calc__tile.pct .k { color:var(--primary); } .calc__tile.zus .k { color:#0f6b3a; }
.calc__tile .v { font-size:24px;font-weight:720;line-height:1.1; } .calc__tile.pct .v { color:var(--primary); } .calc__tile.zus .v { color:#0f6b3a; }
.calc__line { display:flex;justify-content:space-between;font-size:12px;padding:8px 11px;background:var(--well);border-radius:8px; }
.calc__line .k { color:var(--muted); }

/* ---------- Drawer / card modal ---------- */
.drawer { width:min(940px,94vw);max-width:none;height:auto;max-height:88vh;margin:auto;padding:0;border:none;border-radius:22px;background:rgba(255,255,252,.96);box-shadow:0 24px 70px rgba(17,19,15,.28);overflow:hidden; }
.drawer::backdrop { background:rgba(16,24,40,.5); } /* no backdrop-filter: blur() — it GPU-blurs the whole board and makes the modal sluggish */
.drawer[open] { animation:popIn .2s ease; }
@keyframes popIn { from{opacity:0;transform:translateY(12px) scale(.99)} to{opacity:1;transform:none} }
.drawer__body { max-height:88vh;overflow:hidden; }
@media (max-width:640px){ .drawer { max-height:94vh;max-height:94dvh;width:96vw; } .drawer__body { max-height:94vh;max-height:94dvh; } }
.cm { display:flex;flex-direction:column;max-height:88vh; }
@media (max-width:640px){ .cm { max-height:94vh;max-height:94dvh; } }
.cm__head { padding:18px 22px 14px;border-bottom:1px solid #e8eae2;flex:none;background:rgba(255,255,252,.94); }
.cm__head-top { display:flex;align-items:start;gap:12px; }
.cm__id { font-size:11px;font-weight:600;color:#697286;background:#f1f3f0;border-radius:8px;padding:2px 7px; }
.cm__title { font-size:20px;font-weight:650;margin:9px 0 3px;letter-spacing:0;color:#171929; }
.cm__sub { font-size:13px;color:#697286;font-weight:400; }
.cm__close { border:none;background:#f6f7f4;color:#7a8394;width:34px;height:34px;border-radius:10px;cursor:pointer;display:grid;place-items:center;flex:none; }
.cm__close:hover { background:#e2e6ec; }
.cm__tabs { display:flex;gap:2px;margin-top:14px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch; }
.cm__tabs::-webkit-scrollbar { display:none; }
.cm__tab { flex:none;white-space:nowrap;font:inherit;font-size:12.5px;font-weight:560;border:none;background:none;padding:8px 12px;cursor:pointer;border-radius:999px;color:#697286; }
.cm__tab.active { color:#fff;background:#11130f;box-shadow:0 8px 18px rgba(17,19,15,.14); }
.cm__scroll { flex:1;min-height:0;overflow-y:auto;padding:18px 22px 26px; }
.cm__foot { display:flex;align-items:center;gap:8px;flex:none;padding:12px 22px;border-top:1px solid #e8eae2;background:#f7f8f4; }
.cm__foot-note { font-size:12px;color:var(--muted); }
.cm__foot-del { margin-left:auto; }
.cm__panel { display:none; } .cm__panel.active { display:block; }
.quickedit { background:#f7f8f4;border:1px solid #e5e9ef;border-radius:14px;padding:14px 16px;margin-bottom:18px; }
.cm-edit { margin-bottom:20px; } .cm-edit .form-grid { gap:6px 14px; } .cm-edit label { font-size:11.5px;font-weight:560;color:#4f574f; }
.cm-dl { display:grid;grid-template-columns:1fr 1fr;gap:14px 18px;margin:0 0 20px; }
.cm-dl dt { font-size:11px;color:#7a8394;margin-bottom:2px;font-weight:560; } .cm-dl dd { margin:0;font-size:13px;font-weight:560; }
.comments { display:flex;flex-direction:column;gap:12px;margin-bottom:14px; }
.comment { display:flex;gap:10px; }
.comment__av { width:28px;height:28px;font-size:10.5px; }
.comment__name { font-size:12.5px; } .comment__name b { font-weight:560; }
.comment__when { color:var(--muted);font-size:11.5px; }
.comment__body { font-size:13px;line-height:1.5;margin-top:1px; }
.comment-form { display:flex;gap:8px;align-items:end; }
.comment-form textarea { resize:none;border-radius:9px; }
.docrow { display:flex;align-items:center;gap:11px;padding:11px 13px;border:1px solid #e5e9ef;border-radius:12px;margin-bottom:8px;background:rgba(255,255,252,.86); }
.docrow-wrap { display:flex;align-items:center;gap:8px;margin-bottom:8px; }
.docrow-wrap .docrow { flex:1;margin-bottom:0; }
.docrow-wrap .docsel { width:17px;height:17px;flex:none;cursor:pointer;accent-color:var(--primary); }
.docbulk-bar { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px; }
.docbulk-all { display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--muted);cursor:pointer; }
.docbulk-all input { width:16px;height:16px;accent-color:var(--primary);cursor:pointer; }
.docbulk-del[disabled] { opacity:.5;cursor:not-allowed; }
.docrow__type { font-size:10px;font-weight:600;border-radius:8px;padding:3px 8px;flex:none; }
.docrow__main { flex:1;min-width:0; } .docrow__name { font-size:12.5px;font-weight:560;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.docrow__meta { font-size:11px;color:var(--muted); }
.timeline { position:relative;padding-left:6px; }
.tl-row { display:flex;gap:12px;padding-bottom:16px; }
.tl-rail { display:flex;flex-direction:column;align-items:center;flex:none; }
.tl-dot { width:11px;height:11px;border-radius:50%;border:2px solid var(--surface);box-shadow:0 0 0 1px var(--border); }
.tl-line { width:2px;flex:1;background:var(--border);margin-top:2px; }
.tl-title { font-size:13px;font-weight:560; } .tl-note { font-size:12px;color:var(--muted);margin-top:1px;white-space:pre-wrap; } .tl-meta { font-size:11px;color:var(--muted);margin-top:3px; }
.tl-area { display:inline-block;font-size:9px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:#fff;border-radius:4px;padding:1px 5px;vertical-align:middle;margin-right:4px; }

/* ---------- Wizard ---------- */
.wizard { max-width:720px; }
.wiz-steps { display:flex;gap:8px;list-style:none;padding:0;margin:0 0 22px;flex-wrap:wrap; }
.wiz-step { flex:1 1 110px;display:flex;align-items:center;gap:8px;padding:8px 4px;font-size:12px;color:var(--muted);border-bottom:3px solid var(--border);cursor:default; }
.wiz-step__num { width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:var(--well);border:1px solid var(--border-2);font-weight:700;font-size:11px;flex:none; }
.wiz-step.is-active { color:var(--primary);border-bottom-color:var(--primary);font-weight:700; }
.wiz-step.is-active .wiz-step__num { background:var(--primary);color:#fff;border-color:var(--primary); }
.wiz-step.is-done { color:var(--green);border-bottom-color:var(--green);cursor:pointer; }
.wiz-step.is-done .wiz-step__num { background:var(--green);color:#fff;border-color:var(--green); }
.wiz-panel { border:none;padding:0;margin:0; }

/* ---------- Stub ---------- */
.stub { padding:60px 26px;max-width:560px;margin:0 auto;text-align:center; }
.stub__icon { width:54px;height:54px;border-radius:14px;background:var(--tint);color:var(--primary);display:grid;place-items:center;margin:30px auto 16px; }
.stub__icon .icon { width:24px;height:24px; }
.stub__title { font-size:20px;font-weight:700;margin-bottom:6px; }
.stub__body { color:var(--muted);font-size:13.5px;max-width:420px;margin:0 auto;line-height:1.6; }

/* ---------- Admin / generic tables ---------- */
.dl { display:grid;grid-template-columns:170px 1fr;gap:6px 14px; }
.dl dt { color:var(--muted); } .dl dd { margin:0; }
/* Reusable horizontal-scroll wrapper for wide tables on narrow screens.
   Wrap any multi-column .table in <div class="tbl-wrap"> so it scrolls
   instead of overflowing the viewport. Harmless on desktop (no scroll
   when it fits). See docs/DESIGN_HANDOFF.md "Mobile & Touch Standards". */
.tbl-wrap { overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;min-width:0; }

/* Reports */
.reports { display:flex;flex-direction:column;gap:16px;padding:22px 26px 60px; }
.reports__head { display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:2px;padding:16px 18px;border:1px solid rgba(229,231,223,.92);border-radius:22px;background:rgba(255,255,252,.9);box-shadow:0 16px 36px rgba(25,31,46,.06);backdrop-filter:blur(12px); }
.reports__head h1 { font-size:26px;line-height:1.1;font-weight:720;letter-spacing:0;margin-bottom:6px;color:#171929; }
.reports__head .btn { flex:none; }
.reports__filters { background:rgba(255,255,252,.86);border:1px solid #e5e9ef;border-radius:18px;box-shadow:0 8px 20px rgba(25,31,46,.04);padding:14px 16px 0; }
.reports__filters .filters { display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));align-items:end;padding-bottom:14px; }
.reports__filters .btn { min-height:38px;justify-content:center; }
.reports__filters input[type="date"] { min-width:132px; }
.reports__check { flex-direction:row!important;align-items:center;gap:8px;min-height:34px;color:#697286;font-size:12.5px;font-weight:520; }
.reports__check input { width:auto; }
.reports__chips { margin-top:-4px; }
.reports__kpis { margin-bottom:0; }
.reports__grid { align-items:start; }
.saved-views { display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid #e8eae2;border-radius:16px;background:rgba(255,255,252,.78);box-shadow:0 8px 20px rgba(25,31,46,.035); }
.saved-views__left { display:flex;align-items:center;gap:10px;min-width:0; }
.saved-views__label { color:#8c93a3;font-size:10.5px;text-transform:uppercase;letter-spacing:.03em;font-weight:650;white-space:nowrap; }
.saved-views__chips { display:flex;align-items:center;gap:6px;overflow-x:auto;min-width:0; }
.saved-view-chip { flex:none;display:inline-flex;align-items:center;min-height:30px;padding:6px 10px;border:1px solid #e0e5ed;border-radius:999px;background:#fff;color:#4d5667;font-size:12.5px;font-weight:560;white-space:nowrap; }
.saved-view-chip:hover { text-decoration:none;border-color:#b7c4ce;color:#1f2638; }
.saved-view-chip.is-active { color:#11130f;background:#edf3e3;border-color:#c8d5bd; }
.saved-views__form { display:flex;align-items:center;gap:7px;flex:none; }
.saved-views__form input[type="text"] { width:180px;min-height:32px;padding:6px 10px;font-size:12.5px;border-radius:10px;background:#fff; }
.saved-views__delete { flex:none; }
.report-modebar { display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px; }
.report-mode { display:flex;flex-direction:column;gap:5px;min-height:78px;border:1px solid #e8eae2;border-radius:16px;background:rgba(255,255,252,.86);box-shadow:0 8px 20px rgba(25,31,46,.045);padding:14px 16px;color:#20243a; }
.report-mode:hover { text-decoration:none;border-color:#b7c4ce; }
.report-mode b { font-size:13.5px;font-weight:650; }
.report-mode span { color:#7a8394;font-size:12px;font-weight:500;line-height:1.35; }
.report-mode.is-active { border-color:#d6dcc5;background:#fffdf4;box-shadow:0 8px 20px rgba(25,31,46,.045), inset 0 0 0 1px rgba(115,131,108,.12); }
.report-insights { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px; }
.report-insights > div { min-height:72px;background:rgba(255,255,252,.9);border:1px solid #e8eae2;border-radius:16px;padding:13px 15px;display:flex;flex-direction:column;justify-content:center;gap:5px;box-shadow:0 8px 20px rgba(25,31,46,.045); }
.report-insights span { color:#8c93a3;font-size:10.5px;text-transform:uppercase;letter-spacing:.03em;font-weight:600; }
.report-insights b { font-size:18px;font-weight:720;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.report-insights .is-warn { border-color:#f1c98a;background:#fff8ec; }
.reports__streambar { display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px; }
.stream-pill { display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border);background:var(--surface);border-radius:8px;padding:6px 10px;color:var(--muted);font-size:12px;font-weight:700; }
.stream-pill:hover { text-decoration:none;color:var(--text);border-color:#b7c4ce; }
.stream-pill.is-active { color:var(--primary);border-color:color-mix(in srgb, var(--primary) 35%, var(--border));background:var(--tint); }
.stream-tag { display:inline-flex;align-items:center;border-radius:7px;padding:3px 8px;font-size:11.5px;font-weight:800;line-height:1;border:1px solid transparent;white-space:nowrap; }
.stream-tag--dso { color:#0b5c74;background:#e3f3f8;border-color:#b9dce8; }
.stream-tag--electrical { color:#795300;background:#fff5d7;border-color:#eed28e; }
.stream-tag--heat_pump { color:#0f6b3a;background:#e7f6ee;border-color:#b6e3c9; }
.report-cell-sub { margin-top:3px;font-size:12px;line-height:1.3;white-space:normal; }
.report-table-filters { display:grid;grid-template-columns:minmax(180px,1.4fr) repeat(7,minmax(118px,1fr)) auto auto;gap:8px;align-items:end;margin:12px 0 14px;padding:12px;background:#f7f8f4;border:1px solid #e5e9ef;border-radius:14px; }
.report-table-filters label { display:flex;flex-direction:column;gap:5px;min-width:0; }
.report-table-filters label span { color:#7a8394;font-size:10.5px;text-transform:uppercase;letter-spacing:.03em;font-weight:600; }
.report-table-filters input,.report-table-filters select { min-height:34px;font-size:12.5px;padding:6px 9px; }
.report-table-filters .btn { min-height:34px;justify-content:center;white-space:nowrap; }
.report-table { width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px;min-width:860px; }
.report-table th { text-align:left;font-size:10.5px;text-transform:uppercase;letter-spacing:.03em;color:#697286;background:#f0f3f7;border-top:1px solid #dfe5ed;border-bottom:1px solid #dfe5ed;padding:9px 11px;white-space:nowrap;font-weight:650; }
.report-table th:first-child { border-left:1px solid var(--border);border-radius:8px 0 0 8px; }
.report-table th:last-child { border-right:1px solid var(--border);border-radius:0 8px 8px 0; }
.report-table td { padding:11px;border-bottom:1px solid #e7ebf1;vertical-align:top;font-weight:400; }
.report-table tbody tr:hover { background:#fafbfd; }
.report-table .r, .report-table--compact .r { text-align:right; }
.report-table--compact { min-width:640px; }
.report-pager { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;color:var(--muted);font-size:12.5px; }
.report-pager > div { display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end; }
.report-pager__page { min-width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e2e7ef;border-radius:9px;background:#fff;color:#697286;font-size:12.5px;font-weight:600; }
.report-pager__page:hover { text-decoration:none;color:var(--text);border-color:#b7c4ce; }
.report-pager__page.is-active { color:#fff;background:var(--primary);border-color:var(--primary); }
.report-pager .is-disabled { opacity:.45;pointer-events:none; }
@media (max-width:1100px){ .saved-views{align-items:flex-start;flex-direction:column;} .saved-views__form{width:100%;flex-wrap:wrap;} .saved-views__form input[type="text"]{flex:1 1 180px;} .report-table-filters{grid-template-columns:repeat(auto-fit,minmax(138px,1fr));} }
.table { width:100%;border-collapse:separate;border-spacing:0; }
.table th,.table td { text-align:left;padding:10px 11px;border-bottom:1px solid #e7ebf1;vertical-align:top;font-size:13px; }
.table th { font-size:10.5px;text-transform:uppercase;letter-spacing:.03em;color:#697286;background:#f0f3f7;font-weight:650; }
.table tr:last-child td { border-bottom:none; }
/* .tbl — the compact list table used by tickets + the partner portal lists. Same look as .table. */
.tbl { width:100%;border-collapse:separate;border-spacing:0; }
.tbl th,.tbl td { text-align:left;padding:11px 14px;border-bottom:1px solid #e7ebf1;vertical-align:middle;font-size:13px; }
.tbl th { font-size:10.5px;text-transform:uppercase;letter-spacing:.03em;color:#697286;background:#f0f3f7;font-weight:650;white-space:nowrap; }
.tbl tbody tr:last-child td { border-bottom:none; }
.tbl tbody tr:hover td { background:var(--well); }
.tabs { display:flex;gap:2px;border-bottom:1px solid var(--border);margin-bottom:18px;flex-wrap:wrap; }
.tabs a { padding:9px 15px;color:var(--muted);font-weight:600;border-bottom:2px solid transparent; }
.tabs a.active { color:var(--primary);border-bottom-color:var(--primary); }
.tabs a:hover { text-decoration:none;color:var(--text); }

/* ---------- Login ---------- */
.login-body { display:grid;place-items:center;min-height:100vh;background:linear-gradient(135deg,#e8f2ec,#eef3f0); }
.login-card { background:var(--surface);border:1px solid var(--border);border-radius:16px;box-shadow:var(--sh3);padding:34px;width:348px; }
.login-card h1 { font-size:20px; } .login-card .field { margin-bottom:14px; } .login-card button { width:100%;margin-top:8px;justify-content:center; }

/* ---------- Trackers / checklists ---------- */
.tracker { margin-bottom:18px; }
.tracker__head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:6px; }
.tracker__name { font-weight:600; font-size:13px; }
.tracker__count { font-size:12px; font-weight:700; color:var(--muted); }
.tracker__bar { height:6px; background:var(--well); border-radius:99px; overflow:hidden; margin-bottom:10px; }
.tracker__bar span { display:block; height:100%; background:var(--green); border-radius:99px; transition:width .4s ease; }
.tracker__items { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:7px; }
.tracker__item { display:flex; flex-direction:column; gap:3px; }
.tracker__row { display:flex; align-items:center; gap:10px; }
.tracker__label { flex:1; font-size:13px; }
.tracker__sel { width:auto; font-size:12px; padding:5px 8px; margin:0; }
.tracker__item.tstat-done .tracker__label { color:var(--muted); text-decoration:line-through; }
.tracker__item.tstat-na .tracker__label { color:var(--muted); }
/* board card progress chips */
.kcard__trackers { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.tchip { display:inline-flex; align-items:center; gap:4px; max-width:100%; font-size:10.5px; font-weight:600; color:var(--muted); background:var(--well); border:1px solid var(--border); border-radius:6px; padding:2px 6px; }
.tchip__n { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:88px; }
.tchip b { color:var(--text); font-variant-numeric:tabular-nums; }
.tchip.is-part { border-color:#f1c98a; background:#fff8ec; color:#8a5a00; } .tchip.is-part b { color:#8a5a00; }
.tchip.is-done { border-color:#b6e3c9; background:#e7f6ee; color:#0f6b3a; } .tchip.is-done b { color:#0f6b3a; }
/* card Costs tab */
.cost-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.cost-row__name { flex:1; font-size:13px; }
.cost-row__amt { display:inline-flex; align-items:center; gap:4px; color:var(--muted); font-size:13px; }
.cost-row__amt input { width:110px; text-align:right; margin:0; }
.cost-row__note { width:130px; margin:0; font-size:12px; }
.cost-total { display:flex; justify-content:space-between; align-items:center; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); font-size:14px; }
.cost-total b { font-size:18px; }

/* admin checklist item rows */
.cl-items { display:flex; flex-direction:column; gap:6px; }
.cl-row { display:flex; align-items:center; gap:10px; }
.cl-row__label { flex:1; }
.cl-row__sort { width:64px; }
.cl-row--add { border-top:1px dashed var(--border); padding-top:10px; margin-top:4px; }

/* ---------- Compatibility (secondary pages: detail, documents, admin) ---------- */
.page-title { font-size:18px;font-weight:700; }
.grid-2 { display:grid;grid-template-columns:1fr 1fr;gap:16px; }
.grid-3 { display:grid;grid-template-columns:repeat(3,1fr);gap:16px; }
@media (max-width:900px){ .grid-2,.grid-3{grid-template-columns:1fr;} }
@media (max-width:900px){ .report-modebar,.report-insights{grid-template-columns:1fr 1fr;} }
@media (max-width:640px){ .reports{padding:16px 14px 44px;} .reports__head{flex-direction:column;} .report-modebar,.report-insights{grid-template-columns:1fr;} .report-pager{align-items:flex-start;flex-direction:column;} .report-pager > div{justify-content:flex-start;} }
.badge { display:inline-block;padding:2px 9px;border-radius:999px;font-size:12px;font-weight:600; }
.badge-red{color:var(--red);background:#fdeceb;} .badge-amber{color:var(--amber);background:#fff3df;} .badge-green{color:var(--green);background:#e7f6ee;}
.table.compact th,.table.compact td { padding:8px 9px;font-size:12.5px; }
.gate-ok { color:var(--green);font-weight:600; } .gate-bad { color:var(--red);font-weight:600; }
.gate-list { list-style:none;padding:0;margin:6px 0;display:flex;flex-direction:column;gap:4px; }
.kv { display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:16px; }
.kv > div { background:var(--well);border-radius:9px;padding:10px 12px; }
.kv__k { display:block;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.03em; }
.kv__v { font-weight:600; }
.form-grid label, .field label { display:block; }

@media (prefers-reduced-motion:reduce) { *{animation:none !important;transition:none !important;} }

/* ---- Finance (POs + invoices) ---- */
.fin-stats { display:flex;gap:14px;flex-wrap:wrap;margin:0 0 18px; }
.fin-stat { flex:1 1 200px;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:12px 16px;box-shadow:var(--sh1); }
.fin-stat__k { display:block;font-size:12px;color:var(--muted);font-weight:600; }
.fin-stat__v { display:block;font-size:22px;font-weight:700;margin-top:2px; }
.fin-stat__warn { display:inline-block;margin-top:4px;font-size:12px;font-weight:600;color:#b3261e; }
.fin-stat__sub { display:block;margin-top:2px;font-size:11px; }
.ta-r { text-align:right; }
.mini-select, .mini-input { font-size:12.5px;padding:4px 6px;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--text); }
.mini-input { width:92px; }
.pay-form { display:flex;gap:6px;align-items:center;flex-wrap:nowrap;margin:0; }
.pay-form .mini-input[type=date] { width:138px; }

/* ---- Card: contacts + contractors ---- */
.contact-block { padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid var(--border); }
.contractor-row { display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid var(--border-2); }
.contractor-row__name { font-weight:600;font-size:13.5px; }
.contractor-row__meta { font-size:12.5px; }
.contractor-add { display:flex;gap:8px;align-items:center;margin-top:10px;flex-wrap:wrap; }
.contractor-add select { flex:1 1 auto;min-width:130px; }

/* ---- Admin: configurable stage rows ---- */
.stage-phasehead { display:flex;gap:10px;align-items:center;margin:0 0 10px; }
.stage-phasehead__in { flex:1;min-width:0;font-size:1rem;font-weight:700;color:var(--text);border:1px solid transparent;border-radius:7px;padding:5px 8px;background:transparent; }
.stage-phasehead__in:hover { border-color:var(--border-2); }
.stage-phasehead__in:focus { border-color:var(--primary);background:var(--surface);outline:none; }
.stage-row { display:flex;gap:8px;align-items:center;padding:6px 0;border-bottom:1px solid var(--border-2);margin:0; }
.stage-row--add { border-bottom:none;margin-top:8px; }
.stage-row__active { display:flex;align-items:center;gap:5px;font-size:12.5px;color:var(--muted);white-space:nowrap; }

/* ---- Phase-gated (not-yet-active) trackers ---- */
.tracker--locked { opacity:.55; }
.tracker--locked .tracker__sel { display:none; }
.tracker__lock { font-size:10.5px;font-weight:600;color:#b26a00;background:#fdeccd;border-radius:5px;padding:1px 6px;white-space:nowrap;vertical-align:middle;margin-left:6px; }

/* ---- Calendar module: month grid ---- */
.cal-summary { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 14px; }
.cal-summary__card { min-height:82px;border:1px solid #e8eae2;border-radius:16px;background:rgba(255,255,252,.9);box-shadow:0 8px 20px rgba(25,31,46,.045);padding:14px 16px;display:flex;flex-direction:column;justify-content:center;gap:5px; }
.cal-summary__card b { font-size:22px;line-height:1;font-weight:720;color:#1f2638; }
.cal-summary__card span { color:#7a8394;font-size:12px;font-weight:560; }
.cal-summary__card--inst { border-color:#d6dcc5;background:#fffdf4; }
.cal-summary__card--survey { border-color:#d7e4ed;background:#f8fbfd; }
.cal-summary__card--valves { border-color:#d8e8e2;background:#f8fcfa; }
.cal-summary__card--foundation { border-color:#e2ddd0;background:#fbfaf5; }
.cal-filters { display:flex;gap:7px;flex-wrap:wrap;margin:0 0 12px; }
.cal-filter { font:inherit;font-size:11.5px;font-weight:560;border:1px solid #e2e7ef;background:#fff;color:#7a8394;border-radius:999px;padding:5px 10px;cursor:pointer;opacity:.48; }
.cal-filter.is-on { opacity:1;color:#24263b;box-shadow:0 4px 10px rgba(25,31,46,.04); }
/* Legend dropdown: desktop shows the chips inline (summary hidden); the mobile
   override layer collapses them into a "Filter events" dropdown. */
.cal-legend__sum { display:none; }
.cal-legend:not([open]) > .cal-filters { display:flex; }
.cal-dow { display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid #e2e7ef;background:#f7f8f4; }
.cal-dow span { padding:10px 12px;font-size:10.5px;font-weight:650;text-transform:uppercase;letter-spacing:.03em;color:#7d8796; }
.cal-grid { display:grid;grid-template-columns:repeat(7,1fr); }
.cal-cell { min-height:112px;border-right:1px solid #e7ebf1;border-bottom:1px solid #e7ebf1;padding:8px;display:flex;flex-direction:column;gap:4px;min-width:0;background:rgba(255,255,255,.72); }
.cal-cell:nth-child(7n) { border-right:none; }
.cal-cell--out { background:#f7f8f4;opacity:.72; }
.cal-cell--today { background:#f7fbf0;box-shadow:inset 0 0 0 1px #dbe9c6; }
.cal-day { font-size:11.5px;font-weight:650;color:#7d8796;line-height:1; }
.cal-day--today { color:#11130f;background:#b8db55;border-radius:999px;width:22px;height:22px;display:inline-grid;place-items:center; }
.cev { display:flex;align-items:center;gap:4px;font:inherit;font-size:10px;font-weight:560;border:none;border-radius:7px;padding:3px 6px;cursor:pointer;text-align:left;max-width:100%;min-width:0; }
.cev span { white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0; }
.cev b { flex:none;font-weight:650; }
.cal-more { font-size:10.5px;color:#7d8796;font-weight:560; }
@media (max-width:900px){ .cal-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } .cal-cell { min-height:78px; } .cev span { display:none; } }

/* ---- Calendar module: timeline ---- */
.gtl-summary { display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 12px; }
.gtl-sum { font-size:12.5px;font-weight:700;border-radius:999px;padding:5px 12px; }
.gtl { min-width:980px; }
.gtl-head { display:flex;border-bottom:1px solid var(--border);background:var(--well);position:sticky;top:0;z-index:3; }
.gtl-row { display:flex;border-bottom:1px solid var(--border-2); }
.gtl-row:hover { background:var(--surface-2); }
.gtl-label { flex:0 0 250px;min-width:0;padding:9px 12px;display:flex;align-items:center;gap:8px;border-right:1px solid var(--border); }
.gtl-dot { width:11px;height:11px;border-radius:50%;flex:none;box-shadow:0 0 0 3px rgba(16,24,40,.06); }
.gtl-name { font:inherit;font-size:12.5px;font-weight:600;border:none;background:none;color:var(--text);cursor:pointer;padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0; }
.gtl-name:hover { color:var(--primary);text-decoration:underline; }
.gtl-meta { font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-left:auto; }
.gtl-idcol { min-width:0;display:flex;flex-direction:column;gap:1px; }
.gtl-sub { display:flex;align-items:center;gap:4px;font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0; }
.gtl-cdot { width:8px;height:8px;border-radius:50%;flex:none;box-shadow:0 0 0 1px rgba(0,0,0,.12); }
.gtl-cn { font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;min-width:0; }
.gtl-track { flex:1;position:relative;min-height:38px;background-image:repeating-linear-gradient(to right,var(--border-2) 0 1px,transparent 1px calc(100%/12)); }
.gtl-track--head { display:grid;grid-template-columns:repeat(12,1fr);background-image:none;min-height:0; }
.gtl-month { font-size:10.5px;font-weight:700;color:var(--muted);padding:8px 0 8px 8px;border-left:1px solid var(--border-2);white-space:nowrap;overflow:hidden; }
.gtl-month--now { color:var(--primary); }
.gtl-today { position:absolute;top:0;bottom:0;width:2px;background:var(--primary);opacity:.6;z-index:1; }
.gtl-base { position:absolute;top:50%;height:6px;transform:translateY(-50%);background:var(--border-2);border-radius:99px; }
.gtl-slip { position:absolute;top:50%;height:10px;transform:translateY(-50%);background:repeating-linear-gradient(45deg,#f5b5b1 0 6px,#fcdedb 6px 12px);border:1px solid #d6322c;border-radius:99px;z-index:1; }
.gtl-mark { position:absolute;top:50%;transform:translate(-50%,-50%);font-size:13px;line-height:1;z-index:2;cursor:default;background:transparent; }
.gtl-mark--exp { color:var(--primary); }
.gtl-mark--act { color:#0b5ed7; }
.gtl-mark--comm { color:#0a7d8c; }
.gtl-mark--hand { color:#1a7f46;font-weight:800; }

/* ---- Finance: spend plan matrix ---- */
.spend-wrap { overflow-x:auto; }
.spend-table { border-collapse:separate;border-spacing:0;min-width:1080px;width:100%; }
.spend-table th, .spend-table td { white-space:nowrap; }
.spend-sticky { position:sticky;left:0;background:var(--surface);z-index:1;min-width:200px;max-width:260px;overflow:hidden;text-overflow:ellipsis;box-shadow:1px 0 0 var(--border); }
.spend-table thead th { background:var(--well);position:sticky;top:0; }
.spend-table thead .spend-sticky { z-index:2; }
.spend-cell { min-width:72px; }
.spend-cell .spend-plan, .spend-cell .spend-act { display:block;line-height:1.3; }
.spend-plan { font-size:11.5px;color:var(--muted); }
.spend-act { font-size:12px;font-weight:700; }
.spend-ok { color:#1a7f46; }
.spend-over { color:#d6322c; }
.spend-now { background:var(--tint); }
.spend-total { border-left:2px solid var(--border); }
.spend-table tfoot td { border-top:2px solid var(--border);background:var(--surface-2);font-weight:600; }
.cost-row__month { width:132px;flex:none; }

/* ---- Cost payment plans (tranches) ---- */
.plan { margin:2px 0 4px 14px;border-left:2px solid var(--border);padding:2px 0 2px 12px;display:flex;flex-direction:column;gap:4px; }
.plan-row { display:flex;align-items:center;gap:8px;font-size:12px;flex-wrap:wrap; }
.plan-row__label { font-weight:600;min-width:150px; }
.plan-row__pct { color:var(--muted);min-width:34px;text-align:right; }
.plan-row__amt { font-weight:700;min-width:78px;text-align:right; }
.plan-row__trig { font-size:10.5px;color:var(--muted);background:var(--well);border-radius:5px;padding:1px 7px;white-space:nowrap; }
.plan-row__month { font-size:11px;color:var(--muted);min-width:60px; }
.plan-row--due .plan-row__amt { color:#b26a00; }
.plan-row--paid { opacity:.75; } .plan-row--paid .plan-row__amt { color:#1a7f46; }
.plan-apply { margin:2px 0 4px 14px; }
.cost-upload { display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0 14px 14px;padding-bottom:10px;border-bottom:1px dashed var(--border-2); }
.cost-upload input[type=file] { font-size:11.5px;max-width:250px; }
.cost-upload select { font-size:11.5px;padding:4px 6px; }

/* ---- Admin: payment plan template editor ---- */
.sched { margin:0 0 14px 16px;border-left:2px solid var(--border);padding:4px 0 4px 12px; }
.sched__head { font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);margin-bottom:6px; }
.sched-row { display:flex;align-items:center;gap:8px;margin:0 0 5px;font-size:12.5px; }
.sched-row__label { min-width:200px;font-weight:600; }

/* ---- Documents: grouped per project ---- */
.doc-search { font:inherit;font-size:13px;border:1px solid var(--border-2);border-radius:9px;padding:7px 12px;width:280px;background:var(--surface); }
.doc-uploader { padding:14px 18px;margin-bottom:14px; }
.doc-uploader summary { cursor:pointer;font-size:13px; }
.doc-uploader summary::-webkit-details-marker { display:none; }
.docgrp { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--sh1);margin-bottom:10px;overflow:hidden; }
.docgrp__head { display:flex;align-items:center;gap:10px;padding:12px 16px;cursor:pointer;list-style:none;flex-wrap:wrap; }
.docgrp__head::-webkit-details-marker { display:none; }
.docgrp__head:hover { background:var(--surface-2); }
.docgrp__chev { color:var(--muted);transition:transform .15s;flex:none; }
.docgrp[open] .docgrp__chev { transform:rotate(90deg); }
.docgrp__name { font-weight:700;font-size:13.5px; }
.docgrp__meta { font-size:12px; }
.docgrp__latest { font-size:11.5px;margin-left:auto; }
.docgrp__open { flex:none; }
.docgrp__table { border-top:1px solid var(--border); }
.docgrp__table td { vertical-align:middle; }
@media (max-width:720px){ .docgrp__latest { display:none; } .doc-search { width:170px; } }

/* ---- Tracker item documents ---- */
.tdoc-badge { font-size:10px;font-weight:700;color:#b26a00;background:#fdeccd;border-radius:5px;padding:1px 6px;margin-left:6px;white-space:nowrap;text-decoration:none;display:inline-block; }
.tdoc-badge--miss { color:#d6322c;background:#fcdedb; }
.tstat-done .tdoc-badge { text-decoration:none; }
.tdocs { display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-left:2px; }
.tdoc-chip { font-size:11px;font-weight:600;color:var(--primary);background:var(--tint);border-radius:6px;padding:2px 8px;white-space:nowrap; }
.tdoc-chip:hover { text-decoration:none;background:#dbe7ff; }
.tdoc-up { display:inline-block; }
.tdoc-up summary { font-size:11px;color:var(--muted);cursor:pointer;list-style:none;font-weight:600;padding:2px 6px;border-radius:6px; }
.tdoc-up summary::-webkit-details-marker { display:none; }
.tdoc-up summary:hover { background:var(--well);color:var(--text); }
.tdoc-up form { display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:4px;padding:8px;background:var(--surface-2);border:1px solid var(--border);border-radius:8px; }
.tdoc-up input[type=file] { font-size:11px;max-width:210px; }
.tdoc-up select { font-size:11px;padding:3px 6px; }

/* ---- In-app document viewer ---- */
.docviewer { width:min(1100px,96vw);height:92vh;flex-direction:column;padding:0; } /* NO display here — a closed <dialog> must stay display:none */
.docviewer[open] { display:flex; }
.docviewer__bar { display:flex;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--border);flex:none;background:var(--surface); }
.docviewer__name { font-weight:700;font-size:13px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.docviewer__frame { flex:1;border:none;width:100%;background:#525659; }

/* ---- Dashboard: spend planned vs actual ---- */
.spendbars { display:flex;flex-direction:column;gap:12px; }
.spendbar { display:grid;grid-template-columns:64px 1fr 130px;gap:10px;align-items:center;border-radius:8px;padding:4px 6px; }
.spendbar--now { background:var(--tint); }
.spendbar__m { font-size:12px;font-weight:700; }
.spendbar__m small { color:var(--muted);font-weight:600; }
.spendbar__tracks { display:flex;flex-direction:column;gap:3px;min-width:0; }
.spendbar__track { height:8px;background:var(--well);border-radius:99px;overflow:hidden; }
.spendbar__fill { display:block;height:100%;border-radius:99px;animation:growbar .6s cubic-bezier(.22,1,.36,1); }
.spendbar__fill--plan { background:#9db9e8; }
.spendbar__fill--act { background:var(--green); }
.spendbar__fill--over { background:var(--red); }
.spendbar__v { text-align:right;font-size:11.5px;display:flex;flex-direction:column;line-height:1.35; }
.spendbar__plan { color:var(--muted); }
.spendbar__act { color:#1a7f46;font-weight:700; }
.spendbar__over { color:#d6322c;font-weight:700; }

/* ---- Team worklist tables (KfW / DSO) ---- */
.ta-c { text-align:center; }
.team-wrap { overflow-x:auto;border-radius:18px!important;background:rgba(255,255,252,.92);box-shadow:0 8px 20px rgba(31,38,56,.045)!important; }
.team-table { border-collapse:separate;border-spacing:0;min-width:820px;width:100%; }
.team-table th, .team-table td { white-space:nowrap;vertical-align:middle; }
.team-sticky { position:sticky;left:0;background:rgba(255,255,252,.98);z-index:1;min-width:230px;box-shadow:1px 0 0 #e7ebf1; }
.team-table thead th { background:#f0f3f7;position:sticky;top:0;font-size:10.5px;font-weight:650;color:#697286;vertical-align:middle;padding-top:10px;padding-bottom:10px; }
.team-table thead .team-sticky { z-index:2; }
.team-col { min-width:118px; }
.team-col .team-colname { display:block;max-width:132px;margin:0 auto 5px;text-align:center;font-weight:650; }
.team-name { font:inherit;font-weight:650;font-size:13px;color:#006b4a;background:none;border:none;cursor:pointer;padding:0; }
.team-name:hover { color:var(--primary);text-decoration:underline; }
.team-cell { border-left:1px solid #e7ebf1; }
.team-cell.tstat-done { background:#eef8f2; } .team-cell.tstat-doing { background:#fff8ec; } .team-cell.tstat-na { background:#f4f6f8; }
.team-sel { font-size:11.5px;padding:4px 7px;border:1px solid #dfe5ed;border-radius:8px;background:#fff; }
.team-prog { display:flex;align-items:center;gap:6px;justify-content:center; }
.team-prog__bar { width:60px;height:6px;background:var(--well);border-radius:99px;overflow:hidden; }
.team-prog__bar span { display:block;height:100%;background:var(--green);border-radius:99px; }
.team-prog__n { font-size:11px;color:#697286;font-weight:560; }

/* ---- IoT scaffold ---- */
.iot-hero { display:flex;gap:16px;align-items:center;margin-bottom:16px; }
.iot-hero__icon { width:60px;height:60px;border-radius:14px;background:var(--tint);display:grid;place-items:center;flex:none; }
.iot-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:16px; }
.iot-kpi { text-align:center; }
.iot-kpi__v { font-size:26px;font-weight:800;color:var(--muted); }
.iot-kpi__k { font-size:12px;color:var(--muted);font-weight:600;margin-top:2px; }

/* ---- Schedule colour-coding: supplier (bar fill) + client (left stripe) ---- */
/* Month view: multi-day install windows drawn as bars spanning the day columns. */
.cal-month { display:block; }
.cal-week { position:relative; }
.cal-week__days { display:grid;grid-template-columns:repeat(7,1fr); }
.cal-lanes { flex:none;pointer-events:none; }
.cal-week__spans { position:absolute;top:30px;left:0;right:0;display:grid;grid-template-columns:repeat(7,1fr);grid-auto-rows:16px;row-gap:2px;pointer-events:none;z-index:3; }
.cal-span { pointer-events:auto;margin:0 3px;min-width:0;display:flex;align-items:center;gap:4px;font:inherit;font-size:10px;font-weight:600;border:1px solid color-mix(in srgb,var(--pc) 72%,#fff);padding:1px 7px;cursor:pointer;text-align:left;white-space:nowrap;overflow:hidden;color:#28301f;background:color-mix(in srgb,var(--pc) 18%,#fff);box-shadow:0 1px 0 rgba(25,31,46,.04); }
body.bzp-by-supplier .cal-span { background:color-mix(in srgb,var(--sup) 18%,#fff);border-color:color-mix(in srgb,var(--sup) 58%,#fff); }
body.bzp-by-client   .cal-span { background:color-mix(in srgb,var(--cli) 18%,#fff);border-color:color-mix(in srgb,var(--cli) 58%,#fff); }
.cal-span span { overflow:hidden;text-overflow:ellipsis;min-width:0; }
.cal-span__client { flex:none;font-style:normal;font-weight:600;display:inline-flex;align-items:center;gap:3px;padding-left:6px;margin-left:2px;border-left:1px solid rgba(255,255,255,.35);opacity:.95; }
.cal-span__client i { width:7px;height:7px;border-radius:50%;flex:none;box-shadow:0 0 0 1px rgba(255,255,255,.7); }
.cal-span.is-start { border-top-left-radius:8px;border-bottom-left-radius:8px; }
.cal-span.is-end { border-top-right-radius:8px;border-bottom-right-radius:8px; }
.cal-span:not(.is-start) { box-shadow:inset 3px 0 0 0 rgba(255,255,255,.72); }
.cal-span-more { align-self:center;margin:1px 8px 0;padding:1px 8px;border-radius:999px;background:#f4f6f8;color:#7a8394;font-size:10px;font-weight:560;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.gtl-win { position:absolute;top:50%;height:14px;transform:translateY(-50%);background:var(--sup);border-left:4px solid var(--cli);border-radius:4px;z-index:1;box-shadow:inset 0 0 0 1px rgba(0,0,0,.10); }
.sched-by-client .gtl-win { background:var(--cli);border-left-color:var(--sup); }
.sched-key { display:flex;align-items:center;gap:10px 16px;flex-wrap:wrap;margin:0 0 14px;padding:10px 12px;background:rgba(255,255,252,.86);border:1px solid #e5e9ef;border-radius:14px;box-shadow:0 8px 20px rgba(25,31,46,.04); }
.seg--sm { padding:2px; }
.sched-key__toggle button { font:inherit;font-size:12px;font-weight:560;border:none;background:transparent;color:#7a8394;border-radius:999px;padding:6px 11px;cursor:pointer; }
.sched-key__toggle button.active { background:#11130f;color:#fff;box-shadow:0 8px 18px rgba(17,19,15,.14); }
.sched-grp { display:flex;align-items:center;gap:8px;flex-wrap:wrap; }
.sched-grp--supplier,.sched-grp--client { display:none; }
body.bzp-by-supplier .sched-grp--phase,body.bzp-by-client .sched-grp--phase { display:none; }
body.bzp-by-supplier .sched-grp--supplier { display:flex; }
body.bzp-by-client .sched-grp--client { display:flex; }
.sched-grp__lbl { font-size:10.5px;font-weight:650;text-transform:uppercase;letter-spacing:.03em;color:#8a9288; }
.sched-sw { display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:520;color:#4f574f; }
.sched-sw i { width:10px;height:10px;border-radius:3px;flex:none;box-shadow:inset 0 0 0 1px rgba(0,0,0,.12); }
.sched-key__hint { font-size:11.5px;margin-left:auto; }

/* ---- Timeline: install-week band ---- */
.gtl-week { position:absolute;top:50%;height:12px;transform:translateY(-50%);background:repeating-linear-gradient(45deg,#cfe7dc 0 5px,#e8f2ec 5px 10px);border:1px solid #0b6b48;border-radius:4px;z-index:1; }

/* ---- Card head: contractor + system-at-a-glance ---- */
.cm__contractor { font-size:12px;color:var(--text);margin-top:5px;display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-weight:600; }
.cm__sysbadge { font-weight:600;font-size:10.5px;color:var(--muted);background:var(--well);border-radius:5px;padding:1px 7px; }
.cm__sysbadge--hp { color:#0b5ed7;background:#e5edff; }

/* ---- Protocols (commissioning / handover doc attach) ---- */
.proto-list { display:flex;flex-direction:column;gap:8px; }
.proto-up { display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:var(--surface-2);border:1px solid var(--border);border-radius:9px;padding:8px 12px;margin:0; }
.proto-up__label { font-size:12.5px;font-weight:600;flex:1;min-width:130px; }
.proto-up--miss .proto-up__label { color:var(--muted);font-weight:500; }
.proto-up input[type=file] { font-size:11.5px;max-width:190px; }

/* ---- Costs redesign: cost cards ---- */
.costcards { display:flex;flex-direction:column;gap:12px; }
.costcard { border:1px solid var(--border);border-radius:12px;padding:14px 16px;background:var(--surface);box-shadow:var(--sh1); }
.costcard__head { display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap; }
.costcard__title { display:flex;flex-direction:column;min-width:0; }
.costcard__name { font-weight:700;font-size:14px; }
.costcard__paidnote { font-size:11.5px;color:var(--green);font-weight:600;margin-top:1px; }
.costcard__paidnote.muted { color:var(--muted);font-weight:400; }
.costcard__amtform { display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:0; }
.costcard__cur { color:var(--muted);font-weight:700; }
.costcard__amtin { width:104px;font-weight:700;text-align:right; }
.costcard__paidlbl { font-size:11px;color:var(--muted);font-weight:700;margin-left:2px; }
.costcard__paidin { width:92px; }
.costcard__month { width:120px; } .costcard__notein { width:130px; }
/* Costs tab summary: CE Quote / Sub Costs / Actual Paid */
.cost3 { display:flex;gap:10px;flex-wrap:wrap;margin:0 0 14px; }
.cost3__box { flex:1 1 120px;min-width:120px;background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:2px; }
.cost3__box--paid { background:var(--tint);border-color:#cfe7dc; }
.cost3__k { font-size:10px;text-transform:uppercase;letter-spacing:.03em;color:var(--muted);font-weight:700; }
.cost3__v { font-size:1.15rem;font-weight:800;color:var(--text); }
.cost3__sub { font-size:11px;font-weight:600; }
.costcard__amt { font-size:16px;font-weight:800; }
.costcard__bar { height:7px;background:var(--well);border-radius:99px;overflow:hidden;margin:12px 0 6px; }
.costcard__bar span { display:block;height:100%;background:var(--green);border-radius:99px;animation:growbar .6s cubic-bezier(.22,1,.36,1); }
.sched2 { width:100%;border-collapse:collapse;margin-top:4px; }
.sched2-row td { padding:6px 6px;border-top:1px solid var(--border-2);font-size:12.5px;vertical-align:middle; }
.sched2-row--paid .sched2__label { color:var(--muted); }
.sched2__label { font-weight:600; }
.sched2__amt { text-align:right;white-space:nowrap;font-weight:700; }
.trigpill { font-size:10.5px;color:var(--muted);background:var(--well);border-radius:5px;padding:1px 7px;white-space:nowrap; }
.sched2__month { text-align:right;white-space:nowrap;font-size:11.5px; }
.sched2__sel { font-size:11.5px;padding:3px 6px;border-radius:6px;border:1px solid var(--border); }
.sched2__sel.sel-paid { color:#1a7f46;border-color:#bfe6cd;background:#eaf7ef; }
.sched2__sel.sel-due { color:#b26a00;border-color:#f0d9a8;background:#fdf4e3; }
.costcard__actions { display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px;padding-top:10px;border-top:1px solid var(--border-2); }
.costcard__inv summary { display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;color:var(--muted);cursor:pointer;list-style:none;padding:6px 11px;border:1px solid var(--border-2);border-radius:9px; }
.costcard__inv summary::-webkit-details-marker { display:none; }
.costcard__inv[open] summary { color:var(--text);background:var(--well); }
.costcard__inv form { display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px;padding:10px;background:var(--surface-2);border:1px solid var(--border);border-radius:9px; }
.costcard__inv input[type=file] { font-size:11.5px;max-width:200px; }
.cost-grandtotal { display:flex;align-items:center;justify-content:space-between;margin-top:14px;padding:14px 16px;background:var(--tint);border-radius:12px;font-weight:700; }
.cost-grandtotal b { font-size:19px; }

/* ---- Timeline install-week band: slipped ---- */
.gtl-week--slip { background:repeating-linear-gradient(45deg,#f5b5b1 0 5px,#fcdedb 5px 10px);border-color:#d6322c; }

/* ---- Tranche month picker ---- */
.sched2__mon { font-size:11px;padding:3px 5px;border:1px solid var(--border);border-radius:6px;width:120px;background:var(--surface);color:var(--muted); }
.sched2-row--paid .sched2__mon { color:#1a7f46;border-color:#bfe6cd; }

/* ---- Spend plan: breakdown by cost type ---- */
.sp-metrics { display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:0 0 16px; }
.sp-metric { background:var(--bg);border-radius:8px;padding:12px 14px; }
.sp-metric .k { font-size:12px;color:var(--muted); }
.sp-metric .v { font-size:23px;font-weight:600;margin-top:2px; }
.sp-metric--link { display:block;text-decoration:none;color:inherit;transition:background .12s,box-shadow .12s; }
.sp-metric--link:hover { background:var(--tint);box-shadow:0 0 0 1px var(--border); }
.sp-card { background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:14px 16px;margin-bottom:12px; }
.sp-proj { display:flex;justify-content:space-between;align-items:flex-start;gap:12px; }
.sp-name { background:none;border:none;padding:0;font:inherit;font-size:15px;font-weight:600;color:var(--primary);cursor:pointer;text-align:left; }
.sp-name:hover { text-decoration:underline; }
.sp-proj .an { font-size:12px;color:var(--muted);margin-top:1px; }
.sp-pend { text-align:right;white-space:nowrap; }
.sp-pend .lbl { font-size:11px;color:var(--muted); }
.sp-pend .amt { font-size:20px;font-weight:600; }
.sp-row { border-top:1px solid var(--border);padding-top:10px;margin-top:10px; }
.sp-rh { display:flex;justify-content:space-between;align-items:baseline;gap:10px; }
.sp-rh .nm { font-size:13.5px;font-weight:600; }
.sp-rh .pd { font-size:13.5px;font-weight:600;white-space:nowrap; }
.sp-party { font-weight:400;font-size:12px;color:var(--muted);border:1px solid var(--border);border-radius:99px;padding:1px 8px;margin-left:6px;white-space:nowrap; }
.sp-subline { font-size:12px;color:var(--muted);margin:3px 0 6px; }
.sp-bar { height:6px;background:var(--bg);border-radius:99px;overflow:hidden; }
.sp-bar span { display:block;height:100%;background:var(--green);border-radius:99px; }
.sp-tr { display:flex;gap:6px;flex-wrap:wrap;margin-top:9px; }
.sp-pill { font-size:11.5px;padding:3px 9px;border-radius:99px;border:1px solid var(--border);color:var(--muted); }
.sp-pill.paid { background:#e1f5ee;color:#0f6e56;border-color:#9fe1cb; }
@media (max-width:640px){ .sp-metrics{grid-template-columns:1fr} }

/* ---- Pagination ---- */
.pager { display:flex;gap:6px;align-items:center;justify-content:center;flex-wrap:wrap;margin-top:14px; }
.pager__gap { color:var(--muted);padding:0 2px; }

/* ---- Worklist upgrades: search, city groups, column stats, docs ---- */
.wl-toolbar { display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 14px;padding:12px 14px;border:1px solid #e5e9ef;border-radius:18px;background:rgba(255,255,252,.86);box-shadow:0 8px 20px rgba(25,31,46,.04); }
.wl-search { display:flex;gap:6px;align-items:center;margin:0; }
.wl-search input[type=search] { width:280px;font-size:13px;border-radius:10px; }
.wl-count { font-size:12.5px;font-weight:500; }
/* Stage bar: one click per step, answering "where are we on what" without reading the matrix.
   Two rows — where each project is stuck, and how far the fleet has got (the funnel). */
.wl-stages { display:flex;flex-direction:column;gap:6px;margin:-6px 0 14px; }
.wl-stages__row { display:flex;align-items:baseline;gap:6px; }
.wl-stages__strip { display:flex;flex-wrap:wrap;gap:6px;min-width:0; }
.wl-stages__lead { font-size:11.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--muted);
                   margin-right:2px;min-width:74px; }
.wl-stage { display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;text-decoration:none;color:#3c4453;
            background:#fff;border:1px solid #e0e5ec;border-radius:999px;padding:5px 11px;white-space:nowrap; }
.wl-stage:hover { border-color:var(--primary);color:var(--primary); }
.wl-stage b { font-variant-numeric:tabular-nums;font-weight:700;color:var(--muted); }
.wl-stage.is-on { background:var(--primary);border-color:var(--primary);color:#fff; }
.wl-stage.is-on b { color:rgba(255,255,255,.82); }
.wl-stage--done { color:#0f6b3a;border-color:#dbe9e1; }
.wl-stage--done:hover { border-color:#0f6b3a;color:#0f6b3a; }
.wl-stage--done b { color:#4c8a68; }
.wl-stage--done.is-on { background:#0f6b3a;border-color:#0f6b3a;color:#fff; }
.wl-stage--done.is-on b { color:rgba(255,255,255,.82); }
/* A funnel keeps its empty rungs — "Paid 0" is the answer, not an absence. */
.wl-stage.is-empty { opacity:.55; }
.wl-stage.is-empty.is-on { opacity:1; }
.team-stage { display:block;font-size:11px;font-weight:600;color:#5a6274;margin-top:3px;max-width:240px;
              overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.team-stage--done { color:#0f6b3a; }
.team-cityrow td { background:#f7f8f4;font-weight:600;font-size:11.5px;letter-spacing:.02em;color:#697286;padding:8px 12px;position:sticky;left:0; }
.team-sub { font-size:11px;font-weight:400;display:block;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px; }
.subt-beglink { display:inline-block;margin-top:3px;font-size:11.5px;color:var(--primary);text-decoration:none;font-weight:600; }
.subt-beglink:hover { text-decoration:underline; }
.wl-docs { white-space:nowrap;font-size:12px;padding:3px 8px; }
/* docs modal */
.wldocs-dlg { width:min(560px,94vw);max-height:86vh; }
.wldocs { padding:16px 18px; }
.wldocs__head { display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:12px; }
.wldocs__ttl { font-size:16px;font-weight:600; }
.wldocs__x { background:none;border:none;font-size:18px;line-height:1;color:var(--muted);cursor:pointer;padding:2px 6px; }
.wldocs__list { display:flex;flex-direction:column;gap:2px;max-height:44vh;overflow:auto;margin-bottom:14px; }
.wldocs__row { display:flex;align-items:center;gap:8px;padding:7px 4px;border-bottom:1px solid var(--border);font-size:13px; }
.wldocs__row:last-child { border-bottom:none; }
.wldocs__date { font-size:11px;margin-left:auto;white-space:nowrap; }
.wldocs__up { display:flex;gap:8px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--border);padding-top:12px; }
.wldocs__up input[type=file] { font-size:12px;max-width:280px; }

/* ---- Wizard: Fill from sevDesk ---- */
.sevfill { position:relative;background:var(--bg);border:1px solid var(--border);border-radius:10px;padding:12px 14px;margin-bottom:16px; }
.sevfill__results { position:absolute;left:14px;right:14px;top:100%;z-index:30;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:0 10px 28px rgba(15,23,42,.14);overflow:hidden;margin-top:-6px; }
.sevfill__row { display:block;width:100%;text-align:left;background:none;border:none;border-bottom:1px solid var(--border);padding:9px 12px;font:inherit;font-size:13px;cursor:pointer; }
.sevfill__row:last-child { border-bottom:none; }
.sevfill__row:hover { background:var(--bg); }
.sevfill__row b { margin-right:6px; }
.sevfill__row span { display:block;font-size:11.5px;color:var(--muted); }
.sevfill__none { padding:10px 12px;font-size:12.5px;color:var(--muted); }
.sevfill__chip { display:flex;align-items:center;gap:8px;margin-top:9px;background:#e1f5ee;color:#0f6e56;border:1px solid #9fe1cb;border-radius:8px;padding:7px 10px;font-size:12.5px; }
.sevfill__clear { background:none;border:none;color:inherit;cursor:pointer;font-size:13px;margin-left:auto;padding:0 2px; }

/* ---- Worklist polish: two-line column headers + collapsible city groups ---- */
.team-colname { display:block;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.3; }
.team-colstat { display:inline-block;font-size:10px;font-weight:560;padding:2px 9px;border-radius:99px;white-space:nowrap;letter-spacing:.02em;line-height:1.5; }
.team-colstat--pend { color:#8a5200;background:#f9edd6;border:1px solid #eeddb5; }
.team-colstat--ok { color:#14663c;background:#def2e7;border:1px solid #c2e6d2; }
.team-cityrow { cursor:pointer;user-select:none; }
.team-cityrow:hover td { background:#edf1ec; }
.team-cityrow__chev { display:inline-block;width:12px;color:var(--muted);font-size:11px; }
.team-cityrow__n { display:inline-block;background:#fff;border:1px solid #e2e7ef;border-radius:99px;font-size:10.5px;padding:0 7px;margin-left:6px;color:#697286;font-weight:560; }
.team-cityrow.is-collapsed td { opacity:.75; }
.cm__tabn { display:inline-block;background:var(--bg);border-radius:99px;font-size:10px;padding:0 6px;margin-left:3px;color:var(--muted); }

/* .table th/td set text-align:left at higher specificity than .ta-c — re-assert centering inside worklists */
.team-table thead th.ta-c, .team-table td.ta-c { text-align:center; }

/* ---- Subsidy tracker (cross-project overview, phase-grouped) ---- */
.subt-strip { display:flex;gap:10px;flex-wrap:wrap;margin:0 0 14px; }
.subt-stat { flex:1 1 120px;min-width:120px;background:rgba(255,255,252,.9);border:1px solid #e8eae2;border-radius:16px;padding:12px 14px;display:flex;flex-direction:column;gap:4px;box-shadow:0 8px 20px rgba(31,38,56,.045); }
.subt-stat--paid { background:var(--tint);border-color:#cfe7dc; }
.subt-stat--alert { background:#fdeceb;border-color:#f4c9c6; }
.subt-stat--warn { background:#fff3df;border-color:#eeddb5; }
.subt-stat__k { font-size:10px;text-transform:uppercase;letter-spacing:.03em;color:#7a8394;font-weight:600; }
.subt-stat__v { font-size:1.15rem;font-weight:720;color:var(--text); }
.subt-stat--alert .subt-stat__v { color:#d6322c; }
.subt-stat--warn .subt-stat__v { color:#b26a00; }
/* Tracker filters (instant, client-side — initSubsidyTracker). Attention chips (dark when active) sit
   on one axis; the Step dropdown (green when a step is chosen) picks the exact pipeline step. */
.subt-filters { display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:-2px 0 14px; }
.subt-filters__grp { display:flex;flex-wrap:wrap;gap:8px; }
.subt-chip { display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;color:var(--muted);background:#f2f4fa;border:1px solid #e7ebf3;border-radius:999px;padding:7px 13px;min-height:34px;cursor:pointer;line-height:1;white-space:nowrap;transition:background .12s,color .12s,border-color .12s; }
.subt-chip:hover { border-color:#cfd6e4;color:var(--text); }
.subt-chip.is-active { background:#11130f;color:#fff;border-color:#11130f;box-shadow:0 8px 18px rgba(17,19,15,.16); }
/* Route (KfW/BAFA) is a separate filter axis — own group divider + a distinct blue active state. */
.subt-filters__grp--route { padding-right:10px;border-right:1px solid #e2e6ee; }
.subt-chip--route.is-active { background:#0b4ea2;color:#fff;border-color:#0b4ea2;box-shadow:0 8px 18px rgba(11,78,162,.18); }
.subt-chip__n { font-size:11px;font-weight:700;padding:1px 6px;border-radius:999px;background:rgba(19,22,15,.08);color:inherit;min-width:18px;text-align:center; }
.subt-chip.is-active .subt-chip__n { background:rgba(255,255,255,.22); }
.subt-chip.is-empty { opacity:.42; }
.subt-stepwrap { display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:600;color:var(--muted);white-space:nowrap;margin-left:2px; }
.subt-stepsel { font-size:12.5px;font-weight:600;color:var(--text);background:#f2f4fa;border:1px solid #e7ebf3;border-radius:999px;padding:7px 12px;min-height:34px;cursor:pointer; }
.subt-stepsel:hover { border-color:#cfd6e4; }
/* Active = a step is chosen. A LIGHT green so the native option-list popup (which inherits the
   control's own background/colour in Chromium) stays a readable light menu, never a green slab. */
.subt-stepsel.is-active { background:#e9f5ee;border-color:#14663c;color:#14663c;box-shadow:0 0 0 2px rgba(20,102,60,.16); }
/* Pin the dropdown list itself to a normal white/dark palette regardless of the control's colours. */
.subt-stepsel option { background:#fff;color:var(--text);font-weight:600; }
.subt-stepsel optgroup { background:#fff;color:var(--muted);font-weight:700; }
.subt-shown { font-weight:600;color:#b26a00; }
.subt-table { min-width:900px; }
.subt-table td { padding-top:9px;padding-bottom:9px; }
.subt-cell { border-left:1px solid #e7ebf1;font-size:12.5px; }
.subt-foot td { border-top:2px solid #dde2ea;background:#f8fafc;font-size:12.5px;padding-top:11px;padding-bottom:11px; }
/* .table td sets text-align:left at (0,1,1), beating the .ta-r class — re-assert right at (0,2,1),
   the same trick line 1249 uses to keep .ta-c centred inside worklists. */
.team-table td.subt-foot-label { text-align:right;font-weight:600;color:#53606f; }
.subt-foot-val .tnum { font-weight:720; }
.subt-grouphint { font-weight:400;font-size:11px;margin-left:8px; }
.subt-pipe { display:flex;flex-direction:column;gap:5px; }
.subt-pipe__lbl { font-size:12px;font-weight:560;color:var(--text); }
.subt-pipe.is-terminal .subt-pipe__lbl { color:var(--muted); }
.subt-dl { display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:600;border-radius:99px;padding:3px 9px; }
.subt-dl__dot { width:8px;height:8px;border-radius:50%;flex:none; }
.subt-dl__d { opacity:.85;font-weight:700; }
.subt-amts { text-align:right; }
.subt-amtwrap { display:inline-flex;flex-direction:column;align-items:flex-end;gap:1px; }
.subt-amt { display:flex;align-items:baseline;gap:8px;font-size:11.5px;line-height:1.55;white-space:nowrap; }
.subt-amt i { color:#7a8394;font-style:normal;font-size:9.5px;text-transform:uppercase;letter-spacing:.03em;font-weight:600; }
.subt-amt b { font-weight:560;color:var(--text); }
.subt-amt--paid b { font-weight:650; }
.subt-docs { display:inline-flex;align-items:center;gap:7px; }
.subt-docs__pips { display:inline-flex;gap:3px; }
.subt-docs__pips i { width:9px;height:9px;border-radius:2px;background:var(--surface);border:1px solid var(--border-2);box-sizing:border-box; }
.subt-docs__pips i.on { background:var(--green);border-color:var(--green); }
.subt-docs__n { font-size:11.5px;font-weight:560;color:var(--muted); }
.subt-docs.is-full .subt-docs__n { color:#14663c; }
.subt-docs.is-part .subt-docs__n { color:#b26a00; }
.subt-actcell { text-align:center; }
/* Documents section header on the pipeline / project Subsidy tab: pips pushed to the right */
.sub-doch { display:flex;align-items:center;gap:10px;flex-wrap:wrap; }
.sub-doch .subt-docs { margin-left:auto; }

/* ---- Handover wizard (tablet kiosk) ---- */
.hk-body { background:var(--bg); }
.hk { max-width:760px;margin:0 auto;padding:0 0 96px;min-height:100vh; }
.hk-top { position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:12px;background:var(--surface);border-bottom:1px solid var(--border);padding:10px 14px; }
.hk-top__close { display:grid;place-items:center;width:var(--tap-min,44px);height:var(--tap-min,44px);border-radius:10px;color:var(--muted);flex:none; }
.hk-top__close:hover { background:var(--well);color:var(--text); }
.hk-top__ttl { display:flex;flex-direction:column;min-width:0;line-height:1.25; }
.hk-top__ttl b { font-size:14px; } .hk-top__ttl .muted { font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.hk-top__right { margin-left:auto; }
.hk-savechip { font-size:11.5px;font-weight:600;color:#14663c;background:#e7f6ee;border:1px solid #c2e6d2;border-radius:99px;padding:4px 11px;white-space:nowrap; }
.hk-savechip.is-saving { color:#8a5200;background:#fff3df;border-color:#eeddb5; }
.hk-savechip.is-err { color:#b23b3b;background:#fdeceb;border-color:#f4c9c6; }
.hk-lockchip { display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:600;color:var(--muted);background:var(--well);border-radius:99px;padding:4px 11px; }
.hk-progress { display:flex;align-items:center;gap:10px;padding:10px 16px 0; }
.hk-progress__bar { flex:1;height:7px;background:var(--well);border-radius:99px;overflow:hidden; }
.hk-progress__bar span { display:block;height:100%;background:var(--green);border-radius:99px;transition:width .3s ease;width:0; }
.hk-progress__txt { font-size:11px;color:var(--muted);white-space:nowrap;font-weight:600; }
.hk-syswrap { padding:12px 16px 0; }
.hk-steps { padding:8px 16px 0; }
.hk-step { display:none; }
.hk-step.is-active { display:block;animation:hkin .2s ease; }
@keyframes hkin { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }
.hk-step__h { font-size:18px;font-weight:700;margin:8px 0 14px;letter-spacing:-.01em; }
.hk-grid { display:grid;grid-template-columns:1fr;gap:14px; }
.hk-field { display:flex;flex-direction:column;gap:6px;margin:0; }
.hk-lbl { font-size:13px;font-weight:600;color:var(--text); }
.hk-de { font-size:11px;color:var(--muted);margin-top:-3px; }
.hk-star { color:var(--red);font-weight:700; }
.hk input[type=text], .hk input[type=date], .hk input[type=time], .hk select, .hk textarea {
    width:100%;min-height:48px;font-size:16px;border:1px solid var(--border);border-radius:10px;padding:10px 12px;background:var(--surface);color:var(--text);box-sizing:border-box; }
.hk textarea { min-height:auto;line-height:1.4;resize:vertical; }
.hk :is(input,select,textarea):focus { outline:none;border-color:var(--primary);box-shadow:0 0 0 3px var(--tint); }
.hk :is(input,select,textarea):disabled { background:var(--well);color:var(--muted); }
.hk-numwrap { position:relative;display:block; }
.hk-numwrap input { padding-right:48px; }
.hk-unit { position:absolute;right:12px;top:50%;transform:translateY(-50%);font-size:12.5px;color:var(--muted);font-weight:600;pointer-events:none; }
.hk-note { font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.03em;margin:6px 0 -4px;grid-column:1/-1; }
.hk-check { display:flex;align-items:center;gap:12px;min-height:48px;cursor:pointer;padding:4px 0;margin:0; }
.hk-check input { position:absolute;opacity:0;width:0;height:0; }
.hk-check__box { flex:none;width:30px;height:30px;border:2px solid var(--border-2);border-radius:8px;display:grid;place-items:center;transition:.12s; }
.hk-check input:checked + .hk-check__box { background:var(--green);border-color:var(--green); }
.hk-check input:checked + .hk-check__box::after { content:"✓";color:#fff;font-size:18px;font-weight:800;line-height:1; }
.hk-check input:disabled + .hk-check__box { opacity:.5; }
.hk-check__lbl { display:flex;flex-direction:column;gap:2px; }
.hk-docrow { display:flex;flex-direction:column;gap:6px;grid-column:1/-1; }
.hk-docslot { display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-left:42px; }
.hk-docfile { font-size:12px;color:var(--primary);text-decoration:none;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.hk-docfile:hover { text-decoration:underline; }
.hk-docfile--none { display:none; }
.hk-docup { display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:var(--primary);cursor:pointer;border:1px dashed var(--border-2);border-radius:8px;padding:5px 12px;min-height:36px; }
.hk-docup:hover { background:var(--tint); }
.hk-multi { display:flex;flex-wrap:wrap;gap:8px; }
.hk-multi__opt { display:inline-flex;align-items:center;gap:9px;min-height:44px;padding:8px 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface);font-size:14px;font-weight:500;cursor:pointer; }
.hk-multi__opt input { width:20px;height:20px;flex:none; }
.hk-multi__opt:has(input:checked) { border-color:var(--primary);background:var(--tint);color:var(--primary);font-weight:600; }
.hk-field--photo { grid-column:1/-1; }
.hk-thumbs { display:flex;gap:8px;flex-wrap:wrap;align-items:center; }
.hk-thumb { width:64px;height:64px;border-radius:8px;overflow:hidden;border:1px solid var(--border);flex:none;position:relative; }
.hk-thumb img { width:100%;height:100%;object-fit:cover;display:block; }
.hk-thumb__st { position:absolute;right:2px;bottom:2px;font-size:13px;line-height:1;background:rgba(255,255,255,.92);border-radius:6px;padding:2px 4px; }
.hk-thumb.is-queued img, .hk-thumb.is-uploading img { opacity:.45; }
.hk-thumb.is-uploading .hk-thumb__st { animation:hkpulse 1s infinite; }
.hk-thumb.is-failed { border-color:#e0908a; }
.hk-thumb.is-failed .hk-thumb__st { background:#fdeceb;color:#b3261e; }
@keyframes hkpulse { 50% { opacity:.35; } }
.hk-qbadge { font-size:11.5px;font-weight:700;color:#8a5200;background:#fff3df;border:1px solid #eeddb5;border-radius:99px;padding:4px 10px;white-space:nowrap; }
.pgal { display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:10px;margin-bottom:16px; }
.pgal__it { position:relative;display:block;aspect-ratio:1;border-radius:10px;overflow:hidden;border:1px solid var(--border);background:var(--well); }
.pgal__it img { width:100%;height:100%;object-fit:cover;display:block;transition:transform .15s; }
.pgal__it:hover img { transform:scale(1.04); }
.pgal__cap { position:absolute;left:0;right:0;bottom:0;font-size:10.5px;color:#fff;background:linear-gradient(transparent,rgba(0,0,0,.72));padding:14px 7px 5px;line-height:1.2; }
.hk-photobtn { display:inline-flex;align-items:center;gap:7px;min-height:48px;padding:0 16px;border:1px dashed var(--border-2);border-radius:10px;font-size:14px;font-weight:600;color:var(--primary);cursor:pointer;background:var(--surface); }
.hk-attachbtn { display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:700;color:var(--primary);background:var(--tint);border:1px solid #cfe7dc;border-radius:99px;padding:5px 11px;cursor:pointer;min-height:34px; }
.hk-attachbtn [data-attach-n] { background:var(--primary);color:#fff;border-radius:99px;font-size:10.5px;min-width:17px;padding:1px 5px;text-align:center;line-height:1.4; }
.hk-attachdlg { width:min(520px,94vw);max-height:86vh;border:none;border-radius:14px;padding:18px 20px;box-shadow:var(--sh3);color:var(--text); }
.hk-attachdlg::backdrop { background:rgba(15,23,42,.42); }
.hk-attachdlg__head { display:flex;align-items:center;justify-content:space-between;margin-bottom:4px; }
.hk-attachdlg__head b { font-size:16px; }
.hk-attachdlg__x { background:none;border:none;font-size:22px;line-height:1;color:var(--muted);cursor:pointer;padding:0 6px; }
.hk-attachchip { display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--primary);text-decoration:none;border:1px solid var(--border);border-radius:8px;padding:8px 11px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.hk-attachchip:hover { background:var(--well); }
.hk-attachadd { margin-top:14px;width:100%;justify-content:center; }
.hk-radio { display:flex;align-items:center;gap:10px;min-height:48px;font-size:14px;font-weight:500;cursor:pointer; }
.hk-radio input { width:22px;height:22px;flex:none; }
.hk-accept { margin-top:22px;padding-top:16px;border-top:1px solid var(--border); }
.hk-accept h3 { font-size:15px;font-weight:700;margin:0 0 10px; }
.hk-accept__opts { display:flex;flex-direction:column;gap:2px;margin-bottom:14px; }
.hk-hint { font-size:11.5px;color:var(--muted);margin:12px 0 0;line-height:1.4; }
.hk-defects { display:flex;flex-direction:column;gap:12px;margin-bottom:12px; }
.hk-defect { border:1px solid var(--border);border-radius:12px;padding:12px 14px;background:var(--surface-2);display:flex;flex-direction:column;gap:12px; }
.hk-defect__head { display:flex;gap:8px;align-items:center; }
.hk-defect__head select { min-height:40px;font-size:13px;flex:1; }
.hk-defect__del { flex:none;width:40px;height:40px;border:none;background:none;color:var(--muted);cursor:pointer;border-radius:8px; }
.hk-defect__del:hover { background:#fdeceb;color:var(--red); }
.hk-adddefect { width:100%;justify-content:center;border-style:dashed; }
.hk-review { margin-bottom:16px; }
.hk-miss { background:#fff3df;border:1px solid #eeddb5;border-radius:10px;padding:12px 14px;font-size:13px; }
.hk-adv { background:#eef4fb;border:1px solid #cddcf0;border-radius:10px;padding:11px 14px;font-size:12.5px;line-height:1.5;margin-top:10px;color:#33507a; }
.hk-miss ul { margin:8px 0 0;padding-left:18px; } .hk-miss li { margin:2px 0; }
.hk-allgood { background:#e7f6ee;border:1px solid #c2e6d2;border-radius:10px;padding:14px;font-size:14px;font-weight:600;color:#14663c; }
.hk-p2note { display:flex;gap:12px;align-items:flex-start;background:var(--tint);border:1px solid #cfe7dc;border-radius:12px;padding:14px 16px;font-size:13px;line-height:1.45; }
.hk-p2note .icon { color:var(--primary);flex:none;margin-top:2px; }
.hk-sigs { display:grid;grid-template-columns:1fr;gap:20px;margin-top:8px; }
.hk-sig { display:flex;flex-direction:column;gap:10px; }
.hk-pad { position:relative;border:1px solid var(--border);border-radius:10px;background:#fff;height:150px;overflow:hidden; }
.hk-pad canvas { width:100%;height:100%;display:block;touch-action:none;cursor:crosshair; }
.hk-pad__clear { position:absolute;top:6px;right:6px;font-size:11px;font-weight:600;color:var(--muted);background:rgba(255,255,255,.9);border:1px solid var(--border);border-radius:7px;padding:4px 10px;cursor:pointer; }
.hk-consent { margin-top:16px; }
.hk-finalize { margin-top:18px; }
.hk-finalize .btn { width:100%;min-height:52px;font-size:15px;justify-content:center; }
.hk-finalize .btn:disabled { opacity:.55;cursor:not-allowed; }
.hk-signgate { margin-bottom:14px; }
.hk-signed, .hk-signdone { display:flex;flex-direction:column;align-items:flex-start; }
@media (min-width:640px){ .hk-sigs { grid-template-columns:1fr 1fr; } }
.hk-nav { position:fixed;left:0;right:0;bottom:0;z-index:20;display:flex;align-items:center;gap:12px;background:var(--surface);border-top:1px solid var(--border);padding:10px 16px;padding-bottom:calc(10px + env(safe-area-inset-bottom)); }
.hk-nav .btn { min-height:50px;flex:1;justify-content:center;font-size:15px; }
.hk-nav__prev { flex:0 0 40%; }
.hk-nav__dots { display:none; }
@media (min-width:640px) {
    .hk-grid { grid-template-columns:1fr 1fr; }
    .hk-field--photo, .hk-note, .hk-check { grid-column:1/-1; }
    .hk-nav__dots { display:flex;gap:5px;flex:1;justify-content:center; }
    .hk-nav__dots i { width:7px;height:7px;border-radius:50%;background:var(--border-2); }
    .hk-nav__dots i.on { background:var(--primary);transform:scale(1.3); }
    .hk-nav .btn { flex:0 0 auto;padding:0 28px; } .hk-nav__prev { flex:0 0 auto; }
}
/* Handover panel on the project card */
.ho-card { border:1px solid var(--border);border-radius:12px;padding:16px 18px;background:var(--surface);box-shadow:var(--sh1);max-width:520px; }
.ho-card__row { display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px; }
.ho-card__ttl { font-weight:700;font-size:15px; }
.ho-badge { font-size:11px;font-weight:700;padding:3px 10px;border-radius:99px;background:var(--well);color:var(--muted);white-space:nowrap; }
.ho-badge--draft { color:#8a5200;background:#fff3df;border:1px solid #eeddb5; }
.ho-badge--done { color:#14663c;background:#e7f6ee;border:1px solid #c2e6d2; }
.ho-card__bar { height:6px;background:var(--well);border-radius:99px;overflow:hidden;margin-bottom:14px; }
.ho-card__bar span { display:block;height:100%;background:var(--green);border-radius:99px; }

/* ---- Checklist step fields (admin builder + card data entry) ---- */
.cl-fieldn { display:inline-block;background:var(--primary);color:#fff;border-radius:99px;font-size:10px;padding:0 6px;margin-left:2px; }
.tstep-sum { display:flex;flex-wrap:wrap;gap:5px;margin:4px 0 0;padding-left:1px; }
.tstep-sum__date { font-size:10.5px;font-weight:600;color:#0f6b3a;background:#e7f6ee;border-radius:5px;padding:1px 7px;white-space:nowrap; }
.tstep-sum__v { display:inline-flex;align-items:baseline;font-size:11px;color:var(--text);background:var(--well);border-radius:5px;padding:1px 8px;white-space:nowrap;max-width:230px;overflow:hidden;text-overflow:ellipsis; }
.tstep-sum__v .k { color:var(--muted);font-weight:600;margin-right:5px; }
.tstep-edit { margin:4px 0 0; }
.tstep-edit > summary { display:inline-flex;align-items:center;gap:5px;font-size:10.5px;font-weight:600;color:var(--muted);cursor:pointer;list-style:none;padding:2px 10px;border:1px solid var(--border);border-radius:99px; }
.tstep-edit > summary::-webkit-details-marker { display:none; }
.tstep-edit > summary:hover { background:var(--well);color:var(--text); }
.tstep-edit[open] > summary { color:var(--text); }
.tstep-edit__n { background:var(--tint);color:var(--primary);border-radius:99px;padding:0 6px;font-size:9.5px; }
.tstep-form { margin-top:8px;padding:11px 12px;background:var(--surface-2);border:1px solid var(--border);border-radius:9px; }
.tstep-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px 12px;margin-bottom:11px;align-items:end; }
.tf { display:flex;flex-direction:column;gap:3px;font-size:10.5px;font-weight:600;color:var(--muted); }
.tf--full { grid-column:1/-1; }
.tf input, .tf select, .tf textarea { font-size:12px;font-weight:400;padding:5px 8px;width:100%; }
.tstep-hint { font-size:11px;color:var(--muted);margin:0 0 9px;line-height:1.5; }
.tstep-hint em { font-style:normal;color:var(--text); }

/* ---- Business model tool ---- */
.bm-screen { max-width:1180px; }
.bm-topbar { display:flex;align-items:center;gap:14px;margin-bottom:16px;flex-wrap:wrap; }
.bm-topbar__h { margin:0;font-size:19px;font-weight:700;white-space:nowrap; }
.bm-topbar__sub { font-size:12.5px;color:var(--muted); }
.bm-topbar__actions { margin-left:auto;display:flex;align-items:center;gap:10px; }
.bm-savemsg { font-size:12.5px;font-weight:600; }
.bm-hero { display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:18px; }
.bm-hero__tile { background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:14px 16px;box-shadow:var(--sh1); }
.bm-hero__tile .k { font-size:12px;color:var(--muted);font-weight:600; }
.bm-hero__tile .v { font-size:28px;font-weight:700;line-height:1.15;margin-top:2px; }
.bm-hero__tile .s { font-size:11px;color:var(--muted);margin-top:2px; }
.bm-hero__tile--ip { background:var(--tint);border-color:#b5ddca; }
.bm-hero__tile--ip .v { color:var(--primary); }
.bm-grid { display:grid;grid-template-columns:1fr;gap:16px; }
.bm-col { display:flex;flex-direction:column;gap:16px;min-width:0; }
.bm-block { padding:16px 18px; }
.bm-block__h { font-size:13px;font-weight:700;color:var(--text);margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid var(--border); }
.bm-f { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px; }
.bm-f__l { font-size:13px;color:var(--muted);flex:1; }
.bm-f__l em { font-style:normal;color:var(--border-2);font-size:11.5px; }
.bm-f input, .bm-f select { width:132px;flex:none; }
.bm-f select.bm-sel-wide { width:auto;min-width:140px;max-width:100%;flex:0 1 auto; }
.bm-sld { margin-bottom:12px; }
.bm-sld__top { display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:13px;color:var(--muted);margin-bottom:4px; }
.bm-sld__top em { font-style:normal;color:var(--border-2);font-size:11.5px; }
.bm-sld__num { width:104px;flex:none; }
.bm-sld input[type=range] { width:100%;display:block; }
.bm-derived { margin-top:12px;padding-top:10px;border-top:1px dashed var(--border-2);display:flex;flex-direction:column;gap:6px; }
.bm-derived div { display:flex;justify-content:space-between;gap:10px;font-size:13px; }
.bm-derived span { color:var(--muted); }
.bm-derived b { font-weight:700;text-align:right; }
.bm-chartcard { margin-top:16px;padding:16px 18px; }
.bm-chartwrap { position:relative;height:280px;margin-top:8px; }
.bm-openbtn { margin-bottom:14px; }
.bm-trc { display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:12px 16px;margin-bottom:16px; }
.bm-trc__main { display:flex;align-items:center;gap:12px;flex-wrap:wrap;font-size:13px; }
.bm-trc__label { font-weight:700; }
.bm-trc__badge { font-size:12px;font-weight:600;padding:3px 10px;border-radius:99px;background:var(--well);color:var(--muted); }
.bm-trc__target { font-size:12.5px;font-weight:600; }
.bm-trc__actions { display:flex;gap:6px; }
.kcard__trc { background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:10px 12px;margin-bottom:10px; }
.ktrc-facts { display:flex;gap:8px;justify-content:space-between; }
.ktrc-f { display:flex;flex-direction:column;gap:1px;min-width:0; }
.ktrc-f__k { font-size:9.5px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.03em; }
.ktrc-f__v { font-size:15px;font-weight:700; }
.ktrc-note { font-size:11px;color:var(--muted);margin-top:6px; }
.ktrc-empty { font-size:11.5px;color:var(--muted); }
.ktrc-row { display:flex;align-items:center;gap:8px;margin-top:9px;flex-wrap:wrap; }
.ktrc-badge { font-size:11px;font-weight:600;padding:2px 9px;border-radius:99px; }
.ktrc-act { display:flex;gap:6px;margin-left:auto; }
.ktrc-act .btn { padding:3px 9px;font-size:11.5px; }
.bm-embed { width:100%;border:0;display:block;min-height:600px; }
.bm-projpick { position:relative;display:flex;align-items:center;gap:8px;flex-wrap:wrap; }
.bm-projpick #bmProjSearch { min-width:240px;max-width:380px;font-size:13px;height:36px;border:1px solid var(--border);border-radius:8px;padding:0 11px;background:var(--surface);color:var(--text); }
.bm-projpick #bmProjSearch::placeholder { color:var(--text);opacity:.85; }
.bm-projlist { position:absolute;top:calc(100% + 4px);left:0;z-index:60;width:min(380px,92vw);max-height:340px;overflow-y:auto;margin:0;padding:4px;list-style:none;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:0 8px 28px rgba(0,0,0,.16); }
.bm-projlist[hidden] { display:none; }
.bm-projlist__grp { padding:7px 10px 3px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted); }
.bm-projlist__opt a { display:block;padding:8px 10px;border-radius:7px;font-size:13.5px;color:var(--text);text-decoration:none; }
.bm-projlist__opt a:hover,.bm-projlist__opt a:focus { background:var(--surface-2);outline:none; }
.bm-projlist__opt.is-current a { font-weight:700;color:var(--primary); }
.bm-projlist__empty { padding:10px;color:var(--muted);font-size:13px; }
.bm-projlist__empty[hidden] { display:none; }
.bm-projlist__trc { font-size:10px;font-weight:700;padding:1px 5px;border-radius:4px;vertical-align:middle; }
.bm-projchips { display:flex;gap:4px;flex-wrap:wrap; }
.bm-chip { font-size:11.5px;padding:5px 10px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--muted);cursor:pointer;line-height:1; }
.bm-chip:hover { border-color:var(--border-2); }
.bm-chip.is-on { background:var(--primary);border-color:var(--primary);color:#fff; }
.bm-empty { text-align:center;color:var(--muted);padding:52px 20px;margin-top:8px; }
.bm-empty .icon { width:36px;height:36px;color:var(--border-2);margin-bottom:10px; }
.numfmt { display:flex;align-items:center; }
.numfmt select { font:inherit;font-size:12.5px;padding:6px 8px;border:1px solid var(--border-2);border-radius:8px;background:var(--surface);color:var(--muted);cursor:pointer; }
.bulkbar { display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 12px;padding:10px 14px;background:var(--tint);border:1px solid #b5ddca;border-radius:10px;font-size:13px; }
.bulkbar__n { color:var(--primary);font-weight:700; }
.pt-cb { width:36px;text-align:center; }
.ptable .pt-cb input { width:16px;height:16px;cursor:pointer; }
@media (min-width:900px) { .bm-grid { grid-template-columns:1fr 1fr; } }

/* ---- Business model: tabs + full Excel-like model table + summary ---- */
.bm-tabs { display:flex;gap:2px;border-bottom:1px solid var(--border);margin:0 0 16px;overflow-x:auto; }
.bm-tab-btn { font:inherit;font-size:13px;font-weight:600;border:none;background:none;color:var(--muted);padding:9px 14px;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap; }
.bm-tab-btn:hover { color:var(--text); }
.bm-tab-btn.is-active { color:var(--primary);border-bottom-color:var(--primary); }
.bm-tab[hidden] { display:none; }
.bm-modelcard { padding:16px 18px; }
.bm-modelcard__head { display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap; }
.bm-legend { font-size:11px;color:var(--muted);display:flex;align-items:center;gap:6px;flex-wrap:wrap; }
.bm-legend__sw { display:inline-block;width:11px;height:11px;border-radius:3px;vertical-align:middle; }
.bm-legend__sw--in { background:#fdf3d6;box-shadow:inset 0 0 0 1px #e6cf87; }
.bm-legend__sw--calc { background:var(--surface);box-shadow:inset 0 0 0 1px var(--border); }
.bm-tblwrap { overflow-x:auto;margin-top:12px;border:1px solid var(--border);border-radius:10px; }
.bm-tbl { border-collapse:collapse;font-size:11.5px;min-width:100%;white-space:nowrap; }
.bm-tbl th, .bm-tbl td { padding:5px 9px;text-align:right;border-bottom:1px solid var(--border-2); }
.bm-tbl thead th { position:sticky;top:0;background:var(--well);font-weight:700;color:var(--muted);font-size:10.5px;z-index:2; }
.bm-tbl__lbl { text-align:left !important;position:sticky;left:0;background:var(--surface);font-weight:600;color:var(--text);z-index:1;box-shadow:1px 0 0 var(--border-2); }
.bm-tbl thead .bm-tbl__lbl { z-index:3;background:var(--well); }
.bm-tbl__sec td { text-align:left;font-weight:700;font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);background:var(--surface-2);padding:8px 9px 4px; }
.bm-tbl__b td, .bm-tbl__b .bm-tbl__lbl { font-weight:800;background:var(--surface-2); }
.bm-tbl__num { font-variant-numeric:tabular-nums;cursor:help; }
.bm-tbl .bm-neg { color:var(--red); }
.bm-sumgrid { display:grid;grid-template-columns:1fr;gap:16px;margin-top:4px; }
.bm-sumcard { padding:16px 18px; }
.bm-sumrow { display:flex;justify-content:space-between;gap:12px;font-size:13px;padding:6px 0;border-bottom:1px dashed var(--border-2); }
.bm-sumrow:last-child { border-bottom:none; }
.bm-sumrow span { color:var(--muted); }
.bm-sumrow b { font-weight:700;text-align:right; }
.bm-sumrow--hl { background:var(--tint);margin:4px -10px;padding:9px 10px;border-radius:8px;border-bottom:none; }
.bm-sumrow--hl b { color:var(--primary);font-size:15px; }
.bm-hint { font-size:11.5px;color:var(--muted);margin:10px 0 0;line-height:1.45; }
.bm-unit { font-style:normal;font-size:11px;color:var(--muted);font-weight:400; }
.bm-flag { color:#b26a00;font-style:normal;font-size:10px;vertical-align:middle; }
.bm-f--flag input { border-color:#e6cf87;background:#fffdf5; }
.bm-f--total { margin-top:8px;padding-top:8px;border-top:1px solid var(--border); }
.bm-f--total .bm-f__l { font-weight:700;color:var(--text); }
.bm-f--total input { background:var(--tint);border-color:#b5ddca;font-weight:700;color:var(--primary);cursor:default;text-align:right; }
.bm-refblk { margin-bottom:14px; }
.bm-refblk__h { font-size:12px;font-weight:700;margin-bottom:5px; }
.bm-refblk__h em { font-style:normal;color:var(--muted);font-weight:400; }
.bm-refrow { display:flex;justify-content:space-between;gap:10px;font-size:12px;padding:3px 0;border-bottom:1px dashed var(--border-2); }
.bm-refrow span { color:var(--muted); }
.bm-refrow b { font-variant-numeric:tabular-nums; }
.bm-refrow--sum { border-bottom:none;border-top:1px solid var(--border);margin-top:3px;padding-top:5px;font-weight:700; }
.bm-refrow--sum b { color:var(--primary); }
.bm-tiertbl { margin-top:10px;width:100%;font-size:11px; }
.bm-tiertbl th, .bm-tiertbl td { padding:3px 8px; }
@media (min-width:900px) { .bm-sumgrid { grid-template-columns:1fr 1fr; } }

/* ---- Bauzeitenplan phase-entry helpers (card Overview) ---- */
.bzp-formhead { font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin:6px 0 -2px;padding-top:8px;border-top:1px dashed var(--border); }
.bzp-sw { display:inline-block;width:9px;height:9px;border-radius:2px;background:var(--c);vertical-align:baseline;margin-left:1px;box-shadow:0 0 0 1px rgba(0,0,0,.15); }

/* ==================================================================
   Calendar → Timeline: Bauzeitenplan (KW week raster, 4 phase bars/site)
   A single CSS grid: col1 = site label, col2 = phase tag, cols 3.. = KW.
   ================================================================== */
.bzp { display:grid;grid-template-columns:var(--bzp-c1,190px) var(--bzp-c2,68px) repeat(var(--wk,14),minmax(var(--bzp-cw,30px),1fr));min-width:1040px;font-size:11px;background:var(--surface); }
.bzp-corner { position:sticky;left:0;z-index:5;background:var(--well);border-right:1px solid var(--border);border-bottom:1px solid var(--border);display:flex;align-items:flex-end;padding:6px 10px;font-weight:700;color:var(--muted);font-size:10.5px; }
.bzp-mon { background:var(--well);border-bottom:1px solid var(--border-2);border-left:1px solid var(--border);padding:5px 8px;font-weight:700;font-size:10.5px;color:var(--text);white-space:nowrap;overflow:hidden;position:sticky;top:0;z-index:3; }
.bzp-kw { background:var(--well);border-bottom:1px solid var(--border);border-left:1px solid var(--border-2);padding:4px 2px;text-align:center;font-weight:600;font-size:9.5px;color:var(--muted);white-space:nowrap;position:sticky;top:24px;z-index:3; }
.bzp-kw--now { color:var(--primary);background:var(--tint); }
/* cream band + vertical KW gridlines behind the whole schedule */
.bzp-canvas { background-color:#F4F1E9;background-image:repeating-linear-gradient(to right, rgba(110,91,42,.14) 0 1px, transparent 1px calc(100%/var(--wk)));z-index:0; }
.bzp-today { border-left:2px solid var(--primary);opacity:.5;z-index:1;pointer-events:none; }
.bzp-site { position:sticky;left:0;z-index:4;background:var(--surface);border-right:1px solid var(--border);border-top:1px solid var(--border-2);display:flex;align-items:center;gap:7px;padding:6px 10px;min-width:0; }
.bzp-site--alt, .bzp-tag.bzp-site--alt { background:var(--surface-2); }
.bzp-dot { width:10px;height:10px;border-radius:50%;flex:none;box-shadow:0 0 0 3px rgba(16,24,40,.06); }
.bzp-idcol { min-width:0;display:flex;flex-direction:column;gap:1px; }
.bzp-name { font:inherit;font-size:12px;font-weight:600;border:none;background:none;color:var(--text);cursor:pointer;padding:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0; }
.bzp-name:hover { color:var(--primary);text-decoration:underline; }
.bzp-sub { display:flex;align-items:center;gap:4px;font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0; }
.bzp-cdot { width:7px;height:7px;border-radius:50%;flex:none;box-shadow:0 0 0 1px rgba(0,0,0,.12); }
.bzp-tag { position:sticky;left:var(--bzp-c1,190px);z-index:4;background:var(--surface);border-right:1px solid var(--border);border-top:1px solid var(--border-2);display:flex;align-items:center;gap:4px;padding:0 6px;font-size:9px;font-weight:700;letter-spacing:.02em;color:var(--muted);min-height:22px; }
.bzp-tag i { width:8px;height:8px;border-radius:2px;flex:none; }
.bzp-bar { z-index:2;align-self:center;height:15px;margin:0 1px;border:none;border-radius:3px;background:var(--pc);box-shadow:inset 0 0 0 1px rgba(0,0,0,.14);cursor:pointer;display:flex;align-items:center;padding:0 5px;overflow:hidden; }
.bzp-bar span { font-size:8.5px;font-weight:800;letter-spacing:.03em;color:#fff;text-shadow:0 1px 1px rgba(0,0,0,.25);white-space:nowrap;overflow:hidden; }
.bzp-bar:hover { box-shadow:inset 0 0 0 1px rgba(0,0,0,.14), 0 0 0 2px rgba(11,107,72,.35); }
body.bzp-by-supplier .bzp-bar { background:var(--sup); }
body.bzp-by-client   .bzp-bar { background:var(--cli); }
.bzp-key .sched-sw i { border-radius:2px; }
.bzp-scope { margin-left:auto; }

/* ---- Calendar site filter bar (narrow by client / city / supplier) ---- */
.cal-sitefilter { display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 12px; }
.cal-sitefilter__lbl { font-size:12px;font-weight:700;color:var(--muted); }
.cal-sitefilter select { font:inherit;font-size:13px;padding:5px 26px 5px 9px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);cursor:pointer;max-width:210px; }
.cal-sitefilter__clear { font-size:12px;font-weight:600;color:var(--primary);text-decoration:none;white-space:nowrap; }
.cal-sitefilter__clear:hover { text-decoration:underline; }
.cal-sitefilter__n { font-size:11.5px;margin-left:auto;white-space:nowrap; }

/* ---- Folder sync card (browser File System Access API) ---- */
.fsync code { background:var(--well);padding:1px 5px;border-radius:4px;font-size:11.5px; }
.fsync-ok { color:var(--green,#1a7f46);font-size:12.5px;font-weight:600; }
.fsync-log { margin:10px 0 0;padding:0;max-height:0;overflow:auto;font-family:ui-monospace,Consolas,monospace;
  font-size:11.5px;line-height:1.5;color:var(--muted);white-space:pre-wrap;transition:max-height .2s; }
.fsync-log:not(:empty) { max-height:260px;padding:10px 12px;background:var(--well);border-radius:8px; }
.fsync-log__err { color:#b3261e; }
.fsync-log__warn { color:#8a5200;font-weight:600; }

/* ---- BEG pipeline status chip ---- */
.pl-chip { white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis; }
.pl-row { display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12.5px; }
.pl-next { color:var(--muted);font-size:12px; }
.pl-group__h { display:flex;align-items:baseline;gap:9px;margin:18px 0 8px;font-size:14px;font-weight:700; }
.pl-group__n { font-size:12px;font-weight:600;color:var(--muted); }

/* ---- Dashboard "Needs you" worklist ---- */
.todo-card { border-left:4px solid #b26a00;margin-bottom:16px; }
.todo-card__h { display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:15px;font-weight:700;margin-bottom:10px; }
.todo-card__grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px; }
.todo-item { display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;
  background:var(--surface);text-decoration:none;transition:border-color .15s,transform .15s; }
.todo-item:hover { border-color:#b26a00;transform:translateY(-1px); }
.todo-item__n { font-size:20px;font-weight:700;color:#b26a00;min-width:1.6em;text-align:right; }
.todo-item__l { font-size:12.5px;font-weight:600;color:var(--text);line-height:1.25; }

/* ---- BzA request: site picker ---- */
.bza-pick { display:grid;gap:2px;max-height:340px;overflow:auto; }
.bza-pick__row { display:flex;align-items:center;gap:9px;padding:6px 8px;border-radius:8px;cursor:pointer;font-size:13px; }
.bza-pick__row:hover { background:var(--well); }
.bza-pick__t { flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }

/* ---- Pipeline: collapsible stage groups ---- */
.pl-group { margin-bottom:14px; }
.pl-group > summary.pl-group__h { cursor:pointer;list-style:none;user-select:none; }
.pl-group > summary.pl-group__h::-webkit-details-marker { display:none; }
.pl-group__caret { display:inline-block;transition:transform .15s;color:var(--muted);font-size:11px;margin-right:2px; }
.pl-group[open] > summary .pl-group__caret { transform:rotate(90deg); }
.pl-group > summary:hover { background:var(--well); }
.pl-group > summary:focus-visible { outline:2px solid var(--primary);outline-offset:2px; }
/* a collapsed group still has to read as a summary line, so keep the count and button visible */
.pl-group:not([open]) > summary .pl-group__n { opacity:.85; }

/* ---- Tracker step: site photos ---- */
.tdoc-shot { display:inline-block;width:56px;height:56px;border-radius:8px;overflow:hidden;border:1px solid var(--border-2);background:var(--well);flex:0 0 auto; }
.tdoc-shot img { width:100%;height:100%;object-fit:cover;display:block; }
.tdoc-shot:hover { border-color:var(--primary); }

/* ---- Trackers: site sheet + offline badge ---- */
.trk-bar { display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0 0 10px; }
.trk-off { font-size:12px;color:#8a5200;background:#fff3df;border-radius:999px;padding:3px 10px; }
.tstep-act .is-queued { outline:2px dashed #b26a00;outline-offset:1px; }

/* ---- Purchase orders from EPC contracts ---- */
.po-intro { font-size:12.5px;max-width:820px;margin:0 0 14px;line-height:1.6; }
.po-upload { margin-bottom:14px; }
.po-upload__form { display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0; }
.po-upload__label { font-size:12px;font-weight:700;letter-spacing:.02em;text-transform:uppercase;color:var(--muted); }
.po-card { padding:0;overflow:hidden; }
.po-card__head { display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;padding:13px 16px;border-bottom:1px solid var(--border);font-size:13px; }
.po-card__foot { display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 16px;border-top:1px solid var(--border);background:var(--surface-2);font-size:12.5px; }
.po-row { display:flex;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border); }
.po-row:last-of-type { border-bottom:0; }
.po-row--blocked { background:#fffaf8; }
.po-row__pick { flex:0 0 auto;padding-top:2px; }
.po-row__x { color:var(--muted); }
.po-row__body { flex:1 1 auto;min-width:0; }
.po-row__drop { flex:0 0 auto; }
.po-row__title { display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;margin-bottom:8px; }
.po-row__title b { font-size:14px;font-variant-numeric:tabular-nums; }
.po-row__file { font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:320px; }
.po-flag { font-size:10px;font-weight:700;border-radius:5px;padding:1px 7px;text-transform:uppercase;letter-spacing:.03em; }
.po-flag--go { color:#0f6b3a;background:#e7f6ee; }
.po-flag--stop { color:#b3261e;background:#fcdedb; }
.po-flag--hand { color:#7a4b00;background:#fdf1dc;margin-left:6px; }
.po-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px 18px;font-size:12.5px; }
.po-k { display:block;font-size:10.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--muted);margin-bottom:1px; }
.po-note { font-size:11px;margin-left:5px; }
.po-sel { width:100%;max-width:280px;font-size:13px; }
/* After .po-sel, or the narrower width never applies; the mobile layer widens it again. */
.po-meter { max-width:180px;font-variant-numeric:tabular-nums; }
.po-progress { font-size:12.5px;font-weight:600;color:var(--primary); }
.po-inv { margin-bottom:14px; }
.po-inv__sum { cursor:pointer;font-size:13.5px;list-style:none; }
.po-inv__sum::-webkit-details-marker { display:none; }
.po-inv__sum::before { content:'+ ';font-weight:700;color:var(--primary); }
.po-inv[open] .po-inv__sum::before { content:'- '; }
.po-inv__form { display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:12px 18px;margin:0; }
.po-f { display:flex;flex-direction:column;gap:3px;font-size:12.5px;min-width:0; }
.po-f input, .po-f select { width:100%;font-size:13px; }
.po-inv__go { grid-column:1/-1;display:flex;gap:8px;align-items:center;flex-wrap:wrap; }
/* One row per site on a split invoice: which site, and its share of the net. */
.po-f--wide { grid-column:1/-1; }
.po-split { display:flex;gap:8px;align-items:center;margin:0 0 6px; }
.po-split select { flex:1 1 auto;min-width:0; }
.po-split__amt { flex:0 0 140px;text-align:right;font-variant-numeric:tabular-nums; }
.po-split__acts { display:flex;gap:8px;flex-wrap:wrap;margin:2px 0 6px; }
/* The choice of shape. ".po-f input" sets width:100% for the text fields in this form, which
   stretches a radio button across the whole row and pushes its own label off to the right - so the
   radio opts out explicitly, and the wording sits in one span that wraps as a sentence. */
.po-mode { display:flex;gap:8px;align-items:baseline;margin:6px 0 0;font-size:12.5px;line-height:1.45;cursor:pointer; }
.po-f .po-mode input[type="radio"] { width:auto;flex:0 0 auto;margin:0; }
.po-mode > span { flex:1 1 auto;min-width:0; }
.po-site { display:block; }
/* A site in the Issued cell opens its project card — render the address as a link-styled button. */
button.po-site { font:inherit;text-align:left;background:none;border:0;padding:2px 0;color:var(--primary);cursor:pointer; }
button.po-site:hover { text-decoration:underline; }
/* Count of unhandled mail arrivals, on the Finance tab strip. */
.fin-badge { display:inline-block;min-width:18px;padding:1px 5px;border-radius:9px;background:var(--red,#b3261e);color:#fff;font-size:11px;line-height:16px;text-align:center;vertical-align:1px; }
.po-invrow { border:1px solid var(--border);border-radius:12px;margin-bottom:12px;padding:14px 16px; }
.po-invrow:last-of-type { margin-bottom:0; }
.po-acts { white-space:nowrap; }
.po-acts .btn { margin-left:4px; }
.po-void td { opacity:.62; }
.po-void .po-flag { margin-left:7px; }
.po-msg { font-size:12px;margin:8px 0 0;padding:5px 10px;border-radius:8px; }
.po-msg--stop { color:#8c1d18;background:#fcdedb; }
.po-msg--warn { color:#7a4b00;background:#fdf1dc; }
.po-adopt { display:flex;align-items:flex-start;gap:8px;margin-top:9px;font-size:12px;color:#3c4453; }
.po-adopt code { font-size:11px;background:var(--well);border-radius:5px;padding:1px 6px;margin-right:5px; }
/* A flex parent shrinks a fixed-width checkbox: without this the touch rule's 22px box renders
   13px wide and 22px tall on a phone. */
.po-adopt input[type=checkbox], .po-row__check input[type=checkbox] { flex:0 0 auto; }
.po-table th, .po-table td { font-size:12.5px; }

/* ---------- Partner portal (external contractors / suppliers) ----------
   Reuses the app's brand mark, cards, buttons, pills, tables and tab nav so the
   partner-facing surface reads as the same product — on a lighter single-column shell. */
.pt-body { min-height:100dvh; background:linear-gradient(135deg,#eef1e9 0%,#f7f6ef 44%,#eef8f0 100%); }
.pt-shell { max-width:none; margin:0 auto; padding:18px 30px 56px; }
.pt-top { display:flex; align-items:center; gap:14px; padding:12px 18px; margin-bottom:16px;
          background:rgba(255,255,255,.72); border:1px solid rgba(232,235,228,.86); border-radius:18px;
          box-shadow:0 12px 30px rgba(31,38,56,.05); backdrop-filter:blur(12px); }
.pt-top .brand { min-height:auto; padding:0; gap:11px; }
.pt-top .brand__txt { white-space:normal; }
.pt-top__right { margin-left:auto; display:flex; align-items:center; gap:14px; }
.pt-user { font-size:13px; color:var(--muted); font-weight:600; white-space:nowrap; }
.pt-nav { display:flex; gap:2px; margin-bottom:22px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.pt-nav a { padding:10px 16px; color:var(--muted); font-weight:600; border-bottom:2px solid transparent; display:inline-flex; align-items:center; gap:8px; }
.pt-nav a:hover { color:var(--text); text-decoration:none; }
.pt-nav a.is-active { color:var(--primary); border-bottom-color:var(--primary); }
.pt-badge { background:var(--primary); color:#fff; border-radius:999px; min-width:20px; text-align:center; padding:1px 7px; font-size:11px; font-weight:700; }
/* Ticket thread bubbles + context card (shared internal + portal), on the app palette. */
.tk-msg { border:1px solid var(--border); border-left:3px solid var(--border-2); border-radius:12px; padding:11px 14px; background:var(--surface); }
.tk-msg--ext { border-left-color:var(--primary); background:var(--tint); }
.tk-msg__head { font-size:12.5px; margin-bottom:5px; }
.tk-msg__body { white-space:pre-wrap; word-break:break-word; }
.tk-att { display:inline-flex; align-items:center; gap:5px; margin:6px 10px 0 0; font-size:13px; }
.tk-ctx { background:var(--tint); border:1px solid var(--border); }
.tk-ctx__label { font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin-bottom:3px; }

/* Partner project board — all phases in ONE row across the full width, like the internal dashboard.
   Columns share the width (1fr); if they can't fit their floor, the board scrolls horizontally. */
.pt-board { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(230px,1fr); gap:14px;
            align-items:start; overflow-x:auto; padding-bottom:6px; }
.pt-board__col { background:rgba(255,255,255,.5); border:1px solid var(--border); border-radius:14px; padding:10px; min-height:132px; }
/* align-items:flex-start + a reserved two-line min-height so 1- and 2-line phase names keep every
   column's first card at the same Y and the count badge pinned top-right. */
.pt-board__head { display:flex; align-items:flex-start; justify-content:space-between; gap:8px;
                  font-size:12.5px; font-weight:700; color:var(--muted); text-transform:uppercase;
                  letter-spacing:.02em; line-height:1.25; padding:2px 4px 8px; min-height:44px; }
.pt-board__head > span:first-child { min-width:0; }
.pt-pcard { display:block; background:var(--surface); border:1px solid var(--border); border-radius:12px;
            padding:11px 13px; margin-bottom:9px; color:var(--text);
            box-shadow:0 4px 12px rgba(31,38,56,.04); transition:box-shadow .12s,transform .12s; }
.pt-pcard:last-child { margin-bottom:0; }
.pt-pcard:hover { text-decoration:none; box-shadow:0 8px 20px rgba(31,38,56,.09); transform:translateY(-1px); }
.pt-pcard__site { font-weight:700; line-height:1.25; }
.pt-pcard__city { font-size:12.5px; color:var(--muted); margin-top:1px; }
.pt-pcard__meta { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin-top:8px; font-size:12px; }
.pt-pcard__win { font-size:12.5px; color:var(--muted); margin-top:7px; }
/* Portal project modules — one uniform vertical rhythm for every full-width card (overrides the
   global .card + .card margin so the gap isn't doubled). */
.pt-modules { display:flex; flex-direction:column; gap:16px; }
.pt-modules > .card { margin:0; }   /* the flex gap is the only spacing (kills form/.card margins) */
/* Phase & status + on-site contact share one card, side by side. */
.pt-meta { display:flex; flex-wrap:wrap; gap:16px 32px; }
.pt-meta > div { flex:1 1 240px; min-width:0; }
/* Portal date grid — compact, evenly-sized fields; align-items:end keeps every input on one line
   even when a label wraps (e.g. "Planned week (optional)"). Stacks on phones via the touch layer. */
.pt-dates { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,220px)); gap:14px 16px; align-items:end; }
/* Portal handover editor — responsive field grid + multi/check controls */
.ho-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; align-items:end; }
.ho-grid .field { margin:0; }
.field--check { flex-direction:row; align-items:center; gap:8px; }
.ho-multi { display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.pill-check { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border); border-radius:999px; padding:6px 12px; font-size:13px; background:var(--surface); }

/* ---- Post-handover close-out (open items) ---- */
.seg__n { display:inline-block; min-width:17px; padding:0 5px; margin-left:3px; border-radius:9px; background:var(--red,#b4232c); color:#fff; font-size:11px; line-height:16px; text-align:center; vertical-align:1px; }
.ho-grp__head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.ho-field-grp > summary { cursor:pointer; list-style:disclosure-closed; margin-bottom:0; }
.ho-field-grp[open] > summary { list-style:disclosure-open; margin-bottom:10px; }
.ho-field-grp__actions { align-items:center; }
.ho-items td { vertical-align:top; }
.ho-done td { opacity:.72; }
.ho-res { margin-top:4px; font-size:12.5px; color:#1a7f46; }
.ho-complete { display:inline-block; }
.ho-complete > summary { list-style:none; cursor:pointer; display:inline-block; }
.ho-complete > summary::-webkit-details-marker { display:none; }
.ho-complete[open] > summary { opacity:.6; }
.ho-cform { margin-top:8px; padding:10px; border:1px solid var(--border); border-radius:9px; background:var(--well,#f6f8f9); display:flex; flex-direction:column; gap:8px; text-align:left; min-width:240px; }
.ho-cform label { display:flex; flex-direction:column; gap:3px; font-size:12.5px; color:var(--muted); }
.ho-cform input { width:100%; }

/* ==================================================================
   Mobile & touch override layer  (KEEP THIS AT THE END OF THE FILE)
   ------------------------------------------------------------------
   Two concerns, two triggers:
   (a) Touch sizing — (pointer:coarse) OR phone width. pointer:coarse
       alone is unreliable (some Android browsers misreport it), so
       width is a robust fallback.
   (b) Phone layout — pure (max-width:767px).
   The dense mouse/desktop UI (>=768px + fine pointer) is untouched.
   Placed last so these rules win by source order over the base defs
   without needing !important. New components must follow
   docs/DESIGN_HANDOFF.md "Mobile & Touch Standards".
   ================================================================== */
@media (pointer:coarse), (max-width:767px) {
    /* >=16px prevents iOS Safari auto-zoom on focus. !important guards
       against later class-level small font-sizes (.tstep-f input, etc.). */
    input,select,textarea { font-size:var(--fs-input) !important; }
    /* Enlarge the smallest interactive controls to a usable touch target. */
    .icon-btn,.cm__close { width:var(--tap-min);height:var(--tap-min); }
    .btn,.seg a,.chip,.subt-chip,.subt-stepsel,.toggle,.cal-filter,.mini-select,.wl-stage { min-height:var(--tap-min); }
    input[type=checkbox],input[type=radio] { width:22px;height:22px; }
    /* worklist check-off controls — big enough to tap in a dense grid */
    .team-sel,.team-name { min-height:var(--tap-min); }
    .team-sel { padding:6px 8px; }
    .tdoc-up summary { padding:8px 10px; }
}
/* Partner portal — phone: stack the top bar, let the nav scroll. */
@media (max-width:767px) {
    .pt-shell { padding:12px 12px 40px; }
    .pt-top { flex-wrap:wrap; gap:8px 12px; padding:10px 12px; }
    .pt-top__right { margin-left:0; width:100%; justify-content:space-between; }
    .pt-nav { flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; }
    .pt-nav a { white-space:nowrap; }
    /* One column of full-width phase groups; dates stack. */
    .pt-board { grid-auto-flow:row; grid-auto-columns:auto; grid-template-columns:1fr; overflow-x:visible; }
    .pt-dates { grid-template-columns:1fr; }
}

/* Phone topbar: the bottom tab bar owns navigation, so drop the redundant
   hamburger + page title and give the search room; condense the userchip. */
@media (max-width:767px) {
    .app__topbar { padding:0 12px;gap:8px; }
    .app__topbar > [data-toggle-rail] { display:none; }
    .topbar__title { display:none; }
    .topbar__right { margin-left:0;flex:1;gap:8px;min-width:0; }
    .topsearch { flex:1 1 auto;width:auto;min-width:0; }
    .userchip { flex:none;padding:3px 4px;gap:6px; }
    .userchip__name { display:none; }
    /* Subsidy master-detail → the application list becomes a collapsed
       "Applications" picker; the form flows below in natural page scroll
       (no more two cramped nested-scroll panes). */
    .sub-head { padding:14px 16px 0; }
    .sub-track { padding:12px 16px 40px; }
    .sub-screen { display:block;height:auto;padding-left:0; }
    .sub-rail { display:block;width:auto;max-height:none;border:none;background:none; }
    .sub-rail > .sub-rail__head { display:none; }
    .sub-rail > .sub-rail__toggle { display:flex;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;list-style:none;min-height:var(--tap-min);padding:0 14px;margin:12px 14px 0;border:1px solid var(--border-2);border-radius:9px;background:var(--surface);font-weight:600;font-size:13px; }
    .sub-rail > .sub-rail__toggle::-webkit-details-marker { display:none; }
    .sub-rail__toggle-hint { font-size:11.5px;font-weight:600; }
    .sub-rail:not([open]) > .sub-rail__list { display:none; }
    .sub-rail[open] > .sub-rail__list { display:block;max-height:52vh;overflow-y:auto;margin:8px 14px 0; }
    .sub-form { padding:14px 16px 40px;overflow:visible; }
    .sub-form__inner { max-width:none; }

    /* Header actions align to the left edge on phones (consistent with the
       page title, filters and content) instead of being pushed right by the
       desktop margin-left:auto — e.g. the calendar month-nav row. */
    .page-head__actions { margin-left:0; }

    /* Projects toolbar header: keep "16 of 16" on one line and drop the
       Board/Table + New-project actions onto their own row (they were
       flex-squeezing the count into a 3-line column). */
    .proj-toolbar__top { flex-wrap:wrap; column-gap:10px; row-gap:10px; }
    .proj-count { white-space:nowrap; }
    /* Actions row: full-width Board/Table toggle, then the buttons on the next
       row, each on a single line (they were wrapping to two rows of text). */
    .proj-toolbar__top .page-head__actions { margin-left:0; width:100%; flex-wrap:wrap; row-gap:8px; }
    .proj-toolbar__top .page-head__actions > .seg { flex:1 1 100%; }
    .proj-toolbar__top .page-head__actions > .seg a { flex:1; justify-content:center; }
    .proj-toolbar__top .page-head__actions .btn { white-space:nowrap; }

    /* Projects filters → collapse into a tappable "Filters" disclosure so the
       board/table isn't buried under 6 stacked dropdowns. */
    .filters-wrap > .filters-summary { display:inline-flex;align-items:center;gap:7px;cursor:pointer;list-style:none;min-height:var(--tap-min);padding:0 14px;margin:0 0 10px;border:1px solid var(--border-2);border-radius:9px;background:var(--surface);font-weight:600;font-size:13px;width:max-content; }
    .filters-wrap > .filters-summary::-webkit-details-marker { display:none; }
    .filters-wrap > .filters-summary::after { content:"▾";color:var(--muted);font-size:11px; }
    .filters-wrap[open] > .filters-summary::after { content:"▴"; }
    .filters-summary__n { background:var(--primary);color:#fff;border-radius:999px;font-size:11px;padding:0 7px; }
    .filters-wrap:not([open]) > .filters { display:none; }
    .filters-wrap[open] > .filters { display:flex; }
    .filters label { flex:1 1 46%; }
    .filters select { min-width:0;width:100%; }

    /* Kanban board → stack phases vertically & flow into natural page scroll.
       No fixed-height pane, no nested horizontal+vertical scroll: each phase is
       a full-width section, all its cards visible, the page scrolls down. */
    .proj-screen { height:auto; }
    .board { flex:none;overflow:visible;scroll-snap-type:none;padding:4px 14px 24px; }
    .board__inner { flex-direction:column;height:auto;gap:12px; }
    .kcol { min-width:0;width:100%;max-height:none;scroll-snap-align:none; }
    .kcol__list { overflow-y:visible; }
    .kcol--empty { display:none; }        /* only show phases that have work on a phone */
    .board-controls { display:none; }      /* "Hide empty stages" is automatic on mobile */

    /* Projects Table → collapse each row into a tappable card (site = title,
       every other column becomes a labelled line). Far more scannable on a
       phone than a squished 8-column table. */
    .ptable-wrap { padding:4px 14px 24px; }
    .ptable { border:none;background:none;border-radius:0; }
    .ptable thead { display:none; }
    .ptable tbody, .ptable tr, .ptable td { display:block; }
    .ptable tbody tr { background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--sh1);padding:12px 14px;margin-bottom:10px; }
    .ptable td { border:none;padding:4px 0;font-size:13px; }
    .ptable td.pt-site { font-size:15px;font-weight:700;padding:0 0 8px;margin-bottom:6px;border-bottom:1px solid var(--border); }
    .ptable td[data-label] { display:flex;justify-content:space-between;gap:14px;align-items:baseline; }
    .ptable td[data-label]::before { content:attr(data-label);color:var(--muted);font-weight:600;font-size:12px;flex:none; }
    .ptable td.r { text-align:left; }

    /* DSO/KfW worklist grid → per-project cards. Each project is a card; each
       checklist step becomes a labelled row with its status select. All the JS
       (status/due/docs/city-collapse) is bound to the same elements, so it
       keeps working — only the layout changes. */
    .team-wrap { overflow:visible; }
    .team-table { min-width:0; }
    .team-table thead { display:none; }
    .team-table tbody, .team-table tr, .team-table td { display:block; }
    .team-table td { border:none;padding:0;white-space:normal; }
    /* city group header */
    .team-table tr.team-cityrow { margin:16px 0 8px; }
    .team-table tr.team-cityrow td { position:static;background:none;padding:0; }
    /* project card */
    .team-table tr[data-row] { background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--sh1);padding:12px 14px;margin-bottom:10px; }
    /* card header (was the sticky project cell) */
    .team-table td.team-sticky { position:static;min-width:0;box-shadow:none;background:none;padding-bottom:8px;margin-bottom:6px;border-bottom:1px solid var(--border); }
    .team-name { font-size:15px; }
    .team-sub,.team-stage { max-width:none; }
    /* Purchase orders: one column, full-width controls, and the issued table stacks. */
    .po-row { flex-wrap:wrap; }
    .po-row__file { max-width:100%; }
    .po-grid { grid-template-columns:1fr; }
    .po-sel { max-width:none;min-height:var(--tap-min); }
    .po-upload__form { flex-direction:column;align-items:stretch; }
    .po-upload__form .btn { width:100%; }
    .po-upload input[type=file] { width:100%;font-size:16px; }
    .po-card__foot .btn { width:100%; }
    .po-table thead { display:none; }
    .po-table tr { display:block;border-bottom:1px solid var(--border);padding:8px 4px; }
    .po-table td { display:flex;justify-content:space-between;gap:12px;border:0;padding:4px 8px; }
    .po-table td::before { content:attr(data-label);font-weight:700;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.03em; }
    /* Three actions in a nowrap cell overflow a phone; let them wrap and give each a tap target. */
    .po-inv__form { grid-template-columns:1fr; }
    .po-f input, .po-f select { min-height:var(--tap-min);font-size:16px; }
    .po-acts { white-space:normal;flex-wrap:wrap;gap:6px;justify-content:flex-end; }
    .po-acts .btn { margin-left:0;min-height:var(--tap-min); }
    /* The stage bar is two funnels, not a wall of chips: label on its own line, chips on a
       single swipeable strip. Wrapping them cost 344px of an 812px screen before any project. */
    .wl-stages__row { display:block; }
    .wl-stages__lead { display:block;min-width:0;margin:0 0 4px; }
    .wl-stages__strip { flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:2px; }
    .wl-stage { flex:0 0 auto; }
    /* progress row (.team-table td.X specificity beats the .ta-c centering
       + .team-table td padding:0 rules that outrank single-class selectors). */
    .team-table td.team-progcell { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:6px 2px;text-align:left; }
    .team-table td.team-progcell::before { content:attr(data-label);color:var(--muted);font-weight:600;font-size:12px; }
    .team-prog { justify-content:flex-end; } .team-prog__bar { width:96px; }
    /* each checklist step = one clean left-aligned row: label left, status right */
    .team-table td.team-cell { display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;border:none;border-radius:8px;padding:9px 11px;margin-top:6px; }
    .team-table td.team-cell::before { content:attr(data-label);font-weight:600;font-size:12.5px;color:var(--text);flex:1;min-width:0;line-height:1.35; }
    .team-table td.team-cell .team-sel { flex:none;width:auto;min-width:116px; }
    .team-table td.team-cell .team-due { display:none; }   /* set due dates on the project card; keep the worklist uncluttered */
    /* footer actions (Docs + Open) sit side by side */
    .team-table td.team-actcell { display:inline-block;margin:10px 8px 0 0; }

    /* Subsidy tracker: each data cell → a labelled row inside the project card */
    .subt-strip .subt-stat { flex:1 1 44%; }
    .subt-table { min-width:0; }
    .team-table td.subt-cell { display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;border:none;border-top:1px solid var(--border-2);padding:8px 2px; }
    .team-table td.subt-cell::before { content:attr(data-label);color:var(--muted);font-weight:600;font-size:12px;flex:none; }
    .team-table td.subt-cell[data-label=""]::before { content:none; }
    .team-table td.subt-cell.subt-actcell { justify-content:flex-end;border-top:none;padding-top:10px; }
    /* Installed-capacity footer: the table collapses to blocks on phones, so render the row as a
       single labelled card line rather than letting its cells stack and the spacer leave a gap. */
    .team-table tfoot.subt-foot tr { display:flex;justify-content:space-between;align-items:baseline;gap:12px;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:11px 14px;margin-top:4px; }
    .team-table tfoot.subt-foot td { display:block;border:none;padding:0;background:none; }
    .team-table tfoot.subt-foot td.subt-foot-pad { display:none; }
    .team-table tfoot.subt-foot td.subt-foot-label { text-align:left; }
    /* Handover filter bar: let the search + client/city/status selects wrap instead of overflowing
       the 375px row. Scoped to --wrap so other .wl-search toolbars are untouched. */
    .wl-search--wrap { flex-wrap:wrap; }
    .wl-search--wrap input[type=search] { width:100%; }
    .wl-search--wrap select { flex:1 1 44%;min-width:0; }
    .subt-pipe { align-items:flex-end; }

    /* Budget: Purchase-order + AP/AR invoice tables → tappable cards (same
       pattern as the projects table). Numeric Spend matrix stays horizontal
       scroll; the Spend Breakdown is already card-based. */
    .fin-card { background:none;border:none;box-shadow:none;padding:0; }
    .fin-table thead { display:none; }
    .fin-table, .fin-table tbody, .fin-table tr, .fin-table td { display:block; }
    .fin-table tbody tr { background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--sh1);padding:12px 14px;margin-bottom:10px; }
    .fin-table td { border:none;padding:4px 0;font-size:13px; }
    .fin-table td.fin-title { font-size:15px;font-weight:700;padding:0 0 8px;margin-bottom:6px;border-bottom:1px solid var(--border); }
    .fin-table td[data-label] { display:flex;justify-content:space-between;gap:14px;align-items:baseline; }
    .fin-table td[data-label]::before { content:attr(data-label);color:var(--muted);font-weight:600;font-size:12px;flex:none; }
    .fin-table td.ta-r { text-align:left; }
    /* full-width cell for the inline "record payment" form */
    .fin-table td.fin-full { display:block;border-top:1px solid var(--border);margin-top:8px;padding-top:10px; }
    .fin-table td.fin-full::before { content:attr(data-label);display:block;color:var(--muted);font-weight:600;font-size:12px;margin-bottom:8px; }
    .fin-table td.fin-actcell { display:block;margin-top:10px; }
    .fin-table .pay-form { display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0; }
    .fin-table .pay-form .mini-input { width:auto;flex:1 1 120px; }

    /* Calendar legend/filters → a "Filter events" dropdown instead of a
       3-row chip pile that buried the calendar. Tap to reveal the toggles. */
    .cal-legend__sum { display:inline-flex;align-items:center;gap:8px;cursor:pointer;list-style:none;min-height:var(--tap-min);padding:0 14px;margin:0 0 10px;border:1px solid var(--border-2);border-radius:9px;background:var(--surface);font-weight:600;font-size:13px;width:max-content; }
    .cal-legend__sum::-webkit-details-marker { display:none; }
    .cal-legend__sum::after { content:"▾";color:var(--muted);font-size:11px; }
    .cal-legend[open] > .cal-legend__sum::after { content:"▴"; }
    .cal-legend__n { background:var(--primary);color:#fff;border-radius:999px;font-size:11px;padding:0 7px;font-weight:700; }
    .cal-legend:not([open]) > .cal-filters { display:none; }
    .cal-legend[open] > .cal-filters { display:flex;flex-wrap:wrap;margin-bottom:10px; }
}

/* ---- Step due dates / overdue ---- */
.tstep-overdue { font-size:10px;font-weight:700;color:#b3261e;background:#fcdedb;border-radius:5px;padding:1px 7px;margin-left:6px;white-space:nowrap; }
.tracker__item.is-overdue .tracker__label { color:#b3261e; font-weight:600; }
.tstep-sum__due { font-size:10.5px;font-weight:600;color:#8a5200;background:#f9edd6;border:1px solid #eeddb5;border-radius:5px;padding:1px 7px;white-space:nowrap; }
.tstep-sum__due.is-overdue { color:#b3261e;background:#fcdedb;border-color:#f5b5ae; }
.tf-hint { font-weight:400;color:var(--muted);font-size:9.5px; }
.tf--due input { border-color:#e6c3bd; }
.team-overdue { display:inline-block;font-size:10px;font-weight:700;color:#b3261e;background:#fcdedb;border-radius:5px;padding:0 7px;margin-left:6px;white-space:nowrap;vertical-align:middle; }
.team-cell.is-overdue { box-shadow:inset 0 0 0 1px #e24b4a; }

/* ---- Editor label line + worklist colour coding + inline due date ---- */
.tf-l { display:block;line-height:1.3;margin-bottom:1px;min-height:14px; }
.team-cell.tstat-todo { background:#fff8f7; }   /* not done */
.team-cell { vertical-align:middle; }
.team-due { display:block;margin:4px auto 0;font-size:10px;padding:3px 5px;border:1px solid #dfe5ed;border-radius:7px;color:#697286;width:116px;max-width:100%;background:rgba(255,255,255,.82);text-align:center; }
.team-due:hover, .team-due:focus { color:var(--text);background:#fff; }
.team-due-ro { display:block;font-size:10px;color:var(--muted);margin-top:2px; }

/* ---- KfW dispatch (send pack) ---- */
.kfwsend { background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:12px 14px;margin:0 0 14px; }
.kfwsend__row { display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px; }
.kfwsend__sel { font-size:12.5px;padding:4px 8px;border-radius:6px;border:1px solid var(--border); }
.kfwsend__sel--ready { background:#fff6e6;color:#8a5200;border-color:#eeddb5; }
.kfwsend__sel--sent { background:#e7f6ee;color:#0f6b3a;border-color:#c2e6d2; }
.kfwsend__actions { display:flex;gap:8px;flex-wrap:wrap; }
.team-kfwdisp { display:inline-block;font-size:10px;font-weight:700;border-radius:5px;padding:0 7px;margin-left:6px;white-space:nowrap;vertical-align:middle; }
.team-kfwdisp--ready { color:#8a5200;background:#f9edd6; }
.team-kfwdisp--sent { color:#0f6b3a;background:#e7f6ee; }

/* ---- KfW send nudge (Trackers header) ---- */
.kfwnudge { display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:2px 0 10px;padding:9px 12px;border-radius:9px;border:1px solid var(--border); }
.kfwnudge.is-ready { background:#e7f6ee;border-color:#c2e6d2; }
.kfwnudge.is-wait { background:var(--well); }
.kfwnudge__msg { font-size:12px;font-weight:600;color:var(--text);flex:1;min-width:170px; }
.kfwnudge.is-ready .kfwnudge__msg { color:#0f6b3a; }
.kfwnudge.is-wait .kfwnudge__msg { color:var(--muted); }
.kfwnudge__actions { display:flex;gap:6px;align-items:center;flex-wrap:wrap; }

/* Schedule colour-key: stack on phones so the toggle + swatches stay tappable/readable. */
@media (max-width:767px) {
    .sched-key { gap:10px 12px; }
    .sched-key__toggle { width:100%; }
    .sched-key__toggle button { flex:1; min-height:var(--tap-min); }
    .sched-key__hint { margin-left:0;width:100%; }
    /* Bauzeitenplan: narrower sticky label columns so the KW raster keeps room; whole grid scrolls horizontally. */
    .bzp { --bzp-c1:132px; --bzp-c2:56px; --bzp-cw:26px; min-width:660px; }
    .bzp-site { padding:6px 8px; }
    .bzp-name { font-size:11.5px; }
    .bzp-scope { margin-left:0;width:100%; }
    .bzp-scope a { flex:1;min-height:var(--tap-min);display:flex;align-items:center;justify-content:center; }
    /* Site filter: full-width tappable selects, ≥16px so iOS doesn't zoom. */
    .cal-sitefilter select { font-size:16px;min-height:var(--tap-min);flex:1 1 45%;max-width:none; }
    .cal-sitefilter__n { margin-left:0;width:100%; }
}

/* Collapsible group headers and bulk-select checkboxes are the two controls the Signatures and
   Pipeline pages are driven by on a phone, and both were under the 44px minimum: the <summary>
   was only as tall as its text (21px), and .sitesel rendered at the browser default 22px. Neither
   is reachable reliably with a thumb on site. Touch only — the dense desktop UI is unchanged. */
@media (max-width:767px), (pointer:coarse) {
    .pl-group > summary.pl-group__h {
        min-height:var(--tap-min);
        align-items:center;
        padding:8px 10px;
        margin:10px 0 6px;
        border:1px solid var(--border-2);
        border-radius:9px;
        background:var(--surface);
    }
    .pl-group[open] > summary.pl-group__h { margin-bottom:8px; }
    /* An <input> is a replaced element and renders no ::before/::after, so the hit area cannot be
       grown with a pseudo-element — the checkbox has to be wrapped in a label that is itself the
       target. .sitesel-wrap does that; the checkbox keeps its normal size inside it. */
    .sitesel-wrap {
        display:flex;align-items:center;justify-content:center;
        min-width:var(--tap-min);min-height:var(--tap-min);
        margin:-6px;cursor:pointer;
    }
}

/* Wide tables on the Signatures / Pipeline pages must scroll INSIDE their card, not drag the whole
   page sideways. The awaiting table is six columns once the select box and Cancel button are there:
   542px of content in a 323px card, with the last cell landing at x=583 on a 375px screen — i.e.
   off it. app.css already documents `.tbl-wrap` for this, but these views never used it, and
   retro-fitting a wrapper around every table is more churn than the rule is worth. `display:block`
   turns the table itself into the scroll container, which needs no markup change.
   Touch only — the desktop layout is dense on purpose and is not touched. */
@media (max-width:767px), (pointer:coarse) {
    .sigc .card table.table,
    .sigc details table.table {
        display:block;
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
        max-width:100%;
    }
}

/* ---- Crew schedule board ------------------------------------------------------------------
   Desktop: a wide week grid that scrolls inside its own card, never dragging the page.
   Phone: the shared .team-table layer collapses rows to blocks and hides thead, so each week
   cell announces its own KW — otherwise the jobs stack anonymously on the device the site
   crews actually hold. Empty weeks are dropped there rather than printing a blank label. */
@media (min-width: 768px) and (pointer: fine) {
    /* The board scrolls sideways — but only if you can REACH the scrollbar. Unconstrained, this
       grid ran 4517px tall (KW35 alone stacks 31 jobs in one cell), which put its horizontal
       scrollbar ~3900px below the fold: the grid was visibly cut off on the right and the only
       control that moved it was a screen-height away, so it read as "no horizontal scroll".
       Capping the height turns it into a proper pane — both scrollbars in view, and the sticky
       week header finally has the scroll container it always assumed. */
    [data-sched] { overflow: auto; max-height: min(72vh, 760px); overscroll-behavior-x: contain; }
    [data-sched] .team-table thead th { top: 0; }
    /* dense on a mouse: the desktop grid stays compact so more weeks fit on screen */
    .sched-item .sched-sel { font-size: 11px; min-height: 26px; padding: 1px 4px; }
}
@media (max-width: 767px), (pointer: coarse) {
    .team-table td.sched-cell { display:block;text-align:left;border:none;border-top:1px solid var(--border-2);padding:8px 2px; }
    .team-table td.sched-cell::before {
        content:attr(data-label);display:block;color:var(--muted);font-weight:700;font-size:12px;margin-bottom:5px;
    }
    .team-table td.sched-cell--empty { display:none; }
    .sched-item .sched-sel { min-height:var(--tap-min); font-size:16px; }
}

/* ---- Project card tabs: nothing may hide past the right edge -------------------------------
   The strip scrolls horizontally with its scrollbar deliberately hidden. At 13 tabs that put
   Timeline AND History off-screen on a 1280px window with no cue that they existed — the user
   simply could not find them. On a mouse the strip now wraps, so every tab is always visible;
   on touch the swipeable single line stays, because dragging a tab strip is a gesture people
   already know and three wrapped rows would eat the drawer. */
@media (min-width: 768px) and (pointer: fine) {
    .cm__tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 4px; }
}

/* ---- Project card: the 44px floor, applied to the whole card rather than class by class -----
   Measured on the busiest card at 375px BEFORE this rule: 111/111 selects (min 30px),
   118/118 date inputs (37px), 100/100 <summary> toggles (21px), every text and number field
   (35px) and the 13 tabs (35px) sat under the standard. The layer had sized .icon-btn and
   .cm__close individually and everything added since simply missed the floor — so this sets it
   once for the card's own regions instead of naming controls one at a time.
   Desktop is untouched: the dense mouse UI lives outside this query. */
@media (max-width: 767px), (pointer: coarse) {
    .cm__head .cm__tab { min-height: var(--tap-min); display: inline-flex; align-items: center; }
    .cm__scroll select,
    .cm__scroll input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .cm__scroll textarea,
    .cm__scroll button,
    .cm__scroll a.btn,
    .cm__head select,
    .cm__head input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
        min-height: var(--tap-min);
    }
    /* A <summary> is a button in disguise and was the worst of them at 21px. */
    .cm__scroll summary { min-height: var(--tap-min); display: flex; align-items: center; gap: 6px; }
    /* Checkboxes cannot grow their hit area without growing the box — ::before/::after do not
       render on <input>. 24px is an honest improvement on 17px while still looking like a
       checkbox; the full 44px target needs the label-wrapper pattern (.sitesel-wrap) in markup,
       which is a separate sweep. */
    .cm__scroll input[type="checkbox"], .cm__scroll input[type="radio"] { width: 24px; height: 24px; }
}

/* ---- Checkboxes reach the floor through their label, everywhere -----------------------------
   An <input> is a replaced element: no ::before/::after, so a checkbox cannot grow its own hit
   area without growing the box. Of the 61 checkboxes in the views, 52 already sit inside a
   <label> — that label becomes the target here, and the box keeps its normal size. The other 9
   were alone in a table cell and got .sitesel-wrap in markup, so every checkbox in the app now
   has a 44px target rather than the standard being met one view at a time. */
@media (max-width: 767px), (pointer: coarse) {
    label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) {
        min-height: var(--tap-min);
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    /* A label wrapping ONLY the box (no text) also needs the width, or the target is 24px wide. */
    .sitesel-wrap { min-width: var(--tap-min); }
}

/* A split invoice's site rows: on a phone the site and its share stack, so neither the address
   nor the amount is squeezed into a few characters. Desktop keeps them side by side. */
@media (max-width: 767px), (pointer: coarse) {
    /* Keep the shape choice a row of [radio][wording] on touch too: the global rule that gives
       every radio label a 44px target would otherwise make these two inline and run together. */
    .po-mode { display: flex; min-height: var(--tap-min); align-items: center; }
    .po-f .po-mode input[type="radio"] { min-width: 22px; min-height: 22px; }
    .po-split { flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
    .po-split select { flex: 1 1 100%; }
    .po-split__amt { flex: 1 1 100%; text-align: left; }
    /* Each Issued-cell site is a card-opening link; give it a full touch target so the
       2-3 stacked addresses in one cell can be tapped apart without mis-hits. */
    button.po-site { min-height: var(--tap-min); display: flex; align-items: center; padding: 4px 0; }
}

/* Post-handover close-out — touch sizing (see DESIGN_HANDOFF Mobile & Touch Standards). */
@media (max-width: 767px), (pointer: coarse) {
    .ho-cform input { min-height: var(--tap-min); font-size: 16px; }
    .ho-complete, .ho-complete > summary, .ho-cform { display:block; width:100%; }
    .ho-grp__head { flex-direction: column; }
}
