/* Vivesti, from the "Vivesti App" template of the Classical design system in Claude Design: a warm paper ground,
   a dark umber sidebar and top bar, Crimson Pro throughout, hairline rules, tags as soft tinted pills.
   Every colour and size comes from the tokens below. */

@font-face {
  font-family: "Crimson Pro";
  src: url("fonts/crimson-pro.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font: "Crimson Pro", Georgia, "Times New Roman", serif;

  --paper: #FBF9F6;        /* the page */
  --surface: #FFFFFF;      /* cards, inputs, the calendar */
  --ink: #2B2622;
  --ink-soft: #4E4540;
  --muted: #6B625A;
  --faint: #8C8278;
  --line: #E7E1D9;         /* rules between parts of a page */
  --line-soft: #EEE9E2;    /* rules between rows */
  --control: #DDD5CB;      /* borders of buttons and fields */
  --hover: #F4EFE8;
  --chip: #F0EAE2;
  --panel: #F3EEE7;        /* the tinted cards and boxes of the installers' pages */
  --panel-hover: #EDE5DA;

  --accent: #8A6646;
  --accent-strong: #5E4430;
  --accent-soft: #F1E6D7;
  --accent-line: #C9A77F;

  --dark: #3D3530;         /* sidebar, top bar on a phone, primary buttons */
  --dark-strong: #2B2622;
  --dark-hover: #4A413B;
  --dark-active: #5A4E46;
  --dark-line: #5A4F48;
  --on-dark: #EFE8DF;
  --on-dark-strong: #F3ECE3;
  --on-dark-muted: #BDB2A6;

  /* tags: new, done/good, waiting, refused */
  --new-bg: #ECE5DB;  --new-ink: #4E4237;
  --ok-bg: #E1E7DA;   --ok-ink: #3D5034;
  --wait-bg: #F3E5CF; --wait-ink: #6B461A;
  --bad-bg: #F5E0DC;  --bad-ink: #8A2A1B;
  --bad: #9B2C2C;
  /* product types, as their tags in the interface */
  --fabric-bg: #DCE4EA; --fabric-ink: #2E4656; --glider-bg: #C9D6E0;
  --rail-bg: #F1DCE0;   --rail-ink: #6A2E3A;

  --online: #5B7A4E;
  --syncing: #B07A2A;
  --offline: #B0702A;
  --banner-bg: #F5E9D6; --banner-ink: #5C3F17; --banner-line: #E8D6B8;

  /* the installers' calendar colours, as in their Airtable interface */
  --confirmed: #5B7A4E;
  --unconfirmed: #C9962E;
  --noshow: #9B2C2C;
  --fix: #B86A8E;
  --remake: #C2187E;
  --off: #557A9E;
  /* the select colours of "Status of Line Item" in Airtable (blueBright, blueDark1, greenBright, greenLight1, redBright) */
  --st-blue-bright: #166EE1; --st-blue-dark: #1C4EA0; --st-green-bright: #20C933; --st-green-light: #A8E3A0;
  --st-green-ink: #0B3D12; --st-red-bright: #DC1E50;

  --radius: 12px;
  --radius-control: 9px;
  --sidebar: 268px;
  --topbar: 58px;
  --tabs: calc(64px + env(safe-area-inset-bottom));
  --desk-top: 67px;       /* height of the top bar on a computer */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding: calc(var(--topbar) + 16px) 0 calc(var(--tabs) + 16px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 18px/1.4 var(--font); font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
svg.icon { flex: none; display: block; }

/* ---------- the frame */

.shell { min-height: 100dvh; }
.content { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
main { flex: 1; }
.loading { padding: 40px 16px; text-align: center; color: var(--muted); }

.sidebar { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px;
  min-height: calc(var(--topbar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0 6px;
  background: var(--dark); color: var(--on-dark-strong);
}
.menu-button, .icon-button {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 8px; background: none; color: inherit;
}
.menu-button:hover, .icon-button:hover { background: var(--dark-hover); }
.crumbs { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.crumb-section { font-size: 14px; line-height: 1.1; color: var(--on-dark-muted); }
.crumb-sep { display: none; }
.crumb-title { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sync-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border-radius: 15px; font-size: 15px; white-space: nowrap; text-decoration: none;
  background: var(--dark-hover); color: var(--on-dark-strong);
}
.sync-pill:hover { color: var(--on-dark-strong); background: var(--dark-active); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); }
.sync-pill.syncing .sync-dot { background: var(--syncing); animation: pulse 1.4s ease-in-out infinite; }
.sync-pill.offline .sync-dot { background: var(--offline); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .sync-pill.syncing .sync-dot { animation: none; } }
.count {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; font-size: 13px; font-weight: 700;
  line-height: 20px; text-align: center; background: var(--syncing); color: #fff;
}
.count.attention { background: var(--bad); }

.banner {
  position: sticky; top: calc(var(--topbar) + env(safe-area-inset-top)); z-index: 19;
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px; font-size: 16px; line-height: 1.3;
  background: var(--banner-bg); color: var(--banner-ink); border-bottom: 1px solid var(--banner-line);
}
.banner svg { margin-top: 1px; }

.view, .gate { width: 100%; max-width: 980px; margin: 0 auto; padding: 16px 16px calc(var(--tabs) + 32px); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  height: var(--tabs); padding: 6px 4px env(safe-area-inset-bottom);
  background: var(--paper); border-top: 1px solid var(--line);
}
.tab {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 14px; line-height: 1.1; color: var(--muted); text-decoration: none;
}
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.tab { border: 0; background: none; padding: 0; }
.tab::before { content: ""; position: absolute; top: -6px; width: 28px; height: 4px; border-radius: 2px; background: transparent; }
.tab[aria-current=page] { color: var(--ink); font-weight: 600; }
.tab[aria-current=page]::before { background: var(--accent); }
.tab:hover { color: var(--ink); }
/* a phone keyboard leaves little room: the tabs make way while a field is being typed in */
@media (max-width: 959px) {
  body:has(.view input:not([type=checkbox]):not([type=radio]):not([type=file]):focus, .view textarea:focus) .tabs { display: none; }
}

/* the menu on a phone */
.menu { position: fixed; inset: 0; z-index: 40; }
.menu-backdrop { position: absolute; inset: 0; background: rgba(20, 16, 14, .4); }
.menu-panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
  background: var(--dark); color: var(--on-dark);
}
.menu-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 0 10px; }
.menu-foot { margin-top: auto; display: grid; gap: 12px; padding: 14px 6px 0; border-top: 1px solid var(--dark-line); }
.menu-foot .link { color: var(--on-dark); display: inline-flex; align-items: center; gap: 8px; justify-self: start; }

/* navigation, in the sidebar and in the menu */
.brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 600; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.nav { display: flex; flex-direction: column; gap: 14px; }
.nav-heading { display: flex; align-items: center; gap: 12px; padding: 7px 10px; font-weight: 600; border-radius: 6px; color: inherit; text-decoration: none; }
.nav-heading:hover { background: var(--dark-hover); color: var(--on-dark-strong); }
.nav-items { display: flex; flex-direction: column; gap: 2px; margin-left: 19px; padding-left: 10px; border-left: 1px solid var(--dark-line); }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 6px;
  color: var(--on-dark); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-item svg { opacity: .75; }
.nav-emoji { flex: none; width: 18px; font-size: 16px; line-height: 1; text-align: center; }
.tab .nav-emoji { width: 22px; font-size: 20px; }
.nav-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--dark-hover); color: var(--on-dark-strong); }
.nav-item[aria-current=page] { background: var(--dark-active); color: var(--on-dark-strong); font-weight: 600; }
.nav-item[aria-current=page] svg { opacity: 1; }
.mode-note { margin: 0 10px; padding: 4px 10px; border-radius: 6px; font-size: 14px; background: var(--dark-hover); color: var(--on-dark-muted); }
.person-block { display: flex; align-items: center; gap: 10px; }
.person-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sign-out { flex: none; border: 0; background: none; padding: 4px 0; font-size: 14px; font-weight: 600; color: var(--on-dark-muted); text-decoration: none; }
.sign-out:hover { color: var(--on-dark-strong); }
.avatar {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 17px;
}
.person-select {
  flex: 1; min-width: 0; height: 40px; padding: 0 8px; border-radius: 8px; font-size: 16px;
  border: 1px solid var(--dark-line); background: var(--dark-hover); color: var(--on-dark-strong);
}
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.outbox-link { display: inline-flex; align-items: center; gap: 8px; color: var(--on-dark); text-decoration: none; }
.outbox-link:hover { color: var(--on-dark-strong); }
.lang { display: inline-flex; padding: 2px; border: 1px solid var(--dark-line); border-radius: 8px; }
.lang button { padding: 3px 9px; border: 0; border-radius: 6px; background: none; font-size: 14px; font-weight: 600; color: var(--on-dark-muted); }
.lang button[aria-pressed=true] { background: var(--dark-active); color: var(--on-dark-strong); }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 12px; overflow-y: auto;
    padding: 20px 12px 0; background: var(--dark); color: var(--on-dark);
  }
  .sidebar > .brand { padding: 2px 10px 8px; }
  .sidebar .nav { flex: 1; }
  .sidebar-foot {
    position: sticky; bottom: 0; display: grid; gap: 12px; margin: 0 -12px; padding: 14px 20px 16px;
    background: var(--dark); border-top: 1px solid var(--dark-line);
  }
  .topbar {
    min-height: var(--desk-top); padding: 0 32px; gap: 10px;
    background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line);
  }
  .menu-button { display: none; }
  .crumbs { flex-direction: row; align-items: center; gap: 8px; font-size: 21px; }
  .crumb-section { font-size: 21px; color: var(--muted); }
  .crumb-sep { display: block; color: var(--faint); }
  .sync-pill { background: var(--surface); color: var(--ink); border: 1px solid var(--control); }
  .sync-pill:hover { background: var(--hover); color: var(--ink); }
  .banner { top: var(--desk-top); padding: 10px 32px; }
  .view, .gate { padding: 24px 32px 48px; }
  .tabs, .menu { display: none !important; }
}

/* ---------- type and the common pieces of a screen */

h1 { font-size: 28px; font-weight: 600; line-height: 1.15; margin: 4px 0 12px; }
/* a list screen's own title is what the top bar already says: kept for screen readers only */
.view > h1:first-child, .view-measure > div > h1:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h2.section {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 0 10px;
}
h3 { font-size: 19px; font-weight: 600; }
.muted { color: var(--muted); }
.center { text-align: center; }
.hint { margin: -2px 0 10px; font-size: 16px; color: var(--muted); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; gap: 10px; margin-top: 20px; }
.list { margin-top: 14px; }
.footnote { margin-top: 22px; font-size: 16px; color: var(--muted); text-align: center; }
.footnote .link { font-size: 16px; }
.group-count { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }

.link {
  display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 0;
  color: var(--accent); font-weight: 600; white-space: nowrap; text-decoration: none;
}
.link:hover { color: var(--accent-strong); }
.link:disabled { opacity: .5; cursor: default; }
.back { margin-bottom: 6px; font-size: 18px; }

