/* fp-ui.css — the platform look, one stylesheet (Projects P1b, docs/PROJECTS_DESIGN.md PJ1b-1).

   The pieces every section page is built from: the top bar that holds the page's controls, the
   glow-bar stat card, the panel with its section-color title, the tinted glow button and the
   neutral action button, Share Tech Mono numbers, status pills (Blocked is solid, so it never
   reads as a red section color), tabs, tables whose rows light on hover, form fields and
   dialogs. Projects and the Calendar use it (the Calendar since its restyle, DS5d-1).

   Theme tokens only (--fp-*, from tokens.css) plus the page's section color (--section-color,
   --section-color-rgb, set by the base template). No raw colors: the theme ratchet holds this
   file at zero. Rajdhani and Share Tech Mono are loaded by the base templates.
   A card's accent is its own custom property, --c (a token, set by the page's class). */

/* The platform background (base.html's --bg); style.css forces a lighter one with !important. */
body.dark-mode:has(.fp-page) { background: var(--fp-n-04) !important; }

.fp-page {
    --fp-ui-text: var(--fp-n-91);
    --fp-ui-muted: var(--fp-n-73);
    --fp-ui-label: var(--fp-sky-90);
    --fp-ui-act: var(--fp-sky-67-b);
    --fp-ui-input: var(--fp-n-07-b);
    --fp-ui-line: rgba(var(--fp-sky-67-b-rgb), 0.25);
    --fp-ui-rule: rgba(var(--fp-sky-31-rgb), 0.35);
    --fp-ui-sec-text: color-mix(in srgb, var(--section-color) 65%, var(--fp-n-100));
    position: relative;
    z-index: 1;
    color: var(--fp-ui-text);
    font-family: 'Rajdhani', 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    padding: 18px 24px 40px;
}
/* Resets carry no weight (:where), so every component class below wins over them. */
/* A piece of the platform look inside an older page (Settings › Projects, P2b): the type and the
   resets, without the page background or padding. */
.fp-embed { color: var(--fp-n-91); font-family: 'Rajdhani', 'Segoe UI', sans-serif; font-size: 15px; font-weight: 500; line-height: 1.35; }
:where(.fp-page, .fp-embed) *, :where(.fp-page, .fp-embed) *::before, :where(.fp-page, .fp-embed) *::after { box-sizing: border-box; }
:where(.fp-page, .fp-dlg, .fp-embed) :where(button, select, input, textarea) { font: inherit; color: inherit; }
:where(.fp-page, .fp-dlg, .fp-embed) button { cursor: pointer; }
:where(.fp-page, .fp-dlg, .fp-embed) button:disabled { cursor: not-allowed; opacity: 0.55; }
.fp-embed [hidden] { display: none !important; }
.fp-embed label { margin: 0; }
:where(.fp-page) a { color: var(--fp-cyan-50); }
:where(.fp-page) a:hover { color: var(--fp-sky-78); }
.fp-page [hidden], .fp-topbar [hidden], .fp-dlg [hidden] { display: none !important; }
.fp-page :is(button, input, select, textarea, a, [tabindex]):focus-visible,
.fp-topbar :is(button, input, a):focus-visible,
.fp-dlg :is(button, input, select, textarea, a):focus-visible {
    outline: 2px solid var(--fp-cyan-50);
    outline-offset: 2px;
}
:where(.fp-page, .fp-dlg) select option { background: var(--fp-n-07-b); color: var(--fp-n-91); }
.fp-mono { font-family: 'Share Tech Mono', ui-monospace, monospace; }
.fp-spacer { flex: 1 1 20px; }
.fp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fp-note { font-size: 12px; color: var(--fp-n-73); line-height: 1.45; }

/* The legacy style.css paints every heading white with !important; these headings carry the
   section color, so they say so the same way. */
h2.fp-panel-title, h2.fp-dlg-title { color: var(--section-color) !important; }
.fp-panel-dashed h2.fp-panel-title { color: var(--fp-n-73) !important; }

/* ── The top bar: the section name (the back link, as on every section page) on the left,
   the page's own controls in the navbar's right-hand group (no second title row) ── */
nav.navbar.fp-topbar { display: flex; align-items: center; height: auto; min-height: 60px; padding: 8px 24px; }
/* The section name, as every section page draws it (Bootstrap's navbar-brand); the same look
   when the CDN stylesheet doesn't arrive on a weak signal. */
.fp-topbar .navbar-brand { color: var(--fp-n-100); text-decoration: none; font-size: 1.25rem; white-space: nowrap; }
.fp-topbar .navbar-brand:hover, .fp-topbar .navbar-brand:focus { color: var(--fp-n-100); }
.fp-topbar .navbar-brand .fw-bold { font-weight: 700; }
.fp-topbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; width: 100%; }
.fp-topbar .fp-nav-end { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.fp-count {
    font-family: 'Share Tech Mono', ui-monospace, monospace; font-size: 15px;
    color: color-mix(in srgb, var(--section-color) 65%, var(--fp-n-100));
    border: 1px solid rgba(var(--section-color-rgb), 0.5);
    background: rgba(var(--section-color-rgb), 0.1);
    border-radius: 6px; padding: 3px 10px; white-space: nowrap;
}
.fp-search {
    display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 38px; border-radius: 8px;
    border: 1px solid rgba(var(--fp-sky-67-b-rgb), 0.25); background: var(--fp-n-07-b); color: var(--fp-n-73);
}
.fp-search input {
    background: transparent; border: 0; outline: none; color: var(--fp-n-91); width: 220px;
    font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 500;
}
.fp-search input::placeholder { color: var(--fp-n-58); }

/* ── Buttons: the tinted section-color glow button, the neutral uppercase action button ── */
.fp-btn-glow, .fp-btn-act, .fp-btn-icon, .fp-btn-link {
    font-family: 'Rajdhani', sans-serif; display: inline-flex; align-items: center; gap: 7px;
    text-decoration: none; white-space: nowrap; cursor: pointer;
}
.fp-btn-glow {
    height: 38px; padding: 0 16px; border-radius: 8px;
    border: 1px solid rgba(var(--section-color-rgb), 0.55);
    background: linear-gradient(135deg, rgba(var(--section-color-rgb), 0.2), rgba(var(--section-color-rgb), 0.08));
    color: color-mix(in srgb, var(--section-color) 65%, var(--fp-n-100));
    text-transform: uppercase; letter-spacing: 1px; font-weight: 700; font-size: 15px;
    transition: box-shadow 0.15s, background 0.15s;
}
.fp-btn-glow:hover:not(:disabled) {
    box-shadow: 0 0 14px rgba(var(--section-color-rgb), 0.35);
    background: linear-gradient(135deg, rgba(var(--section-color-rgb), 0.28), rgba(var(--section-color-rgb), 0.12));
    color: color-mix(in srgb, var(--section-color) 65%, var(--fp-n-100));
}
.fp-btn-act {
    height: 38px; padding: 0 12px; border-radius: 6px;
    border: 1px solid rgba(var(--fp-overlay-rgb), 0.09); background: transparent;
    color: var(--fp-sky-67-b); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; font-size: 13px;
    transition: color 0.15s, border-color 0.15s;
}
.fp-btn-act:hover:not(:disabled) { color: var(--section-color); border-color: rgba(var(--section-color-rgb), 0.4); }
.fp-btn-sm { height: 32px; padding: 0 10px; font-size: 12px; }
.fp-btn-danger { color: var(--fp-red-75); }
.fp-btn-danger:hover:not(:disabled) { color: var(--fp-red-71-b); border-color: rgba(var(--fp-red-71-b-rgb), 0.5); }
.fp-btn-icon {
    width: 36px; height: 36px; justify-content: center; padding: 0; border-radius: 8px;
    border: 1px solid rgba(var(--fp-sky-67-b-rgb), 0.25); background: transparent; color: var(--fp-n-73);
}
.fp-btn-icon:hover:not(:disabled) { background: rgba(var(--section-color-rgb), 0.08); color: var(--fp-n-91); }
.fp-btn-icon.fp-btn-sm { width: 30px; height: 30px; }
.fp-btn-link {
    border: 0; background: transparent; color: var(--fp-cyan-50); font-size: 13px; font-weight: 600;
    padding: 4px 6px; border-radius: 6px;
}
.fp-btn-link:hover:not(:disabled) { color: var(--fp-sky-78); background: rgba(var(--fp-cyan-50-rgb), 0.06); }

/* ── Glow-bar stat cards: a 2px gradient bar in the card's color (--c), mono numbers ── */
.fp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 12px; margin-bottom: 18px; }
.fp-stat {
    --c: var(--fp-cyan-50);
    position: relative; overflow: hidden; text-align: left;
    background: var(--fp-surface, rgba(var(--fp-n-07-rgb), 0.92));
    border: 1px solid rgba(var(--fp-cyan-50-rgb), 0.35); border-radius: 10px;
    padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0;
    color: var(--fp-n-91); transition: border-color 0.2s, box-shadow 0.2s;
}
.fp-stat::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--c), transparent);
}
.fp-stat:hover { border-color: var(--c); box-shadow: 0 0 20px rgba(var(--fp-shadow-rgb), 0.4), inset 0 0 20px rgba(var(--fp-shadow-rgb), 0.2); }
button.fp-stat[aria-pressed="true"] { border-color: var(--c); }
.fp-stat-value { font-family: 'Share Tech Mono', ui-monospace, monospace; font-size: 38px; line-height: 1; color: var(--c); }
.fp-stat-value.fp-stat-value-sm { font-size: 26px; line-height: 1.2; }
.fp-stat-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.fp-stat-aside { font-size: 14px; color: var(--fp-n-73); }
.fp-stat-label { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--fp-sky-90); margin-top: 4px; }
.fp-stat-sub { font-size: 13px; color: var(--fp-n-73); }
.fp-c-cyan { --c: var(--fp-cyan-50); }
.fp-c-amber { --c: var(--fp-amber-62); }
.fp-c-violet { --c: var(--fp-indigo-76); }
.fp-c-green { --c: var(--fp-green-56); }
.fp-c-orange { --c: var(--fp-orange-65); }
.fp-c-red { --c: var(--fp-red-71-b); }

