/* The iPhone look: one layer on top of styles.css, so it can come off in one
   step (remove the link in index.html). Frosted charcoal bars and side menu,
   with the menu's icons in coloured tiles as in Settings and the page you're
   on in the company's orange; the page title
   big at the top and small in the bar once it scrolls away (main.js); grouped
   white cards on a soft grey, with no outlines; capsule buttons; iPhone-style
   switches, round checks and segmented controls; pages that slide in from the
   right and back from the left; banners that drop from the top; and "Are you
   sure?" as a sheet from the bottom (ConfirmButton in ui.js). On an iPhone or
   a Mac it uses the system font; elsewhere it keeps Inter. */

:root {
  --bg: #F2F2F7; /* the light background, back after trying orange and a warm greige (AJ, 2026-11-15) */
  --surface: #FFFFFF;
  --surface-2: #F2F2F5;
  --line: rgba(60, 60, 67, .14);
  --line-strong: rgba(60, 60, 67, .26);
  --muted: #6C6C70;
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --bar: rgba(28, 30, 34, .88);
  --on-bar: rgba(235, 235, 245, .62);
  --hair: .5px solid rgba(60, 60, 67, .29);
  --r: 10px;
  --r-sm: 8px;
  --shadow: none;
  --spring: cubic-bezier(.32, .72, 0, 1);
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}
/* The trade partner portal keeps its navy in place of the charcoal. */
html.pro { --bar: rgba(16, 36, 58, .9); }
body { background: var(--bg); letter-spacing: -.005em; }

/* ---- Words and buttons sitting straight on the page colour, not in a card:
   grey words turn a see-through black so they read on it (and still on
   white), and links and quiet buttons go dark. Inside cards, everything is as
   usual. ---- */