.primary, .secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 10px 16px;
  border-radius: var(--radius-control); font-size: 18px; text-align: center; text-decoration: none;
}
.primary { border: 1px solid var(--dark); background: var(--dark); color: var(--on-dark-strong); font-weight: 600; }
.primary:hover { background: var(--dark-strong); color: var(--on-dark-strong); }
.primary:disabled { opacity: .55; cursor: default; }
.secondary { border: 1px solid var(--control); background: var(--surface); color: var(--ink); margin-top: 10px; }
.secondary:hover { background: var(--hover); color: var(--ink); }
.secondary:disabled { opacity: .55; cursor: default; }
.stack > .secondary { margin-top: 0; }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 17px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-info { background: var(--accent-soft); color: #4E3A26; border-color: #E6D5BD; }
.alert-warning { background: var(--banner-bg); color: var(--banner-ink); border-color: var(--banner-line); }
.alert-error { background: var(--bad-bg); color: var(--bad-ink); border-color: #EBC7C0; }
.alert a { color: inherit; font-weight: 600; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tags:empty { display: none; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 999px;
  font-size: 15px; line-height: 1.35; background: var(--chip); color: var(--ink-soft); white-space: nowrap;
}

.state { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.state.pending { background: var(--wait-bg); color: var(--wait-ink); }
.state.synced { background: var(--ok-bg); color: var(--ok-ink); }
.state.failed { background: var(--bad-bg); color: var(--bad-ink); white-space: normal; }
.actions { display: flex; gap: 20px; margin-top: 6px; }

input[type=search], input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date],
input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; font-size: 18px;
  border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); color: var(--ink);
}
input:hover, select:hover, textarea:hover { border-color: #C9BFB2; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
textarea { resize: vertical; line-height: 1.4; }
input[type=search] { margin-bottom: 10px; }
select:disabled { opacity: .7; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  min-height: 38px; padding: 4px 14px; border: 1px solid var(--control); border-radius: 19px;
  background: var(--surface); font-size: 17px; white-space: nowrap;
}
.chip:hover { background: var(--hover); }
.chip[aria-pressed=true] { background: var(--dark); border-color: var(--dark); color: var(--on-dark-strong); }

.switch { display: inline-flex; padding: 3px; margin-bottom: 14px; border-radius: 10px; background: var(--chip); }
.switch a, .switch button { padding: 6px 18px; border-radius: 8px; border: 0; background: none; font-weight: 600; color: var(--ink); text-decoration: none; }
.switch .on { background: var(--surface); box-shadow: 0 1px 2px rgba(45, 35, 28, .12); }

/* contact lines: address, phone, email */
.contact { display: grid; gap: 6px; margin: 12px 0 4px; }
.contact a { display: inline-flex; align-items: flex-start; gap: 8px; font-weight: 600; text-decoration: none; word-break: break-word; }
.contact a svg { margin-top: 3px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 12px 0 0; font-size: 17px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
.note-text { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line-soft); white-space: pre-line; font-size: 17px; }
.job-when { font-size: 16px; font-weight: 600; color: var(--muted); }

/* big on/off buttons: picked up, installed, customer accepted */
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 12px;
  border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); font-weight: 600; text-align: left; line-height: 1.2;
}
.toggle:hover { background: var(--hover); }
.toggle .box { width: 22px; height: 22px; border: 1.5px solid var(--faint); border-radius: 6px; flex: none; display: grid; place-items: center; }
.toggle[aria-pressed=true] { background: var(--dark); border-color: var(--dark); color: var(--on-dark-strong); }
.toggle[aria-pressed=true] .box { border-color: var(--on-dark-strong); }
.toggle[aria-pressed=true] .box::after { content: ""; width: 11px; height: 6px; margin-top: -3px; border: solid var(--on-dark-strong); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.toggle:disabled { opacity: .7; cursor: default; }

/* a list row with a title, its details and a state: outboxes */
.item-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 16px; margin-bottom: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.item-row.column { flex-direction: column; gap: 2px; }
.item-row strong, .item-row small { display: block; }
.item-row small { color: var(--muted); font-size: 16px; }
.item-row .state { margin-top: 6px; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th { text-align: left; font-weight: 400; font-size: 15px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* "Who are you?", and sign-in when Airtable login is on */
.welcome { max-width: 440px; }
.welcome .primary { margin-top: 18px; text-decoration: none; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 12px; }
.person {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 18px;
}
.person:hover { background: var(--hover); border-color: var(--control); }

/* photos: the drop zone, thumbnails and the full-screen viewer */
.drop {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px;
  border: 1.5px dashed var(--accent-line); border-radius: var(--radius-control);
  text-align: center; color: var(--accent); font-weight: 600; background: var(--surface); cursor: pointer; overflow: hidden;
}
.drop:hover { background: var(--hover); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.drop.over { background: var(--accent-soft); border-color: var(--accent); }
.drop span, .drop svg { pointer-events: none; }
/* The input covers the control, so the press lands on it. A 1px input sits off the words. */
.drop input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.problem { margin: 4px 0 0; font-size: 16px; color: var(--bad-ink); }

.viewer {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 16, 14, .94); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer button { display: grid; place-items: center; border: 0; border-radius: 99px; background: rgba(255, 255, 255, .16); color: #fff; }
.viewer-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; }
.viewer-nav {
  position: absolute; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; gap: 18px; color: #fff; font-variant-numeric: tabular-nums;
}
.viewer-nav button { width: 48px; height: 48px; }

/* ---------- the design's record views: lists, filters, the record panel */

/* list screens use the whole width, like the interface's grid */
.view.wide { max-width: none; }
.filter-bar { display: grid; gap: 10px; margin-bottom: 14px; }
.filter-bar input[type=search] { margin: 0; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 1px solid var(--control); border-radius: 7px; background: var(--surface); font-size: 17px; white-space: nowrap; cursor: pointer;
}
.pill:hover { background: var(--hover); }
.pill.on { border-color: var(--accent-line); background: var(--accent-soft); }
.pill:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
/* the select covers the pill, so a tap opens the phone's own picker */
.pill select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; opacity: 0; cursor: pointer; border: 0; padding: 0; }

.records { border-top: 1px solid var(--line); }
.rec-head { display: none; }
.rec-row {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  min-height: 72px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none;
}
.rec-row:hover, .rec-row:active { background: var(--hover); color: var(--ink); }
.rec-row.pending::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--accent-line); }
.rec-cell { grid-column: 1; min-width: 0; }
.rec-cell.no-phone { display: none; }
.rec-cell.ph-title { font-size: 19px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-cell.ph-sub { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-cell.ph-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: 14px; color: var(--muted); }
.rec-cell.ph-tags .tag { font-size: 14px; padding: 1px 9px; }
.rec-cell.ph-aside { grid-column: 2; grid-row: 1; text-align: right; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rec-chevron { grid-column: 2; grid-row: 2 / span 2; justify-self: end; color: var(--faint); }
.rec-empty { padding: 24px 4px; color: var(--muted); }
.count-bar { padding: 12px 4px; font-size: 16px; color: var(--muted); }
.rep-chip.big { display: block; max-width: 100%; padding: 5px 10px; border-radius: 6px; font-size: 20px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.rec-row .date-tag { background: var(--wait-bg); color: var(--wait-ink); }
.page-intro { display: grid; gap: 12px; margin-bottom: 14px; }
.intro-text summary { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); cursor: pointer; list-style: none; line-height: 1.3; }
.intro-text summary::-webkit-details-marker { display: none; }
.intro-text summary svg { margin-top: 2px; color: var(--wait-ink); }
.intro-text .more { color: var(--ink); font-weight: 600; white-space: nowrap; }
.intro-text > p { white-space: pre-line; }
.intro-text[open] .more { display: none; }
.intro-text p { margin: 8px 0 0 26px; color: var(--muted); }
.dark-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 9px;
  background: var(--dark-strong); color: #FBF6EF; font-weight: 600; text-decoration: none;
}
.dark-button:hover { background: var(--dark); color: #FBF6EF; }
.rep-chip { display: inline-flex; padding: 1px 9px; border-radius: 4px; font-size: 16px; background: var(--chip); color: var(--ink); white-space: nowrap; }

@media (min-width: 960px) {
  .view.wide { padding: 0 0 0 32px; }
  .view.wide .filter-bar { grid-template-columns: minmax(220px, 320px) 1fr; align-items: center; padding: 16px 32px 16px 0; margin: 0; border-bottom: 1px solid var(--line); }
  .pills { flex-wrap: wrap; overflow: visible; }
  .records { border-top: 0; overflow-x: clip; }
  .rec-head {
    position: sticky; top: var(--desk-top); z-index: 2; display: grid; grid-template-columns: var(--cols); gap: 0 16px; align-items: center; height: 44px; padding-right: 32px;
    font-size: 15px; color: var(--muted); background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .rec-head .num, .rec-cell.num { text-align: right; }
  .rec-row { grid-template-columns: var(--cols); gap: 0 16px; min-height: 48px; padding: 0 32px 0 0; }
  .records .rec-cell { display: block; grid-column: auto; grid-row: auto; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
  .records .rec-cell.ph-tags, .records .rec-cell.ph-aside { display: flex; align-items: center; gap: 6px; margin: 0; text-align: left; color: inherit; font-size: 17px; }
  .rec-cell.ph-aside { justify-content: flex-start; }
  .rec-cell.num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
  .rec-cell.muted, .rec-cell.ph-sub { color: var(--muted); font-size: 17px; }
  .rec-cell.title, .rec-cell.ph-title { font-size: 19px; font-weight: 500; }
  .records .rec-cell.wrap { white-space: normal; line-height: 1.3; margin: 10px 0; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  .view.wide .page-intro { grid-template-columns: 1fr auto; align-items: start; padding: 16px 32px 16px 0; margin: 0; border-bottom: 1px solid var(--line); }
  .rec-cell .tag { font-size: 16px; }
  .rec-chevron, .rec-cell.phone-only { display: none !important; }
  .rec-row.pending::before { left: -14px; }
  .count-bar { position: sticky; bottom: 0; height: 40px; display: flex; align-items: center; padding: 0 32px 0 0; background: var(--paper); border-top: 1px solid var(--line); }
  .view.wide > :not(.filter-bar):not(.page-intro):not(.records):not(.xtable):not(.cal-bar):not(.count-bar):not(.drawer) { margin-right: 32px; }
  .view.wide > h2.section { margin-top: 20px; }
}

/* the record panel */
.drawer { position: fixed; inset: 0; z-index: 30; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(43, 38, 34, .22); }
.drawer-panel {
  position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--paper);
  padding-top: env(safe-area-inset-top);
}
.drawer-back { flex: none; display: flex; align-items: center; height: 56px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.drawer-back .link { min-height: 44px; padding: 0 8px; font-size: 18px; font-weight: 400; }
.drawer-head { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 0; }
.drawer-titles { flex: 1; min-width: 0; }
.drawer-label { font-size: 15px; color: var(--muted); margin-bottom: 2px; }
.drawer-title { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.15; }
.drawer-sub { display: flex; align-items: flex-start; gap: 6px; margin-top: 2px; font-size: 17px; color: var(--muted); }
.drawer-close { display: none; color: var(--ink); }
.drawer-close:hover { background: var(--chip); }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 24px; }
.drawer-body > :first-child { margin-top: 0; }
.drawer-body > .tags { margin-bottom: 14px; }
.drawer-foot { flex: none; display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); }
.drawer-foot > * { flex: 1; margin: 0; white-space: nowrap; }
.confirm-bar { display: flex; flex-direction: column; gap: 8px; min-width: 0; white-space: normal; }
.confirm-bar .photos { margin-top: 0; }
.confirm-bar .primary { width: 100%; }
body:has(.view:not([hidden]) .drawer) { overflow: hidden; }
body:has(.view:not([hidden]) .drawer) .tabs { display: none; }
@media (min-width: 960px) {
  .drawer-panel {
    left: auto; width: 460px; padding-top: 0; box-shadow: -12px 0 40px rgba(43, 38, 34, .16);
    animation: slide-in .18s ease-out;
  }
  .drawer.wide .drawer-panel { width: min(640px, 100vw - var(--sidebar)); }
  .drawer-back { display: none; }
  .drawer-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
  .drawer-close { display: grid; }
  .drawer-body { padding: 20px 24px; }
  .drawer-foot { padding: 16px 24px; }
}
@keyframes slide-in { from { transform: translateX(24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .drawer-panel { animation: none; } }
.fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.fact-label, .drawer-body .field-label { font-size: 15px; color: var(--muted); margin-bottom: 4px; }
.fact-value { font-size: 18px; overflow-wrap: anywhere; }
.fact-grid .fact.wide { grid-column: 1 / -1; }
.drawer-body .card { background: var(--surface); }
.drawer-body .form, .drawer-body > .fact-grid { margin-bottom: 18px; }

/* ---------- sales reps: Business Overview, a customer, Offers */

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 600px) { .tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } } /* the sales dashboard has two tiles */
.tile {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none;
}
a.tile:hover { background: var(--hover); color: var(--ink); }
.tile-label { font-size: 16px; color: var(--muted); }
.tile-value { font-size: 30px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile small { color: var(--muted); font-size: 15px; }

/* the Business Overview's dashboard (web/sales/dashboard.js); the chart colours are set inline, from its palette */
.dash-search { position: sticky; top: var(--topbar); z-index: 5; padding: 8px 0 10px; background: var(--paper); }
@media (min-width: 960px) { .dash-search { top: var(--desk-top); padding-top: 16px; } }
.search-box { position: relative; display: flex; align-items: center; }
.search-box > svg { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search-box input { width: 100%; margin: 0; padding-left: 40px; padding-right: 40px; }
.search-box kbd { position: absolute; right: 12px; padding: 0 6px; border: 1px solid var(--control); border-radius: 5px; font: 13px/1.5 ui-monospace, monospace; color: var(--faint); }
@media (hover: none) { .search-box kbd { display: none; } }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 6; max-height: min(60vh, 480px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(43, 38, 34, .14); padding: 6px; }
.search-result { display: grid; gap: 1px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search-result:hover, .search-result[aria-selected=true] { background: var(--hover); color: var(--ink); }
.search-result strong { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.search-result small { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.search-results .hint { margin: 8px 10px; }

.good { color: var(--ok-ink); }
.bad { color: var(--bad-ink); }
/* the installers' charts share these */
.chart { margin-bottom: 8px; }
.hbar { display: flex; gap: 2px; height: 22px; }
/* the Installers sales dashboard: a column per installer in their own colour (--c), value on the cap, grey hairline grid */
.chart-title { margin: 0 0 14px; font-size: 22px; font-weight: 600; }
.vchart { --axis: 36px; }
.vplot { position: relative; height: 240px; margin: 22px 0 0 var(--axis); border-bottom: 1px solid var(--control); }
.vgrid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line-soft); }
.vgrid:first-child { border-top-color: transparent; } /* the baseline is the plot's own border */
.vgrid span { position: absolute; right: calc(100% + 8px); top: 0; transform: translateY(-50%); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vcols { position: absolute; inset: 0; display: flex; }
.vcol { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; outline: none; }
.vbar { display: block; flex: none; width: min(100%, 24px); min-height: 3px; border-radius: 4px 4px 0 0; background: var(--c); }
.vvalue { flex: none; margin-bottom: 4px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vcol:hover .vbar, .vcol:focus-visible .vbar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.vtip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5; display: none; padding: 6px 10px; border-radius: 8px;
  background: var(--dark-strong); color: var(--on-dark-strong); font-size: 15px; white-space: nowrap; pointer-events: none; }
.vcol:hover .vtip, .vcol:focus-visible .vtip { display: block; }
.vlabels { display: flex; margin: 8px 0 0 var(--axis); }
.vlabels span { flex: 1; min-width: 0; text-align: center; font-size: 15px; color: var(--ink-soft); overflow-wrap: anywhere; }
.vlabels .me { font-weight: 700; color: var(--ink); }
.vlegend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 4px; padding: 0; list-style: none; font-size: 16px; color: var(--ink-soft); }
.vlegend li { display: flex; align-items: center; gap: 8px; }
.vlegend i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); flex: none; }
.vlegend strong { font-weight: 600; color: var(--ink); }
.vtable { margin-top: 10px; font-size: 16px; }
.vtable summary { cursor: pointer; color: var(--accent-strong); }
.vtable table { margin-top: 8px; border-collapse: collapse; }
.vtable th, .vtable td { padding: 4px 24px 4px 0; text-align: left; font-weight: 400; border-bottom: 1px solid var(--line-soft); }
.vtable td:last-child, .vtable th:last-child { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 599px) {
  .vplot { height: 200px; }
  .vchart { --axis: 30px; }
  .vlabels span { font-size: 14px; overflow-wrap: normal; }
}
.chart-tip { position: fixed; z-index: 50; max-width: 260px; padding: 8px 10px; border-radius: 8px; background: var(--dark-strong); color: var(--on-dark-strong);
  font-size: 15px; line-height: 1.35; white-space: pre-line; pointer-events: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }

/* The Sales Studio prototype's workspace (vivesti-source-handoff/), in this app's colours: a heading with an eyebrow,
   figure tiles, cards with a head, tables, tabs and dialogs. The Business Overview (bo-) and a customer's page. */
.ws { max-width: 1500px; padding-bottom: 8px; }
.ws-eyebrow { margin-bottom: 6px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.ws-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin: 18px 0 22px; }
.ws-heading h1 { margin: 0 0 8px; font-size: 34px; font-weight: 500; line-height: 1.12; letter-spacing: -.01em; }
.ws-heading p { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; font-size: 17px; color: var(--muted); }
.ws-heading .tag { font-size: 14px; }
.ws-asof { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); white-space: nowrap; }
.ws-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); }
.ws-back { display: inline-flex; align-items: center; gap: 6px; margin: 16px 0 0; padding: 0; border: 0; background: none; font-size: 16px; color: var(--muted); }
.ws-back:hover { color: var(--ink); }

.ws-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ws-button, .ws-button.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; min-height: 42px; margin: 0; padding: 8px 16px;
  border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); color: var(--ink);
  font-size: 17px; font-weight: 600; white-space: nowrap; text-decoration: none;
}
.ws-button:hover { background: var(--hover); color: var(--ink); }
.ws-button.primary { border-color: var(--dark); background: var(--dark); color: var(--on-dark-strong); }
.ws-button.primary:hover { background: var(--dark-strong); color: var(--on-dark-strong); }
.ws-textbutton { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 16px; font-weight: 600; text-align: left; text-decoration: none; }
.ws-textbutton:hover { color: var(--accent-strong); text-decoration: underline; }
.ws-textbutton.title { font-size: 17px; color: var(--ink); }