/* ── Bars (progress, budget used); widths are set by code, colors by class ── */
.fp-bar { display: block; height: 7px; border-radius: 3px; background: rgba(var(--fp-sky-31-rgb), 0.5); overflow: hidden; flex: 1 1 auto; }
.fp-bar > span { display: block; height: 100%; background: var(--fp-cyan-50); box-shadow: 0 0 6px var(--fp-cyan-50); }
.fp-bar.fp-bar-thin { height: 6px; }
.fp-bar > span.is-done { background: var(--fp-green-56); box-shadow: 0 0 6px var(--fp-green-56); }
.fp-bar > span.is-blocked { background: var(--fp-red-71-b); box-shadow: 0 0 6px var(--fp-red-71-b); }
.fp-bar > span.is-over { background: var(--fp-orange-65); box-shadow: none; }
.fp-bar > span.is-amber { background: var(--fp-amber-62); box-shadow: 0 0 6px var(--fp-amber-62); }

/* ── Panels: an uppercase, letter-spaced title in the section color ── */
.fp-panel {
    background: var(--fp-surface, rgba(var(--fp-n-07-rgb), 0.92));
    border: 1px solid rgba(var(--section-color-rgb), 0.22); border-radius: 10px; min-width: 0;
}
.fp-panel-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 16px;
    border-bottom: 1px solid rgba(var(--section-color-rgb), 0.25);
}
.fp-panel-title {
    margin: 0; font-family: 'Rajdhani', sans-serif; font-size: 14px; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase; color: var(--section-color);
}
.fp-panel-hint { font-size: 12px; color: var(--fp-n-73); }
.fp-panel-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.fp-panel-foot { padding: 12px 16px; font-size: 12px; color: var(--fp-n-73); line-height: 1.45; }
.fp-panel-line { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 10px 16px; border-bottom: 1px solid rgba(var(--fp-sky-31-rgb), 0.3); align-items: baseline; }
.fp-panel-line:last-child { border-bottom: 0; }
.fp-panel-dashed { background: transparent; border: 1px dashed rgba(var(--fp-n-58-rgb), 0.7); border-radius: 12px; }
.fp-panel-dashed .fp-panel-title { color: var(--fp-n-73); }
.fp-cols { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.fp-col-main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.fp-col-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.fp-empty { padding: 28px 16px; text-align: center; color: var(--fp-n-73); }
.fp-kv { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 6px 12px; font-size: 13px; }
.fp-kv > :nth-child(odd) { color: var(--fp-n-73); }

/* ── Status pills: Active, Waiting, Blocked (solid), Done ── */
.fp-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; line-height: 1.3;
}
.fp-pill-active { background: rgba(var(--fp-green-56-rgb), 0.14); color: color-mix(in srgb, var(--fp-green-56) 65%, var(--fp-n-100)); border-color: rgba(var(--fp-green-56-rgb), 0.55); }
.fp-pill-waiting { background: rgba(var(--fp-amber-62-rgb), 0.12); color: color-mix(in srgb, var(--fp-amber-62) 80%, var(--fp-n-100)); border-color: rgba(var(--fp-amber-62-rgb), 0.55); }
.fp-pill-blocked { background: var(--fp-red-71-b); color: var(--fp-n-04); border-color: var(--fp-red-71-b); box-shadow: 0 0 8px rgba(var(--fp-red-71-b-rgb), 0.5); }
.fp-pill-done { background: rgba(var(--fp-n-58-rgb), 0.16); color: var(--fp-n-82); border-color: rgba(var(--fp-n-58-rgb), 0.55); }
.fp-pill-info { background: rgba(var(--fp-cyan-50-rgb), 0.14); color: var(--fp-sky-78); }
.fp-pill-warn { background: transparent; color: color-mix(in srgb, var(--fp-orange-65) 75%, var(--fp-n-100)); border-color: rgba(var(--fp-orange-65-rgb), 0.7); font-weight: 600; }
.fp-tag {
    display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 12px;
    border: 1px solid rgba(var(--fp-sky-67-b-rgb), 0.25); color: var(--fp-n-82); white-space: nowrap;
}
.fp-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--fp-n-58); }
.fp-dot-open { background: var(--section-color); box-shadow: 0 0 5px var(--section-color); }
.fp-dot-active { background: var(--fp-green-56); }
.fp-dot-waiting { background: var(--fp-amber-62); }
.fp-dot-blocked { background: var(--fp-red-71-b); }
.fp-dot-done { background: var(--fp-n-58); }
.fp-avatar {
    width: 26px; height: 26px; border-radius: 50%; font-size: 10px; font-weight: 800; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--fp-cyan-50); color: var(--fp-n-04);
}
.fp-avatar.is-lead { box-shadow: 0 0 0 2px var(--fp-n-07), 0 0 0 3px var(--fp-cyan-50); }
.fp-avatar.is-helper { background: var(--fp-green-56); }

/* ── Segmented filter and toolbar ── */
.fp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.fp-seg { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--fp-n-07-b); border: 1px solid rgba(var(--fp-sky-67-b-rgb), 0.25); }
.fp-seg button {
    padding: 6px 12px; border: 0; border-radius: 7px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px;
    background: transparent; color: var(--fp-n-82); font-family: 'Rajdhani', sans-serif; font-size: 15px;
}
.fp-seg button[aria-pressed="true"] {
    background: rgba(var(--section-color-rgb), 0.16);
    color: color-mix(in srgb, var(--section-color) 65%, var(--fp-n-100));
    box-shadow: inset 0 0 0 1px rgba(var(--section-color-rgb), 0.5);
}
.fp-seg-count { font-size: 12px; font-weight: 500; color: var(--fp-n-73); }
.fp-select-label { display: flex; align-items: center; gap: 8px; color: var(--fp-n-73); font-size: 13px; }

/* ── Fields ── */
.fp-input, .fp-select, .fp-textarea {
    height: 38px; border-radius: 8px; border: 1px solid rgba(var(--fp-sky-67-b-rgb), 0.25);
    background: var(--fp-n-07-b); padding: 0 10px; color: var(--fp-n-91); min-width: 0;
    font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 500;
}
.fp-textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.4; }
.fp-input[readonly] { opacity: 0.75; }
.fp-input::placeholder, .fp-textarea::placeholder { color: var(--fp-n-58); }
.fp-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--fp-n-73); min-width: 0; }
.fp-field > .fp-note { font-size: 11px; }
.fp-field-wide { grid-column: 1 / -1; }
.fp-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.fp-form-grid.fp-form-tight { grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); gap: 10px; }
.fp-money-input { display: flex; align-items: center; gap: 0; }
.fp-money-input > span {
    height: 38px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 8px 0 0 8px;
    border: 1px solid rgba(var(--fp-sky-67-b-rgb), 0.25); border-right: 0; color: var(--fp-n-73); background: var(--fp-n-07);
}
.fp-money-input > input { border-radius: 0 8px 8px 0; flex: 1 1 auto; width: 100%; }
.fp-check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--fp-n-91); }
.fp-check input { accent-color: var(--fp-cyan-50); width: 16px; height: 16px; margin: 0; flex: none; }
.fp-msg { font-size: 13px; min-height: 1em; }
.fp-msg.is-error { color: var(--fp-red-75); }
.fp-msg.is-ok { color: var(--fp-green-75); }

/* ── Tabs ── */
.fp-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid rgba(var(--section-color-rgb), 0.25); margin-bottom: 18px; }
.fp-tab {
    padding: 10px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; margin-bottom: -1px;
    font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: 1.5px; text-transform: uppercase;
    color: var(--fp-n-73); display: inline-flex; align-items: center; gap: 8px;
}
.fp-tab:hover { color: var(--fp-n-91); }
.fp-tab[aria-selected="true"] { color: var(--section-color); border-bottom-color: var(--section-color); text-shadow: 0 0 10px rgba(var(--section-color-rgb), 0.5); }
.fp-tab-badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(var(--fp-sky-31-rgb), 0.6); color: var(--fp-n-82); letter-spacing: 0; text-shadow: none; }

/* ── Tables: rows light on hover; a row whose name is a stretched link opens as a whole ── */
.fp-table-wrap { overflow-x: auto; }
.fp-table { width: 100%; border-collapse: collapse; }
.fp-table th {
    text-align: left; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--fp-sky-90);
    font-weight: 600; padding: 11px 12px; border-bottom: 1px solid rgba(var(--section-color-rgb), 0.25); white-space: nowrap;
}
.fp-table td { padding: 11px 12px; vertical-align: top; border-top: 1px solid rgba(var(--fp-sky-31-rgb), 0.35); }
.fp-table th:first-child, .fp-table td:first-child { padding-left: 16px; }
.fp-table th:last-child, .fp-table td:last-child { padding-right: 16px; }
.fp-table tbody tr:first-child td { border-top: 0; }
.fp-table .fp-num { text-align: right; white-space: nowrap; }
.fp-table tfoot td { font-weight: 700; border-top: 1px solid rgba(var(--fp-sky-31-rgb), 0.7); }
.fp-row:hover { background: rgba(var(--section-color-rgb), 0.045); }
.fp-row-link { position: relative; cursor: pointer; }
.fp-row-link .fp-stretch { color: var(--fp-n-91); font-weight: 600; text-decoration: none; }
.fp-row-link .fp-stretch::after { content: ''; position: absolute; inset: 0; }
.fp-row-link:hover .fp-stretch { color: color-mix(in srgb, var(--section-color) 65%, var(--fp-n-100)); }
.fp-row-link :is(button, a:not(.fp-stretch), input, select) { position: relative; z-index: 1; }
.fp-sub { font-size: 12px; color: var(--fp-n-73); margin-top: 4px; }

