/* ============================================================
   ProjectTelemetry — Complete App Stylesheet v12
   assets/app.css
   ============================================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { height: 100%; font-family: 'Raleway', system-ui, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
/* Fixed-app feel: no rubber-band overscroll, no iOS text auto-resize, no
   double-tap zoom. Pinch-zoom is blocked in JS (index.php) everywhere except
   the Plans viewer (.pl-stage), which drives its own pan/zoom. Deliberate
   scrolling — the page, the schedule's horizontal scroll — still works. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overscroll-behavior: none; }
body { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
input, select, textarea { font-family: inherit; }

/* Theme: Minimal / Light */
:root, [data-theme="light"] {
  --bg: #FFFFFF; --bg2: #F6F6F6; --bd: #E8E8E8;
  --ink: #111111; --ink-soft: #666666; --ink-faint: #AAAAAA;
  --white: #FFFFFF; --accent: #4F46E5; --accent-bg: #EEF2FF; --accent-ink: #FFFFFF;
  --nav-bg: #FFFFFF; --nav-w: 224px; --hdr-h: 52px; --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08); --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  /* Alias tokens: several modules were written against these names, which the
     app never defined — so they silently used their light fallback (fine in day,
     white in dark mode). Defined here as aliases of the real tokens; because they
     reference the base tokens, they re-resolve to the dark values under blueprint,
     so LIGHT MODE IS UNCHANGED and dark mode stops leaking white. */
  --card: var(--white); --surface: var(--white); --surface-soft: var(--bg2);
  --line: var(--bd); --line-soft: var(--bd); --hover: var(--bg2); --bg1: var(--bg);
  --accent-weak: var(--accent-bg); --barcol: var(--accent); --muted: var(--ink-soft);
  --danger: #DC2626; --warn: #D97706; --pos: #16A34A;
  --shadow-sm: var(--shadow); --shadow-lg: var(--shadow-md);
}

/* Theme: Blueprint — a true dark (indigo/slate) night mode.
   Surfaces come from tokens: --white is the raised panel (dark here),
   --bg the page, --bg2 subtle fills. Hardcoded #fff/light backgrounds
   in module CSS were tokenized to var(--white)/var(--bg2) so they adapt;
   in the light theme those tokens resolve to the same values, so light
   is unchanged. */