.ws-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
@media (min-width: 1100px) { .ws-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.ws-kpi {
  display: flex; flex-direction: column; align-items: flex-start; min-width: 0; min-height: 140px; padding: 16px 18px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
}
.ws-kpi:hover { border-color: var(--accent-line); }
.ws-kpi > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; font-size: 15px; color: var(--muted); }
.ws-kpi > span svg { color: var(--faint); }
.ws-kpi strong { margin: 14px 0 10px; font-size: 30px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ws-kpi strong.big { margin-top: 8px; font-size: 40px; }
.ws-kpi small { margin-top: auto; font-size: 14px; line-height: 1.35; color: var(--muted); }
.ws-kpi small.good { color: var(--ok-ink); }
.ws-kpi small.bad { color: var(--bad-ink); }
@media (max-width: 599px) { .ws-kpi { min-height: 128px; padding: 14px; } .ws-kpi strong { font-size: 23px; } .ws-kpi strong.big { font-size: 32px; } }

.ws-card { min-width: 0; margin-bottom: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ws-cardhead { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.ws-cardhead h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.2; }
.ws-cardhead .ws-eyebrow { margin-bottom: 4px; }
.ws-cardhead > svg { flex: none; color: var(--faint); }
.ws-subtitle { margin: 4px 0 0; font-size: 15px; color: var(--muted); }
.ws-cardnote { font-size: 15px; color: var(--muted); white-space: nowrap; }
.ws-cardfoot { margin: 0; padding: 12px 20px; font-size: 15px; color: var(--muted); border-top: 1px solid var(--line-soft); }
.ws-cardtext { margin: 16px 20px 0; }
.ws-cardtext:empty { display: none; }
.ws-cardactions { margin: 0 20px 20px; }
.ws-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 30px 20px; text-align: center; color: var(--muted); }
.ws-stack { display: grid; gap: 16px; margin-bottom: 20px; }
.ws-stack .ws-card { margin: 0; }

.ws-table-scroll { overflow-x: auto; }
.ws-table { width: 100%; border-collapse: collapse; font-size: 17px; white-space: nowrap; }
.ws-table th { padding: 10px 20px; text-align: left; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); background: var(--paper); }
.ws-table td { padding: 14px 20px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.ws-table td small { display: block; margin-top: 3px; font-size: 14px; color: var(--muted); }
.ws-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ws-table .tags { flex-wrap: nowrap; margin: 0; }
.ws-table tr.has-pending td:first-child { box-shadow: inset 3px 0 var(--accent-line); }
.ws-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-right: 4px;
  border-radius: 50%; background: var(--chip); color: var(--ink-soft); font-size: 14px; font-weight: 700; }
.ws-progress { width: 90px; height: 5px; border-radius: 5px; background: var(--chip); overflow: hidden; }
.ws-progress i { display: block; height: 100%; background: var(--accent-line); }

.ws-tabs { display: flex; gap: 24px; margin-bottom: 20px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tabs button { padding: 10px 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; font-size: 17px; color: var(--muted); white-space: nowrap; }
.ws-tabs button:hover { color: var(--ink); }
.ws-tabs button.active { border-color: var(--dark); color: var(--ink); font-weight: 600; }
.ws-tabs span { margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--chip); font-size: 13px; }

/* a customer's page */
.ws-customer-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 20px; }
.ws-customer-grid .ws-card { margin: 0; }
@media (min-width: 1100px) {
  .ws-customer-grid { grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.6fr); }
  .ws-customer-grid .wide { grid-column: 1 / -1; }
}
.ws-details { display: grid; gap: 2px; margin: 0; padding: 16px 20px; }
.ws-details dt { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.ws-details dt:first-child { margin-top: 0; }
.ws-details dd { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.ws-details dd a { color: var(--ink); }
.ws-list { padding: 4px 20px; }
.ws-listrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.ws-listrow:last-child { border-bottom: 0; }
.ws-listrow:hover { color: var(--ink); }
.ws-listrow:hover strong { text-decoration: underline; }
.ws-listrow > span:nth-child(2) { flex: 1; min-width: 0; }
.ws-listrow strong { display: block; font-size: 17px; }
.ws-listrow small { display: block; font-size: 15px; color: var(--muted); }
.ws-listrow > svg { color: var(--faint); }
.ws-dateblock { flex: none; padding: 8px 10px; border-radius: 8px; background: var(--panel); font-size: 14px; white-space: nowrap; }
.ws-notes { padding: 12px 20px; }
.ws-notes article { display: flex; gap: 12px; padding: 10px 0; color: var(--faint); }
.ws-notes article.pending { color: var(--wait-ink); }
.ws-notes article svg { margin-top: 3px; }
.ws-notes p { margin: 0 0 4px; font-size: 17px; color: var(--ink); white-space: pre-line; }
.ws-notes small { font-size: 14px; color: var(--muted); }
.ws-callout { margin: 16px 20px 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--accent-line); }
.ws-callout p { margin: 4px 0 0; color: var(--ink-soft); white-space: pre-line; }
.ws-detailstats { display: flex; flex-wrap: wrap; gap: 16px 40px; margin: 18px 20px; }
.ws-detailstats small { font-size: 14px; color: var(--muted); }
.ws-detailstats strong { display: block; margin-top: 2px; font-size: 20px; font-weight: 500; }
@media (max-width: 599px) { .ws-heading h1 { font-size: 30px; } .ws-heading .ws-actions { width: 100%; } .ws-heading .ws-actions > * { flex: 1; } }

/* a dialog: in the middle on a computer, the whole screen on a phone */
.ws-overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(43, 38, 34, .35); backdrop-filter: blur(3px); }
.ws-dialog { position: relative; width: 620px; max-width: 100%; max-height: 90vh; overflow-y: auto; overscroll-behavior: contain; padding: 28px 28px 0;
  background: var(--paper); border-radius: 14px; box-shadow: 0 25px 80px rgba(43, 38, 34, .25); }