/* ── Menus (status, more actions) ── */
.fp-menu-wrap { position: relative; }
.fp-menu {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: 290px;
    background: var(--fp-n-07-b); border: 1px solid rgba(var(--fp-sky-67-b-rgb), 0.25); border-radius: 10px;
    padding: 6px; box-shadow: 0 16px 40px rgba(var(--fp-shadow-rgb), 0.5);
}
.fp-menu.fp-menu-right { left: auto; right: 0; width: 270px; }
.fp-menu-item {
    width: 100%; text-align: left; border: 0; background: transparent; border-radius: 7px; padding: 8px 10px;
    display: flex; gap: 10px; align-items: flex-start; color: var(--fp-n-91); font-family: 'Rajdhani', sans-serif;
}
.fp-menu-item:hover:not(:disabled) { background: rgba(var(--section-color-rgb), 0.08); }
.fp-menu-item .fp-menu-text { display: flex; flex-direction: column; gap: 2px; }
.fp-menu-item .fp-menu-name { font-weight: 600; font-size: 15px; }
.fp-menu-item .fp-menu-desc { font-size: 12px; color: var(--fp-n-73); }
.fp-menu-item .fp-dot { margin-top: 6px; }
.fp-menu-item.fp-danger .fp-menu-name { color: var(--fp-red-75); }
.fp-menu-sep { height: 1px; background: rgba(var(--fp-sky-31-rgb), 0.6); margin: 4px 6px; }

/* ── Dialogs (native <dialog>, opened with showModal) ── */
.fp-dlg {
    width: min(720px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); padding: 0;
    border-radius: 14px; border: 1px solid rgba(var(--fp-sky-67-b-rgb), 0.25);
    background: var(--fp-n-07); color: var(--fp-n-91); box-shadow: 0 24px 60px rgba(var(--fp-shadow-rgb), 0.55);
    font-family: 'Rajdhani', 'Segoe UI', sans-serif; font-size: 15px; font-weight: 500;
}
.fp-dlg.fp-dlg-sm { width: min(460px, calc(100vw - 32px)); }
.fp-dlg::backdrop { background: rgba(var(--fp-shadow-rgb), 0.72); }
:where(.fp-dlg) * { box-sizing: border-box; }
.fp-dlg-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid rgba(var(--section-color-rgb), 0.25); }
.fp-dlg-title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--section-color); }
.fp-dlg-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.fp-dlg-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 20px; border-top: 1px solid rgba(var(--fp-sky-31-rgb), 0.6); }

/* ── The phase list editor (fp-phase-editor.js: Edit phases and the template editor, P2b) ── */
.fp-pe { display: flex; flex-direction: column; gap: 12px; }
.fp-pe-list { display: flex; flex-direction: column; gap: 10px; }
.fp-pe-phase {
    border: 1px solid rgba(var(--fp-sky-67-b-rgb), 0.25); border-radius: 10px; padding: 12px 14px;
    background: rgba(var(--fp-overlay-rgb), 0.02); display: flex; flex-direction: column; gap: 10px;
}
.fp-pe-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.fp-pe-n {
    width: 28px; height: 28px; border-radius: 50%; flex: none; align-self: center; margin-top: 18px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
    color: var(--fp-cyan-50); border: 2px solid rgba(var(--fp-cyan-50-rgb), 0.55);
}
.fp-pe-grow { flex: 999 1 200px; }
.fp-pe-w { flex: 0 1 120px; }
.fp-pe-src { flex: 1 1 170px; }
.fp-pe-tools { display: inline-flex; gap: 4px; align-self: center; margin-top: 18px; }
.fp-pe-share { min-height: 1em; }
.fp-pe-reqlbl { font-size: 13px; }
.fp-pe-dates { display: flex; flex-wrap: wrap; gap: 10px; }
.fp-pe-dates .fp-field { flex: 0 1 180px; }
.fp-pe-checklist { display: flex; flex-direction: column; gap: 6px; padding-left: 38px; }
.fp-pe-items { display: flex; flex-direction: column; gap: 6px; }
.fp-pe-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fp-pe-item .fp-pe-label { flex: 999 1 220px; }
.fp-pe-cam { font-size: 13px; color: var(--fp-n-73); }
.fp-pe-additem { align-self: flex-start; }
.fp-pe-devnote { padding-left: 38px; margin: 0; }
.fp-pe-foot { display: flex; gap: 10px; }
.fp-dlg.fp-dlg-lg { width: min(980px, calc(100vw - 32px)); }

/* ── Text colors that win over the component they sit on (last, so a .fp-sub or a stat's sub
   line can be colored by adding one of these) ── */
.fp-muted { color: var(--fp-n-73); }
.fp-warn-text { color: color-mix(in srgb, var(--fp-orange-65) 75%, var(--fp-n-100)); }
.fp-good-text { color: color-mix(in srgb, var(--fp-green-56) 65%, var(--fp-n-100)); }
.fp-amber-text { color: var(--fp-amber-62); }
.fp-dim-text { color: var(--fp-sky-67-b); }

/* ── Small screens: a tech on a phone, an office manager on a laptop ── */
@media (max-width: 720px) {
    .fp-page { padding: 14px 12px 32px; }
    nav.navbar.fp-topbar { padding: 8px 12px; }
    .fp-search input { width: 150px; }
    .fp-stat-value { font-size: 30px; }
}

/* ── The phone (My Projects MP-b, MPB-18): the same pieces at phone width, in the phone app's
   system font (Rajdhani comes from Google and would vanish with no signal). base_field.html
   draws the sticky header; .fp-phone is the page under it. Theme tokens only. ── */