.page { --muted: rgba(0, 0, 0, .64); }
.page :is(.card, .kpi, .note, .client-jump) { --muted: #6C6C70; }
.page :is(.back, .back-link, .sec-head a:not(.btn), .sec-head .linkbtn, .page > * > a:not(.btn)):not(.card *, .kpi *, .note *) { color: var(--ink); font-weight: 600; }
.page .btn.ghost:not(.card *, .kpi *, .note *, [class*="hero"] *, .savebar *) { color: var(--ink); }
.page .btn.ghost.danger:not(.card *, .kpi *, .note *, [class*="hero"] *, .savebar *) { color: #7F1D1D; }
.page > * > .btn:not(.primary, .ghost), .page .sec-head .btn:not(.primary, .ghost) { background: rgba(255, 255, 255, .92); color: var(--ink); }
.page .sector-col .sector-head { color: var(--ink); }
.page .sector-residential .sector-head { border-left-color: #0F766E; }
.page .sector-commercial .sector-head { border-left-color: #4338CA; }
/* The trade partner portal keeps its own light background (html.pro in styles.css). */

/* ---- Titles: a big bold page title, like Mail, Notes and Settings ---- */
.h-page { font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.h-hero { font-weight: 650; letter-spacing: -.02em; }
.h-sec { font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.h-card { font-size: 16px; font-weight: 600; letter-spacing: -.005em; }
.eyebrow { letter-spacing: .04em; }

/* ---- Cards: white, a modest corner, a hairline and a soft, tight shadow under them ---- */
.card { border: 0; border-radius: 14px; box-shadow: 0 0 0 .5px rgba(17, 24, 39, .1), 0 1px 2px rgba(17, 24, 39, .05), 0 12px 24px -16px rgba(17, 24, 39, .22); }
.card:hover { box-shadow: 0 0 0 .5px rgba(17, 24, 39, .1), 0 1px 2px rgba(17, 24, 39, .05), 0 12px 24px -16px rgba(17, 24, 39, .22); }
.pcard:hover { box-shadow: 0 0 0 .5px rgba(17, 24, 39, .14), 0 2px 4px rgba(17, 24, 39, .06), 0 18px 32px -16px rgba(17, 24, 39, .3); }

/* ---- The numbers along the top of a page: separate tiles, the label in grey
   over the number. Red only when something's wrong. ---- */
.kpis { background: transparent; border: 0; gap: 10px; overflow: visible; }
.kpis .kpi {
  border: 0; border-radius: 14px; padding: 12px 14px 14px; gap: 4px;
  box-shadow: 0 0 0 .5px rgba(17, 24, 39, .1), 0 1px 2px rgba(17, 24, 39, .05), 0 12px 24px -16px rgba(17, 24, 39, .22);
}
.kpis .kpi-l { order: -1; font-size: 13px; font-weight: 600; color: var(--muted); }
.kpis .kpi.tone-crit .kpi-l { color: var(--crit); }
.kpis .kpi.tone-warn .kpi-l { color: var(--warn); }
.kpis .kpi-n { font-weight: 600; letter-spacing: -.02em; }
.kpis a.kpi:active { transform: scale(.98); }

/* ---- A project's header: charcoal like the side menu, the name in white,
   the kind, address and progress in the company's orange ---- */
.phead {
  display: flex; flex-direction: column; gap: 14px; color: var(--on-dark);
  background: var(--charcoal) linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 55%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .1), 0 12px 24px -16px rgba(17, 24, 39, .5);
}
/* The same header on every tab of a project, with everything on it (AJ,
   2026-11-15: it shouldn't disappear or lose anything between tabs). */
.phead-open { display: flex; flex-direction: column; gap: 14px; }
.phead-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.phead-chips { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.phead .phead-stats { margin: 0; padding: 12px 0 2px; border-top: .5px solid rgba(255, 255, 255, .12); }
.phead .hs-n { font-size: 32px; }
.phead .hs-v { font-size: 16px; font-weight: 650; }
.phead .phead-side { flex-direction: row; flex-wrap: wrap; align-items: center; }
.phead .h-hero { color: #FFFFFF; }
.phead .eyebrow { color: var(--brand); }
.phead .muted, .phead .dates, .phead .prog-l { color: var(--on-dark-muted); }
.phead a { color: #FF9F45; }
.phead .bar { background: #464643; border-color: #52514D; }
/* (.card.phead: stronger than the button and box rules further down) */
.card.phead .btn, .card.phead select { background-color: rgba(255, 255, 255, .14); color: #FFFFFF; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .14); }
.card.phead .btn:hover { background-color: rgba(255, 255, 255, .22); }
.phead select option { color: #111827; }
.phead .star { color: rgba(235, 235, 245, .6); }
.phead .star.on { color: var(--brand); }

/* ---- Buttons: capsules. Grey for most, the company colour for the main one,
   plain coloured words for the quiet ones, red words for the risky ones. ---- */
.btn, .btn.small, .btn.big {
  border: 0; border-radius: 9px; background: #FFFFFF; color: var(--ink); font-weight: 600;
  box-shadow: 0 0 0 .5px rgba(17, 24, 39, .18), 0 1px 1.5px rgba(17, 24, 39, .1);
}
.btn:hover { background: #F6F6F7; border-color: transparent; }
.btn.primary {
  background: var(--btn) linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0)); color: #FFFFFF;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .18), 0 1px 2px rgba(120, 56, 6, .35);
}
.btn.primary:hover { background-color: var(--btn-hover); }
.btn.big { border-radius: 10px; min-height: 48px; font-size: 16px; }
.btn.ghost { background: transparent; color: var(--btn); box-shadow: none; }
.btn.ghost:hover { background: var(--fill); color: var(--btn); }
/* A note inside a project's dark header is light, so its buttons are the
   ordinary ones (the header's own are white on dark, which can't be read here). */
.card.phead .note .btn { background-color: #FFFFFF; color: var(--ink); box-shadow: 0 0 0 .5px rgba(17, 24, 39, .18), 0 1px 1.5px rgba(17, 24, 39, .08); }
.card.phead .note .btn:hover { background-color: #F6F6F7; }
.card.phead .note .btn.primary { background-color: var(--btn); color: #FFFFFF; box-shadow: 0 1px 2px rgba(17, 24, 39, .18); }
.card.phead .note .btn.primary:hover { background-color: var(--btn-hover); }
.card.phead .note .btn.ghost { background-color: transparent; color: var(--btn); box-shadow: none; }
.btn.danger, .btn.ghost.danger { background: transparent; border: 0; color: var(--crit); box-shadow: none; }
.btn.danger:hover, .btn.ghost.danger:hover { background: rgba(180, 35, 24, .08); color: var(--crit); }
.btn.armed, .btn.danger.armed { background: var(--crit); color: #FFFFFF; }
.btn:disabled { opacity: .45; }

/* Buttons on the dark panels (Today's plan, the save bar, the client's
   estimate cover and its bar, the full-screen plan): white, so they show. */
.plan-hero-head .btn, .savebar .btn:not(.primary), .prop-cover .btn:not(.primary), .plan-full .btn:not(.primary), .prop-bar .btn:not(.primary) {
  background: #FFFFFF; color: var(--ink);
}
.plan-hero-head .btn:hover, .savebar .btn:not(.primary):hover, .prop-cover .btn:not(.primary):hover, .plan-full .btn:not(.primary):hover, .prop-bar .btn:not(.primary):hover { background: #EDEDF0; }
.savebar .btn.ghost, .prop-bar .btn.ghost { background: transparent; color: #FFFFFF; }

/* ---- Typing boxes: soft grey fills that turn white with a ring when you type ---- */
input:not([type]), input[type="text"], input[type="email"], input[type="date"], input[type="time"], input[type="number"], input[type="tel"], input[type="search"], input[type="url"], select, textarea {
  border: 0; background-color: var(--fill); border-radius: 8px; box-shadow: none;
}
input:not([type]):focus, input[type="text"]:focus, input[type="email"]:focus, input[type="date"]:focus, input[type="time"]:focus, input[type="number"]:focus, input[type="tel"]:focus, input[type="search"]:focus, input[type="url"]:focus, select:focus, textarea:focus {
  background-color: #FFFFFF; box-shadow: 0 0 0 2px var(--btn); border-color: transparent;
}
select.select-inline, .phead-side select { border: 0; background-color: var(--fill); }
/* Search boxes with an icon: the grey is on the box, the typing area inside stays clear. */
.board-search { border: 0; background: var(--fill); border-radius: 8px; }
.board-search:focus-within { background: #FFFFFF; box-shadow: 0 0 0 2px var(--btn); }
.board-search input, .board-search input:focus, .find-head input, .find-head input:focus { background: transparent; box-shadow: none; border-radius: 0; }
.find-head { border-bottom: var(--hair); }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---- Ticks: round, like Reminders. Filled in the company colour when on. ---- */
input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: none; appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border-radius: 50%;
  border: 1.5px solid rgba(60, 60, 67, .36); background: #FFFFFF; display: inline-grid; place-content: center; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .12s ease; vertical-align: middle;
}
input[type="checkbox"]::after {
  content: ""; width: 10px; height: 6px; border: solid #FFFFFF; border-width: 0 0 2.2px 2.2px; transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform .15s var(--spring);
}
input[type="radio"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #FFFFFF; transform: scale(0); transition: transform .15s var(--spring); }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--btn); border-color: var(--btn); }
input[type="checkbox"]:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
input[type="radio"]:checked::after { transform: scale(1); }
input[type="checkbox"]:active, input[type="radio"]:active { transform: scale(.88); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .45; cursor: default; }

/* "Share with client" as an iPhone on/off switch, on the right of its words. */
.share { flex-direction: row-reverse; justify-content: space-between; align-items: center; border: 0; background: var(--surface-2); border-radius: 12px; }
.share.on { background: var(--surface-2); }
.share input[type="checkbox"] {
  position: relative; display: block; width: 50px; height: 30px; margin: 0; border: 0; border-radius: 999px; background: rgba(120, 120, 128, .2);
  transition: background-color .25s ease;
}
.share input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transform: none; transition: transform .3s var(--spring);
}
.share input[type="checkbox"]:checked { background: #34C759; }
.share input[type="checkbox"]:checked::after { transform: translateX(20px); }
.share input[type="checkbox"]:active { transform: none; }
.share input[type="checkbox"]:active::after { width: 30px; }
.share input[type="checkbox"]:checked:active::after { transform: translateX(16px); }

/* ---- Segmented controls: a grey track with a white thumb ---- */
.seg { border: 0; background: rgba(118, 118, 128, .12); border-radius: 10px; padding: 2px; gap: 2px; overflow: visible; }
.seg button { border-radius: 8px; min-height: 32px; padding: 5px 12px; color: var(--ink); font-weight: 600; font-size: 13px; }
.seg button + button { border-left: 0; }
.seg button[aria-pressed="true"] { background: #FFFFFF; color: var(--ink); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); }

/* Links in the company colour, without underlines, as in iPhone apps. */
a { color: var(--btn); text-decoration: none; }
.linkbtn, .link { color: var(--btn); text-decoration: none; font-weight: 600; }
.link.pcard-move { color: var(--muted); font-weight: 500; }
.dir-link { color: var(--btn); text-decoration: none; font-weight: 600; }
a:active, .linkbtn:active, .link:active { opacity: .5; }

/* ---- Chips: softer ---- */
.chip, .tag { border: 0; }

/* ---- The bar at the top (a phone, and clients on a computer): charcoal and
   frosted. The page's title shows in it once the big title scrolls away. ---- */
.topbar {
  position: sticky; top: 0; z-index: 45; background: var(--bar); color: #FFFFFF; border-bottom: .5px solid rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.topbar-in { position: relative; }
.topbar .brand-name { color: #FFFFFF; transition: opacity .2s ease; }
.topbar .brand-sub { transition: opacity .2s ease; }
.topbar .brand img { transition: opacity .2s ease; }
.topbar .brand { flex: 1; }
.brand-text { position: relative; flex: 1; min-width: 0; }
.nav-title {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-20%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: #FFFFFF; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .3s var(--spring);
}
.topbar.titled .nav-title { opacity: 1; transform: translateY(-50%); }
.topbar.titled .brand-name, .topbar.titled .brand-sub { opacity: 0; }
/* The company name goes quickly and the title comes in just after, so the two don't show on top of each other while scrolling. */
.topbar.titled .brand-name, .topbar.titled .brand-sub, .topbar.titled .brand img { transition-duration: .1s; }
.topbar.titled .nav-title { transition-delay: .08s; }
.me { color: var(--on-bar); }
.me button, .me .me-find, .me .me-refresh {
  background: rgba(255, 255, 255, .14); color: #FFFFFF; border: 0; border-radius: 8px; font-weight: 600;
}
.me button:hover { background: rgba(255, 255, 255, .22); }
.me button.armed { background: var(--crit); color: #FFFFFF; }
.pill { border-color: rgba(255, 255, 255, .2); color: var(--on-bar); }
.pill i { background: #8E8E93; }

/* ---- The menu down the side on a computer: charcoal, each icon in a glossy
   coloured tile, the page you're on in the company's orange ---- */
@media (min-width: 900px) {
  .side { background: var(--charcoal); color: #FFFFFF; border-right: 0; }
  .side .brand-name { color: #FFFFFF; }
  .side-nav a { gap: 12px; padding: 9px 12px; color: rgba(235, 235, 245, .8); font-weight: 500; font-size: 15px; }
  .side-nav a:hover { color: #FFFFFF; background: rgba(255, 255, 255, .07); }
  .side-nav a.on { color: #FFFFFF; background: var(--btn); box-shadow: none; font-weight: 600; }
  /* Each icon in a rounded-square tile of its own colour, with a little gloss. */
  .side-nav a { gap: 11px; padding: 6px 10px; }
  .side-nav a .ic {
    box-sizing: border-box; flex: none; width: 28px; height: 28px; padding: 5.5px; border-radius: 30%;
    color: #FFFFFF; background-color: #8E8E93; stroke-width: 2.1; background-image: linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 62%); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .1), 0 1px 2px rgba(0, 0, 0, .3);
  }
  .side-nav a[href="#/today"] .ic { background-color: #FF9500; }
  .side-nav a[href="#/"] .ic { background-color: #007AFF; }
  .side-nav a[href="#/schedule"] .ic { background-color: #FF3B30; }
  .side-nav a[href="#/bids"] .ic { background-color: #34C759; }
  .side-nav a[href="#/financials"] .ic { background-color: #5856D6; }
  .side-nav a[href="#/team"] .ic { background-color: #AF52DE; }
  .side-nav a[href="#/clients"] .ic { background-color: #FF2D55; }
  .side-nav a[href="#/suppliers"] .ic { background-color: #A2845E; }
  .side-nav a[href="#/checklists"] .ic { background-color: #30B0C7; }
  .side-nav a.on .ic { background-color: rgba(255, 255, 255, .26); background-image: none; box-shadow: none; }
  .side-nav a.on .side-badge { background: #FFFFFF; color: var(--btn); }
  .side-find { background: rgba(255, 255, 255, .1); border: 0; color: var(--on-bar); border-radius: 10px; }
  .side-find:hover { color: #FFFFFF; background: rgba(255, 255, 255, .16); }
  .side-find kbd { border-color: rgba(255, 255, 255, .25); }
  .side-foot { border-top: .5px solid rgba(255, 255, 255, .12); }
  .side-foot .pill { color: var(--on-bar); }
  .side-me b { color: #FFFFFF; }
  .side-me span:not(.avatar) { color: var(--on-bar); }
  .side-out { border: 0; background: rgba(255, 255, 255, .1); color: rgba(235, 235, 245, .85); border-radius: 10px; }
  .side-out:hover { color: #FFFFFF; background: rgba(255, 255, 255, .16); }
  .side-out.armed { background: var(--crit); color: #FFFFFF; }
}

/* ---- The tab bar on a phone: charcoal and frosted, coloured icon for where you are ---- */
@media (max-width: 899px) {
  .tabbar {
    background: var(--bar); border-top: .5px solid rgba(255, 255, 255, .08); box-shadow: none;
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    padding: 4px 2px calc(2px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar a { color: rgba(235, 235, 245, .55); font-size: 10.5px; font-weight: 500; padding: 5px 2px 3px; gap: 3px; border-radius: 10px; letter-spacing: 0; }
  .tabbar a .ic { width: 25px; height: 25px; }
  .tabbar a.on { background: var(--btn); color: #FFFFFF; }
  .tabbar a.on .ic { stroke-width: 2.3; }
  .tab-badge { top: 0; margin-left: 6px; border: 2px solid var(--charcoal); line-height: 14px; }
}

/* ---- Messages drop in from the top, like an iPhone banner ---- */
.toast {
  top: calc(10px + env(safe-area-inset-top, 0px)); bottom: auto; border-radius: 999px; padding: 11px 20px;
  background: rgba(28, 28, 30, .86); color: #FFFFFF; font-weight: 600; font-size: 15px; text-align: center;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  animation: toast-drop .45s var(--spring) backwards;
}
.app.with-nav .toast, .app.with-nav:has(.savebar) .toast { bottom: auto; }
.toast.bad { background: rgba(180, 35, 24, .94); }
@keyframes toast-drop { from { opacity: 0; transform: translate(-50%, -24px) scale(.96); } }

/* ---- Pages slide in from the right, and back from the left ---- */
/* (clipped at the sides, so no scroll bar flashes while a page slides in) */
.main { overflow-x: clip; }
.page-in { animation: ios-push .38s var(--spring) backwards; }
.page-back { animation: ios-pop .32s var(--spring) backwards; }
@keyframes ios-push { from { opacity: .4; transform: translateX(36px); } }
@keyframes ios-pop { from { opacity: .4; transform: translateX(-28px); } }

/* ---- Rows in lists light up grey when pressed, as in Settings ---- */
.find-main:active, .fin-line:active, .sum-posts li:active { background: rgba(118, 118, 128, .12); }

/* ---- "Are you sure?" as a sheet from the bottom (ConfirmButton in ui.js) ---- */
.ios-sheet-back {
  position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .32); display: flex; align-items: flex-end; justify-content: center;
  padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px)); animation: fade-in .2s ease-out backwards;
}
.ios-sheet { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; animation: ios-sheet-up .42s var(--spring) backwards; }
.ios-sheet-group { background: rgba(249, 249, 249, .94); border-radius: 14px; overflow: hidden; -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.ios-sheet-q { margin: 0; padding: 14px 18px; text-align: center; font-size: 13px; line-height: 1.35; color: var(--muted); border-bottom: var(--hair); white-space: normal; }
.ios-sheet button {
  display: block; width: 100%; min-height: 56px; padding: 0 16px; border: 0; background: transparent; font: inherit; font-size: 19px; color: #007AFF;
  cursor: pointer; white-space: normal;
}
.ios-sheet button:active { background: rgba(118, 118, 128, .16); }
.ios-sheet button.go { color: var(--btn); font-weight: 600; }
.ios-sheet button.go.risky { color: #FF3B30; }
.ios-sheet button.cancel { background: #FFFFFF; border-radius: 14px; font-weight: 600; color: #007AFF; }
@keyframes ios-sheet-up { from { transform: translateY(110%); } }
@media (min-width: 900px) {
  /* On a computer, a small alert in the middle, as on a Mac. */
  .ios-sheet-back { align-items: center; padding: 16px; }
  .ios-sheet { max-width: 300px; gap: 0; animation: ios-alert .3s var(--spring) backwards; }
  .ios-sheet-group { border-radius: 14px 14px 0 0; }
  .ios-sheet-q { font-size: 14px; color: var(--ink); font-weight: 600; padding: 18px 18px 14px; }
  .ios-sheet button { min-height: 46px; font-size: 16px; }
  .ios-sheet button.cancel { border-radius: 0 0 14px 14px; border-top: var(--hair); background: rgba(249, 249, 249, .94); }
  @keyframes ios-alert { from { opacity: 0; transform: scale(1.12); } }
}

/* ---- Pull down at the top of a page to load the latest (main.js, installed app) ---- */
.ptr {
  position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 44; width: 34px; height: 34px; margin-left: -17px;
  border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 10px rgba(0, 0, 0, .14); display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(-40px) scale(.6); pointer-events: none;
}
.ptr i { width: 16px; height: 16px; border-radius: 50%; border: 2.4px solid rgba(118, 118, 128, .3); border-top-color: var(--btn); }
.ptr.go i { animation: rc-spin .8s linear infinite; }

/* ---- Swiping back from the left edge (main.js): the page follows your finger ---- */
.page.swiping { transition: none !important; animation: none !important; }
.page.swipe-back { transition: transform .3s var(--spring), opacity .3s var(--spring); }

@media (max-width: 640px) {
  .h-page { font-size: 26px; }
  body { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .page-in, .page-back, .toast, .ios-sheet, .ios-sheet-back { animation: none !important; }
  input[type="checkbox"]:active, input[type="radio"]:active { transform: none; }
}

/* ---- Shapes and weight, refined (AJ, 2026-11-15: "cartoonish and not
   professional", "its not really the colours"). Modest corners in place of
   pills and bubbles, lighter headings, and a hairline with a tight shadow in
   place of soft floating ones. ---- */
.status-tile { border-radius: 10px; }
.status-tile .st-n { font-weight: 600; }
.sector-chips button, .who-acts a, .client-jump a, .recent-job { border-radius: 8px; }
.job-tabs a, .page .fin-tabs a { border-radius: 8px; }
.tabbar a { border-radius: 8px; }

/* A project's four sections each keep their colour: the open one is filled,
   the others have their name in it. The row of tabs under them sits on
   white; the open tab has a light wash of the section's colour. */
.tab-groups { border: 0; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 .5px rgba(17, 24, 39, .1), 0 1px 2px rgba(17, 24, 39, .05), 0 12px 24px -16px rgba(17, 24, 39, .22); }
.tab-groups a[data-g] { background: transparent; color: var(--g); font-weight: 650; }
.tab-groups a[data-g] + a[data-g] { border-left-color: var(--line); }
.tab-groups a[data-g]:hover { background: color-mix(in srgb, var(--g) 8%, #FFFFFF); color: var(--g); }
.tab-groups a[data-g].on { background: var(--g) linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0)); color: #FFFFFF; }
.job-tabs { border: 0; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 .5px rgba(17, 24, 39, .1), 0 1px 2px rgba(17, 24, 39, .05), 0 12px 24px -16px rgba(17, 24, 39, .22); }
.job-tabs a:hover { background: var(--surface-2); }
.job-tabs a.on { background: color-mix(in srgb, var(--g) 11%, #FFFFFF); color: var(--g); font-weight: 700; }
.job-tabs .t-badge { border-color: var(--surface); }
.job-tabs a.on .t-badge { border-color: #FFFFFF; }
.page .fin-tabs a[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 700; }
.page .fin-tabs { border-radius: 12px; box-shadow: 0 0 0 .5px rgba(17, 24, 39, .1), 0 1px 2px rgba(17, 24, 39, .05), 0 12px 24px -16px rgba(17, 24, 39, .22); }

/* ---- A project card (ProjectCard in staff.js): white, its kind as a slim
   bar down the side and the colour of its top line; the percent done over
   one bar; "Now" and the budget on a line; then the next three tasks. ---- */
.pcard { gap: 12px; }
.pcard[class*="kind-"] { border-left: 0; background: var(--surface); }
.pcard[class*="kind-"]::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 4px; border-radius: 0 4px 4px 0; background: var(--kind); }
.pcard-prog { display: flex; flex-direction: column; gap: 7px; }
.pcard-pct { display: flex; align-items: baseline; gap: 8px; }
.pcard-pct b { font-family: var(--font-display); font-size: 24px; font-weight: 650; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pcard-pct span { font-size: 13px; color: var(--muted); }
.pcard-now { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; font-size: 14.5px; }
.pcard-now .eyebrow { color: var(--kind, var(--muted)); margin-right: 2px; }
.pcard-now .money-line { font-weight: 500; }
.pcard-now .money-line.tone-crit, .pcard-now .money-line.tone-warn { font-weight: 650; }
/* The next three tasks, small and quiet under Now (AJ likes seeing them). */
.pcard-next { gap: 5px; margin-top: -4px; font-size: 14px; color: #3A3F47; }
.pcard-next .box { width: 14px; height: 14px; margin-top: 3px; border: 1.5px solid var(--line-strong); border-radius: 4px; }
.pcard-foot { align-items: center; border-top: .5px solid var(--line-strong); padding-top: 8px; }
.pcard-foot .pcard-move { min-height: 0; align-self: center; }

/* ---- Found going over every page on a phone (2026-11-15) ---- */
/* A dropdown never runs wider than its card (a project's Trades tab). */
select { max-width: 100%; min-width: 0; }
/* A small label keeps its own width in a stacked row (it was stretched across). */
.tag { width: fit-content; max-width: 100%; }
/* Filter chips: a solid fine edge and the same corner as the rest, not dashed pills. */
.chip-btn { border: 0; border-radius: 8px; box-shadow: 0 0 0 .5px rgba(17, 24, 39, .18), 0 1px 1.5px rgba(17, 24, 39, .08); }
.chip-btn:hover { border: 0; color: var(--ink); background: #F6F6F7; }
.sup-cats .chip-btn.on { border: 0; box-shadow: none; }
.tabs:not(.job-tabs) a { border-radius: 8px; }
/* Checklists: the twelve job types are one dropdown on a phone, pills on a computer. */
.kind-select { display: none; }
@media (max-width: 640px) {
  .kind-select { display: flex; flex-direction: column; gap: 4px; }
  .kind-select select { width: 100%; background-color: #FFFFFF; box-shadow: 0 0 0 .5px rgba(17, 24, 39, .18), 0 1px 1.5px rgba(17, 24, 39, .08); font-weight: 600; }
  .kind-select + .tabs { display: none; }
}

/* ---- Phones: a project's header, packed tighter. Everything is still on it
   (AJ, 2026-11-15: smaller on the phone, without taking the info out).
   The client and address share a line, the bar sits right under the percent,
   and now / up next / finish are a label and its answer on one line each. ---- */
@media (max-width: 640px) {
  .card.phead { padding: 12px 14px 13px; gap: 0; }
  .phead .phead-open, .phead .phead-stats { display: contents; }
  .phead > .minw { order: 0; }
  .phead .phead-top .eyebrow { font-size: 11px; }
  .phead .phead-chips .chip { font-size: 12px; padding: 2px 9px; }
  .phead .phead-title { margin-top: 1px; }
  .phead .h-hero { font-size: 21px; line-height: 1.2; }
  .phead .phead-title .star { width: 32px; height: 32px; }
  .phead .archived-note { order: 1; margin-top: 8px; }
  .phead .phead-open > .minw { order: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; margin-top: 1px; }
  .phead .pcard-who, .phead .phead-addr { margin: 0; font-size: 13.5px; }
  .phead .phead-addr .dir-pin { width: 14px; height: 14px; }
  /* A real address comes with the house picture and the map. They get the
     full width on their own line under the client and address, never squeezed
     in beside them. */
  .phead .phead-addr, .phead .phead-addr .dir { display: contents; }
  .phead .phead-addr .site-views { order: 3; flex: 0 0 100%; margin-top: 8px; }
  .phead .phead-addr .dir-menu { order: 4; flex: 0 0 100%; margin-top: 6px; }
  /* Shorter here than elsewhere, to keep the header small (ui.js asks for pictures this tall). */
  .phead .site-views, .phead .site-photo, .phead .site-map, .phead .site-wait { height: 120px; }
  .phead .phead-stats > div { order: 4; display: block; position: relative; padding-left: 100px; margin-top: 5px; line-height: 19px; }
  .phead .phead-stats > div:first-child { order: 2; display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 9px; margin-top: 10px; padding: 9px 0 0; border-top: .5px solid rgba(255, 255, 255, .12); }
  .phead .hs-n { font-size: 22px; }
  .phead > .prog { order: 3; margin: 7px 0 4px; }
  .phead .bar { height: 6px; }
  .phead .hs-k { position: absolute; left: 0; top: 0; font-size: 10.5px; line-height: 19px; letter-spacing: .07em; }
  .phead .hs-v { display: inline-block; margin-right: 8px; font-size: 14.5px; }
  .phead .hs-v + .hs-l { display: inline-block; font-size: 12.5px; }
  .phead .phead-side { order: 5; margin-top: 11px; gap: 8px; }
  .phead .phead-side:empty { display: none; } /* trades have no buttons here */
  .card.phead .phead-side .btn, .card.phead .phead-side .select-inline { min-height: 40px; }
  /* The status menu is as wide as a status, not as its longest choice, so the buttons stay beside it. */
  .card.phead .phead-side .select-inline { max-width: 150px; }
}
/* The smallest phones: the three buttons still fit on one line. */
@media (max-width: 360px) {
  .phead .phead-side .row { gap: 6px; }
  .card.phead .phead-side .btn { padding-inline: 11px; }
  .card.phead .phead-side .select-inline { min-width: 0; flex: 0 1 auto; }
}

/* ---- Computers and tablets: a project's header, tidied (AJ, 2026-11-15).
   The status sits beside the kind, the client and address share a line, and
   the spacing is tighter. Nothing is taken off. (Everything wider than a phone.) ---- */
@media (min-width: 641px) {
  .card.phead { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: start; padding: 20px 22px; }
  .phead .phead-open { display: contents; }
  .phead .phead-top { justify-content: flex-start; gap: 12px; }
  .phead .phead-chips { justify-content: flex-start; }
  .phead .archived-note { margin-top: 12px; }
  .phead .phead-open > .minw { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; margin-top: 4px; }
  .phead .pcard-who, .phead .phead-addr { margin: 0; }
  /* A real address comes with the house picture and the map. They get their
     own line under the client and address (no wider than Google's pictures
     go), never squeezed in beside them. */
  .phead .phead-addr, .phead .phead-addr .dir { display: contents; }
  .phead .phead-open > .minw::after { content: ""; order: 2; flex: 0 0 100%; height: 0; } /* ends the line of words, so the pictures start a new one */
  .phead .phead-addr .site-views { order: 3; flex: 0 0 auto; width: 100%; max-width: 560px; margin-top: 10px; }
  .phead .phead-addr .dir-menu { order: 4; flex: 0 0 100%; margin-top: 6px; }
  /* All four facts on one line, on a tablet or a small laptop too. */
  .phead .phead-stats { margin-top: 16px; padding: 14px 0 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
  .phead > .prog { margin-top: 14px; }
  .phead .phead-side { margin-top: 14px; }
  .phead .phead-side:empty { display: none; }
  /* The status menu is as wide as a status, not as its longest choice. */
  .card.phead .phead-side .select-inline { max-width: 170px; }
}
/* With room to spare, the status menu and the buttons sit beside the name,
   and the card ends on the progress bar. */
@media (min-width: 1100px) {
  .card.phead { grid-template-columns: minmax(0, 1fr) fit-content(55%); column-gap: 24px; }
  .phead > .minw { grid-column: 1; grid-row: 1; }
  .phead .phead-side { grid-column: 2; grid-row: 1; align-self: end; justify-content: flex-end; margin-top: 0; padding-bottom: 3px; }
  .phead .archived-note, .phead .phead-open > .minw, .phead .phead-stats, .phead > .prog { grid-column: 1 / -1; }
  /* Asking before a job is marked complete: the question gets the full width, under the bar. */
  .phead .phead-side:has(.finish-ask) { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; margin-top: 14px; padding-bottom: 0; }
}