.ws-close { position: absolute; top: 12px; right: 12px; color: var(--ink); }
.ws-close:hover { background: var(--chip); }
.ws-dialog-title { margin: 0 40px 6px 0; font-size: 28px; font-weight: 500; line-height: 1.15; }
.ws-dialog-sub { margin: 0 0 14px; color: var(--muted); }
.ws-dialog-body { padding-bottom: 22px; }
.ws-dialog-body > :first-child { margin-top: 0; }
.ws-dialog-body > .tags { margin-bottom: 12px; }
.ws-dialog-foot { position: sticky; bottom: 0; margin: 0 -28px; padding: 14px 28px calc(14px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
.ws-form { display: grid; gap: 14px; margin-top: 8px; }
.ws-form label { display: grid; gap: 6px; font-size: 16px; color: var(--muted); }
.ws-form label > :is(input, textarea) { margin: 0; color: var(--ink); }
.ws-form .hint { margin: 0; }
.ws-form .ws-button { justify-self: start; }
body:has(.view:not([hidden]) .ws-overlay) { overflow: hidden; }
body:has(.view:not([hidden]) .ws-overlay) .tabs { display: none; }
@media (max-width: 959px) {
  .ws-overlay { align-items: stretch; padding: 0; }
  .ws-dialog { width: 100%; max-height: none; padding: calc(20px + env(safe-area-inset-top)) 18px 0; border-radius: 0; }
  .ws-dialog-foot { margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
  .ws-dialog-foot > * { flex: 1; }
}

/* the Business Overview */
.bo-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; margin-bottom: 20px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.bo-filters label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.bo-filters select { width: auto; min-width: 170px; min-height: 40px; margin: 0; padding: 4px 30px 4px 10px; font-size: 17px; color: var(--ink); }
.bo-filters > span { margin-left: auto; text-align: right; font-size: 16px; color: var(--ink-soft); }
.bo-filters small { display: block; font-size: 14px; color: var(--muted); }
@media (max-width: 599px) {
  .bo-filters label { flex: 1 1 140px; }
  .bo-filters select { width: 100%; min-width: 0; }
  .bo-filters > span { margin: 0; text-align: left; }
}
.bo-chartgrid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 20px; }
@media (min-width: 1100px) { .bo-chartgrid { grid-template-columns: minmax(0, 2.35fr) minmax(280px, 1fr); } }
.bo-chartgrid > .ws-card { margin: 0; display: flex; flex-direction: column; }
.bo-chartgrid .bo-chart { flex: 1; min-height: 250px; height: auto; }
.bo-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 14px 20px 6px; font-size: 15px; color: var(--ink-soft); }
.bo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bo-legend i { width: 10px; height: 10px; border-radius: 3px; }
.bo-legend i, .bo-bars i { background: var(--dark); }
.bo-legend i.sales, .bo-bars i.sales { background: var(--accent-line); }
.bo-legend small { margin-left: auto; font-size: 14px; color: var(--faint); }
.bo-chart { display: flex; gap: 8px; height: 250px; margin: 0 14px; padding: 12px 10px 0; overflow-x: auto; border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to top, transparent 0 49px, var(--line-soft) 49px 50px); }
.bo-chart button { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 36px; padding: 0; border: 0; background: none; color: inherit; }
.bo-chartvalue { padding-bottom: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bo-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; }
.bo-bars i { display: block; width: 36%; max-width: 24px; min-height: 1px; border-radius: 3px 3px 0 0; transition: height .25s; }
.bo-chart button:hover .bo-bars i { background: var(--dark-strong); }
.bo-chart button:hover .bo-bars i.sales { background: var(--accent); }
.bo-chartlabel { width: 100%; padding: 8px 0; text-align: center; font-size: 14px; color: var(--muted); background: var(--surface); }
.bo-chartfooter { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; padding: 12px 20px; font-size: 14px; color: var(--faint); }
@media (prefers-reduced-motion: reduce) { .bo-bars i { transition: none; } }