.fp-page.fp-phone { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; padding: 12px 12px 96px; max-width: 560px; margin: 0 auto; }
.fp-phone :where(.fp-btn-glow, .fp-btn-act, .fp-btn-icon, .fp-btn-link, .fp-search input, .fp-tab, .fp-seg button) { font-family: inherit; }
.fp-phone .fp-btn-glow, .fp-phone .fp-btn-act { height: 44px; }
.fp-phone .fp-btn-sm { height: 36px; }
.fp-phone .fp-search { height: 44px; width: 100%; }
.fp-phone .fp-search input { width: 100%; font-size: 16px; }
.fp-phone .fp-tabs { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.fp-phone .fp-tab { white-space: nowrap; min-height: 44px; }
.fp-phone .fp-panel { margin-bottom: 12px; }
.fp-phone .fp-stat-value { font-family: inherit; font-weight: 700; font-size: 30px; }
.mp-header { padding: 10px 12px; }
.mp-header .header-title { min-width: 0; }
.mp-header .header-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-sync {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; flex: none;
    border-radius: 18px; border: 1px solid rgba(var(--fp-overlay-rgb), 0.12); background: transparent;
    color: var(--fp-n-73); font: inherit; font-size: 13px; cursor: pointer;
}
.mp-sync.is-offline { color: color-mix(in srgb, var(--fp-amber-62) 80%, var(--fp-n-100)); border-color: rgba(var(--fp-amber-62-rgb), 0.55); }
.mp-sync.is-waiting { color: var(--section-color); border-color: rgba(var(--section-color-rgb), 0.55); }
.mp-sync.is-alert { color: var(--fp-red-75); border-color: rgba(var(--fp-red-71-b-rgb), 0.6); }
.mp-asof { font-size: 12px; color: var(--fp-n-73); margin: 2px 2px 10px; }
.mp-card {
    display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; padding: 14px;
    margin: 0 0 10px; border-radius: 12px; cursor: pointer; color: var(--fp-n-91);
    background: var(--fp-surface, rgba(var(--fp-n-07-rgb), 0.92));
    border: 1px solid rgba(var(--section-color-rgb), 0.3); font: inherit;
}
.mp-card:active { transform: scale(0.99); }
.mp-card.is-today { border-color: var(--section-color); box-shadow: 0 0 14px rgba(var(--section-color-rgb), 0.25); }
.mp-card-top { display: flex; align-items: flex-start; gap: 10px; }
.mp-card-name { font-size: 16px; font-weight: 700; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.mp-card-sub { font-size: 13px; color: var(--fp-n-73); }
.mp-card-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fp-n-82); }
.mp-pct { font-weight: 700; min-width: 40px; text-align: right; color: var(--section-color); }
.mp-group { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--fp-sky-90); margin: 14px 2px 8px; }
.mp-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-hero { padding: 14px; border-radius: 12px; margin-bottom: 12px; border: 1px solid rgba(var(--section-color-rgb), 0.35); background: rgba(var(--section-color-rgb), 0.06); }
.mp-hero-name { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.mp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mp-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px; border-bottom: 1px solid rgba(var(--fp-sky-31-rgb), 0.3); }
.mp-item:last-child { border-bottom: 0; }
.mp-item-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.mp-item-sub { display: block; font-size: 12px; color: var(--fp-n-73); }
.mp-tick {
    width: 32px; height: 32px; flex: none; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid rgba(var(--section-color-rgb), 0.6); background: transparent; color: var(--fp-n-04); cursor: pointer; font-size: 15px;
}
.mp-tick[aria-checked="true"] { background: var(--section-color); border-color: var(--section-color); }
.mp-tick:disabled { opacity: 0.45; cursor: not-allowed; }
.mp-wait { font-size: 12px; color: var(--section-color); }
.mp-codes { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 6px 12px; font-size: 15px; }
.mp-codes > :nth-child(odd) { color: var(--fp-n-73); font-size: 13px; }
.mp-codes > :nth-child(even) { font-family: ui-monospace, monospace; letter-spacing: 1px; }
.mp-card-alert { border-color: rgba(var(--fp-red-71-b-rgb), 0.6); }
.mp-card-office { border-color: rgba(var(--fp-amber-62-rgb), 0.6); }
.mp-toast {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 200; max-width: calc(100vw - 24px);
    padding: 10px 16px; border-radius: 10px; background: var(--fp-n-11-b); color: var(--fp-n-91);
    border: 1px solid rgba(var(--section-color-rgb), 0.45); box-shadow: 0 8px 30px rgba(var(--fp-shadow-rgb), 0.5); font-size: 14px;
}
.mp-toast[hidden] { display: none; }
/* MP-c: the install list (tap = next stage, the arrow opens the item), Undo, the scanner. */
.mp-inst { padding: 0; gap: 0; }
.mp-inst-main {
    flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 6px 8px 14px;
    background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.mp-inst-main:active { background: rgba(var(--section-color-rgb), 0.12); }
.mp-inst-more {
    flex: 0 0 44px; align-self: stretch; background: none; border: 0; border-left: 1px solid rgba(var(--fp-sky-31-rgb), 0.3);
    color: var(--fp-n-73); cursor: pointer;
}
/* MP-e1: photos, "I'm stuck". */
.mp-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mp-photo { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 8px;
    overflow: hidden; background: var(--fp-n-11-b); }
.mp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
button.mp-photo { cursor: pointer; }
.mp-photo.is-picked { outline: 3px solid var(--section-color); outline-offset: -3px; }
.mp-photo-wait, .mp-photo-tag { position: absolute; left: 4px; bottom: 4px; padding: 2px 6px; border-radius: 999px; font-size: 11px;
    background: rgba(var(--fp-n-00-rgb), 0.7); color: var(--fp-n-91); }
.mp-photo-tag { left: auto; right: 4px; text-transform: capitalize; }
.mp-photo-x { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 999px; border: 0;
    background: rgba(var(--fp-n-00-rgb), 0.7); color: var(--fp-n-91); cursor: pointer; }
.mp-photo-link { display: block; }
.mp-tag { flex: 0 1 auto; width: auto; }
.mp-flag { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid rgba(var(--fp-sky-31-rgb), 0.3); }
.mp-flag:last-child { border-bottom: 0; }
.mp-stuck-btn { border-color: color-mix(in srgb, var(--fp-orange-65) 70%, transparent); }
/* MP-e2: Update today and the customer's sign-off. */
.mp-hours { display: grid; gap: 8px; }
.mp-hours-row { display: grid; grid-template-columns: minmax(0, 1fr) 78px 78px; gap: 8px; align-items: end;
    padding-bottom: 8px; border-bottom: 1px solid rgba(var(--fp-sky-31-rgb), 0.3); }
.mp-hours-row:last-child { border-bottom: 0; padding-bottom: 0; }
.mp-hours-in { display: grid; gap: 2px; font-size: 12px; color: var(--fp-n-73); }
.mp-hours-in .fp-input { width: 100%; font-size: 16px; text-align: center; padding-left: 4px; padding-right: 4px; }
.mp-sig { display: block; width: 100%; height: auto; aspect-ratio: 700 / 260; touch-action: none; border-radius: 10px;
    border: 1px dashed rgba(var(--section-color-rgb), 0.6); background: var(--fp-n-11-b); color: var(--fp-n-91); }
.mp-accept { font-size: 15px; }
.mp-form textarea.fp-input { min-height: 120px; resize: vertical; }
span.mp-inst-more { display: flex; align-items: center; justify-content: center; }
.mp-mat-tools { margin: 0 0 12px; }
.mp-field-row.mp-stepper .fp-input { flex: 0 1 110px; width: 110px; text-align: center; }
.mp-field-row .fp-input.mp-units { flex: 0 0 64px; width: 64px; text-align: center; }
.mp-pile { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding-bottom: 10px; border-bottom: 1px solid rgba(var(--fp-sky-31-rgb), 0.3); }
.mp-per { align-self: center; white-space: nowrap; }
.mp-pile:last-child { border-bottom: 0; padding-bottom: 0; }
.mp-pile .fp-select { flex: 1 1 auto; min-width: 0; }
.mp-inst.is-flash { animation: mp-flash 1.1s ease-out; }
@keyframes mp-flash { from { background: rgba(var(--section-color-rgb), 0.28); } to { background: transparent; } }
.mp-facts { display: grid; grid-template-columns: minmax(70px, auto) 1fr; gap: 4px 12px; font-size: 14px; }
.mp-facts > :nth-child(odd) { color: var(--fp-n-73); font-size: 13px; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-chip {
    min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(var(--section-color-rgb), 0.45);
    background: transparent; color: var(--fp-n-91); font: inherit; font-size: 14px; cursor: pointer;
}
.mp-chip[aria-pressed="true"] { background: var(--section-color); border-color: var(--section-color); color: var(--fp-n-05); font-weight: 700; }
.mp-chip:disabled { opacity: 0.5; cursor: not-allowed; }
.mp-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.mp-field { display: grid; gap: 4px; font-size: 13px; color: var(--fp-n-73); }
.mp-field[hidden] { display: none; }
.mp-field-row { display: flex; gap: 8px; }
.mp-field-row .fp-input { flex: 1 1 auto; min-width: 0; font-size: 16px; }
.mp-undo {
    position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 210; width: min(560px, calc(100vw - 24px));
    display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 12px;
    background: var(--fp-n-11-b); color: var(--fp-n-91); border: 1px solid rgba(var(--section-color-rgb), 0.55);
    box-shadow: 0 8px 30px rgba(var(--fp-shadow-rgb), 0.5); font-size: 14px;
}
.mp-undo[hidden] { display: none; }
body:has(.mp-undo:not([hidden])) .mp-toast { bottom: 80px; }
.mp-undo-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.mp-scan {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 12px; border: 0;
    background: var(--fp-n-05); color: var(--fp-n-91); display: flex; flex-direction: column; gap: 10px;
}
.mp-scan:not([open]) { display: none; }
.mp-scan::backdrop { background: rgba(var(--fp-n-00-rgb), 0.85); }
.mp-scan-top { display: flex; align-items: center; justify-content: space-between; font-size: 17px; }
.mp-scan-view { position: relative; flex: 1 1 auto; min-height: 0; border-radius: 12px; overflow: hidden; background: var(--fp-n-00); }
.mp-scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-scan-frame {
    position: absolute; inset: 22% 10%; border: 2px solid var(--section-color); border-radius: 12px;
    box-shadow: 0 0 0 999px rgba(var(--fp-n-00-rgb), 0.35);
}
.mp-scan-status { min-height: 22px; font-size: 15px; text-align: center; }
.mp-scan-type { display: flex; gap: 8px; }
.mp-scan-input {
    flex: 1 1 auto; min-width: 0; font-size: 16px; padding: 10px 12px; border-radius: 10px;
    border: 1px solid rgba(var(--fp-sky-31-rgb), 0.6); background: var(--fp-n-11-b); color: var(--fp-n-91);
}

/* ── The calm look (HM-a, HMA-1, choice A) ───────────────────────────────────────────────────
   A slate ground, the system font, larger type, rounded cards with no glows, and one accent.
   A page opts in with <body class="fp-calm"> and leaves base_minimal's legacy CSS out (its
   legacy_css blocks), so it loads nothing from a CDN. Home is the first; the restyle pass moves
   every page onto it. Tokens only, like the rest of this file. */
body.fp-calm {
    --fp-calm-ground: var(--fp-n-11-b);
    --fp-calm-card: var(--fp-n-13);
    --fp-calm-side: var(--fp-n-10-b);
    --fp-calm-line: rgba(var(--fp-n-58-rgb), 0.22);
    --fp-calm-text: var(--fp-n-91);
    --fp-calm-muted: var(--fp-n-65);
    --fp-calm-accent: var(--fp-cyan-53);
    --fp-calm-accent-rgb: var(--fp-cyan-53-rgb);
    --fp-calm-done: var(--fp-green-64);
    --fp-calm-done-rgb: var(--fp-green-64-rgb);
    --fp-calm-work: var(--fp-amber-60);
    --fp-calm-work-rgb: var(--fp-amber-60-rgb);
    --fp-calm-wait: var(--fp-red-71);
    --fp-calm-wait-rgb: var(--fp-red-71-rgb);
    margin: 0;
    min-height: 100vh;
    background: var(--fp-calm-ground);
    color: var(--fp-calm-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
body.fp-calm *, body.fp-calm *::before, body.fp-calm *::after { box-sizing: border-box; }
body.fp-calm :is(h1, h2, h3, p) { margin: 0; }
body.fp-calm a { color: var(--fp-calm-accent); }
body.fp-calm :is(a, button):focus-visible { outline: 2px solid var(--fp-calm-accent); outline-offset: 2px; }
body.fp-calm [hidden] { display: none !important; }

/* The shell: the sidebar (cc_sidebar.html) and the page beside it. */
.fp-shell { display: flex; min-height: 100vh; }
.fp-side {
    flex: 0 0 236px; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px;
    background: var(--fp-calm-side); border-right: 1px solid var(--fp-calm-line);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.fp-side-brand { display: flex; align-items: center; gap: 10px; padding: 0 2px; }  /* PX-1: room for the collapse button */
.fp-side-mark, .fp-side-logo { flex: none; width: 38px; height: 38px; border-radius: 10px; }
.fp-side-logo { object-fit: cover; }
.fp-side-mark {
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
    background: rgba(var(--fp-calm-accent-rgb), 0.14); color: var(--fp-calm-accent);
}
.fp-side-names { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.fp-side-company { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-side-app { font-size: 13px; color: var(--fp-calm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-side-nav { display: flex; flex-direction: column; gap: 2px; }
.fp-side-group {
    margin: 14px 10px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--fp-calm-muted);
}
.fp-side-group:first-child { margin-top: 0; }
.fp-side-link {
    display: block; padding: 9px 10px; border-radius: 9px; color: var(--fp-calm-text) !important;
    text-decoration: none; font-size: 15px;
}
.fp-side-link:hover { background: rgba(var(--fp-n-58-rgb), 0.12); }
.fp-side-link[aria-current="page"] { background: rgba(var(--fp-calm-accent-rgb), 0.14); color: var(--fp-calm-accent) !important; }
.fp-side-in { display: flex; align-items: center; gap: 11px; }
.fp-side-in i { width: 18px; text-align: center; color: var(--fp-calm-muted); }
.fp-side-link[aria-current="page"] i { color: var(--fp-calm-accent); }
.fp-shell-main { flex: 1 1 auto; min-width: 0; }
.fp-side-toggle {
    display: none; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--fp-calm-line); background: var(--fp-calm-card); color: var(--fp-calm-text);
    font: inherit; font-size: 15px; cursor: pointer;
}
.fp-side-scrim { display: none; }

/* Cards and the small pieces every calm page uses. */
.fp-calm-card { background: var(--fp-calm-card); border: 1px solid var(--fp-calm-line); border-radius: 14px; }
.fp-calm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.fp-calm-title { font-size: 18px; font-weight: 600; }
.fp-calm-hint { font-size: 14px; color: var(--fp-calm-muted); }
.fp-calm-btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px;
    border-radius: 10px; border: 1px solid rgba(var(--fp-calm-accent-rgb), 0.5);
    background: rgba(var(--fp-calm-accent-rgb), 0.12); color: var(--fp-calm-accent) !important;
    font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.fp-calm-btn:hover { background: rgba(var(--fp-calm-accent-rgb), 0.2); }
.fp-calm-btn-quiet { border-color: var(--fp-calm-line); background: transparent; color: var(--fp-calm-muted) !important; }
.fp-calm-chip {
    display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px;
    font-size: 13px; font-weight: 600; white-space: nowrap;
}
.fp-calm-chip-done { background: rgba(var(--fp-calm-done-rgb), 0.14); color: var(--fp-calm-done); }
.fp-calm-chip-working { background: rgba(var(--fp-calm-work-rgb), 0.14); color: var(--fp-calm-work); }
.fp-calm-chip-scheduled { background: rgba(var(--fp-n-58-rgb), 0.16); color: var(--fp-n-82); }
.fp-calm-chip-waiting { background: rgba(var(--fp-calm-wait-rgb), 0.14); color: var(--fp-calm-wait); }

@media (max-width: 900px) {
    .fp-side {
        position: fixed; left: 0; top: 0; z-index: 50; width: min(280px, 86vw); height: 100vh;
        transform: translateX(-105%); transition: transform 0.18s ease;
    }
    .fp-shell.fp-side-open .fp-side { transform: none; }
    .fp-shell.fp-side-open .fp-side-scrim {
        display: block; position: fixed; inset: 0; z-index: 40; background: rgba(var(--fp-n-00-rgb), 0.55);
    }
    .fp-side-toggle { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) { .fp-side { transition: none; } }

/* SB: the sidebar collapses to an icon rail on a computer (PX-1: the button at the top, in the brand
   row, and under the mark in the rail; fp-shell.js keeps the choice). Each link's name stays for screen readers and shows on hover.
   At phone width none of this applies: the sidebar is the slide-out menu. */
.fp-side-nav { flex: 1 1 auto; }
.fp-side-gap { height: 18px; }
.fp-side-end { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 18px; }
.fp-side-end .fp-side-link { flex: 1 1 auto; min-width: 0; }
.fp-side-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-side-collapse {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    border-radius: 9px; border: 1px solid var(--fp-calm-line); background: transparent;
    color: var(--fp-calm-muted); cursor: pointer;
}
.fp-side-collapse:hover { color: var(--fp-calm-accent); border-color: rgba(var(--fp-calm-accent-rgb), 0.5); }
@media (min-width: 901px) {
    .fp-side { transition: flex-basis 0.16s ease, padding 0.16s ease; }
    .fp-side.is-rail { flex-basis: 68px; padding: 20px 10px; overflow-x: hidden; }
    .fp-side.is-rail .fp-side-brand { flex-direction: column; gap: 12px; padding: 0; }
    .fp-side.is-rail .fp-side-names { display: none; }
    .fp-side.is-rail .fp-side-end { flex-direction: column; gap: 10px; }
    .fp-side.is-rail .fp-side-end .fp-side-link { align-self: stretch; }
    .fp-side.is-rail .fp-side-collapse i { transform: rotate(180deg); }
    .fp-side.is-rail .fp-side-gap { height: 1px; margin: 9px 8px; background: var(--fp-calm-line); }
    .fp-side.is-rail .fp-side-link { padding: 10px 0; }
    .fp-side.is-rail .fp-side-in { justify-content: center; gap: 0; }
    .fp-side.is-rail .fp-side-in i { width: auto; font-size: 17px; }
    .fp-side.is-rail .fp-side-label {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
        clip-path: inset(50%); white-space: nowrap; border: 0;
    }
}
@media (max-width: 900px) { .fp-side-collapse { display: none; } }
@media (prefers-reduced-motion: reduce) { .fp-side, .fp-side-collapse i { transition: none; } }

/* SB-6 (CD-7): Calendar and Dispatch only. With no saved choice the server marks the sidebar
   is-auto: drawn as the rail from 901 to 1599px and open from 1600px, by CSS alone (no script runs
   first, so nothing jumps). The rules are the rail's, word for word (a test holds them equal).
   Clicking « or » saves a choice, which drops is-auto (fp-shell.js). */
@media (min-width: 901px) and (max-width: 1599.98px) {
    .fp-side.is-auto { flex-basis: 68px; padding: 20px 10px; overflow-x: hidden; }
    .fp-side.is-auto .fp-side-brand { flex-direction: column; gap: 12px; padding: 0; }
    .fp-side.is-auto .fp-side-names { display: none; }
    .fp-side.is-auto .fp-side-end { flex-direction: column; gap: 10px; }
    .fp-side.is-auto .fp-side-end .fp-side-link { align-self: stretch; }
    .fp-side.is-auto .fp-side-collapse i { transform: rotate(180deg); }
    .fp-side.is-auto .fp-side-gap { height: 1px; margin: 9px 8px; background: var(--fp-calm-line); }
    .fp-side.is-auto .fp-side-link { padding: 10px 0; }
    .fp-side.is-auto .fp-side-in { justify-content: center; gap: 0; }
    .fp-side.is-auto .fp-side-in i { width: auto; font-size: 17px; }
    .fp-side.is-auto .fp-side-label {
        position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
        clip-path: inset(50%); white-space: nowrap; border: 0;
    }
}

/* ── The calm page kit (SC, the restyle pass) ────────────────────────────────────────────────
   What every Command Center page on the calm look is built from, so they all read as one
   product: the top bar (the page's name, its controls, the user menu last: MP-1), stat cards,
   the main and side columns, segmented views, form fields, switches, dialogs and buttons.
   Change a token above or a rule here and every calm page follows. */
body.fp-calm nav.navbar.fp-calm-bar {
    display: block; padding: 0; margin: 0 0 20px; background: transparent !important;
    border-bottom: 0 !important; box-shadow: none !important;
}
.fp-calm-bar-in { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 14px; }
.fp-calm-name { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 26px; font-weight: 600; line-height: 1.2; }
.fp-calm-name i { font-size: 20px; color: var(--fp-calm-accent); }
/* RS: on a record's page the bar names its section as the way back; the record has the page's h1. */
.fp-calm-name-link { display: inline-flex; align-items: center; gap: 12px; color: var(--fp-calm-text) !important; text-decoration: none; }
.fp-calm-name-link:hover { color: var(--fp-calm-accent) !important; }
.fp-calm-bar-in .fp-nav-end { gap: 10px; }
.fp-calm-search {
    display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; min-width: 260px;
    border-radius: 10px; border: 1px solid var(--fp-calm-line); background: var(--fp-calm-card); color: var(--fp-calm-muted);
}
.fp-calm-search input { border: 0 !important; background: transparent !important; height: 38px; padding: 0 !important; min-width: 0; flex: 1 1 auto; box-shadow: none !important; }
.fp-calm-count {
    display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 15px; font-size: 14px; font-weight: 600;
    background: rgba(var(--fp-calm-accent-rgb), 0.12); color: var(--fp-calm-accent); white-space: nowrap;
}
.fp-calm-page { max-width: 1320px; margin: 0 auto; padding: 22px 28px 48px; }
.fp-calm-page.is-wide { max-width: none; }  /* CD-2: the Calendar and Dispatch boards use the full width */
.fp-calm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.fp-calm-stat { padding: 14px 16px; }
.fp-calm-stat-label { font-size: 13px; color: var(--fp-calm-muted); }
.fp-calm-stat-value { font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fp-calm-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.fp-calm-side { display: flex; flex-direction: column; gap: 14px; }
.fp-calm-body { padding: 6px 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.fp-calm-note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--fp-calm-muted); }
.fp-calm-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(var(--fp-n-58-rgb), 0.1); }
.fp-calm-seg button {
    height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--fp-calm-muted);
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.fp-calm-seg button:hover { color: var(--fp-calm-text); }
.fp-calm-seg button.active, .fp-calm-seg button[aria-pressed="true"] { background: var(--fp-calm-card); color: var(--fp-calm-text); box-shadow: 0 1px 2px rgba(var(--fp-n-00-rgb), 0.4); }

/* Fields: every input, select and textarea on a calm page, with or without a class. */
body.fp-calm :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea) {
    width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--fp-calm-line);
    background: var(--fp-calm-ground); color: var(--fp-calm-text); font: inherit; font-size: 15px;
}
body.fp-calm textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
body.fp-calm :is(input, select, textarea):focus { outline: none; border-color: var(--fp-calm-accent); box-shadow: 0 0 0 3px rgba(var(--fp-calm-accent-rgb), 0.18); }
body.fp-calm :is(input, select, textarea):disabled { opacity: 0.55; cursor: not-allowed; }
body.fp-calm ::placeholder { color: var(--fp-n-58); }
body.fp-calm select option { background: var(--fp-calm-card); color: var(--fp-calm-text); }
body.fp-calm input[type="checkbox"], body.fp-calm input[type="radio"] { accent-color: var(--fp-calm-accent); width: 18px; height: 18px; }
body.fp-calm input[type="checkbox"][role="switch"] {
    appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 24px; margin: 0; border-radius: 12px; cursor: pointer;
    background: rgba(var(--fp-n-58-rgb), 0.35); position: relative; transition: background 0.15s;
}
body.fp-calm input[type="checkbox"][role="switch"]::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: var(--fp-calm-text); transition: transform 0.15s;
}
body.fp-calm input[type="checkbox"][role="switch"]:checked { background: var(--fp-calm-accent); }
body.fp-calm input[type="checkbox"][role="switch"]:checked::after { transform: translateX(16px); background: var(--fp-calm-ground); }
.fp-calm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fp-calm-field > label, .fp-calm-label { font-size: 13px; font-weight: 600; color: var(--fp-calm-muted); }
.fp-calm-field .fp-calm-hint-inline { font-weight: 400; }
.fp-calm-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--fp-calm-text); cursor: pointer; }
.fp-calm-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 16px; }
.fp-calm-grid > .span-2 { grid-column: span 2; }
.fp-calm-grid > .span-3 { grid-column: span 3; }
.fp-calm-grid > .span-4 { grid-column: span 4; }
.fp-calm-grid > .span-6 { grid-column: 1 / -1; }
body.fp-calm .fp-calm-section { margin: 26px 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fp-calm-muted); }
body.fp-calm .fp-calm-section:first-of-type { margin-top: 0; }