[data-theme="blueprint"] {
  --bg: #0E1322; --bg2: #1B2236; --bd: #2C3550;
  --ink: #EAEEF6; --ink-soft: #A9B6CE; --ink-faint: #6E7C98;
  --white: #161C2E; --accent: #6366F1; --accent-bg: #20264A; --accent-ink: #FFFFFF;
  --nav-bg: #121829;
  --shadow: 0 1px 3px rgba(0,0,0,.45); --shadow-md: 0 8px 24px rgba(0,0,0,.5);
}
body { background: var(--bg); color: var(--ink); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-ghost { background: transparent; border: 1.5px solid var(--bd); color: var(--ink-soft); padding: 7px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--white); padding: 7px 18px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-dark:hover { opacity: .88; }
.btn-dark:disabled { opacity: .45; cursor: not-allowed; }
.btn-dark-lg { background: var(--ink); color: var(--white); padding: 12px 28px; border-radius: 7px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-dark-lg:hover { opacity: .88; }
/* Landing (splash) CTAs use the signature accent purple, matching the Explore page */
#landing .btn-dark, #landing .btn-dark-lg { background: var(--accent); }
.btn-outline-lg { background: transparent; color: var(--ink); border: 1.5px solid var(--bd); padding: 11px 22px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; }
.btn-outline-lg:hover { border-color: var(--ink-soft); }
.btn-accent { background: var(--accent); color: var(--accent-ink); padding: 8px 18px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-accent:hover { opacity: .9; }
.btn-accent:disabled { opacity: .45; cursor: not-allowed; }
.btn-full { width: 100%; padding: 11px; font-size: 14px; border-radius: 7px; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 5px; }
.btn-icon { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink-soft); font-size: 16px; }
.btn-icon:hover { background: var(--bg2); color: var(--ink); }

/* ── Unified module toolbar ──────────────────────────────────
   One layout for every tool's controls so users don't get lost
   jumping between modules. Two zones:
     .mod-tb-l  = ACTIONS  (verbs that change the data — create,
                  undo, lock, link, baseline, milestone…). The
                  primary create button (btn-dark) comes first.
     .mod-tb-r  = VIEW     (how you look at the data — filters,
                  group/color selects, view toggles, zoom, refresh).
                  Zoom + refresh sit at the far right.
   A .mod-tb-sub hint line goes directly beneath. Active toggles
   get .on. Modules keep their own buttons; only the placement
   and styling are shared. */
.mod-tb { display: flex; justify-content: space-between; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 14px 0 8px; }
.mod-tb-l, .mod-tb-r { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mod-tb-sub { font-size: 12px; color: var(--ink-soft); margin: 0 0 12px; display: flex; align-items: center; gap: 6px; }
.mod-tb-sub b { color: var(--ink); }
.mod-tb-sub.link { color: var(--accent); }
.mod-tb-sub.link b { color: var(--ink); }

/* ── Multi-select (assets/multiselect.js) ─────────────────────
   Shared like .mod-tb above: selection must look and read the same on every
   surface that has it. Buttons inside are stock .btn-* primitives — no control
   geometry is declared here. */
.pt-selbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 14px;
  flex-wrap: wrap; margin: 0 0 12px; padding: 8px 12px;
  background: var(--accent-bg); border: 1px solid var(--accent);
  border-radius: 9px;
}
.pt-selbar-n { font-size: 12.5px; font-weight: 650; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.pt-selbar-n i { color: var(--accent); }
.pt-selbar-acts { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* The checkbox lives on the card/row itself. Always present on touch (no ctrl
   key on an iPad); on a pointer device it fades in on hover, or stays put once
   anything is selected so the affordance doesn't vanish mid-task. */
.pt-selbox {
  position: absolute; top: 6px; left: 6px; z-index: 3;
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); border: 1.5px solid var(--bd);
  color: transparent; cursor: pointer; opacity: 0; transition: opacity .12s, background .12s;
}
.pt-selbox i { font-size: 17px; }
/* Same trick as the design system's controls: reach a real touch target by
   growing the hit region, not the box. */
@media (hover: none) and (pointer: coarse) {
  .pt-selbox::after { content: ''; position: absolute; inset: -9px; }
}
.pt-selbox:hover { border-color: var(--accent); }
.fb-item:hover .pt-selbox { opacity: 1; }
.pt-selmode .pt-selbox { opacity: 1; }
.pt-selbox.on { opacity: 1; background: var(--accent); border-color: var(--accent); color: #fff; }
@media (hover: none) { .pt-selbox { opacity: 1; } }

/* Selected-state visuals for the browser's own items live in filebrowser.css
   (.fb-item.pt-sel / .fb-row.pt-sel) — the surfaces that used to declare their
   own went away with patch 605. */
/* Dragging a multi-selection: every member travels, so every member dims. */
.pt-dragging-multi { opacity: .5; }
.mod-tb .on { background: var(--accent, #2563EB); color: #fff; border-color: var(--accent, #2563EB); }
/* Shared control primitives (also used directly by module code). */
.mod-lbl { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 5px; }
.mod-lbl select { padding: 6px 8px; border: 1px solid var(--bd); border-radius: 7px; background: var(--bg); color: var(--ink); font-size: 13px; }
.mod-seg { display: inline-flex; border: 1px solid var(--bd); border-radius: 7px; overflow: hidden; }
.mod-seg button { padding: 6px 11px; border: none; background: transparent; color: var(--ink-soft); font-size: 12px; font-weight: 600; cursor: pointer; }
.mod-seg button + button { border-left: 1px solid var(--bd); }
.mod-seg button.active { background: var(--accent, #2563EB); color: #fff; }

/* ── Forms ───────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 12px; border: 1.5px solid var(--bd); border-radius: 6px; font-size: 14px; color: var(--ink); background: var(--bg); transition: border-color .15s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { min-height: 80px; resize: vertical; }
/* Modal form rows laid out with flex: let fields shrink and wrap instead of
   overflowing the modal. Native date/number inputs carry a wide intrinsic
   min-width that otherwise bunches them past the modal edge on narrow screens. */
.cp-body .field { min-width: 0; }
.cp-body .field input, .cp-body .field select { min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-hint { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px; }
.pw-eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-size: 16px; cursor: pointer; display: flex; align-items: center; }
.pw-eye:hover { color: var(--ink-soft); }
.check-label { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--ink-soft); cursor: pointer; line-height: 1.5; }
.check-label input[type="checkbox"] { width: auto; flex: 0 0 auto; margin-top: 2px; accent-color: var(--accent); }
.check-label a { color: var(--accent); text-decoration: underline; }

/* ── Theme toggle ────────────────────────────────────────── */
.theme-toggle-wrap { display: flex; align-items: center; gap: 6px; color: var(--ink-faint); font-size: 15px; }
.theme-toggle { position: relative; width: 38px; height: 22px; background: var(--bd); border-radius: 11px; cursor: pointer; transition: background .2s; flex-shrink: 0; }
[data-theme="blueprint"] .theme-toggle { background: var(--accent); }
.toggle-knob { position: absolute; top: 4px; left: 4px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: transform .2s; pointer-events: none; }
[data-theme="blueprint"] .toggle-knob { transform: translateX(16px); }

/* Text size lives in Settings ▸ Appearance (it left the chrome — a set-once
   preference didn't earn a permanent pill beside the dark-mode switch). */
.set-scale { display: flex; flex-direction: column; gap: 8px; }
.set-scale-opt { display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  border: 1.5px solid var(--bd); border-radius: 8px; padding: 10px 12px; background: var(--bg); }
.set-scale-opt:hover { border-color: var(--ink-faint); }
.set-scale-opt.on { border-color: var(--accent); background: var(--accent-bg); }
.set-scale-opt input { margin-top: 2px; flex: 0 0 auto; accent-color: var(--accent); }
.set-scale-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-scale-txt b { font-size: 13px; font-weight: 600; color: var(--ink); }
.set-scale-txt span { font-size: 11.5px; color: var(--ink-faint); }

/* Date-of-birth typed group (MM / DD / YYYY) — replaces the mobile date picker.
   .dob-group .dob-in beats the full-width .field input rule on specificity. */
.dob-group { display:flex; align-items:center; gap:8px; }
.dob-group .dob-in { width:auto; text-align:center; font-variant-numeric:tabular-nums; letter-spacing:.04em; }
.dob-group .dob-m, .dob-group .dob-d { width:56px; }
.dob-group .dob-y { width:82px; }
.dob-sep { color:var(--ink-faint); font-weight:700; user-select:none; }

/* ── Landing ─────────────────────────────────────────────── */
#landing { min-height: 100vh; display: flex; flex-direction: column; }
.land-nav { display: flex; align-items: center; justify-content: space-between; padding: 15px 40px; background: var(--bg2); border-bottom: 1px solid var(--bd); }
.land-logo { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.land-logo span { color: var(--accent); }
.land-nav-r { display: flex; align-items: center; gap: 12px; }
.land-hero { text-align: center; padding: 70px 40px 64px; max-width: 680px; margin: 0 auto; }
.land-eyebrow { display: inline-block; font-size: 11px; letter-spacing: .13em; text-transform: uppercase; font-weight: 600; color: var(--accent); margin-bottom: 22px; }
.land-h1 { font-size: 42px; font-weight: 700; line-height: 1.13; letter-spacing: -.025em; margin-bottom: 18px; }
.land-h1 span { color: var(--accent); }
.land-sub { font-size: 15px; color: var(--ink-soft); line-height: 1.72; max-width: 480px; margin: 0 auto 32px; }
.land-ctas { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; }
.land-note { font-size: 11px; color: var(--ink-faint); }
.land-feats-bg { background: var(--bg2); border-top: 1px solid var(--bd); border-bottom: 1px solid var(--bd); }
.land-feats { display: grid; grid-template-columns: repeat(3,1fr); gap: 40px; padding: 52px 40px; max-width: 860px; margin: 0 auto; }
.land-feat { text-align: center; }
.land-feat i { font-size: 24px; color: var(--accent); display: block; margin-bottom: 14px; }
.land-feat h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.land-feat p { font-size: 12px; color: var(--ink-soft); line-height: 1.65; }
.land-footer { padding: 20px 40px; font-size: 11px; color: var(--ink-faint); display: flex; gap: 16px; justify-content: center; align-items: center; border-top: 1px solid var(--bd); background: var(--bg2); margin-top: auto; }
.land-footer a { color: var(--ink-soft); }
.land-footer a:hover { color: var(--ink); }

/* ── Auth modal ──────────────────────────────────────────── */
/* ── Z-INDEX SCALE (single source of truth) ─────────────────────────────
   Keep every overlay on this ladder so nothing hides behind a full-screen
   surface (that was the toast bug AND the plan-pin issue/constraint bug):
     page content / sticky chrome ....... 1–199
     in-page dropdowns / popovers ....... 800–1299
     full-screen surfaces (plans viewer,
       ⌘K palette, file/photo lightbox) . 4000–4199
     MODALS (must sit above the above,
       because a modal can be opened from
       inside a full-screen surface) ..... 5000  (module .co-modal)
                                           5100  (drawers)
                                           5200  (shared .modal-overlay / confirms)
     toasts (always on top) ............. 9000
   A modal is the most-focused thing on screen, so modals intentionally
   outrank the 4000 surfaces. Do not add new overlays outside this ladder. */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 5200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.hidden { display: none; }
.auth-card { background: var(--white); border-radius: 12px; width: 100%; max-width: 460px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; max-height: calc(100vh - 40px); overflow: hidden; }
.auth-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.auth-logo { font-size: 15px; font-weight: 700; }
.auth-logo span { color: var(--accent); }
.auth-close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink-faint); font-size: 18px; }
.auth-close:hover { background: var(--bg2); color: var(--ink); }
.auth-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 20px; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-error { background: #FEF2F2; border: 1px solid #FCA5A5; color: #7F1D1D; border-radius: 6px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; display: none; }
.auth-error.visible { display: block; }
.auth-footer { padding: 16px 24px 20px; border-top: 1px solid var(--bd); display: flex; flex-direction: column; gap: 10px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--ink-soft); }
.auth-switch a { color: var(--accent); font-weight: 600; cursor: pointer; }
.auth-divider { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink-faint); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--bd); }

/* ── Legal gate ──────────────────────────────────────────── */
#legal-gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.gate-card { background: var(--white); border: 1px solid var(--bd); border-radius: 12px; padding: 40px; max-width: 580px; width: 100%; }
.gate-logo { font-size: 16px; font-weight: 700; margin-bottom: 24px; display: block; }
.gate-logo span { color: var(--accent); }
.gate-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.gate-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 20px; }
.gate-content { max-height: 300px; overflow-y: auto; border: 1px solid var(--bd); border-radius: 6px; padding: 16px; font-size: 13px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 24px; background: var(--bg2); }
.gate-form { margin-bottom: 10px; }
.gate-btn { width: 100%; padding: 12px; font-size: 14px; }
.gate-form-decline { text-align: center; }
.gate-decline-btn { font-size: 12px; color: var(--ink-faint); cursor: pointer; text-decoration: underline; }

/* ── Toasts ──────────────────────────────────────────────── */
#pt-toasts { position: fixed; bottom: 24px; right: 24px; z-index: 9000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.pt-toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 8px; min-width: 280px; max-width: 380px; font-size: 13px; font-weight: 500; pointer-events: all; background: var(--ink); color: var(--white); box-shadow: var(--shadow-md); transform: translateY(8px); opacity: 0; transition: transform .25s, opacity .25s; }
.pt-toast.show { transform: translateY(0); opacity: 1; }
.pt-toast.success { background: #166534; }
.pt-toast.error { background: #991B1B; }
.pt-toast.warning { background: #92400E; }
.pt-toast i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── Notification panel ──────────────────────────────────── */
#notif-panel { position: fixed; top: var(--hdr-h); right: 0; bottom: 0; width: 360px; max-width: 100vw; background: var(--white); border-left: 1px solid var(--bd); z-index: 500; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s; }
#notif-panel.open { transform: translateX(0); }
.notif-panel-hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--bd); background: var(--bg2); }
.notif-panel-title { font-size: 14px; font-weight: 600; }
.notif-panel-actions { display: flex; align-items: center; gap: 8px; }
.notif-mark-all { font-size: 11px; color: var(--accent); cursor: pointer; font-weight: 600; }
.notif-mark-all:hover { text-decoration: underline; }
.notif-close-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink-faint); font-size: 18px; }
.notif-close-btn:hover { background: var(--bg); color: var(--ink); }
.notif-list { flex: 1; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--bd); cursor: pointer; transition: background .1s; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--accent-bg); }
.notif-severity { width: 3px; border-radius: 2px; flex-shrink: 0; align-self: stretch; }
.sev-info { background: var(--bd); }
.sev-yellow { background: #F59E0B; }
.sev-orange { background: #F97316; }
.sev-red { background: #EF4444; }
.sev-black { background: #111111; }
.notif-content { flex: 1; min-width: 0; }
.notif-title, .notif-msg { overflow-wrap: anywhere; }
.notif-go { align-self: center; color: var(--ink-faint); font-size: 16px; flex-shrink: 0; opacity: 0; transition: opacity .1s, transform .1s; }
.notif-item.has-link:hover .notif-go { opacity: 1; transform: translateX(2px); }
.notif-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-msg { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.notif-time { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.notif-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; color: var(--ink-faint); text-align: center; }
.notif-empty i { font-size: 32px; margin-bottom: 12px; }
.notif-empty p { font-size: 13px; }

/* ── App shell ───────────────────────────────────────────── */
/* height: 100dvh follows the tablet/mobile browser's *visible* viewport (toolbars in/out),
   so nested scroll regions like the curve-editor sidebar aren't pushed off-screen. 100vh fallback. */
#pt-app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
#pt-header { height: var(--hdr-h); flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 20px 0 12px; background: var(--nav-bg); border-bottom: 1px solid var(--bd); z-index: 100; }
.pt-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pt-header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pt-logo { display: flex; align-items: center; }
.logo-pt, .logo-vmb { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.logo-pt span, .logo-vmb span { color: var(--accent); }
.hdr-org-name { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--bd); border-radius: 4px; padding: 3px 8px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; cursor: pointer; transition: color .12s, border-color .12s, background .12s; }
.hdr-org-name:hover { color: var(--ink); border-color: var(--accent); background: var(--bg2); }
.hdr-org-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* VMB chrome: the company nameplate is a label, not a link (see header.php —
   #/enterprise is not a VMB route). Inherits the nameplate's geometry
   unchanged and only drops the affordances that imply it is clickable. */
.hdr-org-name-static { cursor: default; }
.hdr-org-name-static:hover { color: var(--ink-soft); border-color: var(--bd); background: var(--bg); }

/* Chrome project/context switcher — carries "what project am I in" for every
   module and doubles as a project switcher, so pages don't repeat the name. */
.hdr-context { position: relative; display: flex; min-width: 0; }
.hdr-ctx-btn { display: flex; align-items: center; gap: 6px; max-width: 260px; height: 34px; padding: 0 8px; border: 1px solid var(--bd); border-radius: 7px; background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; min-width: 0; }
.hdr-ctx-btn:hover { background: var(--bg2); border-color: var(--ink-faint); }
.hdr-ctx-btn > i.ti-point-filled { font-size: 13px; flex: 0 0 auto; }
.hdr-ctx-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hdr-ctx-chev { font-size: 14px; color: var(--ink-faint); flex: 0 0 auto; }
.hdr-ctx-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; max-width: 320px; background: var(--bg); border: 1px solid var(--bd); border-radius: 10px; box-shadow: var(--shadow-md); padding: 5px; z-index: 200; max-height: 72vh; overflow-y: auto; }
.hctx-sec { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); padding: 6px 9px 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hctx-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 9px; border-radius: 7px; background: none; border: none; color: var(--ink); font-size: 13px; cursor: pointer; text-align: left; }
.hctx-item:hover { background: var(--bg2); }
.hctx-item.on { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.hctx-item.on > i { color: var(--accent); }
.hctx-item > i { font-size: 16px; color: var(--ink-soft); flex: 0 0 auto; }
.hctx-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hctx-div { height: 1px; background: var(--bd); margin: 5px 4px; }
.hctx-cur { display: flex; align-items: center; gap: 8px; padding: 8px 9px 6px; }
.hctx-cur > i { font-size: 14px; flex: 0 0 auto; }
.hctx-cur-txt { min-width: 0; }
.hctx-cur-name { font-size: 13.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hctx-cur-sub { font-size: 11px; color: var(--ink-soft); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.hctx-cur-sub > i { font-size: 12px; }
.hctx-empty { font-size: 12px; color: var(--ink-faint); padding: 6px 9px; }
@media (max-width:1024px) { .hdr-ctx-btn { max-width: 170px; } }
.hdr-icon-btn { background: transparent; color: var(--ink-soft); width: 34px; height: 34px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; border: 0; }
.hdr-icon-btn:hover { background: var(--bg2); color: var(--ink); }
.hdr-back.is-off { opacity: .32; cursor: default; pointer-events: none; }
.save-status { font-size: 11px; color: var(--ink-faint); min-width: 60px; text-align: right; }
/* ── Header global-search trigger ────────────────────────────── */
.hdr-search-btn { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 8px 0 10px; border: 1px solid var(--bd); border-radius: 7px; background: var(--bg); color: var(--ink-faint); font-size: 12.5px; cursor: pointer; min-width: 200px; }
.hdr-search-btn:hover { background: var(--bg2); color: var(--ink-soft); border-color: var(--ink-faint); }
.hdr-search-btn > i { font-size: 16px; }
.hdr-search-label { flex: 1; text-align: left; }
.hdr-search-kbd { display: flex; gap: 2px; }
.hdr-search-kbd kbd { font: inherit; font-size: 10px; line-height: 1; padding: 3px 4px; border: 1px solid var(--bd); border-bottom-width: 2px; border-radius: 4px; background: var(--bg2); color: var(--ink-faint); }
@media (max-width: 760px) {
  .hdr-search-btn { min-width: 0; padding: 0; width: 34px; justify-content: center; }
  .hdr-search-label, .hdr-search-kbd { display: none; }
}
/* ── Command palette overlay ─────────────────────────────────── */
.cmdk-overlay { position: fixed; inset: 0; z-index: 4000; background: rgba(17,17,17,.32); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.cmdk-overlay[hidden] { display: none; }
.cmdk-panel { width: 100%; max-width: 600px; background: var(--white); border: 1px solid var(--bd); border-radius: 12px; box-shadow: var(--shadow-lg, 0 24px 60px rgba(0,0,0,.28)); overflow: hidden; display: flex; flex-direction: column; max-height: 68vh; }
.cmdk-input-row { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--bd); flex-shrink: 0; }
.cmdk-input-row > i { font-size: 19px; color: var(--ink-faint); }
.cmdk-input { flex: 1; border: none; background: none; outline: none; font-family: inherit; font-size: 15.5px; color: var(--ink); }
.cmdk-input::placeholder { color: var(--ink-faint); }
.cmdk-esc { font-size: 10.5px; color: var(--ink-faint); border: 1px solid var(--bd); border-radius: 4px; padding: 2px 6px; text-transform: uppercase; letter-spacing: .04em; }
.cmdk-results { overflow-y: auto; padding: 6px; flex: 1; }
.cmdk-group-label { display: flex; align-items: center; gap: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); font-weight: 700; padding: 10px 9px 4px; }
.cmdk-group-label i { font-size: 12px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: none; background: none; border-radius: 8px; cursor: pointer; text-align: left; color: var(--ink-soft); }
.cmdk-item.sel { background: var(--accent-bg, var(--bg2)); color: var(--ink); }
.cmdk-ico { font-size: 17px; width: 20px; text-align: center; color: var(--ink-faint); flex-shrink: 0; }
.cmdk-item.sel .cmdk-ico { color: var(--accent); }
.cmdk-dot { width: 9px; height: 9px; border-radius: 50%; margin: 0 5px 0 6px; flex-shrink: 0; }
.cmdk-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cmdk-title { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-title mark { background: var(--accent-bg, #fde68a); color: inherit; padding: 0 1px; border-radius: 3px; }
.cmdk-sub { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-enter { font-size: 15px; color: var(--accent); opacity: 0; flex-shrink: 0; }
.cmdk-item.sel .cmdk-enter { opacity: .8; }
.cmdk-empty { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 34px 16px; color: var(--ink-faint); font-size: 13px; }
.cmdk-empty .ti-loader { animation: spin 1s linear infinite; }
.cmdk-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--bd); font-size: 11px; color: var(--ink-faint); flex-shrink: 0; }
.cmdk-foot kbd { font: inherit; font-size: 10px; padding: 1px 4px; border: 1px solid var(--bd); border-radius: 3px; background: var(--bg2); margin-right: 2px; }
.notif-btn { position: relative; }
.notif-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; background: #c8553d; color: #fff; border-radius: 8px; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 3px; pointer-events: none; }
.user-menu-wrap { position: relative; }
.user-avatar-btn { display: flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--bd); border-radius: 6px; padding: 4px 10px 4px 4px; color: var(--ink); }
.user-avatar-btn:hover { background: var(--bg2); }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--white); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-name-label { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; }
.user-menu { position: absolute; top: calc(100% + 6px); right: 0; background: var(--white); border: 1px solid var(--bd); border-radius: 8px; min-width: 200px; z-index: 200; overflow: hidden; box-shadow: var(--shadow); }
.user-menu[hidden] { display: none; }
.user-menu-header { padding: 12px 14px; background: var(--bg2); }
.um-name { display: block; font-size: 13px; font-weight: 600; }
.um-role { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.um-org { display: block; font-size: 11px; color: var(--ink-faint); }
.user-menu-divider { height: 1px; background: var(--bd); }
.um-item { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 13px; color: var(--ink); background: transparent; width: 100%; text-align: left; cursor: pointer; }
.um-item:hover { background: var(--bg2); }
.um-item i { font-size: 15px; color: var(--ink-soft); }
.um-logout { color: #c8553d; }
.um-logout i { color: #c8553d; }
#pt-body { flex: 1; display: flex; overflow: hidden; }
#pt-sidebar { width: var(--nav-w); flex-shrink: 0; background: var(--nav-bg); border-right: 1px solid var(--bd); display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; transition: width .2s; }
#pt-sidebar.collapsed { width: 52px; }
#pt-sidebar.collapsed .nav-section-label, #pt-sidebar.collapsed .nav-badge-soon { display: none; }
#pt-main { flex: 1; overflow-y: auto; padding: 28px; background: var(--bg); }

/* ── Navigation ──────────────────────────────────────────── */
.nav-section-label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); font-weight: 600; padding: 14px 14px 4px; pointer-events: none; }
.nav-list { flex: 1; padding: 6px 8px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-radius: 6px; font-size: 13px; color: var(--ink-soft); font-weight: 500; white-space: nowrap; overflow: hidden; transition: background .1s, color .1s; cursor: pointer; }
.nav-item:hover { background: var(--bg2); color: var(--ink); }
.nav-item i { font-size: 17px; flex-shrink: 0; }
.nav-msg-badge { margin-left: auto; flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.nav-active { background: var(--bg2) !important; color: var(--ink) !important; font-weight: 600; }
.nav-active i { color: var(--accent); }
.nav-soon { opacity: .45; pointer-events: none; }
.nav-badge-soon { margin-left: auto; font-size: 9px; padding: 1px 5px; border-radius: 3px; background: var(--bd); color: var(--ink-faint); font-weight: 600; flex-shrink: 0; }
.nav-footer { padding: 8px; border-top: 1px solid var(--bd); margin-top: auto; }
.nav-suite-link { color: var(--accent) !important; }

/* ── Context-aware sidebar: scope switcher + project picker ── */
.nav-scope { position: relative; padding: 8px; border-bottom: 1px solid var(--bd); flex-shrink: 0; }
.nav-scope-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border-radius: 8px; background: var(--bg2); cursor: pointer; text-align: left; border: none; }
.nav-scope-btn:hover { background: var(--bd); }
.nav-scope-ico { width: 30px; height: 30px; border-radius: 7px; background: var(--bg); border: 1px solid var(--bd); display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--ink-soft); flex-shrink: 0; }
.nav-scope-ico.proj { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.nav-scope-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.nav-scope-name { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-scope-sub { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-scope-caret { font-size: 16px; color: var(--ink-faint); flex-shrink: 0; }
.nav-scope-menu { position: absolute; top: calc(100% - 3px); left: 8px; right: 8px; background: var(--white); border: 1px solid var(--bd); border-radius: 9px; box-shadow: var(--shadow-md); z-index: 200; padding: 5px; max-height: 64vh; overflow-y: auto; }
.nav-scope-menu[hidden] { display: none; }
.nav-pick-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; border-radius: 6px; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; text-align: left; background: none; border: none; }
.nav-pick-item:hover { background: var(--bg2); color: var(--ink); }
.nav-pick-item.on { background: var(--bg2); color: var(--ink); font-weight: 600; }
.nav-pick-item i { font-size: 15px; flex-shrink: 0; }
.nav-pick-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-pick-home { color: var(--ink); font-weight: 600; }
.nav-pick-sep { font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); font-weight: 700; padding: 9px 9px 4px; }
.nav-pick-empty { font-size: 12px; color: var(--ink-faint); padding: 10px 9px; }
/* ── Portfolio branch scope control ─────────────────────────── */
.nav-bscope { display: flex; align-items: center; gap: 7px; padding: 7px 10px; margin: 0 8px; border-bottom: 1px solid var(--bd); flex-shrink: 0; }
.nav-bscope > i { font-size: 15px; color: var(--ink-faint); flex-shrink: 0; }
.nav-bscope-sel { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--ink-soft); background: none; border: none; cursor: pointer; padding: 2px 2px; border-radius: 5px; font-family: inherit; }
.nav-bscope-sel:hover { color: var(--ink); }
.nav-bscope-sel:focus { outline: none; color: var(--ink); }
.nav-bscope.locked { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.nav-bscope.locked span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-groups { flex: 1; padding: 6px 8px; }
#pt-sidebar .pd-rail-group { margin-bottom: 1px; }
/* collapsed (icon-only) rail hides text, keeps group icons tappable */
#pt-sidebar.collapsed .nav-scope-txt, #pt-sidebar.collapsed .nav-scope-caret,
#pt-sidebar.collapsed .pd-rg-label, #pt-sidebar.collapsed .pd-rg-count,
#pt-sidebar.collapsed .pd-rg-chev, #pt-sidebar.collapsed .pd-rail-items,
#pt-sidebar.collapsed .nav-footer span, #pt-sidebar.collapsed .nav-bscope { display: none; }
/* Collapsed rail: allow hover flyouts to escape the 52px column, and
   center the icon-only controls. */
#pt-sidebar.collapsed { overflow: visible; }
#pt-sidebar.collapsed .pd-rail-ghead,
#pt-sidebar.collapsed .nav-footer .nav-item { justify-content: center; }
#pt-sidebar.collapsed .pd-rail-group { position: relative; }
.pd-rail-flyhead { display: none; }
/* Hover a collapsed group → pop its items as a side flyout. */
#pt-sidebar.collapsed .pd-rail-group:hover > .pd-rail-items {
  display: block; position: absolute; left: 100%; top: -2px; min-width: 190px;
  background: var(--white); border: 1px solid var(--bd); border-radius: 9px;
  box-shadow: var(--shadow-md); padding: 5px; z-index: 300;
}
#pt-sidebar.collapsed .pd-rail-group:hover > .pd-rail-items .pd-rail-flyhead {
  display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); font-weight: 700; padding: 4px 8px 6px;
}
/* Collapsed: the project switcher menu flies out to the side too. */
#pt-sidebar.collapsed .nav-scope-menu:not([hidden]) {
  left: calc(100% + 4px); right: auto; width: 248px; top: 6px;
}

/* ── Health badges ───────────────────────────────────────── */
.health-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
.health-green  { background: #DCFCE7; color: #166534; }
.health-yellow { background: #FEF9C3; color: #854D0E; }
.health-orange { background: #FFEDD5; color: #9A3412; }
.health-red    { background: #FEE2E2; color: #991B1B; }
.health-black  { background: var(--bg2); color: var(--ink); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; }
.delta-up { color: #16A34A; }
.delta-down { color: #DC2626; }
.delta-flat { color: var(--ink-faint); }

/* ── Status pills ────────────────────────────────────────── */
.status-pill { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px; }
.status-active   { background: #DCFCE7; color: #166534; }
.status-planning { background: #EEF2FF; color: var(--accent); }
.status-pursuit  { background: #EDE9FE; color: #5B21B6; }
.status-on_hold  { background: #FEF9C3; color: #854D0E; }
.status-closed   { background: var(--bg2); color: var(--ink-soft); }
.status-archived { background: var(--bg2); color: #AAAAAA; }

/* ── Dashboard ───────────────────────────────────────────── */
.dash-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-search { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1.5px solid var(--bd); border-radius: 6px; padding: 0 12px; flex: 1; min-width: 200px; max-width: 340px; }
.dash-search i { color: var(--ink-faint); font-size: 15px; flex-shrink: 0; }
.dash-search input { border: none; background: transparent; font-size: 13px; color: var(--ink); padding: 8px 0; width: 100%; outline: none; }
.dash-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn { padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; border: 1.5px solid var(--bd); color: var(--ink-soft); background: var(--white); cursor: pointer; transition: all .15s; }
.filter-btn:hover { border-color: var(--ink-soft); color: var(--ink); }
.filter-btn.active { background: var(--ink); color: var(--white); border-color: var(--ink); }
.dash-sort { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--ink-soft); }
.dash-sort select { border: 1.5px solid var(--bd); border-radius: 6px; padding: 6px 10px; font-size: 12px; background: var(--white); color: var(--ink); cursor: pointer; }
.dash-section { margin-bottom: 28px; }
.dash-section-hdr { display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin-bottom: 12px; }
.dash-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.dash-count { font-size: 11px; font-weight: 700; color: var(--ink-soft); background: var(--bg2); border: 1px solid var(--bd); border-radius: 999px; padding: 1px 8px; min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap-min); }

/* ── All Projects page (#/projects) ── */
.ap-body { display: grid; grid-template-columns: 1fr 240px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .ap-body { grid-template-columns: 1fr; } .ap-side { order: -1; } }
.ap-main { min-width: 0; }
.ap-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ap-toolbar .dash-search { flex: 1; min-width: 180px; }
.ap-sort { font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--bd, #e5e7eb); border-radius: 8px; background: var(--white, #fff); color: var(--ink, #111); }
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.ap-chip { font: inherit; font-size: 12px; font-weight: 600; padding: 5px 11px; border: 1px solid var(--bd, #e5e7eb); border-radius: 999px; background: var(--white, #fff); color: var(--ink-soft, #667); cursor: pointer; }
.ap-chip b { color: var(--ink, #111); }
.ap-chip.on { background: var(--accent, #4F46E5); border-color: var(--accent, #4F46E5); color: #fff; }
.ap-chip.on b { color: #fff; }
.ap-recents { margin-bottom: 18px; }
.ap-recents-h, .ap-grid-h, .ap-summary-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft, #667); margin-bottom: 8px; }
.ap-grid-h { display: flex; align-items: center; gap: 8px; }
.ap-count { font-size: 11px; font-weight: 700; color: var(--ink-soft, #667); background: var(--bg2, #f0f2f7); border-radius: 999px; padding: 1px 8px; }
.ap-recents-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.ap-recent { flex: 0 0 auto; min-width: 150px; text-align: left; background: var(--white, #fff); border: 1px solid var(--bd, #e5e7eb); border-radius: 10px; padding: 9px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.ap-recent:hover { border-color: var(--accent, #4F46E5); }
.ap-recent-nm { font-size: 13px; font-weight: 600; color: var(--ink, #111); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.ap-recent-meta { font-size: 11px; color: var(--ink-soft, #667); display: flex; align-items: center; gap: 5px; }
.ap-side { position: sticky; top: 12px; }
.ap-summary { background: var(--white, #fff); border: 1px solid var(--bd, #e5e7eb); border-radius: 12px; padding: 14px; }
.ap-stat { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; }
.ap-stat-n { font-size: 22px; font-weight: 700; color: var(--ink, #111); font-variant-numeric: tabular-nums; }
.ap-stat-l { font-size: 12px; color: var(--ink-soft, #667); }
.ap-side-row { width: 100%; display: flex; align-items: center; justify-content: space-between; font: inherit; font-size: 12.5px; color: var(--ink, #111); background: none; border: 0; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.ap-side-row:hover { background: var(--bg2, #f0f2f7); }
.ap-side-row.on { background: var(--accent, #4F46E5); color: #fff; }
.ap-side-row b { font-variant-numeric: tabular-nums; }
.ap-loading { padding: 40px; text-align: center; color: var(--ink-soft, #667); font-size: 13px; }
.project-card { background: var(--white); border: 1.5px solid var(--bd); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.project-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pc-name { font-size: 14px; font-weight: 600; line-height: 1.35; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pc-number { font-size: 11.5px; font-weight: 600; color: var(--ink-faint); margin-top: 2px; font-variant-numeric: tabular-nums; }
.pc-fav { font-size: 16px; color: var(--bd); flex-shrink: 0; padding: 0; line-height: 1; }
.pc-fav.active { color: #F59E0B; }
.pc-fav:hover { color: #F59E0B; }
.pc-health-row { display: flex; align-items: center; gap: 8px; }
/* Workspace cards: subtly set apart from real projects (dashed edge + private chip) */
.workspace-card { border-style: dashed; background: color-mix(in srgb, var(--accent) 3%, var(--white)); }
.ws-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 4px; padding: 2px 7px; letter-spacing: .02em; }
.pc-bar-bg { height: 3px; background: var(--bd); border-radius: 2px; overflow: hidden; }
.pc-bar-fill { height: 3px; background: var(--accent); border-radius: 2px; transition: width .3s; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pc-meta { font-size: 11px; color: var(--ink-faint); }
.recents-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.recent-card { background: var(--white); border: 1.5px solid var(--bd); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; flex-shrink: 0; width: 200px; transition: border-color .15s; }
.recent-card:hover { border-color: var(--accent); }
.rc-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 6px; }
.rc-meta { font-size: 11px; color: var(--ink-faint); }

/* ── Project detail ──────────────────────────────────────── */
.pd-back { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-faint); margin-bottom: 6px; cursor: pointer; background: none; border: none; }
.pd-back:hover { color: var(--accent); }
.pd-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pd-title-block { flex: 1; min-width: 0; }
.pd-name { font-size: 22px; font-weight: 700; line-height: 1.2; margin-bottom: 4px; }
.pd-number { font-size: 13px; font-weight: 600; color: var(--ink-faint); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.pd-meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pd-health-panel { display: flex; align-items: center; gap: 20px; background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; flex-wrap: wrap; }
.pd-health-score { text-align: center; flex-shrink: 0; min-width: 60px; }
.pd-health-number { font-size: 32px; font-weight: 700; line-height: 1; }
.pd-health-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin-top: 2px; }
.pd-health-dims { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; flex: 1; }
.pd-dim { text-align: center; }
.pd-dim-score { font-size: 17px; font-weight: 700; }
.pd-dim-label { font-size: 10px; color: var(--ink-faint); margin-top: 2px; }
.pd-dim-weight { font-size: 9px; color: var(--ink-faint); }
.project-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--bd); margin-bottom: 20px; overflow-x: auto; }
.tab-btn { padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--ink-soft); border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none; transition: color .15s, border-color .15s; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
#tab-content { min-height: 200px; }

/* ── Project workspace: condensed health strip + grouped rail ─ */
.pd-health-strip { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--radius); padding: 8px 16px; margin-bottom: 16px; }
.pd-hs-main { display: flex; align-items: center; gap: 9px; }
.pd-hs-score { font-size: 22px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pd-hs-color { font-size: 12px; color: var(--ink-soft); }
.pd-hs-dims { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.pd-hs-dim { font-size: 11px; color: var(--ink-faint); display: flex; align-items: baseline; gap: 5px; }
.pd-hs-dim b { font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.pd-workspace { display: grid; grid-template-columns: 212px 1fr; gap: 24px; align-items: start; }
.pd-rail { display: flex; flex-direction: column; gap: 1px; position: sticky; top: 12px; }
.pd-rail-group { display: flex; flex-direction: column; }
.pd-rail-ghead { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; background: none; border: none; }
.pd-rail-ghead:hover { background: var(--bg2); }
.pd-rail-ghead > i:first-child { font-size: 16px; color: var(--ink-soft); flex-shrink: 0; }
.pd-rg-label { flex: 1; }
.pd-rg-count { font-size: 10px; font-weight: 600; color: var(--ink-faint); background: var(--bg2); border-radius: 10px; padding: 1px 7px; }
.pd-rail-ghead:hover .pd-rg-count { background: var(--bd); }
.pd-rg-chev { font-size: 14px; color: var(--ink-faint); transition: transform .18s; }
.pd-rail-group.open .pd-rg-chev { transform: rotate(90deg); }
.pd-rail-items { display: none; flex-direction: column; gap: 1px; padding: 1px 0 6px 4px; }
.pd-rail-group.open .pd-rail-items { display: flex; }
.pd-rail-item { display: block; width: 100%; text-align: left; font-size: 12.5px; color: var(--ink-soft); padding: 7px 10px 7px 28px; border-radius: 6px; position: relative; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: none; border: none; }
.pd-rail-item::before { content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--bd); }
.pd-rail-item:hover { background: var(--bg2); color: var(--ink); }
.pd-rail-item.on { background: var(--bg2); color: var(--ink); font-weight: 600; }
.pd-rail-item.on::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

@media (max-width: 860px) {
  .pd-workspace { grid-template-columns: 1fr; gap: 12px; }
  .pd-rail { position: static; border-bottom: 1px solid var(--bd); padding-bottom: 8px; }
}
.curve-list { display: flex; flex-direction: column; gap: 10px; }
.curve-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--white); border: 1px solid var(--bd); border-radius: 6px; cursor: pointer; transition: border-color .15s; }
.curve-row:hover { border-color: var(--accent); }
.curve-row-name { font-size: 14px; font-weight: 600; flex: 1; }
.curve-row-meta { font-size: 12px; color: var(--ink-soft); }
.curve-baseline-badge { font-size: 10px; background: var(--accent-bg); color: var(--accent); padding: 2px 6px; border-radius: 3px; font-weight: 600; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 600; padding: 6px 12px; text-align: left; border-bottom: 1px solid var(--bd); }
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--bg2); }
.data-table tr:hover td { background: var(--bg2); }
.progress-mini-wrap { display: flex; align-items: center; gap: 8px; }
.progress-mini { width: 80px; height: 4px; background: var(--bd); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.progress-mini-fill { height: 4px; background: var(--accent); border-radius: 2px; }
.team-list { display: flex; flex-direction: column; gap: 8px; }
.team-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--white); border: 1px solid var(--bd); border-radius: 6px; }
.team-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--white); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.team-name { font-size: 13px; font-weight: 600; flex: 1; }
.team-role { font-size: 12px; color: var(--ink-soft); }

/* ── Create project modal ────────────────────────────────── */
.cp-modal { background: var(--white); border-radius: 12px; width: 100%; max-width: 520px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; max-height: calc(100vh - 40px); overflow: hidden; }
.cp-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--bd); }
.cp-title { font-size: 16px; font-weight: 700; }
.cp-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.cp-footer { padding: 14px 24px; border-top: 1px solid var(--bd); display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-shrink: 0; background: var(--white); }
.cp-footer-err { color: #DC2626; font-size: 12px; margin-right: auto; text-align: left; }
/* Even, predictable columns for the task dialog rows — no flex-wrap bunching. */
.op-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* The schedule block is a 2×3 grid, so the six fields must share ONE column
   template — it previously ran 1fr/84px/1fr over 1fr/1fr/84px, which put a
   narrow box above a wide one and made the whole block read ragged. */
.op-grid-sched, .op-grid-load { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
/* Constraints row holds two date pickers + a select — NOT the 84px "Days"
   slot the schedule row uses, which crams a date control. Equal thirds. */
/* The constraint SELECT carries long labels ("Finish no earlier than") while
   its neighbours are date pickers — equal thirds clipped the selected text. */
.op-grid-cons { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 12px; align-items: end; }
@media (max-width: 520px) { .op-grid-sched, .op-grid-load, .op-grid-cons { grid-template-columns: 1fr 1fr; } }

/* ── Health history bars ─────────────────────────────────── */
.health-history-wrap { display: flex; align-items: flex-end; gap: 3px; height: 48px; padding-top: 8px; }
.hh-bar { flex: 1; border-radius: 2px 2px 0 0; min-width: 6px; cursor: pointer; transition: opacity .15s; }
.hh-bar:hover { opacity: .75; }
.hh-date-row { display: flex; justify-content: space-between; font-size: 9px; color: var(--ink-faint); margin-top: 4px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 24px; text-align: center; }
.empty-state i { font-size: 36px; color: var(--bd); margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--ink-soft); max-width: 320px; line-height: 1.6; }
.empty-state .empty-cta { margin-top: 20px; }

/* ── Skeleton ────────────────────────────────────────────── */
@keyframes shimmer { 0%{background-position:-600px 0} 100%{background-position:600px 0} }
.sk-line { height: 14px; border-radius: 6px; margin-bottom: 10px; background: linear-gradient(90deg, var(--bd) 25%, var(--bg2) 50%, var(--bd) 75%); background-size: 1200px 100%; animation: shimmer 1.5s infinite; }
.sk-w80{width:80%} .sk-w60{width:60%} .sk-w40{width:40%}
.sk-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 20px; }
.sk-card { height: 130px; border-radius: 8px; background: linear-gradient(90deg, var(--bd) 25%, var(--bg2) 50%, var(--bd) 75%); background-size: 1200px 100%; animation: shimmer 1.5s infinite; }

/* ── Page header + card ──────────────────────────────────── */
.page-hdr { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 700; }
.page-sub { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.pt-card { background: var(--white); border: 1px solid var(--bd); border-radius: var(--radius); padding: 18px 20px; }

/* ── Impersonation banner ────────────────────────────────── */
#impersonationBanner { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; background: #c8553d; color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 7px 14px; }
#impersonationBanner a { color: #fff; text-decoration: underline; margin-left: 10px; }
body:has(#impersonationBanner) #pt-app { padding-top: 32px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width:1024px) { :root{--nav-w:200px} #pt-main{padding:16px} .hdr-org-name{max-width:132px} .pd-health-dims{grid-template-columns:repeat(2,1fr)} .sk-cards{grid-template-columns:1fr 1fr} .land-feats{grid-template-columns:1fr 1fr;gap:24px;padding:36px 24px} }
/* The nameplate is the ONLY entry to the Enterprise dashboard, so keep it
   reachable on iPad/phones — shrink it (and drop the logo wordmark on the
   tightest screens) rather than hiding it. */
/* The Messages icon is a primary entry and stays on every width, so the
   header gives up the user's NAME instead — the avatar keeps the menu
   reachable, and dropping ~70px of text buys back more than the icon costs.
   Shrink-or-drop-text, never drop-the-control. */
@media (max-width:600px) { .hdr-org-name{max-width:108px} .logo-pt span, .logo-vmb span{display:none} .user-name-label{display:none} }
@media (max-width:400px) { .hdr-org-name{max-width:84px} }
/* Tablet portrait (≤900px, e.g. 11" iPad at 820px): the sidebar becomes an
   off-canvas slide-over drawer so content gets the FULL width instead of being
   squeezed to ~590px. Scrim + drawer sit above in-page popovers (≤1299) and
   below modals (5000) — see the z-index ladder above. JS (#sidebar-toggle)
   toggles .mobile-open; the router closes it on navigation. */
#pt-nav-scrim { display:none; }
@media (max-width:900px) {
  #pt-sidebar { position:fixed; top:var(--hdr-h); left:0; bottom:0; width:min(288px,84vw); z-index:1450;
    transform:translateX(-100%); transition:transform .22s ease; box-shadow:3px 0 24px rgba(0,0,0,.20); overflow-y:auto; }
  #pt-sidebar.collapsed { width:min(288px,84vw); }   /* ignore desktop icon-collapse while in drawer mode */
  #pt-sidebar.mobile-open { transform:translateX(0); }
  #pt-nav-scrim { display:block; position:fixed; inset:var(--hdr-h) 0 0 0; background:rgba(2,6,23,.42);
    z-index:1440; opacity:0; visibility:hidden; transition:opacity .2s; }
  #pt-nav-scrim.on { opacity:1; visibility:visible; }
}
@media (max-width:768px) { .land-feats{grid-template-columns:1fr} .land-h1{font-size:30px} .land-nav{padding:12px 20px} .field-row{grid-template-columns:1fr} .project-grid{grid-template-columns:1fr} .pd-health-dims{grid-template-columns:repeat(2,1fr)} }

/* ── Utility ─────────────────────────────────────────────── */
.hidden{display:none!important} .muted{color:var(--ink-soft)} .faint{color:var(--ink-faint)} .accent{color:var(--accent)} .text-sm{font-size:12px} .text-xs{font-size:11px} .fw-600{font-weight:600} .mt-8{margin-top:8px} .mt-16{margin-top:16px} .mt-24{margin-top:24px} .mb-8{margin-bottom:8px} .mb-16{margin-bottom:16px} .flex{display:flex} .items-center{align-items:center} .gap-8{gap:8px} .gap-12{gap:12px}

@keyframes spin { to { transform: rotate(360deg) } }

/* ── Growth-bars loader ────────────────────────────────────────────
   Every .ti-loader spinner becomes the brand mark, animated: three
   ascending bars that build small→large in sequence, then reset. Pure
   CSS on a childless <i> — the element is the MIDDLE bar, ::before the
   (shortest) left bar, ::after the (tallest) right bar, all on a shared
   baseline with their own staggered grow. NO icon-font dependency (it
   animates even if the Tabler CDN font is blocked, which left the old
   wheel static), themes off --accent, scales with the surrounding
   font-size. One rule restyles every loading spot in the app at once. */
.ti-loader {
  display: inline-block; position: relative; box-sizing: border-box;
  vertical-align: middle;
  width: .24em; height: .77em;                 /* the MIDDLE bar */
  margin: 0 .34em;                             /* room for the side bars */
  background: currentColor; border-radius: .12em;
  color: var(--accent);
  transform-origin: bottom;
  animation: pt-grow 1.35s cubic-bezier(.35,.1,.25,1) infinite !important;
  animation-delay: .13s !important;            /* middle bar fires 2nd */
}
.ti-loader::before,
.ti-loader::after {
  content: ""; position: absolute; bottom: 0; width: .24em;
  background: currentColor; border-radius: .12em;
  transform-origin: bottom;
  animation: pt-grow 1.35s cubic-bezier(.35,.1,.25,1) infinite;
}
.ti-loader::before { right: 100%; margin-right: .10em; height: .46em; animation-delay: 0s; }    /* LEFT — shortest, 1st */
.ti-loader::after  { left: 100%;  margin-left: .10em;  height: 1.10em; animation-delay: .26s; }  /* RIGHT — tallest, 3rd */
@keyframes pt-grow {
  0%   { transform: scaleY(.12); opacity: .45; }
  38%  { transform: scaleY(1);   opacity: 1; }
  72%  { transform: scaleY(1);   opacity: 1; }
  100% { transform: scaleY(.12); opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
  .ti-loader, .ti-loader::before, .ti-loader::after { animation-duration: 2.6s !important; }
}

/* ── My File Space ───────────────────────────────────────────── */
.mfs-wrap { max-width: 1100px; }
.mfs-meter { margin: 4px 0 18px; }
.mfs-meter-bar { height: 10px; background: var(--bg2); border-radius: 6px; overflow: hidden; }
.mfs-meter-fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width .3s; }
.mfs-meter-fill.warn { background: var(--warn, #D97706); }
.mfs-meter-txt { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
/* Upload-progress modal — spinner + per-file % bar so an upload is obviously
   in flight (was a silent await-loop that looked like a blank failure). */
.mfs-uphint { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: var(--ink-soft); background: var(--bg2); border-radius: 8px; padding: 8px 10px; margin: 0 0 12px; }
.mfs-uphint i { color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.mfs-uprows { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; }
.mfs-uprow { display: flex; align-items: center; gap: 10px; }
.mfs-upicon { font-size: 18px; color: var(--ink-faint); flex: 0 0 auto; }
.mfs-uprow.failed .mfs-upicon { color: #DC2626; }
.mfs-upmain { flex: 1; min-width: 0; }
.mfs-upname { font-size: 12.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mfs-upbar { height: 6px; background: var(--bg2); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.mfs-upbar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .2s; }
.mfs-uprow.failed .mfs-upbar-fill { background: #DC2626; }
.mfs-uppct { flex: 0 0 auto; width: 40px; text-align: right; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* The shared file-source dialog (file-source.js) — "from your device" or
   "from this project". Lives here rather than in a module stylesheet because
   every upload surface in the app opens it. */
.fs-modal { max-width: 540px; }
.fs-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.fs-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--bd); border-radius: 8px; background: var(--white); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.fs-tab:hover { background: var(--bg2); }
.fs-tab.on { border-color: var(--accent); color: var(--accent); }
.fs-drop { border: 2px dashed var(--bd); border-radius: 10px; padding: 26px 16px; text-align: center; color: var(--ink-soft); cursor: pointer; transition: border-color .12s, background .12s; }
.fs-drop.drag { border-color: var(--accent); background: var(--bg2); }
.fs-drop > i.ti { font-size: 34px; color: var(--ink-faint); }
.fs-drop p { margin: 8px 0 2px; font-size: 14px; }
.fs-browse { background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; font: inherit; }
/* The "or choose from your files" link that sits beside a module's own file
   input. Modules keep their flow and gain the second source. */
.fs-inline { background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.fs-inline:hover { opacity: .8; }
.fs-hint { font-size: 12px; color: var(--ink-faint); }
.fs-search { position: relative; margin-bottom: 8px; }
.fs-search i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-size: 15px; }
.fs-search input { width: 100%; padding-left: 30px; }
.fs-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--bd); border-radius: 8px; }
.fs-row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--bd); font-size: 13px; }
.fs-row:last-child { border-bottom: none; }
.fs-row:hover, .fs-row.on { background: var(--bg2); }
.fs-row i.ti { color: var(--ink-faint); flex: none; }
.fs-row-n { flex: 1; overflow-wrap: anywhere; }
.fs-row-s { color: var(--ink-faint); font-variant-numeric: tabular-nums; flex: none; }
.fs-muted { padding: 16px; text-align: center; color: var(--ink-faint); font-size: 13px; }

/* The shared destination picker (file-dest.js) — one namespace spanning My File
   Space and every project you can file into. */
.fd-modal { max-width: 520px; }
.fd-tree { max-height: 380px; overflow-y: auto; border: 1px solid var(--bd); border-radius: 8px; }
.fd-grp { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); padding: 10px 12px 5px; background: var(--bg2); }
.fd-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; background: none; cursor: pointer; font-size: 13px; color: var(--ink); text-align: left; }
.fd-row:hover:not(:disabled) { background: var(--bg2); }
.fd-row.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; }
.fd-row:disabled { opacity: .4; cursor: not-allowed; }
.fd-row i.ti { color: var(--ink-faint); flex: none; }
.fd-row.on i.ti { color: var(--accent); }
.fd-note { font-size: 12px; color: var(--ink-faint); margin: 10px 0 0; }
.fd-muted { padding: 16px; text-align: center; color: var(--ink-faint); font-size: 13px; }

/* PDF letterhead settings (renderPdfBranding). */
.pb-prev { border: 1px solid var(--bd); border-radius: 8px; background: var(--bg2); padding: 8px; text-align: center; margin-bottom: 8px; }
.pb-prev img { max-width: 100%; max-height: 90px; }
.pb-none { border: 1px dashed var(--bd); border-radius: 8px; padding: 14px; text-align: center; color: var(--ink-faint); font-size: 12px; margin-bottom: 8px; }
.pb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-align { display: inline-flex; gap: 2px; margin-left: auto; }
.pb-al { border: 1px solid var(--bd); background: var(--white); cursor: pointer; padding: 5px 8px; color: var(--ink-soft); }
.pb-al:first-child { border-radius: 6px 0 0 6px; } .pb-al:last-child { border-radius: 0 6px 6px 0; }
.pb-al + .pb-al { border-left: none; }
.pb-al:hover:not(:disabled) { background: var(--bg2); }
.pb-al.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pb-al:disabled { opacity: .45; cursor: not-allowed; }
.pb-sel { font-size: 12px; }
/* The just-picked image, shown from the local file while the upload runs. */
.pb-busy { opacity: .55; }
/* Says why an alignment control is having no visible effect, rather than
   leaving someone to conclude the feature is broken. */
.pb-warn { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: #92400e; background: #fef3c7; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; }
.pb-warn i { flex: none; margin-top: 1px; }

/* Cancelling an upload run (upload-progress.js). A row is "skipped" when it
   never ran or was aborted, "removed" when it had landed and was rolled back —
   both read as struck-through and faded so the outcome is scannable. No control
   geometry here: the buttons are stock .btn-* primitives. */
/* Cancel sits far left while the run is live; once it hides, the footer's own
   flex-end puts Done back on the right instead of stranding it mid-row. */
.ptu-footer > #ptu-cancel { margin-right: auto; }
.ptu-confirm { background: var(--bg2); border: 1px solid #F0B429; border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.ptu-confirm-q { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: var(--ink); margin: 0 0 10px; }
.ptu-confirm-q i { color: #B45309; flex: 0 0 auto; margin-top: 1px; }
.ptu-confirm-btns { display: flex; gap: 8px; justify-content: flex-end; }
.mfs-uprow.ptu-skipped, .mfs-uprow.ptu-removed { opacity: .55; }
.mfs-uprow.ptu-skipped .mfs-upname, .mfs-uprow.ptu-removed .mfs-upname { text-decoration: line-through; }
.mfs-uprow.ptu-removed .mfs-upicon, .mfs-uprow.ptu-removed .mfs-uppct { color: #DC2626; }
.mfs-uprow.ptu-skipped .mfs-upbar-fill, .mfs-uprow.ptu-removed .mfs-upbar-fill { background: var(--ink-faint); }

/* Destination picker used by the shared file browser's "Move to…" (the rest of
   the old My File Space browser CSS went with patch 605 — grid, cards, folder
   tiles, crumbs and drag styling all live in assets/filebrowser.css now). */
.mfs-move-opts { display: flex; flex-direction: column; gap: 4px; }
.mfs-move-opt { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--bd); border-radius: 8px; background: var(--white); font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; }
.mfs-move-opt:hover { border-color: var(--accent); background: var(--bg2); }
.mfs-move-opt i { font-size: 16px; color: var(--accent); }

/* ── Unified file-hub lens bar (Files · Photos · Documents) ───── */
.filehub-lenses { display: flex; gap: 4px; border-bottom: 1px solid var(--bd); margin-bottom: 16px; overflow-x: auto; }
.filehub-lens { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.filehub-lens:hover { color: var(--ink); }
.filehub-lens.on { color: var(--accent); border-bottom-color: var(--accent); }
.filehub-lens i { font-size: 16px; }

/* ── Onboarding card grid ─────────────────────────────────────── */
.ob-card-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ob-card { display:flex; flex-direction:column; align-items:flex-start; text-align:left; padding:16px; background:var(--bg2); border:1.5px solid var(--bd); border-radius:10px; cursor:pointer; font-family:inherit; transition:border-color .15s, transform .1s; }
.ob-card:hover { border-color:var(--accent); background:var(--white); transform:translateY(-1px); }
.ob-card-icon { width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:18px; margin-bottom:10px; }
.ob-card-title { font-size:14px; font-weight:700; color:var(--ink); margin-bottom:4px; }
.ob-card-desc { font-size:11.5px; color:var(--ink-soft); line-height:1.4; }
@media (max-width: 560px) { .ob-card-grid { grid-template-columns:1fr; } }

/* ── Weather heads-up modal ───────────────────────────────────── */
.wx-list { display:flex; flex-direction:column; gap:14px; }
.wx-project { border:1px solid var(--bd); border-radius:10px; padding:12px 14px; background:var(--bg2); }
.wx-project-hd { display:flex; align-items:baseline; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.wx-project-name { font-size:13px; font-weight:700; color:var(--ink); text-decoration:none; }
.wx-project-name:hover { color:var(--accent); text-decoration:underline; }
.wx-project-loc { font-size:11px; color:var(--ink-faint); }
.wx-item { display:flex; gap:10px; padding:7px 0; border-top:1px solid var(--bd); }
.wx-item:first-of-type { border-top:none; }
.wx-ic { flex-shrink:0; width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:16px; }
.wx-item-body { min-width:0; flex:1; }
.wx-item-hd { display:flex; align-items:center; gap:6px; flex-wrap:wrap; font-size:12.5px; color:var(--ink); }
.wx-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.wx-when { font-size:11px; color:var(--ink-faint); font-weight:600; }
.wx-detail { font-size:11.5px; color:var(--ink-soft); line-height:1.45; margin-top:2px; }

/* ── Dashboard telemetry KPI band ─────────────────────────────── */
/* ── Dashboard rhythm ────────────────────────────────────────
   The page stacks several bands (numbers, what needs you, your projects,
   shared with you). They each used to carry their own margin — 28, 20, 18,
   16 — so the vertical spacing changed as you scrolled and the page read as
   a pile rather than a structure. One rhythm, and an :empty rule on every
   band so a section with nothing in it contributes NO space at all instead
   of leaving a gap that looks like something failed to load. */
#pt-mydash-band, #dash-shared, .dash-telemetry-band { margin-bottom: var(--stack); }
#pt-mydash-band:empty, #dash-shared:empty, .dash-telemetry-band:empty { display: none; margin: 0; }
/* Each band owns its heading, so the first one needs no extra lead-in. */
.dash-band-hd {
  display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap;
  margin: 0 0 var(--gap-min);
}
.dash-band-hd h2 { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.dash-band-hd span { font-size: 12px; color: var(--ink-faint); }
.tel-grid { display:grid; grid-template-columns:repeat(5, 1fr); gap:10px; }
.tel-tile { text-align:left; background:var(--white); border:1px solid var(--bd); border-radius:10px; padding:12px 14px; font-family:inherit; cursor:default; transition:border-color .15s, transform .1s, box-shadow .15s; }
.tel-tile[data-tel-nav] { cursor:pointer; }
.tel-tile[data-tel-nav]:hover { border-color:var(--accent); transform:translateY(-1px); box-shadow:0 4px 14px rgba(0,0,0,.06); }
.tel-tile-top { display:flex; align-items:center; gap:6px; color:var(--ink-faint); margin-bottom:8px; }
.tel-tile-top i { font-size:15px; }
.tel-tile-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.tel-tile-value { font-size:26px; font-weight:700; color:var(--ink); font-family:'JetBrains Mono', monospace; line-height:1.1; font-variant-numeric:tabular-nums; }
.tel-tile-sub { font-size:11px; color:var(--ink-soft); margin-top:3px; }
@media (max-width:1100px) { .tel-grid { grid-template-columns:repeat(3, 1fr); } }
@media (max-width:640px)  { .tel-grid { grid-template-columns:repeat(2, 1fr); } }

/* ── Telemetry module page ────────────────────────────────────── */
.tp-wrap { max-width:1120px; margin:0 auto; }
.tp-head { margin-bottom:18px; }
.tp-title { font-size:24px; font-weight:800; color:var(--ink); margin:0; letter-spacing:-.01em; }
.tp-sub { font-size:13px; color:var(--ink-soft); margin:4px 0 0; }
/* Compact KPI tiles — sized to their content, no flex-grow (they were growing to
   fill the row, reading as oversized). Just big enough for the label + number. */
.tp-kpi-row { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:18px; }
.tp-kpi { background:var(--white); border:1px solid var(--bd); border-radius:9px; padding:8px 12px; flex:0 1 auto; min-width:108px; }
.tp-kpi[data-tp-nav] { cursor:pointer; transition:border-color .15s, transform .1s; }
.tp-kpi[data-tp-nav]:hover { border-color:var(--accent); transform:translateY(-1px); }
.tp-kpi-top { display:flex; align-items:center; gap:5px; font-size:9.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-faint); margin-bottom:4px; white-space:nowrap; }
.tp-kpi-top i { font-size:13px; }
.tp-kpi-val { font-size:21px; font-weight:800; color:var(--ink); font-family:'JetBrains Mono',monospace; line-height:1; font-variant-numeric:tabular-nums; }
.tp-kpi-sub { font-size:10.5px; color:var(--ink-soft); margin-top:3px; white-space:nowrap; }
.tp-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.tp-card { background:var(--white); border:1px solid var(--bd); border-radius:12px; padding:16px 18px; }
.tp-card-hd { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:700; color:var(--ink); margin-bottom:14px; }
.tp-card-hd i { color:var(--accent); font-size:16px; }
.tp-card-hd-note { font-weight:500; font-size:11px; color:var(--ink-faint); margin-left:auto; text-transform:none; letter-spacing:0; }
.tp-card-subhd { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-faint); margin:14px 0 8px; }
.tp-card-foot { font-size:11.5px; color:var(--ink-soft); margin-top:12px; text-align:center; }
.tp-card-cta { margin-top:14px; }
.tp-dist-bar { display:flex; height:12px; border-radius:6px; overflow:hidden; background:var(--bg2); }
.tp-dist-bar span { display:block; height:100%; }
.tp-dist-legend { display:flex; gap:16px; margin-top:10px; font-size:11.5px; color:var(--ink-soft); }
.tp-dist-legend span { display:flex; align-items:center; gap:5px; }
.tp-dot { width:9px; height:9px; border-radius:50%; display:inline-block; }
.tp-proj-row { display:flex; align-items:center; gap:10px; padding:8px 6px; border-bottom:1px solid var(--bd); cursor:pointer; border-radius:6px; }
.tp-proj-row:last-child { border-bottom:none; }
.tp-proj-row:hover { background:var(--bg2); }
.tp-proj-name { font-size:12.5px; font-weight:600; color:var(--ink); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tp-proj-status { font-size:11px; color:var(--ink-faint); }
.tp-health-chip { font-size:12px; font-weight:700; font-family:'JetBrains Mono',monospace; padding:2px 9px; border-radius:20px; min-width:34px; text-align:center; }
.tp-wx-ic { width:26px; height:26px; border-radius:7px; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
.tp-ok { display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink-soft); padding:10px 4px; }
.tp-ok i { color:#16A34A; font-size:16px; }
.tp-bars { display:flex; align-items:flex-end; gap:4px; height:110px; padding-top:6px; }
.tp-bar-col { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:4px; }
.tp-bar { width:100%; max-width:22px; background:linear-gradient(180deg,var(--accent),color-mix(in srgb,var(--accent) 55%,#fff)); border-radius:4px 4px 0 0; min-height:3px; }
.tp-bar-x { font-size:9px; color:var(--ink-faint); }
.tp-comp-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.tp-comp { text-align:center; background:var(--bg2); border-radius:8px; padding:12px 6px; }
.tp-comp-n { font-size:24px; font-weight:800; font-family:'JetBrains Mono',monospace; line-height:1; }
.tp-comp-l { font-size:10.5px; color:var(--ink-soft); margin-top:5px; }
@media (max-width:820px)  { .tp-grid { grid-template-columns:1fr; } }

/* ── Project Telemetry tab ────────────────────────────────────── */
.pth-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.pth-card { background:var(--white); border:1px solid var(--bd); border-radius:12px; padding:16px 18px; }
.pth-span-2 { grid-column:1 / -1; }
.pth-hd { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:700; color:var(--ink); margin-bottom:14px; }
.pth-hd i { color:var(--accent); font-size:16px; }
.pth-hd-note { font-weight:500; font-size:11px; color:var(--ink-faint); margin-left:auto; }
.pth-empty { font-size:12px; color:var(--ink-faint); padding:14px 4px; display:flex; align-items:center; gap:8px; }
.pth-dims { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:16px; }
.pth-dim { text-align:center; background:var(--bg2); border-radius:8px; padding:10px 4px; }
.pth-dim-n { font-size:22px; font-weight:800; font-family:'JetBrains Mono',monospace; color:var(--ink); line-height:1; }
.pth-dim-l { font-size:10px; color:var(--ink-soft); margin-top:4px; }
.pth-mp-head { display:flex; align-items:flex-end; gap:14px; margin-bottom:12px; }
.pth-mp-stat { text-align:center; }
.pth-big { font-size:24px; font-weight:800; font-family:'JetBrains Mono',monospace; color:var(--ink); line-height:1; }
.pth-cap { font-size:10.5px; color:var(--ink-soft); margin-top:4px; }
.pth-vs { font-size:11px; color:var(--ink-faint); padding-bottom:4px; }
.pth-pct { margin-left:auto; font-size:20px; font-weight:800; font-family:'JetBrains Mono',monospace; }
.pth-bar { height:10px; background:var(--bg2); border-radius:6px; overflow:hidden; }
.pth-bar-fill { height:100%; border-radius:6px; transition:width .3s; }
.pth-warn { display:flex; align-items:center; gap:6px; font-size:11.5px; color:#DC2626; margin-top:8px; font-weight:600; }
.pth-comp { text-align:center; padding:8px 0; }
.pth-comp-score { font-size:34px; font-weight:800; font-family:'JetBrains Mono',monospace; line-height:1; }
.pth-wx-alert { display:flex; align-items:center; gap:6px; font-size:11.5px; font-weight:600; color:#D97706; background:#FEF3C7; border-radius:7px; padding:7px 10px; margin-bottom:10px; }
.pth-wx-list { display:flex; flex-direction:column; }
.pth-wx-day { display:grid; grid-template-columns:52px 1fr auto auto; gap:8px; align-items:center; padding:5px 0; border-top:1px solid var(--bd); font-size:11.5px; }
.pth-wx-day:first-child { border-top:none; }
.pth-wx-dow { font-weight:600; color:var(--ink); }
.pth-wx-lbl { color:var(--ink-soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pth-wx-t { font-variant-numeric:tabular-nums; color:var(--ink); }
.pth-wx-p { font-variant-numeric:tabular-nums; color:#2563EB; min-width:32px; text-align:right; }
.pth-hours-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:18px; }
.pth-hstat { text-align:center; background:var(--bg2); border:1px solid var(--bd); border-radius:10px; padding:14px 6px; }
.pth-h4 { font-size:12px; font-weight:700; color:var(--ink-soft); margin:18px 0 8px; text-transform:uppercase; letter-spacing:.04em; }
@media (max-width:820px) { .pth-grid { grid-template-columns:1fr; } }

/* ════════════════════════════════════════════════════════════
   ENTERPRISE DASHBOARD + BRANCH DASHBOARD (#/enterprise, #/branch/ID)
   ════════════════════════════════════════════════════════════ */
.ent-wrap { max-width:1120px; margin:0 auto; padding:4px 2px 40px; }
.ent-hero { margin-bottom:20px; }
.ent-back { display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:600; color:var(--ink-soft); text-decoration:none; margin-bottom:10px; }
.ent-back:hover { color:var(--accent); }
.ent-eyebrow { display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--ink-faint); }
.ent-tier-badge { background:var(--accent); color:#fff; font-size:10px; font-weight:700; padding:2px 8px; border-radius:20px; letter-spacing:.02em; text-transform:none; }
.ent-title { font-size:26px; font-weight:800; color:var(--ink); margin:6px 0 4px; line-height:1.15; }
.ent-sub { font-size:14px; color:var(--ink-soft); margin:0; }

/* Guided setup checklist */
.ent-setup { background:var(--bg2); border:1px solid var(--bd); border-radius:14px; padding:18px 18px 14px; margin-bottom:20px; }
.ent-setup-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.ent-setup-hd { font-size:15px; font-weight:700; color:var(--ink); }
.ent-setup-sub { font-size:13px; color:var(--ink-soft); margin-top:2px; }
.ent-setup-pct { font-size:22px; font-weight:800; color:var(--accent); font-variant-numeric:tabular-nums; line-height:1; }
.ent-progress { height:6px; border-radius:6px; background:var(--bd); overflow:hidden; margin:12px 0 14px; }
.ent-progress-fill { height:100%; background:var(--accent); border-radius:6px; transition:width .3s ease; }
.ent-steps { display:flex; flex-direction:column; gap:8px; }
.ent-step { display:flex; align-items:center; gap:12px; padding:11px 12px; border:1px solid var(--bd); border-radius:11px; background:var(--bg); }
.ent-step.done { opacity:.62; }
.ent-step.next { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset; }
.ent-step-ico { width:32px; height:32px; flex-shrink:0; display:grid; place-items:center; border-radius:9px; background:var(--bg2); color:var(--ink-soft); font-size:16px; }
.ent-step.done .ent-step-ico { color:#16A34A; }
.ent-step.next .ent-step-ico { background:var(--accent); color:#fff; }
.ent-step-body { flex:1; min-width:0; }
.ent-step-title { font-size:14px; font-weight:700; color:var(--ink); display:flex; align-items:center; gap:8px; }
.ent-step-tag { font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--accent); background:color-mix(in srgb, var(--accent) 14%, transparent); padding:2px 7px; border-radius:20px; }
.ent-step-desc { font-size:13px; color:var(--ink-faint); margin-top:3px; line-height:1.45; }
.ent-step-cta { flex-shrink:0; white-space:nowrap; }
.ent-step-check { flex-shrink:0; font-size:11px; font-weight:700; color:#16A34A; display:inline-flex; align-items:center; gap:4px; white-space:nowrap; }

/* At-a-glance stat grid */
.ent-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; margin-bottom:20px; }
.ent-stat { background:var(--bg2); border:1px solid var(--bd); border-radius:12px; padding:13px 14px; }
.ent-stat[role=button] { cursor:pointer; transition:border-color .15s, transform .1s; }
.ent-stat[role=button]:hover { border-color:var(--accent); transform:translateY(-1px); }
.ent-stat-top { display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600; color:var(--ink-soft); }
.ent-stat-val { font-size:26px; font-weight:800; color:var(--ink); font-variant-numeric:tabular-nums; line-height:1.1; margin-top:4px; }
.ent-stat-sub { font-size:12px; color:var(--ink-faint); margin-top:2px; }

/* Branch dashboard — module tiles (each opens focused to the branch) */
.branch-tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:10px; margin-bottom:20px; }
.branch-tile { display:flex; flex-direction:column; align-items:flex-start; gap:3px; text-align:left; background:var(--bg2); border:1px solid var(--bd); border-radius:12px; padding:14px 15px; cursor:pointer; font:inherit; transition:border-color .15s, transform .1s, box-shadow .15s; }
.branch-tile:hover { border-color:var(--accent); transform:translateY(-1px); box-shadow:0 6px 18px -12px rgba(0,0,0,.35); }
.branch-tile i { font-size:20px; color:var(--accent); }
.branch-tile span { font-size:13.5px; font-weight:700; color:var(--ink); margin-top:4px; }
.branch-tile small { font-size:11px; color:var(--ink-faint); }

/* Two-column body */
.ent-cols { display:grid; grid-template-columns:1.5fr 1fr; gap:16px; align-items:start; }
.ent-col { display:flex; flex-direction:column; gap:16px; }
.ent-card { background:var(--bg2); border:1px solid var(--bd); border-radius:14px; padding:16px; }
.ent-card-hd { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:13px; font-weight:700; color:var(--ink); margin-bottom:12px; }
.ent-card-hd span { display:inline-flex; align-items:center; gap:7px; }
.ent-empty-inline { font-size:13px; color:var(--ink-faint); padding:10px 2px; display:flex; align-items:center; gap:7px; }

/* Branch list */
.ent-branch-list { display:flex; flex-direction:column; gap:4px; }
.ent-branch-row { display:flex; align-items:center; gap:11px; padding:10px 10px; border-radius:10px; text-decoration:none; color:var(--ink); border:1px solid transparent; }
.ent-branch-row:hover { background:var(--bg); border-color:var(--bd); }
.ent-branch-ico { width:30px; height:30px; flex-shrink:0; display:grid; place-items:center; border-radius:8px; background:var(--bg); color:var(--ink-soft); font-size:15px; }
.ent-branch-name { flex:1; min-width:0; font-size:14px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ent-branch-div { color:var(--ink-faint); font-weight:500; }
.ent-branch-meta { font-size:12px; color:var(--ink-faint); font-variant-numeric:tabular-nums; white-space:nowrap; }
.ent-branch-chev { color:var(--ink-faint); font-size:15px; }

/* Company quick links */
.ent-quick { display:flex; flex-direction:column; gap:2px; }
.ent-quick-item { display:flex; align-items:center; gap:11px; padding:10px 8px; border-radius:10px; text-decoration:none; color:var(--ink); }
.ent-quick-item:hover { background:var(--bg); }
.ent-quick-item > .ti { color:var(--ink-faint); font-size:15px; }
.ent-quick-ico { width:32px; height:32px; flex-shrink:0; display:grid; place-items:center; border-radius:9px; background:var(--bg); color:var(--accent); font-size:16px; }
.ent-quick-txt { flex:1; min-width:0; display:flex; flex-direction:column; }
.ent-quick-label { font-size:14px; font-weight:600; }
.ent-quick-sub { font-size:12px; color:var(--ink-faint); }

/* Activity feed */
.ent-act-list { display:flex; flex-direction:column; }
.ent-act-row { display:flex; align-items:baseline; gap:9px; padding:9px 0; border-top:1px solid var(--bd); font-size:13px; }
.ent-act-row:first-child { border-top:none; }
.ent-act-row > .ti { color:var(--ink-faint); font-size:10px; }
.ent-act-body { flex:1; min-width:0; }
.ent-act-who { font-weight:700; color:var(--ink); }
.ent-act-what { color:var(--ink-soft); }
.ent-act-note { color:var(--ink-faint); }
.ent-act-when { font-size:11.5px; color:var(--ink-faint); white-space:nowrap; }

/* Upgrade nudge */
.ent-upgrade { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--bg2)), var(--bg2)); border:1px solid var(--accent); border-radius:14px; padding:16px 18px; margin-bottom:20px; }
.ent-upgrade-hd { font-size:14px; font-weight:800; color:var(--ink); display:flex; align-items:center; gap:7px; }
.ent-upgrade-txt p { font-size:13px; color:var(--ink-soft); margin:4px 0 0; max-width:560px; }

/* Branch/region type badge on the list rows */
.ent-branch-type { display:inline-block; margin-left:7px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; padding:2px 7px; border-radius:20px; background:var(--bd); color:var(--ink-soft); vertical-align:middle; }
.ent-branch-type.region { background:color-mix(in srgb, var(--accent) 16%, transparent); color:var(--accent); }

/* Branch detail block (dashboard) */
.ent-detail-card { margin-bottom:16px; }
.ent-detail-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; }
.ent-detail-l { font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-faint); display:flex; align-items:center; gap:5px; margin-bottom:3px; }
.ent-detail-v { font-size:14px; color:var(--ink); line-height:1.45; }
.ent-detail-muted { color:var(--ink-faint); font-style:italic; }

/* Add-branch/region form */
.ent-branch-body { max-height:min(72vh,640px); overflow-y:auto; }
.ent-form-hint { display:flex; gap:7px; font-size:13px; line-height:1.5; color:var(--ink-soft); background:var(--bg2); border:1px solid var(--bd); border-radius:9px; padding:10px 12px; margin:0 0 14px; }
.ent-form-hint .ti { color:var(--accent); flex-shrink:0; margin-top:1px; }
.ent-form-row { display:flex; gap:10px; }
.ent-f-type { width:150px; flex-shrink:0; }
.ent-f-name { flex:1; }
.ent-form-sec { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-soft); margin:16px 0 8px; padding-top:12px; border-top:1px solid var(--bd); display:flex; align-items:center; justify-content:space-between; }
.ent-addr-row { display:flex; gap:10px; }
.ent-addr-row .field { flex:1; }
.ent-addr-st { max-width:80px; }
.ent-addr-zip { max-width:100px; }
.ent-same { font-size:11.5px; font-weight:500; text-transform:none; letter-spacing:0; color:var(--ink-soft); display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.ent-same input { margin:0; }
.ent-opt { font-weight:400; color:var(--ink-faint); text-transform:none; letter-spacing:0; }
.req { color:#DC2626; }

@media (max-width:860px) { .ent-cols { grid-template-columns:1fr; } .ent-title { font-size:22px; } }
@media (max-width:520px) { .ent-form-row { flex-direction:column; } .ent-f-type { width:auto; } }

/* The Apple-17pt Enterprise-page preview moved into assets/type-scale.css,
   gated behind html[data-type-scale="comfortable"] so it's part of the
   site-wide Comfortable scale (and reverts cleanly under Standard). */

/* ── No-organization empty state (Settings → org-scoped tabs) ── */
.oa-noorg { text-align:center; padding:38px 24px 30px; max-width:520px; margin:0 auto; }
.oa-noorg-ico { font-size:36px; color:var(--ink-faint); }
.oa-noorg h3 { font-size:17px; font-weight:700; color:var(--ink); margin:12px 0 8px; }
.oa-noorg p { font-size:13px; line-height:1.6; color:var(--ink-soft); margin:0 auto 10px; max-width:440px; }
.oa-noorg-cta { margin-top:18px; }
.oa-noorg-cta .btn-dark { display:inline-flex; align-items:center; gap:7px; text-decoration:none; }

/* ── Plans & billing (#/plan) ── */
.plan-note-top { display:flex; align-items:flex-start; gap:9px; background:var(--bg2); border:1px solid var(--bd);
  border-radius:8px; padding:12px 14px; font-size:13px; color:var(--ink-soft); line-height:1.5; margin-bottom:22px; }
.plan-note-top i { color:var(--accent); font-size:16px; flex:0 0 auto; margin-top:1px; }
.plan-note-top span { flex:1; min-width:0; }
.plan-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; align-items:stretch; }
.plan-card { position:relative; background:var(--bg); border:1.5px solid var(--bd); border-radius:14px;
  padding:24px 22px 22px; display:flex; flex-direction:column; }
.plan-card.plan-featured { border-color:var(--accent); box-shadow:0 8px 30px rgba(79,70,229,.10); }
.plan-card.plan-current { border-color:var(--accent); }
.plan-ribbon { position:absolute; top:-11px; left:50%; transform:translateX(-50%); background:var(--accent); color:#fff;
  font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; padding:3px 12px; border-radius:20px; white-space:nowrap; }
.plan-name { font-size:15px; font-weight:700; color:var(--ink); }
.plan-price { font-size:32px; font-weight:800; color:var(--ink); margin:6px 0 2px; letter-spacing:-.02em; }
.plan-per { font-size:14px; font-weight:600; color:var(--ink-faint); letter-spacing:0; }
.plan-tag { font-size:12.5px; color:var(--ink-soft); line-height:1.5; min-height:38px; margin-bottom:14px; }
.plan-feats { list-style:none; margin:0 0 20px; padding:0; display:flex; flex-direction:column; gap:10px; flex:1; }
.plan-feats li { display:flex; align-items:flex-start; gap:9px; font-size:13px; color:var(--ink); line-height:1.4; }
.plan-feats .plan-yes { color:#22C55E; font-size:16px; flex:0 0 auto; margin-top:1px; }
.plan-feats .plan-no  { color:var(--ink-faint); font-size:16px; flex:0 0 auto; margin-top:1px; }
.plan-feats .plan-off { color:var(--ink-faint); }
.plan-cta { width:100%; justify-content:center; text-align:center; padding:11px; font-size:14px; }
.plan-cta:disabled { opacity:.55; cursor:default; }
.plan-foot { font-size:12px; color:var(--ink-faint); text-align:center; margin-top:20px; line-height:1.5; }
/* Education section (Students & educators) */
.plan-edu-sec { margin-top:34px; padding-top:26px; border-top:1px dashed var(--bd); }
.plan-edu-hd { display:flex; align-items:center; gap:8px; font-size:16px; font-weight:700; color:var(--ink); }
.plan-edu-hd i { color:var(--accent); }
.plan-edu-lede { font-size:13px; color:var(--ink-soft); line-height:1.55; margin:6px 0 16px; max-width:680px; }
.plan-edu-status { display:flex; align-items:center; gap:8px; background:var(--accent-bg); border:1px solid var(--accent);
  border-radius:10px; padding:10px 14px; font-size:13px; color:var(--ink); margin-bottom:16px; }
.plan-edu-status i { color:var(--accent); font-size:16px; }
.plan-card.plan-edu { border-style:dashed; }
.plan-grid-2 { grid-template-columns:repeat(2,1fr); max-width:680px; }
@media (max-width:820px) {
  .plan-grid { grid-template-columns:1fr; max-width:420px; margin:0 auto; }
  .plan-grid-2 { grid-template-columns:1fr; }
}

/* ── Project collaborators (guest invites & permissions) ─────── */
.clb-note { display:flex; align-items:flex-start; gap:8px; background:var(--bg2); border:1px solid var(--bd);
  border-radius:9px; padding:9px 12px; font-size:12px; color:var(--ink-soft); line-height:1.5; margin:12px 0; }
.clb-note i { color:var(--accent); flex:0 0 auto; margin-top:1px; }
.clb-list { display:flex; flex-direction:column; gap:8px; }
.clb-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px;
  background:var(--bg); border:1px solid var(--bd); border-radius:10px; }
.clb-who { font-weight:650; font-size:13.5px; color:var(--ink); display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.clb-sub { font-size:12px; color:var(--ink-soft); margin-top:2px; }
.clb-sub i { font-size:12px; margin-right:2px; }
.clb-caps { font-size:11.5px; color:var(--ink-faint); margin-top:4px; }
.clb-actions { display:flex; align-items:center; gap:6px; flex:0 0 auto; }
.clb-pill { display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:20px; }
.clb-pill i { font-size:12px; }
.clb-active { background:rgba(22,163,74,.12); color:#15803D; }
.clb-invited { background:rgba(217,119,6,.12); color:#B45309; }
.clb-inv-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.clb-editwho { display:flex; align-items:center; gap:7px; font-size:13px; color:var(--ink); background:var(--bg2);
  border:1px solid var(--bd); border-radius:8px; padding:8px 12px; margin-bottom:12px; }
.clb-preset-desc { font-size:11.5px; color:var(--ink-soft); margin-top:5px; line-height:1.45; }
.clb-caphd { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--ink-soft); margin:16px 0 8px; }
.clb-caps-wrap { display:flex; flex-direction:column; gap:14px; }
.clb-capgroup-h { font-size:11px; font-weight:700; color:var(--accent); margin-bottom:6px; }
.clb-cap { display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink); padding:4px 0; cursor:pointer; }
.clb-cap input { width:15px; height:15px; accent-color:var(--accent); cursor:pointer; flex:0 0 auto; }
@media (max-width:560px) { .clb-inv-grid { grid-template-columns:1fr; } .clb-row { flex-direction:column; align-items:flex-start; } }

/* Shared-with-me (guest collaborator projects) */
.shared-section { margin-bottom: 0; }   /* the band owns the rhythm now */
.shared-sub { font-size: 12px; color: var(--ink-soft); margin-left: auto; }
.shared-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--gap-min); margin-top: 10px; }
.shared-card { display: block; min-width: 0; background: var(--bg2); border: 1px solid var(--bd); border-left: 3px solid var(--accent); border-radius: 12px; padding: var(--pad-min); text-decoration: none; color: inherit; transition: box-shadow .12s, transform .12s; }
.shared-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.shared-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.shared-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; background: var(--accent-bg); color: var(--accent); border-radius: 20px; padding: 2px 8px; }
.shared-org { font-size: 12px; color: var(--ink-faint); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shared-card-name { font-size: 15px; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.shared-card-meta { font-size: 12px; color: var(--ink-soft); margin-top: 4px; overflow-wrap: anywhere; }
/* The chip must never be squeezed to nothing by a long org name beside it. */
.shared-card-top .shared-chip { flex: 0 0 auto; }
.shared-card-top .shared-org  { min-width: 0; }

/* ── Hours tab: labor-hours source + guidance + manual grid ── */
.pth-srcbar { display:grid; grid-template-columns:auto auto 1fr; align-items:center; gap:12px; padding:10px 14px; background:var(--bg2); border:1px solid var(--bd); border-radius:10px; margin-bottom:16px; }
.pth-srclab { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color:var(--ink-soft); display:flex; align-items:center; gap:6px; white-space:nowrap; }
.pth-srclab i { color:var(--accent); font-size:15px; }
.pth-srcsel { padding:6px 10px; border:1px solid var(--bd); border-radius:7px; background:var(--white); color:var(--ink); font-size:13px; }
.pth-srcval { font-weight:700; color:var(--ink); }
.pth-srchint { font-size:12px; color:var(--ink-faint); }
@media (max-width:640px){ .pth-srcbar { grid-template-columns:1fr; } .pth-srchint { grid-column:1; } }

.pth-guide { border:1px dashed color-mix(in srgb, var(--accent) 45%, var(--bd)); border-radius:12px; padding:16px 18px; margin-bottom:18px; background:color-mix(in srgb, var(--accent) 4%, transparent); }
.pth-guide-hd { font-size:15px; font-weight:800; color:var(--ink); display:flex; align-items:center; gap:8px; }
.pth-guide-hd i { color:var(--accent); }
.pth-guide-sub { font-size:13px; color:var(--ink-soft); margin:6px 0 14px; }
.pth-guide-opts { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
@media (max-width:720px){ .pth-guide-opts { grid-template-columns:1fr; } }
.pth-opt { text-align:left; display:flex; flex-direction:column; gap:4px; padding:12px 14px; border:1px solid var(--bd); border-radius:10px; background:var(--white); cursor:pointer; transition:border-color .12s, box-shadow .12s; }
.pth-opt:hover:not([disabled]) { border-color:var(--accent); box-shadow:0 2px 10px rgba(0,0,0,.06); }
.pth-opt[disabled] { opacity:.55; cursor:default; }
.pth-opt i { font-size:20px; color:var(--accent); }
.pth-opt b { font-size:13.5px; color:var(--ink); display:flex; align-items:center; gap:6px; }
.pth-opt span { font-size:12px; color:var(--ink-soft); line-height:1.4; }
.pth-rec { font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color:#16A34A; background:color-mix(in srgb,#16A34A 15%,transparent); padding:1px 6px; border-radius:10px; }
.pth-soon { font-size:9px; font-weight:700; text-transform:uppercase; color:var(--ink-faint); background:var(--bg2); padding:1px 6px; border-radius:10px; }

.pth-manual { border:1px solid var(--bd); border-radius:12px; padding:14px 16px; margin-top:18px; }
.pth-manual-hd { font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; color:var(--ink-soft); display:flex; align-items:center; gap:7px; margin-bottom:10px; }
.pth-manual-hd i { color:var(--accent); }

/* ── Project templates (Enterprise ▸ Project Templates) ────── */
.tpl-lede { font-size: 13.5px; color: var(--ink-soft); max-width: 70ch; margin: 0 0 var(--stack); }
.tpl-locked h3 { display: flex; align-items: center; gap: var(--sp-2); font-size: 14px; font-weight: 700; margin: 0 0 4px; }
.tpl-locked p { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 10px; max-width: 74ch; }
.tpl-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin: var(--stack) 0 var(--gap-min); }
.tpl-head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.tpl-head-r { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.tpl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--stack); }
.tpl-card { border: 1px solid var(--bd); border-radius: 12px; background: var(--white); padding: var(--sp-4); min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tpl-card-h { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.tpl-card-h h3 { font-size: 15px; font-weight: 700; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tpl-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); background: var(--bg2); border: 1px solid var(--bd); border-radius: 999px; padding: 2px 8px; }
.tpl-tag-on { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); }
.tpl-desc { font-size: 12.5px; color: var(--ink-soft); margin: 0; }
.tpl-count { font-size: 11.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.tpl-mods { display: flex; flex-wrap: wrap; gap: 5px; }
.tpl-mod { font-size: 11.5px; color: var(--ink-soft); background: var(--bg2); border: 1px solid var(--bd); border-radius: 5px; padding: 2px 7px; }
.tpl-mod-lock { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); font-weight: 600; }
.tpl-none { font-size: 11.5px; color: var(--ink-faint); font-style: italic; }
.tpl-acts { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.tpl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 7px; }
.tpl-chk { display: flex; align-items: baseline; gap: 7px; font-size: 13px; color: var(--ink); cursor: pointer; min-width: 0; }
.tpl-chk input { flex: none; }
.tpl-needs { font-size: 10.5px; color: var(--ink-faint); }

/* ── Project ▸ Permissions ───────────────────────────────── */
.pp-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: var(--stack); align-items: start; }
@media (max-width: 820px) { .pp-wrap { grid-template-columns: 1fr; } }
.pp-people { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--bd); border-radius: 12px; background: var(--white); padding: 6px; min-width: 0; }
.pp-person { display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: none; border-radius: 8px; padding: 8px 10px; cursor: pointer; min-width: 0; }
.pp-person:hover { background: var(--bg2); }
.pp-person.on { background: var(--accent-bg); }
.pp-name { font-size: 13px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.pp-person.on .pp-name { color: var(--accent); }
.pp-role { font-size: 11px; color: var(--ink-faint); overflow-wrap: anywhere; }
.pp-body { min-width: 0; display: flex; flex-direction: column; gap: var(--stack); }
.pp-super { border: 1px solid var(--bd); background: var(--bg2); border-radius: 12px; padding: var(--pad-min); font-size: 13px; color: var(--ink-soft); max-width: 78ch; }
.pp-cat { border: 1px solid var(--bd); border-radius: 12px; background: var(--white); overflow: hidden; }
.pp-cat h4 { margin: 0; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); padding: 10px 14px; background: var(--bg2); border-bottom: 1px solid var(--bd); }
.pp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 74px; align-items: center; gap: var(--gap-min); padding: 10px 14px; border-bottom: 1px solid var(--bd); }
.pp-row:last-child { border-bottom: none; }
.pp-over { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.pp-p { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pp-lbl { font-size: 13px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.pp-why { font-size: 11.5px; color: var(--ink-faint); overflow-wrap: anywhere; }
.pp-nd { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); border: 1px solid var(--bd); border-radius: 4px; padding: 1px 5px; align-self: flex-start; }
.pp-seg { display: inline-flex; flex: none; }
.pp-b { border: 1px solid var(--bd); background: var(--white); color: var(--ink-soft); font-size: 11.5px; font-weight: 600; padding: 5px 11px; cursor: pointer; }
.pp-b:first-child { border-radius: 6px 0 0 6px; } .pp-b:last-child { border-radius: 0 6px 6px 0; }
.pp-b + .pp-b { border-left: none; }
.pp-b:hover:not(:disabled) { background: var(--bg2); }
.pp-b.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pp-b:disabled { opacity: .45; cursor: not-allowed; }
.pp-eff { font-size: 11px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pp-eff.yes { color: #16A34A; } .pp-eff.no { color: var(--ink-faint); }

/* ── Project settings: summary pairs ─────────────────────────
   These sit in a three-column grid. A grid item defaults to min-width:auto, so
   without this a long project name or address cannot shrink and overlaps the
   column beside it. */
.ps-sum { min-width: 0; }
.ps-sum-l { color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.ps-sum-v { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ── Searchable person picker (Project Manager / Field Lead) ──
   Replaces a <select> holding the whole roster. The element consumers read is
   still a hidden input with the same id, so nothing downstream changed. */
.pk-field { min-width: 0; }
.pk-wrap { position: relative; min-width: 0; }
.pk-q { width: 100%; padding-right: 34px; }
.pk-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--ink-faint); padding: 4px; line-height: 1; }
.pk-clear:hover { color: var(--ink); }
.pk-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto;
  background: var(--white); border: 1px solid var(--bd); border-radius: 10px; box-shadow: var(--shadow-md); padding: 4px; }
.pk-opt { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; background: none; border: none;
  border-radius: 7px; padding: 7px 10px; cursor: pointer; min-width: 0; }
.pk-opt:hover { background: var(--bg2); }
.pk-opt-n { font-size: 13px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.pk-opt-t { font-size: 11.5px; color: var(--ink-faint); overflow-wrap: anywhere; }
.pk-empty { padding: 12px; text-align: center; font-size: 12.5px; color: var(--ink-faint); }

/* ── Branch / Enterprise page: stop columns overlapping ──────
   Fourth instance of the same root cause this session: a grid item defaults to
   min-width:auto, so it refuses to shrink below its content and a long branch,
   org or project name runs into the column beside it. */
.branch-tile { min-width: 0; }
.branch-tile span, .branch-tile small { min-width: 0; overflow-wrap: anywhere; }
.ent-cols > *, .ent-col > *, .ent-card { min-width: 0; }
.ent-card-hd { min-width: 0; flex-wrap: wrap; }
.ent-card-hd span { min-width: 0; overflow-wrap: anywhere; }

/* Project settings → the two setup screens, where people look for them. */
.ps-jump { border: 1px solid var(--bd); border-left: 3px solid var(--accent); border-radius: 12px; background: var(--white); padding: var(--pad-min); margin-bottom: var(--stack); }
.ps-jump-t { display: flex; align-items: center; gap: var(--sp-2); font-size: 15px; font-weight: 700; color: var(--ink); }
.ps-jump-t i { color: var(--accent); font-size: 18px; }
.ps-jump p { font-size: 12.5px; color: var(--ink-soft); margin: 6px 0 12px; max-width: 68ch; }
.ps-jump-b { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ── Project settings grids ──────────────────────────────────
   minmax(0,1fr), not 1fr. `1fr` is shorthand for minmax(auto,1fr), and `auto`
   resolves to the item's CONTENT width — so a wide input forces its track past
   the container, eating the gap and pushing the last column over the card edge.
   min-width:0 on the child cannot fix this; the TRACK is what is oversized. */
.ps-g2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px 16px; }
.ps-g3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px 18px; }
@media (max-width: 640px) { .ps-g2, .ps-g3 { grid-template-columns: minmax(0,1fr); } }
/* Inputs fill their cell exactly — border-box so padding and border are inside
   the width rather than added to it, which is the other half of the overflow. */
.ps-g2 input, .ps-g2 select, .ps-g3 input, .ps-g3 select { width: 100%; box-sizing: border-box; min-width: 0; }

/* ── Project Features, grouped by nav section ─────────────────
   Same headings and same order as the sidebar, so "what does switching this
   off actually remove" is answered on the screen rather than from memory. */
.pf-group + .pf-group { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bd); }
.pf-group-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.pf-group-h i { font-size: 15px; color: var(--accent); }
.pf-group-note { font-size: 12px; color: var(--ink-faint); margin: -4px 0 10px; }

/* Project ▸ Equipment — overdue rows carry the warning tone the rest of the
   suite uses for a date that has passed. */
.pe-od td { background: color-mix(in srgb, #B45309 7%, transparent); }
.pe-row { cursor: pointer; }

/* Forms preloaded by a project template — visually secondary to the feature
   chips above them, because features decide what the job DOES and forms are
   what it comes stocked with. */
.tpl-mods-forms { margin-top:6px; padding-top:6px; border-top:1px dashed var(--bd); }
.tpl-mod-form { display:inline-flex; align-items:center; gap:4px; background:var(--bg2);
  color:var(--ink-soft); font-weight:600; }
.tpl-mod-form i { font-size:12px; opacity:.7; }
/* The per-project forms card reuses .tpl-mod as a checkbox chip. */
.tpl-mod input[type="checkbox"] { margin-right:6px; vertical-align:middle; }
label.tpl-mod { cursor:pointer; user-select:none; opacity:.55; }
label.tpl-mod.on { opacity:1; border-color:var(--accent); color:var(--ink); }
.tpl-group { margin-bottom:12px; }
.tpl-group-h { font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.05em;
  color:var(--ink-faint); margin:0 0 5px; }