.bo-pipeline { display: flex; flex-direction: column; align-items: flex-start; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.bo-pipeline h2 { margin: 2px 0 12px; font-size: 30px; font-weight: 500; line-height: 1.12; }
.bo-pipeline > strong { font-size: 32px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bo-pipeline > p { margin: 2px 0 12px; font-size: 16px; color: var(--muted); }
.bo-pipeline-lines { width: 100%; margin: 4px 0 18px; border-top: 1px solid var(--control); }
.bo-pipeline-lines > div { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 16px; color: var(--ink-soft); }
.bo-pipeline-lines small { font-size: 14px; color: var(--faint); }
.bo-pipeline-lines b { font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bo-pipeline > small { margin-top: 14px; font-size: 14px; line-height: 1.45; color: var(--muted); }

.bo-profile-heading { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin: 28px 0 14px; }
.bo-profile-heading h2 { margin: 0; font-size: 28px; font-weight: 500; }
.bo-profile-heading > span { font-size: 15px; color: var(--muted); }
.bo-profiles { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1000px) { .bo-profiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bo-profiles .ws-card { margin: 0; }
.bo-ranking { padding: 6px 20px 12px; }
.bo-ranking button { display: flex; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line-soft); background: none; color: inherit; text-align: left; }
.bo-ranking button:last-child { border-bottom: 0; }
.bo-ranking button:hover strong { text-decoration: underline; }
.bo-rankindex { padding-top: 2px; font-size: 14px; color: var(--faint); font-variant-numeric: tabular-nums; }
.bo-rankbody { flex: 1; min-width: 0; }
.bo-rankbody > div:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: 17px; }
.bo-rankbody strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bo-rankbody span { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bo-track { height: 5px; margin: 8px 0 6px; border-radius: 5px; background: var(--chip); overflow: hidden; }
.bo-track i { display: block; height: 100%; background: var(--accent-line); }
.bo-rankbody small { font-size: 14px; color: var(--muted); }

.bo-method { margin: 20px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.bo-method summary { display: flex; align-items: center; gap: 8px; padding: 14px 20px; font-weight: 600; cursor: pointer; list-style: none; }
.bo-method summary::-webkit-details-marker { display: none; }
.bo-method summary svg:last-child { margin-left: auto; transition: transform .2s; }
.bo-method[open] summary svg:last-child { transform: rotate(180deg); }
.bo-method > div { padding: 0 20px 6px; border-top: 1px solid var(--line-soft); }
.bo-method p { font-size: 16px; color: var(--ink-soft); }
.bo-detailtotal { display: flex; justify-content: space-between; gap: 10px; padding: 12px 20px; font-size: 16px; color: var(--muted); }
.bo-detailtotal strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.view-sales .tag.st-new { background: var(--new-bg); color: var(--new-ink); }
.view-sales .tag.st-todo { background: var(--wait-bg); color: var(--wait-ink); }
.view-sales .tag.st-wait { background: var(--accent-soft); color: #4E3A26; }
.view-sales .tag.st-won { background: var(--ok-bg); color: var(--ok-ink); }
.view-sales .tag.st-lost { background: var(--bad); color: #fff; }

.order-row {
  display: flex; align-items: flex-start; gap: 14px; padding: 12px 16px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none;
}
a.order-row:hover { background: var(--hover); color: var(--ink); }
.order-row.has-pending { border-color: var(--accent-line); }
.order-row .when { flex: none; width: 72px; font-size: 16px; font-weight: 600; color: var(--muted); }
.order-row .when small { display: block; font-weight: 400; }
.order-row .what { flex: 1; min-width: 0; }
.order-row .what strong { display: block; font-size: 19px; font-weight: 600; }
.order-row .what small { display: block; color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.order-row .right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.order-row .right small { color: var(--muted); font-size: 15px; }
.order-row > .tag { flex: none; }
.pricing { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; padding: 0 9px; border-radius: 99px; background: var(--wait-bg); color: var(--wait-ink); white-space: nowrap; }
.pricing::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pricing.done { background: var(--ok-bg); color: var(--ok-ink); }
.head h1 { margin: 2px 0 4px; }
.head .link { margin-top: 8px; }

.form { display: grid; gap: 14px; }
.view-sales .field, .view-installer .field { display: grid; gap: 4px; min-width: 0; }
.field-label { font-size: 16px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pending-mark { font-size: 14px; font-weight: 600; color: var(--wait-ink); }

.totals { display: grid; gap: 4px; }
.totals .row { flex-wrap: nowrap; font-variant-numeric: tabular-nums; }
.totals .row > :last-child { white-space: nowrap; }
.totals .total { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 20px; }
.totals .link { margin-top: 6px; justify-self: start; }
.line.is-new { border-style: dashed; border-color: var(--accent-line); }
.line.has-pending { border-color: var(--accent-line); }
.line-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.line-head > div:first-child { min-width: 0; }
.line-head strong { display: block; font-size: 19px; }
.line-head small { display: block; color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.line-head .price { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.line-head .discount { color: var(--ok-ink); }
.line-actions { display: flex; gap: 20px; margin-top: 8px; }
.editor { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pick-current {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); text-align: left; font-weight: 600;
}
.view-sales .picker { display: grid; gap: 6px; padding: 10px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.view-sales .picker input[type=search] { margin: 0; }
.pick-list { display: grid; gap: 4px; max-height: 320px; overflow-y: auto; }
.pick { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-align: left; }
.pick:hover { background: var(--hover); }
.pick[aria-pressed=true] { background: var(--dark); border-color: var(--dark); color: var(--on-dark-strong); }
.pick small { opacity: .7; }
.view-sales .check { display: flex; gap: 8px; align-items: center; font-size: 16px; color: var(--muted); }

.log { margin: 0; white-space: pre-line; font-size: 16px; padding: 10px 12px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line-soft); max-height: 360px; overflow-y: auto; }
.log-entry { padding: 8px 12px; border-radius: 8px; background: var(--wait-bg); color: var(--wait-ink); }
.log-entry p { margin: 4px 0 0; white-space: pre-line; color: var(--ink); }

/* ---------- installers: start, pickup, jobs, calendar, SOPs, timesheets */

.nav-cards { display: grid; gap: 10px; }
@media (min-width: 720px) { .nav-cards { grid-template-columns: 1fr 1fr; } }
.nav-card {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); text-decoration: none;
}
.nav-card:hover { background: var(--hover); color: var(--ink); }
.nav-card .icon-wrap { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--chip); color: var(--accent); }
.nav-card strong { display: block; font-size: 19px; }
.nav-card small { display: block; color: var(--muted); font-size: 16px; }
.nav-card.warn { border-color: var(--banner-line); background: var(--banner-bg); }
.nav-card.warn .icon-wrap { background: var(--surface); color: var(--wait-ink); }
.nav-card.warn small { color: var(--banner-ink); }
.links { display: grid; gap: 8px; }
.links a { display: block; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-weight: 600; text-decoration: none; }
.links a:hover { background: var(--hover); }

.job {
  display: block; position: relative; padding: 12px 16px 12px 22px; margin-bottom: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; overflow: hidden;
}
.job::before, .job-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, var(--line)); }
.job:hover { background: var(--hover); color: var(--ink); }
.job strong { display: block; font-size: 19px; }
.job small { display: block; color: var(--muted); font-size: 16px; margin-top: 1px; }
.job-wrap { position: relative; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.job-wrap::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, var(--line)); }
.job-wrap > .job { margin: 0; border: 0; border-radius: 0; background: transparent; }
.job-wrap > .job::before { display: none; }
.expand {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 16px 10px 22px; border: 0; border-top: 1px solid var(--line-soft);
  background: var(--paper); color: var(--accent); font-weight: 600; text-align: left;
}
.expand:hover { background: var(--hover); }
.job-more { padding: 2px 16px 14px 22px; border-top: 1px solid var(--line-soft); }
.job-more h3 { margin: 18px 0 0; }
.item-mini { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.confirmed { --c: var(--confirmed); }
.unconfirmed { --c: var(--unconfirmed); }
.noshow { --c: var(--noshow); }
.fix { --c: var(--fix); }
.off { --c: var(--off); }
.view-installer .tag.fix { background: #F3E1EA; color: #7A2F55; }
.view-installer .tag.noshow { background: var(--bad); color: #fff; }
.view-installer .tag.status-red { background: var(--bad-bg); color: var(--bad-ink); }
.view-installer .tag.status-green { background: var(--ok-bg); color: var(--ok-ink); }
.view-installer .tag.status-blue { background: var(--new-bg); color: var(--new-ink); }

.job-head { position: relative; overflow: hidden; padding-left: 24px; }
.job-head h1 { margin: 2px 0 4px; }
.notes { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--banner-bg); color: var(--banner-ink); }
.notes p { margin: 4px 0 0; white-space: pre-line; }

.view-installer .item.is-installed { background: #F8FAF5; }
.item-head { display: flex; gap: 12px; align-items: flex-start; }
.item-head strong { display: block; font-size: 19px; }
.item-head small { display: block; color: var(--muted); font-size: 16px; }
.item-head small.ok { color: var(--confirmed); }
.item-head small.warn { color: var(--noshow); }

.gallery { display: grid; gap: 6px; margin-top: 12px; }
.gallery small { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; font-weight: 600; }
.view-installer .thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.view-installer .thumb { flex: none; width: 84px; height: 84px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper); }
.view-installer .photos .thumb { position: relative; }
.view-installer .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.view-installer .photos .thumb button { position: absolute; z-index: 1; top: 3px; right: 3px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 0; background: rgba(43, 38, 34, .75); color: #fff; }
.no-photo { display: grid; place-items: center; height: 100%; padding: 4px; font-size: 13px; color: var(--muted); }
.photos { margin-top: 10px; display: grid; gap: 8px; }
.photos .thumbs { margin-top: 2px; }

.pickup { padding: 0; overflow: hidden; }
.pickup-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-soft); background: var(--paper); }
.pickup-head:hover { background: var(--hover); color: var(--ink); }
.pickup-head strong { display: block; font-size: 19px; }
.pickup-head small { display: block; color: var(--muted); font-size: 16px; }
.progress { font-weight: 600; padding: 1px 10px; border-radius: 99px; background: var(--wait-bg); color: var(--wait-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress.done { background: var(--ok-bg); color: var(--ok-ink); }
.pickup-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.pickup-item:last-child { border-bottom: 0; }
.pickup-item .what { flex: 1; min-width: 0; }
.pickup-item .what strong { display: block; }
.pickup-item .what small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 16px; }
.pickup-item .storage { color: var(--ink); font-weight: 600; }
.pickup-item .toggle { min-width: 120px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--line)); flex: none; }
.dot.ready { background: var(--confirmed); }
.dot.not-ready { background: var(--noshow); }
.legend { display: flex; align-items: center; gap: 6px 8px; font-size: 16px; color: var(--muted); }
.legend .dot { margin-left: 6px; }
.legend .dot:first-child { margin-left: 0; }
.legend.wrap { flex-wrap: wrap; gap: 6px 16px; }
.legend.wrap > span { display: inline-flex; align-items: center; gap: 6px; }
.legend.wrap .dot { margin: 0; }

.delayed-box { border-color: var(--banner-line); background: var(--banner-bg); color: var(--banner-ink); }
.delayed-box > strong { display: flex; align-items: center; gap: 8px; }
.delayed-box p { margin: 6px 0 10px; }
.delayed-box textarea { margin-bottom: 10px; }
.comment { padding: 8px 12px; margin-bottom: 8px; border-radius: 8px; background: var(--surface); color: var(--ink); }
.comment p { margin: 0 0 6px; white-space: pre-line; }

.sop-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.sop-group summary { padding: 12px 16px; font-weight: 600; font-size: 19px; cursor: pointer; background: var(--paper); }
.sop { padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.sop strong { font-size: 19px; }
.sop p { margin: 6px 0 0; white-space: pre-line; }
.label-inline { font-weight: 600; color: var(--accent); }

/* timesheets, read only: year number, then week number, each folded with a rule on its left */
.sheet-tools { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 8px; }
.sheet-group { margin: 0 0 6px; }
.sheet-group > summary { list-style: none; cursor: pointer; padding: 4px 0 8px; }
.sheet-group > summary::-webkit-details-marker { display: none; }
.sheet-group:not([open]) > summary .sheet-title svg { transform: rotate(-90deg); }
.sheet-group > :not(summary) { margin-left: 8px; padding-left: 20px; border-left: 1px solid var(--line); }
.sheet-label { font-size: 15px; color: var(--muted); margin-bottom: 2px; }
.sheet-title { display: inline-flex; align-items: center; gap: 12px; font-size: 21px; }
.sheet-title svg { color: var(--muted); }
.sheet-title .group-count { font-weight: 400; }
table.sheets { width: 100%; max-width: 900px; margin-bottom: 18px; border-collapse: collapse; font-size: 17px; }
table.sheets th { text-align: left; font-weight: 400; font-size: 15px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); }
table.sheets td { padding: 12px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
table.sheets tbody tr:hover { background: var(--hover); }
table.sheets .sorted { display: inline-flex; align-items: center; gap: 4px; }
/* the timesheets' month, weekend folded into one column; read only, so every entry looks the same */
.sheet-calendar .month { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-calendar .month strong { font-size: 22px; }
.sc-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, .7fr); gap: 3px; }
.sc-head { font-size: 14px; color: var(--muted); text-align: center; padding-bottom: 4px; }
.sc-cell { min-height: 74px; padding: 4px; border-radius: 8px; background: var(--paper); display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.sc-cell.blank { background: transparent; }
.sc-cell.weekend { background: #F6F2EC; }
.sc-cell.today .n { background: var(--accent); color: #fff; border-radius: 50%; width: 26px; text-align: center; }
.sc-cell .n { font-size: 16px; font-weight: 600; line-height: 26px; }
.sheet-entry { padding: 1px 6px; border-radius: 4px; font-size: 13px; line-height: 1.3; background: var(--chip); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the timesheets' calendar on a computer: a shift a bar, green up to 8 hours, yellow above; its fields over the day */
.mbar.sheet-bar { width: 100%; border: 0; text-align: left; background: #CFE2C3; color: #2F4626; cursor: pointer; }
.mbar.sheet-bar:hover { filter: brightness(.95); color: #2F4626; }
.mbar.sheet-bar.over { background: #F2D88F; color: #5C4310; }
.sheet-grid .mcell.weekend .sheet-bar { padding: 0 4px; }
.day-popup.sheet-card { display: block; width: max(calc(100% + 12px), 420px); padding: 0; }
.sheet-card-head { display: flex; justify-content: flex-end; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--paper); border-radius: 10px 10px 0 0; }
.sheet-card-fields { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px 16px; align-items: center; margin: 0; padding: 20px 20px 22px; }
.sheet-card-fields dt { font-size: 17px; color: var(--ink-soft); line-height: 1.3; }
.sheet-card-fields dd { margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-variant-numeric: tabular-nums; }
.sheet-task { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.task-card.sheet-task::before { background: #8DBB79; }
.task-card.sheet-task.over::before { background: #D9B04A; }
table.sheets td:not(:first-child) { white-space: nowrap; }
/* row height and headers, as chosen in the tools */
table.sheets th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; }
table.sheets.wrap-headers th { white-space: normal; }
table.sheets { table-layout: fixed; }
table.sheets th:first-child { width: 40%; }
table.sheets.rows-short td { padding-top: 5px; padding-bottom: 5px; }
table.sheets.rows-tall td { padding-top: 20px; padding-bottom: 20px; }
table.sheets.rows-extra td { padding-top: 30px; padding-bottom: 30px; }
.menu-item > svg:first-child { flex: none; color: var(--ink-soft); }
.menu-item > span { flex: 1; }
@media (max-width: 959px) {
  .sheet-group > :not(summary) { margin-left: 6px; padding-left: 10px; }
  table.sheets { font-size: 16px; }
  table.sheets th, table.sheets td { padding: 10px 6px; }
}
@media (min-width: 960px) { .sheet-tools { margin: 16px 32px 0 0; } }

/* start: the interface's three cards and its introduction links */
.start { display: grid; gap: 20px; }
.start-cards { display: grid; gap: 12px; align-content: start; }
.start-heading { margin: 0; font-size: 22px; font-weight: 600; }
.start-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 10px; background: var(--panel); color: var(--ink); text-decoration: none; }
.start-card:hover { background: var(--panel-hover); color: var(--ink); }
.start-card-text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.start-card strong { display: flex; align-items: center; gap: 8px; font-size: 20px; line-height: 1.2; color: var(--accent); }
.start-card small { font-size: 16px; line-height: 1.4; color: var(--muted); }
.start-card-note { justify-self: start; margin-top: 4px; padding: 1px 10px; border-radius: 8px; font-size: 15px; font-weight: 600; background: var(--ok-bg); color: var(--ok-ink); }
.start-card-note.warn { background: var(--wait-bg); color: var(--wait-ink); }
.round-arrow { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; }
.start-alert { display: flex; align-items: center; gap: 8px; margin: 0; text-decoration: none; }
.intro-panel { display: grid; gap: 16px; padding: 22px; border-radius: var(--radius); background: var(--panel); }
.intro-panel h2 { margin: 0; font-size: 22px; font-weight: 600; }
.intro-panel a { display: flex; gap: 10px; font-size: 18px; font-weight: 600; line-height: 1.35; color: var(--ink); text-decoration: none; }
.intro-panel a svg { margin-top: 4px; }
.intro-panel a:hover { color: var(--accent); }
.intro-panel p { margin: 0; }

/* tags of the tables: the task type, the product type, a person */
.type-pill, .ptype, .person-chip { display: inline-flex; align-items: center; padding: 2px 12px; border-radius: 999px; white-space: nowrap; }
.type-pill { font-weight: 600; background: var(--chip); color: var(--ink); }
.type-pill.first, .type-block.first { background: var(--ok-bg); color: var(--ok-ink); }
.type-pill.remake, .type-block.remake { background: var(--remake); color: #fff; }  /* pinkBright in Airtable */
.type-pill.claim, .type-block.claim { background: var(--bad); color: #fff; }
.type-pill.off, .type-block.off { background: var(--off); color: #fff; }
.ptype { background: var(--chip); color: var(--ink-soft); }
.ptype.fabric { background: var(--fabric-bg); color: var(--fabric-ink); }
.ptype.rail { background: var(--rail-bg); color: var(--rail-ink); }
/* the other product types in their Airtable colours (cyan, teal, green, yellow, orange and red, light 2) */
.ptype.honeycomb { background: #D3F2F8; color: #0B4E5C; }
.ptype.vertical { background: #CDF3EC; color: #0B4D42; }
.ptype.roller { background: #D9F2D0; color: #20491A; }
.ptype.roman { background: #FCEDB8; color: #5C4508; }
.ptype.venetian { background: #FDE2CE; color: #6A3209; }
.ptype.accessory { background: #FBD9DC; color: #6E1A23; }
.ptype.glider { background: var(--glider-bg); color: var(--fabric-ink); }
.person-chip { padding: 1px 10px; border: 1px solid var(--line); background: var(--surface); }

/* the tables of the installers' pages on a computer: an installation a row, its items folded out under it */
/* one column: every row and folded-out item table is as wide as the widest, so they scroll sideways together */
.xtable { display: grid; overflow-x: auto; }
.xtable > .x-items { overflow-x: visible; }
.x-head, .xtable .x-row { display: grid; grid-template-columns: var(--cols); column-gap: 16px; align-items: center; padding-right: 32px; }
.x-head { height: 44px; font-size: 15px; color: var(--muted); border-bottom: 1px solid var(--line); }
.x-head .num, .x-cell.num { text-align: right; }
.x-head .sorted { display: inline-flex; align-items: center; gap: 4px; }
/* an item with the rail it links to nested under it, as in the interface */
.x-nest { display: flex; align-items: center; gap: 6px; min-width: 0; }
.x-nest.sub { padding-left: 38px; }
.x-fold.small { width: 26px; height: 26px; flex: none; }
.x-fold-space { flex: none; width: 26px; }
.x-count { flex: none; color: var(--faint); font-size: 15px; }
.x-check { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--control); border-radius: 4px; background: var(--surface); }
.x-check.on { border-color: var(--st-green-bright); background: var(--st-green-bright); color: var(--st-green-ink); }
.xtable > .x-row { position: relative; min-height: 72px; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); font-size: 17px; cursor: pointer; }
.x-row:hover { background: var(--hover); }
.x-row.pending::before { content: ""; position: absolute; left: 2px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--accent-line); }
.x-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-cell.wrap { white-space: normal; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.x-cell.muted { color: var(--muted); }
.x-cell .none { color: var(--faint); }
.x-cell .rep-chip.big { display: block; }
.x-cell a.rep-chip { color: var(--ink); text-decoration: none; }
.x-cell a.rep-chip:hover { background: var(--panel-hover); color: var(--ink); }
.x-fold { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--faint); }
.x-fold:hover { background: var(--chip); color: var(--ink); }
.x-lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.x-lead > span:not(.muted) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.x-lead .rep-chip.big { flex: 0 1 auto; min-width: 0; }
.open-link { flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none; }
.open-link:hover { color: var(--accent); }
.x-date { display: flex; flex-wrap: wrap; column-gap: 14px; }
.x-progress { display: flex; align-items: center; gap: 12px; }
.x-progress .bar { flex: none; display: flex; width: 90px; height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.x-progress .bar > span { background: var(--syncing); }
.x-progress .bar.full > span { background: var(--confirmed); }
.x-items { overflow-x: auto; padding: 4px 0 16px 52px; border-bottom: 1px solid var(--line); }
.x-items .x-head { height: 42px; padding-right: 0; }
.x-items .x-row { position: relative; min-height: 56px; padding-right: 0; border-bottom: 1px solid var(--line-soft); font-size: 17px; cursor: pointer; }
.x-items .x-row > :first-child { align-self: stretch; display: flex; align-items: center; padding-left: 14px; border-left: 3px solid transparent; }
.x-items .x-row.is-done > :first-child { border-left-color: var(--confirmed); }
.x-items .x-row.is-todo > :first-child { border-left-color: var(--accent); }
/* a day's items, coloured by "Status of Line Item" with Airtable's colours */
.x-items .x-row[class*=" st-"] > :first-child { border-left-width: 5px; padding-left: 12px; }
.item-mini[class*=" st-"] { padding-left: 12px; border-left: 5px solid transparent; }
.x-items .x-row.st-blue-bright > :first-child, .item-mini.st-blue-bright { border-left-color: var(--st-blue-bright); }
.x-items .x-row.st-blue-dark > :first-child, .item-mini.st-blue-dark { border-left-color: var(--st-blue-dark); }
.x-items .x-row.st-green-bright > :first-child, .item-mini.st-green-bright { border-left-color: var(--st-green-bright); }
.x-items .x-row.st-green-light > :first-child, .item-mini.st-green-light { border-left-color: var(--st-green-light); }
.x-items .x-row.st-red-bright > :first-child, .item-mini.st-red-bright { border-left-color: var(--st-red-bright); }
.view-installer .tag.st-blue-bright { background: var(--st-blue-bright); color: #fff; }
.view-installer .tag.st-blue-dark { background: var(--st-blue-dark); color: #fff; }
.view-installer .tag.st-green-bright { background: var(--st-green-bright); color: var(--st-green-ink); }
.view-installer .tag.st-green-light { background: var(--st-green-light); color: var(--st-green-ink); }
.view-installer .tag.st-red-bright { background: var(--st-red-bright); color: #fff; }
.pick-tick { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1.5px solid var(--faint); border-radius: 50%; background: var(--surface); color: transparent; }
.pick-tick:hover { border-color: var(--confirmed); color: var(--confirmed); }
.pick-tick[aria-pressed=true] { border-color: var(--confirmed); background: var(--confirmed); color: #fff; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.outline-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 9px;
  border: 1px solid var(--control); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none;
}
.outline-button:hover { background: var(--hover); color: var(--ink); }
.page-intro .legend { flex-wrap: wrap; }

/* the month on a computer: every installation a bar in its day */
.cal-bar { display: flex; align-items: center; gap: 8px; padding: 16px 32px 8px 0; }
.cal-title { font-size: 24px; }
.cal-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-button.ghost { width: 36px; height: 36px; color: var(--ink); }
.icon-button.ghost:hover { background: var(--chip); }
.tool-button { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border: 1px solid var(--control); border-radius: 6px; background: var(--surface); color: var(--ink); text-decoration: none; }
.tool-button:hover { background: var(--hover); color: var(--ink); }
.mgrid-head { display: grid; grid-template-columns: var(--cols); padding-bottom: 6px; font-size: 17px; text-align: center; }
.mgrid {
  display: grid; grid-template-columns: var(--cols); grid-template-rows: repeat(var(--weeks), minmax(112px, 1fr));
  height: max(calc(100dvh - var(--desk-top) - 230px), calc(var(--weeks) * 112px));
  border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface);
}
.mcell { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.mcell.weekend { background: #F6F2EC; }
.mnum { align-self: flex-end; display: grid; place-items: center; min-width: 30px; height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: none; font-size: 18px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.mnum:hover { background: var(--chip); }
.mcell.other .mnum, .mcell.outside .mnum { color: var(--faint); }
.mnum.today { background: var(--accent); color: #fff; font-weight: 600; }
.mbar { display: block; flex: none; height: 26px; line-height: 26px; padding: 0 8px; border-radius: 4px; background: var(--c, var(--accent)); color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.mbar:hover { color: #fff; filter: brightness(.9); }
.mbar.unconfirmed { color: var(--ink); }
.mcount { align-self: flex-start; padding: 0; border: 0; background: none; font-size: 15px; color: var(--muted); }
.mcount:hover, .mcount[aria-expanded=true] { color: var(--accent); text-decoration: underline; }
/* a day's tasks, opened over its cell */
.mcell.popped { overflow: visible; z-index: 3; }
.day-popup {
  position: absolute; top: -6px; left: -6px; z-index: 4; display: grid; gap: 8px; width: max(calc(100% + 12px), 270px); padding: 12px 14px 16px;
  border: 1px solid var(--control); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px rgba(43, 38, 34, .18); cursor: default;
}
.day-popup.end { left: auto; right: -6px; }
.day-popup-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; margin-bottom: 2px; border-bottom: 2px solid var(--line); font-size: 18px; }
.day-popup .mbar { height: 32px; line-height: 32px; font-size: 16px; }
.mnum.today:hover { background: var(--accent-strong); }
/* expanded: the rows grow to show every task; one row (a day, 3 days, a week) fills the screen and scrolls */
.mgrid.expanded { height: auto; grid-template-rows: repeat(var(--weeks), minmax(112px, auto)); }
.mgrid.expanded .mcell { overflow: visible; }
.mgrid.single .mcell { overflow-y: auto; }
.tool-button.square { width: 36px; justify-content: center; padding: 0; }
button.tool-button { gap: 8px; font-size: inherit; cursor: pointer; }

/* the calendar's popovers: the date picker, the view and the row height */
.pop-anchor { position: relative; }
.popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 10; min-width: 250px; padding: 8px;
  border: 1px solid var(--control); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px rgba(43, 38, 34, .18);
}
.popover.end { left: auto; right: 0; }
.menu-list { display: grid; min-width: 260px; }
.menu-list hr { width: 100%; margin: 6px 0; border: 0; border-top: 1px solid var(--line); }
.menu-label { padding: 6px 12px 2px; font-size: 14px; color: var(--muted); }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; padding: 6px 12px; border: 0; border-radius: 6px; background: none; text-align: left; }
.menu-item:hover { background: var(--hover); }
.menu-item small { display: block; font-size: 15px; color: var(--muted); }
.menu-item svg { color: var(--accent); }
.picker-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; }
.picker-grid { display: grid; grid-template-columns: repeat(7, 38px); gap: 2px; text-align: center; }
.picker-dow { font-size: 14px; color: var(--muted); padding-bottom: 4px; }
.picker-day { height: 36px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: none; font-variant-numeric: tabular-nums; }
.picker-day:hover { background: var(--hover); }
.picker-day.other { color: var(--faint); }
.picker-day.today { border-color: var(--control); }
.picker-day.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.cal-search { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 4px 0 12px; border: 1px solid var(--accent); border-radius: 9px; background: var(--surface); color: var(--muted); }
.cal-search input { width: 220px; min-height: 0; margin: 0; padding: 0; border: 0; outline: 0; background: none; }
.cal-search input:focus-visible { outline: 0; }
.cal-search input::-webkit-search-cancel-button { display: none; }
.intro-actions { align-items: center; }
/* the side panel of the calendar: every task, or a search's results; the calendar makes room for it */
.cal-body.with-panel { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; }
.cal-body .cal-bar, .cal-body .count-bar { padding-right: 0; }
.cal-panel { position: sticky; top: calc(var(--desk-top) + 12px); align-self: start; display: flex; flex-direction: column;
  height: calc(100dvh - var(--desk-top) - 40px); margin-top: 12px; padding-left: 20px; border-left: 1px solid var(--line); }
.cal-panel-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cal-panel-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 4px 12px 0; }
.task-card { position: relative; flex: none; display: block; padding: 14px 16px 14px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--ink); text-decoration: none; overflow: hidden; }
.task-card::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 5px; border-radius: 3px; background: var(--c, var(--line)); }
.task-card:hover { background: var(--hover); color: var(--ink); }
.task-card strong { display: block; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-card small { display: block; margin-top: 4px; font-size: 16px; color: var(--muted); }
.cal-search-count { flex: none; font-size: 15px; color: var(--muted); white-space: nowrap; }
/* the calendar on a phone: the computer's bar, grid and panel, smaller; a day's tasks open in a sheet from the bottom */
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; }
@media (max-width: 959px) {
  .cal-intro .intro-actions { flex-wrap: nowrap; gap: 8px; }
  .cal-intro .intro-actions:has(.cal-search) { flex-wrap: wrap; }
  .cal-intro .intro-actions > a { flex: 1 1 0; min-height: 40px; padding: 0 10px; font-size: 16px; white-space: nowrap; }
  .cal-intro .intro-actions > a svg { display: none; }
  .cal-intro .cal-search { flex: 1 1 100%; }
  .cal-intro .cal-search input { flex: 1; width: auto; min-width: 0; }
  .cal-bar { position: relative; flex-wrap: wrap; gap: 8px 4px; padding: 4px 0 12px; }
  .cal-title { flex: 1; min-width: 0; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-tools { flex: 1 1 100%; margin: 0; gap: 8px; }
  .cal-tools .tasks-button { margin-left: auto; }
  .cal-bar .pop-anchor { position: static; }
  .cal-bar .popover { top: 100%; }
  .cal-bar .popover:not(.end) { left: 0; }
  .mgrid-head { font-size: 14px; color: var(--muted); }
  .mgrid.phone { height: auto; grid-template-rows: repeat(var(--weeks), minmax(76px, auto)); }
  .mgrid.phone.single { grid-template-rows: minmax(260px, auto); }
  .mgrid.phone .mcell { padding: 0; }
  .mgrid.phone .mnum { min-width: 24px; height: 24px; padding: 0 3px; font-size: 15px; }
  .mgrid.phone .mtap { flex: 1; display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; padding: 2px; border: 0; background: none; text-align: left; font: inherit; color: inherit; }
  .mgrid.phone .mbar { height: 22px; line-height: 22px; padding: 0 4px; font-size: 13px; }
  .mgrid.phone.dense .mbar { padding: 0 2px; font-size: 12px; text-align: center; text-overflow: clip; }
  .mgrid.phone .mcount { font-size: 13px; line-height: 1.15; color: var(--ink-soft); pointer-events: none; }
  .mgrid.phone .mcell.popped { background: var(--accent-soft); overflow: hidden; }
  .mgrid.phone .mcell.popped .mcount { color: var(--accent); }
  .cal-panel { position: static; height: auto; margin-top: 8px; padding-left: 0; border-left: 0; }
  .cal-panel-list { overflow: visible; padding-right: 0; }
  .day-sheet { position: fixed; inset: 0; z-index: 45; display: flex; align-items: flex-end; }
  .day-sheet-backdrop { position: absolute; inset: 0; background: rgba(43, 38, 34, .32); }
  .day-sheet .day-popup { position: relative; inset: auto; width: 100%; max-height: 75dvh; overflow-y: auto; gap: 10px;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); border: 0; border-radius: 14px 14px 0 0; }
  .day-sheet .mbar { height: 44px; line-height: 44px; padding: 0 12px; font-size: 16px; }
  .day-sheet .tool-button { justify-content: center; height: 44px; margin-top: 4px; }
  body:has(.view:not([hidden]) .day-sheet) .tabs { display: none; }
  .tasks-sheet .cal-panel { position: relative; width: 100%; height: 80dvh; margin: 0; padding: 14px 16px env(safe-area-inset-bottom);
    border-radius: 14px 14px 0 0; background: var(--paper); box-shadow: 0 -12px 32px rgba(43, 38, 34, .18); }
  .tasks-sheet .cal-panel-list { overflow-y: auto; overscroll-behavior: contain; }
}
}

/* claim SOPs on a computer: a table per product type */
.sop-table { margin: 0 0 18px; }
.sop-table summary { display: flex; align-items: center; gap: 12px; padding: 6px 0 10px; cursor: pointer; list-style: none; font-size: 21px; }
.sop-table summary::-webkit-details-marker { display: none; }
.sop-table:not([open]) summary svg { transform: rotate(-90deg); }
.sop-table .ptype { font-size: 19px; padding: 2px 16px; }
.sop-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .8fr) minmax(0, 1.5fr); gap: 24px; margin-left: 8px; padding: 16px 0 16px 16px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line-soft); font-size: 18px; line-height: 1.4; white-space: pre-line; }
.sop-row.x-head { display: grid; height: auto; padding: 10px 0 10px 16px; border-bottom-color: var(--line); white-space: normal; }
.sop-row small { display: block; margin-top: 6px; font-size: 16px; }

/* a record's panel: its parts in tinted boxes, as the interface's record pages */
.panel-box { margin-bottom: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); }
.panel-box h3 { margin: 0 0 14px; font-size: 22px; }
.panel-box .fact-label { color: var(--ink); font-weight: 600; }
.panel-box .rep-chip { background: #E7E0D6; }
.type-block { display: flex; align-items: center; min-height: 40px; padding: 4px 14px; line-height: 1.2; border-radius: 6px; font-weight: 600; background: var(--chip); }
.big-value { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.note-row { margin: 0; white-space: pre-line; line-height: 1.4; }
.note-row + .note-row { margin-top: 12px; }
.note-row p { margin: 4px 0 0; }

/* a task's panel: the interface's record page, its groups folding and reached from the tabs */
.task-steps { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; font-size: 16px; color: var(--muted); }
.task-steps .icon-button { width: 36px; height: 36px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); color: var(--ink); }
.task-steps .icon-button:hover:not(:disabled) { background: var(--hover); }
.task-steps .icon-button:disabled { opacity: .45; cursor: default; background: var(--surface); }
.task-steps span { margin-left: 8px; }
.group-tabs { position: sticky; top: -16px; z-index: 2; display: flex; gap: 0; margin: 0 -18px 14px; padding: 0 18px; overflow-x: auto;
  background: var(--paper); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.group-tabs button { flex: none; min-height: 48px; padding: 0 2px; margin-right: 20px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); font-size: 16px; white-space: nowrap; cursor: pointer; }
.group-tabs button:hover { background: none; color: var(--ink); }
.group-tabs button.on { background: none; color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 6px 14px;
  border: 0; border-radius: 8px; background: var(--bad); color: #fff; font-weight: 600; font-size: 16px;
}
.danger:hover { background: #7d2222; color: #fff; }
.panel-group { scroll-margin-top: 64px; }
.panel-group > summary { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; list-style: none; cursor: pointer; }
.panel-group > summary::-webkit-details-marker { display: none; }
.panel-group > summary h3 { margin: 0; font-size: 22px; }
.panel-group > summary svg { flex: none; color: var(--muted); transition: transform .15s; }
.panel-group:not([open]) > summary { margin-bottom: 0; }
.panel-group:not([open]) > summary svg { transform: rotate(-90deg); }
.group-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.group-note { margin: 0 0 16px; padding: 10px 12px; border-left: 3px solid var(--accent-line); background: var(--accent-soft); border-radius: 0 6px 6px 0; font-size: 16px; color: var(--ink-soft); }
.panel-group .fact-value > .primary, .panel-group .fact-value > .secondary, .group-actions > .secondary { width: auto; min-height: 40px; margin: 0; padding: 6px 14px; font-size: 16px; }
.panel-group .fact-value input { width: 100%; }
.group-actions > [aria-pressed=true] { background: var(--wait-bg); color: var(--wait-ink); border-color: transparent; }
.addons { display: grid; gap: 10px; justify-items: start; }
.addons .rep-chip.waiting { background: var(--wait-bg); color: var(--wait-ink); }
.addons > .secondary, .addon-form > .primary, .addon-form > .secondary { width: auto; min-height: 40px; margin: 0; padding: 6px 14px; font-size: 16px; }
.addon-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; width: 100%; }
.addon-form select { flex: 1 1 240px; min-width: 0; min-height: 40px; }
.addon-qty { display: grid; gap: 2px; font-size: 14px; color: var(--muted); }
.panel-group .fact-value .addon-qty input { width: 84px; min-height: 40px; }
.task-pictures { display: grid; gap: 10px; }
.task-picture { display: grid; place-items: center; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); overflow: hidden; cursor: zoom-in; }
.task-picture img { display: block; max-width: 100%; max-height: 420px; object-fit: contain; }
.task-picture .no-photo { padding: 24px; color: var(--muted); }
.field-hint { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.not-yet:disabled { opacity: .5; cursor: not-allowed; }
input:disabled, textarea:disabled { background: var(--hover); cursor: not-allowed; }
.panel-group .x-items { margin: 0 -16px; padding: 0 16px 4px; border-bottom: 0; }
.panel-group .x-items .x-head, .panel-group .x-items .x-row { display: grid; grid-template-columns: var(--cols); column-gap: 16px; align-items: center; min-width: 860px; }
.panel-group .x-items .x-row { background: var(--surface); }
.panel-group .fact-value .rep-chip { white-space: normal; }
@media (max-width: 600px) { .panel-group .fact-grid { grid-template-columns: 1fr; } }
.panel-group .x-items .x-row:hover { background: var(--hover); }
.panel-comments { margin: 4px 0 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.panel-comments h3 { margin: 0 0 10px; font-size: 20px; }
.panel-comments textarea { margin: 10px 0; }
@media (min-width: 960px) {
  .group-tabs { top: -20px; margin: 0 -24px 16px; padding: 10px 24px; }
  .drawer.wide .panel-group .x-items { margin: 0 -28px; padding: 0 28px 4px; }
}

@media (min-width: 960px) {
  .view > h1.page-title:first-child {
    position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal;
    margin: 20px 0 36px; padding-bottom: 26px; border-bottom: 1px solid var(--line); font-size: 52px; font-weight: 700; line-height: 1.1;
  }
  .view:has(> .start) { max-width: 1240px; padding: 24px 64px 48px; }
  .start { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .start-cards { gap: 20px; }
  .start-heading, .intro-panel h2 { font-size: 26px; }
  .start-card { gap: 20px; padding: 22px 26px; }
  .start-card strong { font-size: 23px; }
  .start-card small { font-size: 18px; }
  .round-arrow { width: 46px; height: 46px; }
  .intro-panel { margin-top: 56px; gap: 22px; padding: 34px 32px; }
  .intro-panel a { font-size: 20px; }
  .drawer.wide .panel-box { margin-bottom: 16px; padding: 24px 28px; }
  .drawer.wide .panel-box .fact-grid { gap: 20px 32px; }
  .view-installer .drawer.wide .drawer-panel { width: min(560px, 100vw - var(--sidebar)); }
  .view-installer .group-tabs button { font-size: 17px; border-bottom-width: 2px; }
}

/* phone installer frames: smaller type and stacked rows, so a day's jobs and a task are not cramped */
@media (max-width: 959px) {
  body:has(.view-installer:not([hidden])) .crumb-section { font-size: 12px; line-height: 1.2; }
  body:has(.view-installer:not([hidden])) .crumb-title { font-size: 17px; line-height: 1.25; }
  .view-installer { padding: 12px 12px calc(var(--tabs) + 20px); }
  .view-installer .alert { font-size: 14px; padding: 10px 12px; }
  .day-note { margin: 0 0 12px; padding: 2px 4px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
  .day-note summary { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; list-style: none; }
  .day-note summary::-webkit-details-marker { display: none; }
  .day-note summary svg { flex: none; margin-top: 2px; color: #C9962E; }
  .day-note summary span { min-width: 0; }
  .day-note summary strong { font-weight: 700; color: var(--ink); }
  .day-note[open] summary strong { display: none; }
  .day-note p { margin: 6px 0 0 24px; }
  .day-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
  .day-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 16px 0; }
  .day-time { font-size: 26px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
  .day-card .type-pill { height: 30px; padding: 0 10px; border-radius: 15px; font-size: 14px; font-weight: 600; }
  .day-name { display: block; margin: 10px 16px 0; font-size: 17px; font-weight: 600; color: var(--ink); text-decoration: none; }
  .day-name:hover { color: var(--ink); }
  .day-place { display: flex; align-items: center; gap: 6px; margin: 4px 16px 0; font-size: 14px; color: var(--muted); }
  .day-place svg { flex: none; }
  .day-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 16px; }
  .panel-group .day-acts { padding: 0; }
  .act {
    display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 10px;
    background: var(--chip); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600;
  }
  .act:active { background: var(--panel-hover); color: var(--ink); }
  .items-left {
    display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 0 16px;
    border: 0; border-top: 1px solid var(--line); background: var(--panel); font-size: 14px; font-weight: 600; text-align: left;
  }
  .items-left .muted { font-weight: 500; margin-left: 6px; }
  .mrow { position: relative; display: flex; align-items: center; gap: 8px; min-height: 80px; padding: 10px 4px 10px 18px; border-top: 1px solid var(--line-soft); }
  .mrow.rail { padding-left: 36px; }
  .mrow::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--bar, transparent); }
  .mrow.fabric-bar { --bar: #166EE1; }
  .mrow.rail-bar { --bar: #20C933; }
  .mrow.st-blue-bright { --bar: var(--st-blue-bright); }
  .mrow.st-blue-dark { --bar: var(--st-blue-dark); }
  .mrow.st-green-bright { --bar: var(--st-green-bright); }
  .mrow.st-green-light { --bar: var(--st-green-light); }
  .mrow.st-red-bright { --bar: var(--st-red-bright); }
  .mrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; color: inherit; text-decoration: none; }
  .mrow-main strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mrow-main small { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mrow-main .tags { margin: 0; }
  .day-card .type-pill, .day-card .ptype, .day-card .rep-chip, .mrow .ptype, .mrow .rep-chip, .phone-lines .ptype, .phone-lines .rep-chip { font-size: 14px; }
  .tick-hit { flex: none; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; }
  .tick-hit input { width: 26px; height: 26px; accent-color: var(--dark); }
  .view-installer .drawer-panel {
    display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .view-installer .drawer-label { display: none; }
  .view-installer .drawer-back {
    grid-column: 1; grid-row: 1; align-self: start; height: auto; border: 0; background: var(--surface); padding-top: 6px;
  }
  .view-installer .drawer-back .link { min-height: 44px; padding: 0 6px; font-size: 0; gap: 0; color: var(--ink); }
  .view-installer .drawer-head {
    grid-column: 2; grid-row: 1; min-height: 60px; padding: 8px 12px 0 0; background: var(--surface); border-bottom: 0;
  }
  .view-installer .drawer-body, .view-installer .drawer-foot { grid-column: 1 / -1; }
  .view-installer .drawer-title { font-size: 19px; font-weight: 700; line-height: 1.25; }
  .view-installer .drawer-sub { margin-top: 0; font-size: 14px; line-height: 1.3; }
  .view-installer .drawer-body { padding: 0 12px 20px; background: var(--paper); }
  .view-installer .drawer-body > .tags { margin-bottom: 8px; }
  .view-installer .tag { font-size: 14px; }
  .view-installer .fact-label, .view-installer .drawer-body .field-label { font-size: 14px; }
  .view-installer .fact-value { font-size: 15px; }
  .view-installer .fact-grid { gap: 14px 12px; }
  .view-installer .panel-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
  .view-installer .panel-group:not(details) { display: flex; flex-direction: column; gap: 16px; }
  .view-installer .panel-group > h3, .view-installer .panel-box h3 { margin: 0; font-size: 19px; font-weight: 600; }
  .view-installer .group-tabs {
    position: sticky; top: 0; z-index: 2; margin: 0 -12px 12px; padding: 0 12px; background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .view-installer .group-tabs button { min-height: 44px; margin-right: 18px; font-size: 15px; border-bottom-width: 3px; }
  .view-installer .phone-facts { display: flex; flex-direction: column; gap: 18px; }
  .view-installer .phone-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .view-installer .phone-facts .fact-label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
  .view-installer .phone-facts .fact-value { font-size: 15px; }
  .view-installer .group-actions { margin: 0; }
  .view-installer .group-actions > .danger { width: 100%; min-height: 48px; border-radius: 12px; }
  .view-installer .big-value { font-size: 24px; }
  .view-installer .primary, .view-installer .secondary { min-height: 48px; font-size: 16px; }
  .view-installer .drawer-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); }
  .view-installer .drop { flex-direction: column; gap: 8px; min-height: 120px; border-radius: 12px; color: var(--ink-soft); font-size: 15px; font-weight: 500; }
  .phone-lines { margin: 0 -4px; }
  .phone-lines .mini { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 56px; padding: 8px 4px; border-top: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
  .phone-lines .mini.rail { padding-left: 22px; }
  .phone-lines .mini-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .phone-lines .mini-main strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .phone-lines .tags { margin: 0; }
}

/* ---------- measure: house visits and the measurement form */

.view-measure { max-width: 760px; }
.view-measure .visits-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.view-measure .visits-head h1 { margin: 0; }
.view-measure .visits-head input[type=date] { width: auto; }
.visit {
  display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; color: var(--ink);
}
.visit:hover { background: var(--hover); }
.visit strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 19px; }
.visit small { color: var(--muted); display: block; margin-top: 2px; font-size: 16px; }
.view-measure .tag.draft { background: var(--accent-soft); color: #4E3A26; }
.view-measure .tag.waiting { background: var(--wait-bg); color: var(--wait-ink); }
.view-measure .tag.booked { background: var(--ok-bg); color: var(--ok-ink); }
.visit-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.visit-bar div { min-width: 0; }
.visit-bar strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 20px; }
.view-measure .card > h2 { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 14px; }

.fields { display: flex; flex-wrap: wrap; gap: 16px 12px; }
.view-measure .field { flex: 1 1 100%; min-width: 0; }
.view-measure .field.half { flex-basis: calc(50% - 6px); }
.view-measure .field.third { flex-basis: calc(33.333% - 8px); }
.label { display: block; font-weight: 600; margin-bottom: 6px; }
.label .req { color: var(--bad-ink); margin-left: 2px; }
.view-measure .hint { margin: -2px 0 6px; font-size: 16px; }
.view-measure .field.invalid .label { color: var(--bad-ink); }
.view-measure .field.invalid input[type=text], .view-measure .field.invalid textarea, .view-measure .field.invalid .picker, .view-measure .field.invalid .drop { border-color: var(--bad-ink); }
.view-measure .field.invalid::after { content: attr(data-required); display: block; margin-top: 4px; font-size: 16px; color: var(--bad-ink); }
.view-measure .chips { margin-bottom: 0; }
.view-measure .chip { min-height: 44px; }
.view-measure .picker {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; text-align: left; min-height: 48px;
  padding: 8px 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface);
}
.view-measure .picker:hover { background: var(--hover); }
.view-measure .picker.empty { color: var(--muted); }
.view-measure .picker::after { content: ""; flex: none; width: 8px; height: 8px; border: solid var(--faint); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.view-measure .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.view-measure .check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--dark); flex: none; }

.bends { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bend { padding: 6px; border: 1px solid var(--control); border-radius: 10px; background: var(--surface); font-size: 16px; font-weight: 600; }
.bend:hover { background: var(--hover); }
.bend img { display: block; width: 100%; height: 64px; object-fit: contain; margin-bottom: 4px; }
.bend.special { display: flex; align-items: center; justify-content: center; min-height: 100px; }
.bend[aria-pressed=true] { border: 2px solid var(--accent); background: var(--accent-soft); padding: 5px; }

.view-measure .thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.view-measure .thumb {
  position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--paper);
  display: flex; align-items: center; justify-content: center; font-size: 13px; text-align: center; padding: 4px; word-break: break-all;
}
.view-measure .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.view-measure .thumb button { position: absolute; z-index: 1; top: 3px; right: 3px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 0; background: rgba(43, 38, 34, .75); color: #fff; }
.view-measure .alert { flex: 1 1 100%; margin-bottom: 0; }
.view-measure .field .problem { margin: 6px 0 0; }

.submitbar {
  position: sticky; bottom: var(--tabs); z-index: 10; margin: 0 -16px; padding: 10px 16px;
  background: var(--paper); border-top: 1px solid var(--line);
}
.submitbar p { margin: 0 0 8px; font-size: 16px; color: var(--bad-ink); }
.submitbar .saved { color: var(--muted); }
body:has(.view input:focus, .view textarea:focus) .submitbar { bottom: 0; }
@media (min-width: 960px) {
  .submitbar { bottom: 0; margin: 0 -32px; padding: 12px 32px; }
}

.note { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: #4E3A26; font-size: 17px; }
.note .link { color: inherit; text-decoration: underline; }

.done { text-align: center; padding: 8px 0 4px; }
.done .tick { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: var(--online); color: #fff; }
.done .tick.pending { background: var(--syncing); }
table.preview { width: 100%; border-collapse: collapse; font-size: 16px; }
table.preview td { padding: 7px 0; border-top: 1px solid var(--line-soft); vertical-align: top; }
table.preview td:first-child { color: var(--muted); width: 46%; padding-right: 10px; }
table.preview td:last-child { word-break: break-word; }

.view-measure .item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; }
.view-measure .item strong { display: block; }
.view-measure .item small { display: block; color: var(--muted); font-size: 16px; margin-top: 2px; }
.view-measure .item .state { margin-top: 8px; }

/* a panel from the bottom on a phone, a dialog on a computer: record pickers and booking a visit */
.sheet { position: fixed; inset: 0; z-index: 45; background: rgba(20, 16, 14, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel {
  width: 100%; max-width: 640px; height: 88dvh; background: var(--surface); border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.sheet-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-head .row { margin-bottom: 10px; flex-wrap: nowrap; }
.sheet-head strong { font-size: 20px; }
.sheet-head input { background: var(--paper); margin: 0; }
.sheet-head .note { margin-bottom: 0; }
.sheet-head .note small { display: block; font-size: 16px; }
.sheet-second { margin-top: 12px; }
.sheet-head .sheet-second .row { margin-bottom: 0; }
.sheet-list { overflow-y: auto; flex: 1; padding-bottom: env(safe-area-inset-bottom); }
.option { display: block; width: 100%; text-align: left; padding: 12px 16px; background: none; border: 0; border-bottom: 1px solid var(--line-soft); }
.option:hover { background: var(--hover); }
.option[aria-selected=true] { background: var(--accent-soft); font-weight: 600; }
.option small { display: block; color: var(--muted); font-weight: 400; font-size: 16px; }
.option.with-image { display: flex; align-items: center; gap: 14px; }
.option-image { flex: none; width: 84px; height: 84px; }
.option-image img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 8px; background: #fff; }
.sheet-list .muted { padding: 16px; margin: 0; }
.sheet-foot { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet-foot .fields { margin-bottom: 12px; }
.sheet-foot .problem { margin: 0 0 10px; }
@media (min-width: 700px) {
  .sheet { align-items: center; }
  .sheet-panel { height: 72vh; border-radius: 16px; box-shadow: 0 20px 60px rgba(45, 35, 28, .22); }
}

/* printing a page: the page itself, without the frame and its tools */
@media print {
  .sidebar, .topbar, .tabs, .banner, .menu, .sheet-tools, .count-bar { display: none !important; }
  .shell { display: block; }
  .view { padding: 0; max-width: none; }
  body { background: #fff; }
}

/* the sales dashboard's date filter: the interface's operator menu, its choices opening beside it (one after the other on a phone) */
.dfilter { margin-bottom: 12px; }
.dfilter-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dfilter-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--control); border-radius: 10px;
  background: var(--surface); font: inherit; text-align: left; cursor: pointer; }
.dfilter-btn svg { margin-left: 6px; color: var(--muted); }
.dfilter-btn:hover, .dfilter-btn.open { border-color: var(--accent-line); background: var(--accent-soft); }
.dfilter-field { color: var(--muted); }
.dmenu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; display: flex; align-items: flex-start; gap: 6px; }
.dcol { min-width: 220px; padding: 6px; border: 1px solid var(--control); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px rgba(43, 38, 34, .18); }
.dcol hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--line); }
.dmenu-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.dmenu-item:hover, .dmenu-item.on, .dmenu-item:focus-visible { background: var(--hover); outline: none; }
.dmenu-item svg { flex: none; color: var(--accent); }
.dmenu-counted { display: inline-flex; align-items: center; white-space: nowrap; }
.dmenu .dmenu-n { flex: none; width: 56px; min-height: 30px; margin: 0 6px; padding: 2px 4px; border: 1px solid var(--control); border-radius: 6px; background: var(--chip); font: inherit; text-align: center; }
.dmenu-fields { display: grid; gap: 8px; padding: 4px 10px 10px; }
.dmenu-field { display: grid; gap: 2px; font-size: 14px; color: var(--muted); }
.dmenu-fields input[type="date"] { min-height: 38px; padding: 4px 8px; border: 1px solid var(--control); border-radius: 6px; background: var(--surface); font: inherit; color: var(--ink); }
.dback { display: none; }
@media (max-width: 599px) {
  .dmenu { right: 0; }
  .dcol { flex: 1; min-width: 0; }
  .dcol:not(:last-child) { display: none; }
  .dback { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 40px; margin-bottom: 4px; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--line);
    background: none; color: var(--accent-strong); font: inherit; text-align: left; cursor: pointer; }
}