/* Buttons beside .fp-calm-btn: the filled main action, danger, small, and the dashed drop. */
.fp-calm-btn-primary { background: var(--fp-calm-accent); border-color: var(--fp-calm-accent); color: var(--fp-calm-ground) !important; }
.fp-calm-btn-primary:hover { background: color-mix(in srgb, var(--fp-calm-accent) 85%, var(--fp-n-100)); }
.fp-calm-btn-danger { border-color: rgba(var(--fp-calm-wait-rgb), 0.5); background: rgba(var(--fp-calm-wait-rgb), 0.1); color: var(--fp-calm-wait) !important; }
.fp-calm-btn-sm { min-height: 32px; padding: 0 12px; font-size: 14px; }
.fp-calm-btn-wide { width: 100%; }
.fp-calm-btn-dashed { width: 100%; border-style: dashed; background: transparent; }
.fp-calm-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px;
    border: 1px solid var(--fp-calm-line); background: transparent; color: var(--fp-calm-muted); cursor: pointer;
}
.fp-calm-icon-btn:hover { color: var(--fp-calm-text); border-color: var(--fp-n-58); }

/* Dialogs: native <dialog>, opened with showModal(); [data-close] closes (fp-shell.js). */
dialog.fp-calm-dlg {
    width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border-radius: 16px;
    border: 1px solid var(--fp-calm-line); background: var(--fp-calm-card); color: var(--fp-calm-text);
    box-shadow: 0 24px 60px rgba(var(--fp-n-00-rgb), 0.55); overflow: hidden;
}
dialog.fp-calm-dlg[open] { display: flex; flex-direction: column; }
dialog.fp-calm-dlg.fp-calm-dlg-sm { width: min(560px, calc(100vw - 24px)); }
dialog.fp-calm-dlg::backdrop { background: rgba(var(--fp-n-00-rgb), 0.6); }
.fp-calm-dlg-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--fp-calm-line); }
.fp-calm-dlg-head h2 { flex: 1 1 auto; margin: 0; font-size: 19px; font-weight: 600; }
.fp-calm-dlg-body { padding: 20px 22px; overflow-y: auto; }
.fp-calm-dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--fp-calm-line); }
.fp-calm-dlg-foot .fp-spacer { flex: 1 1 auto; }

/* The ask dialog (fp-shell.js window.fpAsk, RS-5): the calm dialog with a line of text and, for a
   prompt, one field. */
.fp-ask .fp-calm-dlg-body { display: flex; flex-direction: column; gap: 12px; }
.fp-ask .fp-ask-text { margin: 0; line-height: 1.5; white-space: pre-line; }
.fp-ask form { display: contents; }

/* The bridge: the few utility class names older page scripts still write into the page. */
body.fp-calm :is(.text-muted, .small) { color: var(--fp-calm-muted); }
body.fp-calm .small { font-size: 13px; }
body.fp-calm .text-danger { color: var(--fp-calm-wait); }
body.fp-calm .text-warning { color: var(--fp-calm-work); }
body.fp-calm .text-info { color: var(--fp-calm-accent); }
body.fp-calm .text-center { text-align: center; }
body.fp-calm .d-block { display: block; }
body.fp-calm .d-flex { display: flex; }
body.fp-calm .gap-2 { gap: 8px; }
body.fp-calm .mt-1 { margin-top: 4px; }
body.fp-calm .mt-3 { margin-top: 16px; }
body.fp-calm .mb-2 { margin-bottom: 8px; }
body.fp-calm .me-1 { margin-right: 4px; }
body.fp-calm .me-2 { margin-right: 8px; }
body.fp-calm .btn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--fp-calm-line); background: transparent; color: var(--fp-calm-text); font: inherit; font-size: 14px;
}
body.fp-calm .btn-outline-info { border-color: rgba(var(--fp-calm-accent-rgb), 0.5); color: var(--fp-calm-accent); }
body.fp-calm .form-control-sm { min-height: 34px; font-size: 14px; }
body.fp-calm .table-responsive { overflow-x: auto; }
body.fp-calm .table { width: 100%; border-collapse: collapse; font-size: 14px; }
body.fp-calm .table :is(th, td) { padding: 8px 10px; border-bottom: 1px solid var(--fp-calm-line); text-align: left; }
body.fp-calm .table th { font-size: 13px; color: var(--fp-calm-muted); font-weight: 600; }

/* The section colour switch (Settings › single colour off): a section's own colour on its
   sidebar icon and its page-name icon only. */
.fp-side-in i[style], .fp-calm-name i[style] { opacity: 1; }

@media (max-width: 1100px) { .fp-calm-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
    .fp-calm-page { padding: 14px 14px 40px; }
    .fp-calm-name { font-size: 22px; }
    .fp-calm-bar-in .fp-nav-end { flex-wrap: wrap; flex: 1 1 100%; margin-left: 0; }
    .fp-calm-search { min-width: 0; flex: 1 1 100%; order: 5; }
    .fp-calm-grid { grid-template-columns: minmax(0, 1fr); }
    .fp-calm-grid > :is(.span-2, .span-3, .span-4) { grid-column: 1 / -1; }
    .fp-calm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Toasts (fp-shell.js window.notify): bottom right, one accent stripe by kind. */
.fp-calm-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.fp-calm-toast {
    padding: 12px 16px; border-radius: 12px; border: 1px solid var(--fp-calm-line); background: var(--fp-calm-card); color: var(--fp-calm-text);
    font-size: 15px; box-shadow: 0 12px 30px rgba(var(--fp-n-00-rgb), 0.45), inset 3px 0 0 var(--fp-calm-accent);
}
.fp-calm-toast-success { box-shadow: 0 12px 30px rgba(var(--fp-n-00-rgb), 0.45), inset 3px 0 0 var(--fp-calm-done); }
.fp-calm-toast-warning { box-shadow: 0 12px 30px rgba(var(--fp-n-00-rgb), 0.45), inset 3px 0 0 var(--fp-calm-work); }
.fp-calm-toast-error { box-shadow: 0 12px 30px rgba(var(--fp-n-00-rgb), 0.45), inset 3px 0 0 var(--fp-calm-wait); }

/* The list-first layout (TS): a narrow picker column on the left, the work on the right. */
.fp-calm-cols-left { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.fp-calm-pager { display: inline-flex; align-items: center; gap: 6px; }
.fp-calm-pager-label { min-width: 180px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .fp-calm-cols-left { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .fp-calm-pager-label { min-width: 0; flex: 1 1 auto; } .fp-calm-pager { flex: 1 1 100%; } }

/* ── RS (claude/DESIGN_AUDIT_RS_PLAN.md RS-1..RS-4): the platform kit on a calm page ─────────────
   The pages built on the platform kit above (Projects, the project page, Customers, the customer
   and site pages, Leads, Team, the person page, and Settings › Projects through the shared project
   scripts) keep their class names; on a calm page (body.fp-calm) those classes draw in the calm
   look: the system font, the calm tokens, no glows, no upper-case letter-spaced titles. The phone
   (FieldLink's My Projects, .fp-phone) never carries body.fp-calm, so it keeps its look (RS-12).
   Tokens only. */
body.fp-calm :is(.fp-embed, .fp-dlg) { font-family: inherit; font-weight: 400; color: var(--fp-calm-text); }
body.fp-calm :is(.fp-btn-glow, .fp-btn-act, .fp-btn-icon, .fp-btn-link, .fp-seg button, .fp-tab, .fp-menu-item, .fp-search input) { font-family: inherit; }
body.fp-calm :is(.fp-mono, .fp-num, .fp-count, .fp-stat-value) { font-family: inherit; font-variant-numeric: tabular-nums; }
body.fp-calm :where(.fp-calm-page, .fp-dlg, .fp-embed) :where(button, select, input, textarea) { font: inherit; color: inherit; }
body.fp-calm :where(.fp-calm-page, .fp-dlg) button:disabled { cursor: not-allowed; opacity: 0.55; }

/* Buttons: the glow button is the filled main action; the action button is the calm neutral one. */
body.fp-calm .fp-btn-glow, body.fp-calm .fp-btn-act {
    height: auto; min-height: 40px; padding: 0 16px; border-radius: 10px; gap: 6px;
    text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 600; box-shadow: none; transition: background 0.15s;
}
body.fp-calm .fp-btn-glow { background: var(--fp-calm-accent); border: 1px solid var(--fp-calm-accent); color: var(--fp-calm-ground); }
body.fp-calm .fp-btn-glow:hover:not(:disabled) { background: color-mix(in srgb, var(--fp-calm-accent) 85%, var(--fp-n-100)); color: var(--fp-calm-ground); box-shadow: none; }
body.fp-calm .fp-btn-act { background: transparent; border: 1px solid var(--fp-calm-line); color: var(--fp-calm-text); }
body.fp-calm .fp-btn-act:hover:not(:disabled) { background: rgba(var(--fp-n-58-rgb), 0.12); color: var(--fp-calm-text); border-color: var(--fp-calm-line); }
body.fp-calm .fp-btn-sm { min-height: 32px; height: 32px; padding: 0 12px; font-size: 14px; }
body.fp-calm .fp-btn-danger { color: var(--fp-calm-wait); border-color: rgba(var(--fp-calm-wait-rgb), 0.5); }
body.fp-calm .fp-btn-danger:hover:not(:disabled) { color: var(--fp-calm-wait); background: rgba(var(--fp-calm-wait-rgb), 0.1); border-color: rgba(var(--fp-calm-wait-rgb), 0.5); }
body.fp-calm .fp-btn-icon { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--fp-calm-line); color: var(--fp-calm-muted); }
body.fp-calm .fp-btn-icon:hover:not(:disabled) { background: transparent; color: var(--fp-calm-text); border-color: var(--fp-n-58); }
body.fp-calm .fp-btn-icon.fp-btn-sm { width: 30px; height: 30px; min-height: 0; padding: 0; }
body.fp-calm .fp-btn-link { color: var(--fp-calm-accent); font-size: 14px; font-weight: 600; }
body.fp-calm .fp-btn-link:hover:not(:disabled) { color: var(--fp-calm-accent); background: rgba(var(--fp-calm-accent-rgb), 0.1); }

/* Stat cards (RS-2): calm cards, the label above the number, the system font, no glow bar. */
body.fp-calm .fp-stat {
    background: var(--fp-calm-card); border: 1px solid var(--fp-calm-line); border-radius: 14px; padding: 14px 16px;
    gap: 2px; color: var(--fp-calm-text); box-shadow: none;
}
body.fp-calm .fp-stat::before { content: none; }
body.fp-calm .fp-stat:hover { border-color: var(--fp-calm-line); box-shadow: none; }
body.fp-calm button.fp-stat { font: inherit; cursor: pointer; }
body.fp-calm button.fp-stat:hover { border-color: var(--fp-n-58); }
body.fp-calm button.fp-stat[aria-pressed="true"] { border-color: var(--fp-calm-accent); }
body.fp-calm .fp-stat-label { order: -1; margin: 0; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--fp-calm-muted); }
body.fp-calm .fp-stat-value { font-size: 26px; font-weight: 600; line-height: 1.2; color: var(--fp-calm-text); }
body.fp-calm .fp-stat-value.fp-stat-value-sm { font-size: 22px; }
body.fp-calm :is(.fp-stat-sub, .fp-stat-aside) { font-size: 13px; color: var(--fp-calm-muted); }

/* Bars */
body.fp-calm .fp-bar { background: rgba(var(--fp-n-58-rgb), 0.18); border-radius: 4px; }
body.fp-calm .fp-bar > span { background: var(--fp-calm-accent); box-shadow: none; }
body.fp-calm .fp-bar > span.is-done { background: var(--fp-calm-done); box-shadow: none; }
body.fp-calm .fp-bar > span.is-blocked { background: var(--fp-calm-wait); box-shadow: none; }
body.fp-calm .fp-bar > span:is(.is-over, .is-amber) { background: var(--fp-calm-work); box-shadow: none; }

/* Panels: calm cards with a plain title. */
body.fp-calm .fp-panel { background: var(--fp-calm-card); border: 1px solid var(--fp-calm-line); border-radius: 14px; }
body.fp-calm .fp-panel-head { padding: 14px 20px; border-bottom: 1px solid var(--fp-calm-line); }
body.fp-calm h2.fp-panel-title, body.fp-calm .fp-panel-title {
    font-family: inherit; font-size: 17px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--fp-calm-text) !important;
}
body.fp-calm :is(.fp-panel-hint, .fp-panel-foot) { font-size: 13px; color: var(--fp-calm-muted); }
body.fp-calm .fp-panel-body { padding: 16px 20px; }
body.fp-calm .fp-panel-line { padding: 10px 20px; border-bottom: 1px solid var(--fp-calm-line); }
body.fp-calm .fp-panel-dashed { background: transparent; border: 1px dashed var(--fp-calm-line); }
body.fp-calm .fp-panel-dashed h2.fp-panel-title { color: var(--fp-calm-muted) !important; }
body.fp-calm .fp-empty { color: var(--fp-calm-muted); }
body.fp-calm .fp-kv > :nth-child(odd) { color: var(--fp-calm-muted); }

/* Status pills (RS-4): calm chips in the Service Calls colours. */
body.fp-calm .fp-pill { height: 24px; padding: 0 10px; border: 0; border-radius: 12px; font-size: 12px; font-weight: 600; box-shadow: none; }
body.fp-calm .fp-pill-active { background: rgba(var(--fp-calm-done-rgb), 0.14); color: var(--fp-calm-done); }
body.fp-calm .fp-pill-waiting { background: rgba(var(--fp-calm-work-rgb), 0.14); color: var(--fp-calm-work); }
body.fp-calm .fp-pill-blocked { background: rgba(var(--fp-calm-wait-rgb), 0.16); color: var(--fp-calm-wait); }
body.fp-calm .fp-pill-done { background: rgba(var(--fp-n-58-rgb), 0.16); color: var(--fp-n-82); }
body.fp-calm .fp-pill-info { background: rgba(var(--fp-calm-accent-rgb), 0.14); color: var(--fp-calm-accent); }
body.fp-calm .fp-pill-warn { background: rgba(var(--fp-calm-work-rgb), 0.1); color: var(--fp-calm-work); }
body.fp-calm .fp-tag { border-color: var(--fp-calm-line); color: var(--fp-n-82); }
body.fp-calm .fp-dot-open { background: var(--fp-calm-accent); box-shadow: none; }
body.fp-calm .fp-dot-active { background: var(--fp-calm-done); }
body.fp-calm .fp-dot-waiting { background: var(--fp-calm-work); }
body.fp-calm .fp-dot-blocked { background: var(--fp-calm-wait); }
body.fp-calm .fp-avatar { background: rgba(var(--fp-calm-accent-rgb), 0.2); color: var(--fp-calm-accent); font-weight: 700; }
body.fp-calm .fp-avatar.is-lead { box-shadow: 0 0 0 2px var(--fp-calm-card), 0 0 0 3px var(--fp-calm-accent); }
body.fp-calm .fp-avatar.is-helper { background: rgba(var(--fp-calm-done-rgb), 0.2); color: var(--fp-calm-done); }

/* The segmented switch, the search, the count: the calm ones. */
body.fp-calm .fp-seg { gap: 4px; padding: 4px; border: 0; border-radius: 12px; background: rgba(var(--fp-n-58-rgb), 0.1); }
body.fp-calm .fp-seg button { min-height: 34px; padding: 0 14px; border-radius: 9px; font-size: 14px; color: var(--fp-calm-muted); }
body.fp-calm .fp-seg button:hover { color: var(--fp-calm-text); }
body.fp-calm .fp-seg button[aria-pressed="true"] {
    background: var(--fp-calm-card); color: var(--fp-calm-text); box-shadow: 0 1px 2px rgba(var(--fp-n-00-rgb), 0.4);
}
body.fp-calm :is(.fp-seg-count, .fp-select-label) { color: var(--fp-calm-muted); }
body.fp-calm .fp-search {
    height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--fp-calm-line);
    background: var(--fp-calm-card); color: var(--fp-calm-muted);
}
body.fp-calm .fp-search input {
    border: 0 !important; background: transparent !important; height: 38px; min-height: 0; padding: 0 !important; box-shadow: none !important;
    width: 220px; font-size: 15px;
}
body.fp-calm .fp-count {
    display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border: 0; border-radius: 15px; font-size: 14px; font-weight: 600;
    background: rgba(var(--fp-calm-accent-rgb), 0.12); color: var(--fp-calm-accent);
}
/* The calm kit sizes every field to its column; in a toolbar or beside a label they keep their own width. */
body.fp-calm :is(.fp-toolbar, .fp-select-label, .fp-seg) :is(select, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"])) { width: auto; }

/* Fields */
body.fp-calm .fp-field { gap: 6px; font-size: 13px; font-weight: 600; color: var(--fp-calm-muted); }
body.fp-calm .fp-field > .fp-note { font-weight: 400; }
body.fp-calm .fp-check { font-size: 14px; color: var(--fp-calm-text); }
body.fp-calm .fp-check input { accent-color: var(--fp-calm-accent); }
body.fp-calm .fp-msg.is-error { color: var(--fp-calm-wait); }
body.fp-calm .fp-msg.is-ok { color: var(--fp-calm-done); }
body.fp-calm .fp-money-input > span {
    height: 40px; border-radius: 9px 0 0 9px; border-color: var(--fp-calm-line); background: var(--fp-calm-ground); color: var(--fp-calm-muted);
}
body.fp-calm .fp-money-input > input { border-radius: 0 9px 9px 0; }

/* Tabs (RS-3, the calm tab bar): plain words, the current one underlined in the accent.
   fp-shell.js moves along a [role="tablist"] with the arrow keys, Home and End. */
body.fp-calm .fp-tabs { gap: 4px; border-bottom: 1px solid var(--fp-calm-line); }
body.fp-calm .fp-tab {
    padding: 10px 14px; font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--fp-calm-muted);
    text-shadow: none; cursor: pointer;
}
body.fp-calm .fp-tab:hover { color: var(--fp-calm-text); }
body.fp-calm .fp-tab[aria-selected="true"] { color: var(--fp-calm-text); border-bottom-color: var(--fp-calm-accent); text-shadow: none; }
body.fp-calm .fp-tab-badge { background: rgba(var(--fp-n-58-rgb), 0.18); color: var(--fp-n-82); }

/* Tables */
body.fp-calm .fp-table th {
    font-size: 12px; letter-spacing: 0.05em; color: var(--fp-calm-muted); border-bottom: 1px solid var(--fp-calm-line);
}
body.fp-calm .fp-table td { border-top: 1px solid var(--fp-calm-line); }
body.fp-calm .fp-table tfoot td { border-top-color: var(--fp-n-58); }
body.fp-calm .fp-row:hover { background: rgba(var(--fp-n-58-rgb), 0.06); }
body.fp-calm .fp-row-link .fp-stretch { color: var(--fp-calm-text); }
body.fp-calm .fp-row-link:hover .fp-stretch { color: var(--fp-calm-accent); }

/* Menus */
body.fp-calm .fp-menu { background: var(--fp-calm-card); border: 1px solid var(--fp-calm-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(var(--fp-n-00-rgb), 0.5); }
body.fp-calm .fp-menu-item { color: var(--fp-calm-text); }
body.fp-calm .fp-menu-item:hover:not(:disabled) { background: rgba(var(--fp-n-58-rgb), 0.12); }
body.fp-calm .fp-menu-item .fp-menu-desc { color: var(--fp-calm-muted); }
body.fp-calm .fp-menu-item.fp-danger .fp-menu-name { color: var(--fp-calm-wait); }
body.fp-calm .fp-menu-sep { background: var(--fp-calm-line); }

/* Dialogs: the calm dialog look. */
body.fp-calm .fp-dlg {
    border-radius: 16px; border: 1px solid var(--fp-calm-line); background: var(--fp-calm-card);
    box-shadow: 0 24px 60px rgba(var(--fp-n-00-rgb), 0.55); font-size: 15px;
}
body.fp-calm .fp-dlg::backdrop { background: rgba(var(--fp-n-00-rgb), 0.6); }
body.fp-calm .fp-dlg-head { padding: 18px 22px; border-bottom: 1px solid var(--fp-calm-line); }
body.fp-calm h2.fp-dlg-title, body.fp-calm .fp-dlg-title {
    font-size: 19px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--fp-calm-text) !important;
}
body.fp-calm .fp-dlg-body { padding: 20px 22px; }
body.fp-calm .fp-dlg-foot { padding: 14px 22px; border-top: 1px solid var(--fp-calm-line); }
body.fp-calm :is(.fp-page, .fp-dlg, .fp-calm-page) :is(button, input, select, textarea, a, [tabindex]):focus-visible {
    outline: 2px solid var(--fp-calm-accent); outline-offset: 2px;
}

/* The phase editor (Settings › Projects and the project page) */
body.fp-calm .fp-pe-phase { border: 1px solid var(--fp-calm-line); border-radius: 12px; background: rgba(var(--fp-n-58-rgb), 0.04); }
body.fp-calm .fp-pe-n { color: var(--fp-calm-accent); border-color: rgba(var(--fp-calm-accent-rgb), 0.5); }
body.fp-calm .fp-pe-cam { color: var(--fp-calm-muted); }

/* Text colours */
body.fp-calm :is(.fp-muted, .fp-sub, .fp-note) { color: var(--fp-calm-muted); }
body.fp-calm .fp-note { font-size: 13px; }
body.fp-calm .fp-sub { font-size: 13px; }
body.fp-calm .fp-warn-text { color: var(--fp-calm-work); }
body.fp-calm .fp-good-text { color: var(--fp-calm-done); }
body.fp-calm .fp-amber-text { color: var(--fp-calm-work); }
body.fp-calm .fp-dim-text { color: var(--fp-n-82); }
@media (max-width: 900px) {
    body.fp-calm .fp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.fp-calm .fp-search { flex: 1 1 100%; }
    body.fp-calm .fp-search input { width: 100%; }
}

/* ── RS-8 (claude/DESIGN_AUDIT_RS_PLAN.md): the calm centred card ─────────────────────────────────
   The pages outside the menu (sign-in and its code step, the invite, the public request form, the
   error pages) are one card on the calm ground: <body class="fp-calm fp-calm-solo-page"> and a
   .fp-calm-solo card. The calm fields and buttons above apply inside it. Nothing loads from
   outside, and it works on a phone. Tokens only. */
body.fp-calm.fp-calm-solo-page { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.fp-calm-solo {
    width: min(420px, 100%); padding: 30px 28px; border-radius: 16px; border: 1px solid var(--fp-calm-line);
    background: var(--fp-calm-card); box-shadow: 0 24px 60px rgba(var(--fp-n-00-rgb), 0.35);
}
.fp-calm-solo.is-wide { width: min(560px, 100%); }
.fp-calm-solo-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.fp-calm-solo-brand .fp-side-names { min-width: 0; }
.fp-calm-solo h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; line-height: 1.25; }
.fp-calm-solo-lead { margin: 0 0 18px !important; font-size: 15px; line-height: 1.5; color: var(--fp-calm-muted); }
.fp-calm-solo-form { display: flex; flex-direction: column; gap: 14px; }
.fp-calm-solo-alert {
    margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; font-size: 14px; line-height: 1.45;
    border: 1px solid rgba(var(--fp-calm-wait-rgb), 0.45); background: rgba(var(--fp-calm-wait-rgb), 0.1); color: var(--fp-calm-text);
}
.fp-calm-solo-alert.is-ok { border-color: rgba(var(--fp-calm-done-rgb), 0.45); background: rgba(var(--fp-calm-done-rgb), 0.1); }
.fp-calm-solo .fp-calm-btn-primary { width: 100%; min-height: 46px; gap: 8px; }
.fp-calm-solo-link {
    display: block; width: 100%; margin-top: 8px; padding: 8px; border: 0; background: none; color: var(--fp-calm-accent);
    font: inherit; font-size: 14px; text-align: center; text-decoration: underline; cursor: pointer;
}
.fp-calm-solo-link.is-quiet { color: var(--fp-calm-muted); }
.fp-calm-solo-link:disabled { color: var(--fp-calm-muted); text-decoration: none; cursor: default; }
.fp-calm-solo-note { margin: 14px 0 0 !important; font-size: 13px; line-height: 1.45; color: var(--fp-calm-muted); }
@media (max-width: 480px) {
    body.fp-calm.fp-calm-solo-page { align-items: flex-start; padding: 16px 12px; }
    .fp-calm-solo { padding: 24px 18px; }
}
/* RS-10: the error page (core/ui/errors.py) is this card: a small label, the message, Back to Home. */
.fp-calm-error-code { margin: 0 0 8px !important; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--fp-calm-muted); }
.fp-calm-error-home { margin: 6px 0 0 !important; }
.fp-calm-error-home a {
    display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 10px; font-weight: 600;
    text-decoration: none; background: var(--fp-calm-accent); color: var(--fp-calm-ground) !important;
}
.fp-calm-error-home a:hover { background: color-mix(in srgb, var(--fp-calm-accent) 85%, var(--fp-n-100)); }
.fp-calm-solo-form .fp-calm-section { margin: 10px 0 0 !important; }

/* ── PX-1/PX-2 (claude/POLISH_PX_PLAN.md): fp-fold, one way to fold a side panel ────────────────
   <section class="fp-fold [fp-fold-end] [is-folded]" data-fold="key"> with a .fp-fold-head (its
   title, then the .fp-fold-btn) and the panel's body after it. The button sits at the top of the
   panel, on the edge that faces the page (« on a left panel, » on a right one, .fp-fold-end).
   Folded, the panel is a slim strip: the button at its top, the title down its side. fp-shell.js
   keeps the choice in the fp_fold cookie, so the server draws the page folded before the first
   paint (no jump). Folding is for a computer: at 1100px and under (where the columns stack, and on
   a phone) the button hides and every panel shows in full. Calendar's
   and Dispatch's own fold buttons wear the same .fp-fold-btn. */
.fp-fold-head { display: flex; align-items: center; gap: 10px; }
.fp-fold-btn {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
    margin-left: auto; padding: 0; border-radius: 9px; border: 1px solid var(--fp-calm-line); background: transparent;
    color: var(--fp-calm-muted); font-size: 14px; cursor: pointer;
}
.fp-fold-btn:hover { color: var(--fp-calm-accent); border-color: rgba(var(--fp-calm-accent-rgb), 0.5); }
.fp-fold-end .fp-fold-btn { margin-left: 0; }  /* a right panel: the button comes first, on the edge facing the page */
@media (min-width: 1101px) {
    .fp-fold.is-folded > :not(.fp-fold-head) { display: none !important; }
    .fp-fold.is-folded { align-self: stretch; padding: 0 !important; }
    .fp-fold.is-folded > .fp-fold-head { flex-direction: column; align-items: center; gap: 14px; margin: 0; padding: 12px 0 !important; border: 0; }
    .fp-fold.is-folded .fp-fold-btn { order: -1; margin: 0; }  /* the button at the strip's top, the title under it */
    .fp-fold.is-folded .fp-fold-btn i { transform: rotate(180deg); }
    .fp-fold.is-folded .fp-fold-head > :not(.fp-fold-btn) {
        margin: 0; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 14px; white-space: nowrap;
    }
    .fp-calm-cols-left:has(> .fp-fold.is-folded:first-child) { grid-template-columns: 56px minmax(0, 1fr); }
    .fp-calm-cols:has(> .fp-fold.is-folded:last-child) { grid-template-columns: minmax(0, 1fr) 56px; }
}
@media (max-width: 1100px) { .fp-fold > .fp-fold-head .fp-fold-btn { display: none; } }
@media (prefers-reduced-motion: no-preference) { .fp-fold-btn i { transition: transform 0.16s ease; } }

/* ── PX-3: the calm file picker. The browser's own "Choose File" control is kept (it opens the
   picker and holds the file) but drawn as a calm button and the chosen file's name:
   <label|span class="fp-calm-file"><input type="file"><span class="fp-calm-file-btn">Choose a file…</span>
   <span class="fp-calm-file-name">No file chosen</span></…>. The input stays focusable; its focus
   ring shows on the button. fp-shell.js writes the name (window.fpFile.sync after a script clears it). */
.fp-calm-file { position: relative; display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; cursor: pointer; }
.fp-calm-file input[type="file"] {
    position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; margin: 0 !important;
    padding: 0 !important; border: 0 !important; opacity: 0 !important; cursor: pointer; font-size: 0;
}
.fp-calm-file-btn {
    flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--fp-calm-line); color: var(--fp-calm-text); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.fp-calm-file:hover .fp-calm-file-btn { border-color: var(--fp-n-58); }
.fp-calm-file input[type="file"]:focus-visible + .fp-calm-file-btn { outline: 2px solid var(--fp-calm-accent); outline-offset: 2px; }
.fp-calm-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--fp-calm-muted); }
.fp-calm-file.has-file .fp-calm-file-name { color: var(--fp-calm-text); }

/* ── PX-8: the phone bar. Menu, the page's name and the user menu share the top row; the page's
   own buttons (and its search) wrap onto the rows below. The end group's items join the bar's
   rows (display: contents) so the user menu can sit top right; a zero-height break keeps the rest
   off the top row. */
@media (max-width: 900px) {
    .fp-calm-bar-in { row-gap: 0; }
    .fp-calm-bar-in .fp-nav-end { display: contents; }
    .fp-calm-bar-in > *, .fp-calm-bar-in .fp-nav-end > * { order: 3; margin-top: 10px; }
    .fp-calm-bar-in > .fp-side-toggle { order: 0; margin-top: 0; }
    .fp-calm-bar-in > .fp-calm-name { order: 1; flex: 1 1 auto; min-width: 0; margin-top: 0; }
    .fp-calm-bar-in .fp-nav-end > .fp-um { order: 2; margin: 0 0 0 auto; }
    .fp-calm-bar-in::after { content: ""; order: 2; flex: 0 0 100%; height: 0; }
    .fp-calm-bar-in .fp-calm-search { order: 5; }
}
