/* TechStone Field — app.css — tokens, layout system and components (BUILD-SPEC-v2 §4), in the
 * "Brand Light" style Will chose on 24 Sep 2026 (artboard A · Next Up): basalt header, offwhite stage,
 * white cards on warm #e0dbd3 rules, white tab bar with a copper indicator, Montserrat labels.
 *
 * Layout rulings, made mechanical (checked by test/field-app-css.test.js):
 *   - no horizontal scrolling, ever: every element min-width:0, overflow-wrap:anywhere on text,
 *     no overflow-x:auto/scroll, no fixed width above 360px outside the 768px breakpoint, no 100vw;
 *   - white-space:nowrap only on short pills (≤ 10 characters), times and the 9-letter wordmark;
 *   - inputs 16px or larger (anything smaller makes iOS zoom, which scrolls sideways);
 *   - targets 48px (44px floor); no tables; one breakpoint at 768px.
 * Home's layout is NOT here — it lives in modules/home.css so Phase 8 can replace it whole.
 */

/* ------------------------------------------------------------------ tokens (§4.1) */
:root {
  --basalt: #1E1F22;
  --copper: #B47A3C;          /* accents, icons, rules — never white text on copper (3.6:1) */
  --copper-ink: #8a6535;      /* copper-coloured text on light */
  --copper-deep: #6E4A22;     /* pressed states, small copper text */
  --mineral: #8A8F98;         /* disabled icons; never text on light (2.9:1) */
  --offwhite: #F4F3F1;
  --gold: #c8a96a;            /* selected tab on basalt; never text on light */
  --ink-soft: #5f5a52;        /* secondary text on light — the Brand Light warm grey (6.8:1 on white, 6.2:1 on offwhite); spec §4.1 proposed #5C6068 */
  --card: #FFFFFF;
  --rule: #e0dbd3;            /* card borders */
  --rule-soft: #eeeae4;       /* dividers inside a card */
  --btn-rule: #d6d0c6;
  /* Brand Light pills: copper, mineral, green, amber (all at least 6:1) */
  --p-cop-bg: #f3e8dc; --p-cop: #6E4A22;
  --p-min-bg: #e9eaec; --p-min: #44484f;
  --p-grn-bg: #e3efe6; --p-grn: #2d6a3e;
  --p-amb-bg: #fbeed5; --p-amb: #744a0a;
  --ok: #046c40;   --ok-bg: #e3f7ec;
  --warn: #8a5300; --warn-bg: #fff3e0;
  --bad: #a3132a;  --bad-bg: #ffe8ec;
  --info: #00449e; --info-bg: #cce5ff;
  --tech-dark: #d0cdc7;       /* TECH on a dark bar */
  --tech-light: #1a1a18;      /* TECH on a light surface */
  --tagline: #6d695d;
  --stone: linear-gradient(90deg, #8b5a2b, #a87040, #c4944f, #d4a85c, #e8c878, #f0d890, #e8c878, #d4a85c, #c4944f, #a87040, #8b5a2b);

  --f-head: Montserrat, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --f-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --hdr-h: 48px;
  --tab-h: 56px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --app-h: 100vh;
  --gutter: 12px;
  --radius: 12px;
  --row-h: 72px;
  --row-gap: 8px;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
  background: var(--basalt);
}
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ground, var(--offwhite));
  color: var(--ink, var(--basalt));
  font: 400 16px/1.45 var(--f-body);
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: rgba(180, 122, 60, .18);
}
h1, h2, h3 { font-family: var(--f-head); font-weight: 600; line-height: 1.25; margin: 0; }
p { margin: 0; }
a { color: var(--copper-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
.ic { width: 24px; height: 24px; flex: 0 0 auto; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.tnum, .srow-time, .badge-t, .alert-when { font-variant-numeric: tabular-nums; }
.prewrap { white-space: pre-wrap; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.tab-ic { display: inline-flex; height: 24px; }
:focus-visible { outline: 3px solid var(--copper); outline-offset: 2px; }

/* ------------------------------------------------------------------ frame (§4.4) */
.app {
  position: fixed;
  left: 0; right: 0; top: 0;
  height: var(--app-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@supports (height: 100dvh) { .app { height: 100dvh; } }

.hdr {
  flex: 0 0 auto;
  height: calc(var(--hdr-h) + var(--safe-t));
  padding: var(--safe-t) 6px 0 12px;
  background: var(--basalt);
  color: var(--tech-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.stage {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  background: var(--ground, var(--offwhite));
}
.stage:focus { outline: none; }
.tabbar {
  flex: 0 0 auto;
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 0 0 var(--safe-b);
  background: var(--card);
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
body.signed-out .tabbar .tab { visibility: hidden; }
/* Fix Wave E2 (staged launch): a tab switched off for this person is removed; the rest share the bar (app.js) */
.tabbar .tab[hidden] { display: none; }
.tabbar[data-tabs="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tabbar[data-tabs="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tabbar[data-tabs="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* L0: tab roots never scroll; L1: faces scroll vertically only */
.l0 {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 14px var(--gutter) 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.l0.l0-escape { overflow-y: auto; }                 /* declared escape valve: large text zoom */
.l0-center { justify-content: center; }
.face {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px var(--gutter) 24px;
}

/* ------------------------------------------------------------------ wordmark (§4.3, locked) */
.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  text-decoration: none;
  min-height: 44px;
  padding: 7px 0;
}
.brand-mark { display: block; flex: 0 0 auto; width: 30px; height: 30px; }
.brand-text { display: inline-flex; flex-direction: column; gap: 3px; line-height: 1; }
.brand-word {
  font-family: Montserrat, sans-serif;
  font-weight: 500;
  font-size: 16px;
  white-space: nowrap;                               /* the 9-letter wordmark, as the website sets it */
}
.ts-tech { color: var(--tech-dark); }
.on-light .ts-tech { color: var(--tech-light); }
.ts-stone {
  background: var(--stone);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.brand-tag {
  font-family: Montserrat, sans-serif;
  font-size: 6.5px;                                  /* the website's size; may wrap on a 320px phone rather than push sideways */
  font-weight: 400;
  letter-spacing: .22em;
  color: var(--tagline);
  text-align: left;
}
.hdr-right { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.ib {
  position: relative;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px; padding: 0;
  background: transparent;
  color: var(--tech-dark);
  cursor: pointer;
}
.ib .ic { width: 22px; height: 22px; }
.ib-count {
  position: absolute; top: 5px; right: 4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px;
  background: var(--copper); color: var(--basalt);
  font: 700 11px/17px var(--f-body);
  text-align: center;
}

/* ------------------------------------------------------------------ StateBadge (header) */
.badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-height: 32px;
  padding: 3px 8px;
  border-radius: 8px;
  font: 600 12px/1.15 var(--f-body);
  max-width: 96px;
}
.badge-offline { background: var(--info-bg); color: var(--info); }
.badge-stale { background: var(--warn-bg); color: var(--warn); }
.badge-failed { background: var(--bad-bg); color: var(--bad); }
.badge-t { font-weight: 500; }

/* ------------------------------------------------------------------ update bar */
.upd { flex: 0 0 auto; background: var(--copper-deep); }
.upd button {
  display: block;
  width: 100%;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* ------------------------------------------------------------------ TabBar */
.tab {
  position: relative;
  height: var(--tab-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-soft);
  text-decoration: none;
  font: 600 10.5px/1.1 var(--f-head);
  text-align: center;
}
.tab .ic { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--ink, var(--basalt)); }
.tab[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: -1px; left: 28%; right: 28%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--copper);
}

/* ------------------------------------------------------------------ buttons and fields */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--btn-rule);
  background: var(--card);
  color: var(--ink, var(--basalt));
  font: 600 13.5px/1.2 var(--f-head);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--copper-solid, var(--basalt)); border-color: var(--copper-solid, var(--basalt)); color: var(--offwhite); }
.btn-primary:active { background: #000; }
.btn-secondary:active { background: var(--ground, var(--offwhite)); }
.btn-destructive { color: var(--bad); border-color: var(--bad); }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 44px; padding: 8px 12px; font-size: 13px; }
.btn .ic { width: 17px; height: 17px; }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font: 600 14px/1.3 var(--f-body); color: var(--ink, var(--basalt)); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1.5px solid var(--grey-solid, var(--mineral));
  border-radius: 10px;
  background: var(--card);
  font-size: 16px;
}
.field input:focus { border-color: var(--copper); outline: none; box-shadow: 0 0 0 3px rgba(180, 122, 60, .25); }
.field-err { color: var(--bad); font: 500 14px/1.4 var(--f-body); }

/* ------------------------------------------------------------------ chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font: 600 12px/1 var(--f-body);
  white-space: nowrap;                              /* pills are ≤ 10 characters */
  background: var(--p-min-bg);
  color: var(--p-min);
}
.chip-cop { background: var(--p-cop-bg); color: var(--p-cop); }
.chip-grn, .chip-ok { background: var(--p-grn-bg); color: var(--p-grn); }
.chip-amb, .chip-warn { background: var(--p-amb-bg); color: var(--p-amb); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-info { background: var(--info-bg); color: var(--info); }
/* A pill whose text can run long (an activity type) wraps rather than pushing sideways. */
.chip-wrap { white-space: normal; height: auto; min-height: 24px; padding: 3px 9px; line-height: 1.2; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }

/* ------------------------------------------------------------------ region state rows (§6.2) */
.srow-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 10px;
  font: 500 14px/1.3 var(--f-body);
}
.st-ok { color: var(--ink-soft); padding-left: 0; }
.st-stale { background: var(--warn-bg); color: var(--warn); }
.st-offline { background: var(--info-bg); color: var(--info); }
.st-failed { background: var(--bad-bg); color: var(--bad); }
.st-forbidden { background: var(--card); color: var(--ink-soft); border: 1px solid var(--rule); }
.st-text { flex: 1 1 auto; }
.srow-state .btn { margin-left: auto; }

/* ------------------------------------------------------------------ SegmentedControl */
.seg {
  display: flex;
  flex: 0 0 auto;
  padding: 3px;
  gap: 8px;                 /* H1 (re-audit A2-4): targets 8 px apart (was 3 px — Meetings' Status, Schedule's day) */
  border-radius: 12px;
  background: #E9E6E1;
}
.seg-b {
  flex: 1 1 0;
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink, var(--basalt));
  font: 600 14px/1.15 var(--f-body);
  cursor: pointer;
}
.seg-b.on { background: var(--card); box-shadow: 0 1px 3px rgba(30, 31, 34, .18); }

/* ------------------------------------------------------------------ Deck + Pager */
.deck { display: flex; flex-direction: column; gap: 8px; }
.deck-rows { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--row-gap); overflow: hidden; }
.pager {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
}
.pg {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink, var(--basalt));
  cursor: pointer;
}
.pg:disabled { opacity: .35; cursor: default; }
.pg-next .ic { transform: rotate(180deg); }
.pg-t { flex: 1 1 auto; text-align: center; font: 500 14px/1.2 var(--f-body); color: var(--ink-soft); }
.deck-single .pg { visibility: hidden; }

/* ------------------------------------------------------------------ ScheduleRow */
.srow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: var(--row-h);
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink, var(--basalt));
  text-align: left;
  cursor: pointer;
}
.srow.is-pool { background: #FCFAF6; border-style: dashed; }
.srow.sel { border: 2px solid var(--copper); }
.srow-when { flex: 0 0 48px; display: flex; flex-direction: column; align-items: flex-start; }
.srow-day { font: 600 12px/1.2 var(--f-body); color: var(--ink-soft); }
.srow-time { font: 600 15px/1.2 var(--f-body); white-space: nowrap; }
.srow-glyph { flex: 0 0 auto; color: var(--copper); display: inline-flex; }
.srow-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.srow-subj, .srow-who {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
}
.srow-subj { font: 600 15px/1.3 var(--f-body); }
.srow-who { font: 400 13px/1.3 var(--f-body); color: var(--ink-soft); }
.srow-chips { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* ------------------------------------------------------------------ schedule tab */
.sc-sum { flex: 0 0 auto; font: 500 14px/1.3 var(--f-body); color: var(--ink-soft); }
.sc-states { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.sc-states:empty { display: none; }
.sc-deck { flex: 1 1 auto; min-height: 0; }
.split { flex-direction: row; gap: 16px; }
.split-list { flex: 0 1 44%; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.split-detail {
  flex: 1 1 56%;
  position: relative;
  border-left: 1px solid var(--rule);
}

/* ------------------------------------------------------------------ Face (L1) */
.face-top { margin: 0 0 4px; }
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  min-width: 48px;
  padding: 0 12px 0 4px;
  margin-left: -4px;
  border: 0;
  background: transparent;
  color: var(--copper-ink);
  font: 600 16px/1.2 var(--f-body);
  cursor: pointer;
}
.face-title { font-size: 22px; margin: 4px 0 8px; }
.face-title:focus { outline: none; }
.face-body { display: flex; flex-direction: column; gap: 12px; }
.kv-l { font: 600 12px/1.3 var(--f-body); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.kv-v { font: 400 16px/1.45 var(--f-body); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.actions .btn { flex: 1 1 160px; }
.actions-later { margin-top: 8px; }
.note { font: 400 14px/1.4 var(--f-body); color: var(--ink-soft); }
.note-warn { color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 10px; }

/* ------------------------------------------------------------------ EmptyState, NotAvailableNow, Skeleton */
.empty, .nan { padding: 20px 8px; text-align: center; }
.empty-t, .nan-t { font: 600 17px/1.3 var(--f-head); margin-bottom: 6px; }
.empty-b, .nan-b { color: var(--ink-soft); font-size: 15px; }
.empty .btn { margin-top: 16px; }
.skel-list { display: flex; flex-direction: column; gap: var(--row-gap); }
.skel {
  height: var(--row-h);
  border-radius: var(--radius);
  background: linear-gradient(90deg, #ECE9E4, #F6F4F0, #ECE9E4);
  background-size: 200% 100%;
  animation: skel 1.4s ease-in-out infinite;
}
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ------------------------------------------------------------------ coming-soon stubs */
.soon { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 24px 8px; }
.soon-ic { color: var(--copper); display: inline-flex; }
.soon-ic .ic { width: 40px; height: 40px; }
.soon-t { font: 600 18px/1.3 var(--f-head); }
.soon-b { color: var(--ink-soft); }
.soon-l0 { flex: 1 1 auto; justify-content: center; }
.h-sec { font-size: 18px; }
.acct { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--rule); }
.acct-l { font-size: 13px; color: var(--ink-soft); }
.acct-n { font-weight: 600; }

/* ------------------------------------------------------------------ sign-in */
.signin { display: flex; flex-direction: column; gap: 14px; background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 20px 16px; }
.signin-t { font-size: 22px; }
.signin-b { color: var(--ink-soft); font-size: 15px; }

/* ------------------------------------------------------------------ Sheet (L2) */
#sheet-host { display: none; }
#sheet-host.on { display: block; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(30, 31, 34, .5); z-index: 50; }
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  padding: 20px var(--gutter) calc(16px + var(--safe-b));
  z-index: 51;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@supports (max-height: 60dvh) { .sheet { max-height: 60dvh; } }
.sheet .signin { border: 0; padding: 0; }
.sheet-t { font-size: 19px; }
.sheet-b { color: var(--ink-soft); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet-actions .btn { flex: 1 1 140px; }

/* v58 (English/Tagalog Phase 3): the Tagalog reviewers' "Draft Tagalog" button and panel (public/i18n.js draws them,
   reviewers only) sit above the tab bar, not on it. Position only: their colours are the engine's palette tokens. */
.ts-i18n-launch { bottom: calc(var(--tab-h) + var(--safe-b) + 8px); }
.ts-i18n-panel { bottom: calc(var(--tab-h) + var(--safe-b) + 54px); max-height: calc(100vh - var(--tab-h) - var(--safe-b) - 120px); }

/* ------------------------------------------------------------------ native alerts */
.alert-host {
  position: fixed;
  left: 8px; right: 8px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  z-index: 40;
  display: none;
}
.alert-host.on { display: block; }
.alert {
  max-height: 40vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--info);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(16, 24, 40, .22);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.alert-action { border-left-color: var(--warn); }
.alert-urgent { border-left-color: var(--bad); }
.alert-k { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.alert-when { font-size: 13px; color: var(--ink-soft); }
.alert-t { font: 600 16px/1.35 var(--f-body); }
.alert-b { font-size: 14px; color: var(--ink-soft); white-space: pre-wrap; }
.alert-err { color: var(--bad); font-size: 14px; }
.alert-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.alert-more { margin-right: auto; font-size: 13px; color: var(--ink-soft); }

/* ------------------------------------------------------------------ the bell's notification panel (9 Oct 2026) */
.nf-back {
  position: fixed; left: 0; right: 0; bottom: 0;
  top: calc(var(--hdr-h) + var(--safe-t));          /* below the header, so the bell can still close it */
  z-index: 44;
  background: rgba(30, 31, 34, .28);
}
.nf-panel {
  position: fixed; z-index: 45;
  top: calc(var(--hdr-h) + var(--safe-t) + 6px);
  left: 8px; right: 8px;
  max-height: 70vh;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(16, 24, 40, .28);
  overflow: hidden;
}
@supports (max-height: 70dvh) { .nf-panel { max-height: 70dvh; } }
.nf-panel:focus { outline: none; }
.nf-head {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 6px 10px 14px;
  border-bottom: 1px solid var(--rule-soft);
}
.nf-h { flex: 1 1 auto; margin: 0; font: 600 16px/1.3 var(--f-body); }
.nf-n { font-weight: 500; font-size: 13px; color: var(--ink-soft); margin-left: 4px; }
.nf-x {
  flex: 0 0 auto; width: 44px; height: 44px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft);
  font: 400 26px/1 var(--f-body); cursor: pointer;
}
.nf-body { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.nf-list { list-style: none; margin: 0; padding: 0; }
.nf-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule-soft);
  border-left: 4px solid transparent;
}
.nf-new.nf-info { border-left-color: var(--info); }
.nf-new.nf-action { border-left-color: var(--warn); }
.nf-new.nf-urgent { border-left-color: var(--bad); }
.nf-old { color: var(--ink-soft); }
.nf-k { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nf-when { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.nf-t { margin: 0; font: 600 15px/1.35 var(--f-body); overflow-wrap: anywhere; }
.nf-old .nf-t { font-weight: 500; }
.nf-b {
  margin: 0; font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.nf-err { margin: 0; color: var(--bad); font-size: 14px; }
.nf-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.nf-sub {
  margin: 0; padding: 10px 14px 6px;
  font: 600 12px/1.3 var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft);
  background: var(--ground, var(--offwhite));
}
.nf-empty, .nf-note { margin: 0; padding: 14px; font-size: 14px; color: var(--ink-soft); }

/* ------------------------------------------------------------------ toast */
.toast-host {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  z-index: 60;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.toast { max-width: 100%; padding: 10px 14px; border-radius: 10px; background: var(--basalt); color: #fff; font-size: 15px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.toast-bad { background: var(--bad); }

/* ------------------------------------------------------------------ narrow phones (320–359px) */
@media (max-width: 359px) {
  .brand-mark { width: 26px; height: 26px; }
  .brand-word { font-size: 14px; }
  .badge { max-width: 72px; }
}

/* ------------------------------------------------------------------ the one breakpoint: 768px */
@media (min-width: 768px) {
  :root { --gutter: 20px; }
  .sheet { left: 50%; right: auto; width: 560px; transform: translateX(-50%); border-radius: 16px; bottom: 16px; }
  .alert-host { left: auto; right: 16px; width: 420px; }
  .nf-panel { left: auto; right: 16px; width: 420px; }
  .signin { width: 440px; align-self: center; }
}

@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
}

/* ------------------------------------------------------------------ install page (/field/install) */
body.install-page { height: auto; overflow-x: hidden; overflow-y: auto; }
.install-top { background: var(--basalt); padding: calc(12px + var(--safe-t)) var(--gutter) 12px; }
.install-main { padding: 20px var(--gutter) calc(32px + var(--safe-b)); display: flex; flex-direction: column; gap: 16px; }
.install-main h1 { font-size: 24px; }
.install-card { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.install-card h2 { font-size: 17px; }
.install-card ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.install-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.install-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.install-url { font: 600 15px/1.4 var(--f-body); background: var(--ground, var(--offwhite)); border-radius: 8px; padding: 8px 10px; }
@media (min-width: 768px) {
  .install-main { max-width: 640px; margin: 0 auto; }
}

/* Travel #4: the Fixed/Flexible chip is a toggle button (tap to change a stop's time handling). */
.trv-fixtog { border: none; cursor: pointer; font: inherit; -webkit-appearance: none; appearance: none; }
.trv-fixtog[aria-pressed="false"] { box-shadow: inset 0 0 0 1px currentColor; }

/* Travel #2: nearest-lead list (best-graded within 500 m). */
.trv-near { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.trv-near-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; width: 100%; text-align: left; background: var(--card, #fff); border: 1px solid var(--line, #e2ded7); border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; color: inherit; }
.trv-near-row:active { border-color: var(--cop, #b47a3c); }
.trv-near-row .tn-t { min-width: 0; }
.trv-near-row .tn-1 { display: block; font-weight: 600; font-size: 14px; }
.trv-near-row .tn-2 { display: block; font-size: 12px; color: var(--ink-soft, #6b6f76); }
.trv-near-row .tn-km { font-size: 12px; color: var(--ink-soft, #6b6f76); font-variant-numeric: tabular-nums; }

/* Completion nudge: "N meetings to log" banner on the Schedule (Will #1 target). */
/* Samples in your bag (#5, 29 Sep 2026) */
.sm-sub { color: var(--ink-soft, #6b6f76); margin: 0 0 10px; }
.sm-h { font-size: 14px; margin: 16px 0 8px; }
.sm-list { display: flex; flex-direction: column; gap: 8px; }
.sm-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--rule-soft, #e3e0da); border-radius: 12px; background: var(--card, #fff);
  color: inherit; font: inherit; cursor: pointer;
}
.sm-row[disabled] { opacity: .5; cursor: default; }
.sm-t { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sm-1 { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.sm-2 { font-size: 12px; color: var(--ink-soft, #6b6f76); }
.sm-q { font-size: 18px; font-variant-numeric: tabular-nums; }
.sm-res { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; }
.sm-res-b {
  min-height: 44px; padding: 8px 12px; text-align: left; border: 1px solid var(--rule-soft, #e3e0da);
  border-radius: 10px; background: var(--card, #fff); color: inherit; font: inherit; cursor: pointer;
}
.sm-res-b.on { border-color: var(--p-cop, #b47a3c); border-width: 2px; }

/* Month calendar (requested update #3, 29 Sep 2026) */
.sc-cal-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.sc-cal-t { font-weight: 600; }
.sc-cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.sc-cal-h { text-align: center; font-size: 12px; color: var(--ink-soft, #6b6f76); }
.sc-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sc-cal-d { position: relative; aspect-ratio: 1 / 1; min-height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--rule-soft, #e3e0da); border-radius: 10px; background: var(--card, #fff); color: inherit; font: inherit; cursor: pointer; }
.sc-cal-d.out { opacity: .38; }
.sc-cal-d.is-today { border-color: var(--p-cop, #b47a3c); border-width: 2px; }
.sc-cal-n { font-size: 14px; line-height: 1; }
.sc-cal-c { min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--p-cop, #b47a3c); color: #fff; font-size: 11px; line-height: 17px; }
.sc-cal-c.done { background: var(--ink-soft, #6b6f76); }
.sc-cal-hint { font-size: 12px; color: var(--ink-soft, #6b6f76); margin-top: 8px; }
.sc-tolog { display: flex; align-items: center; gap: 12px; background: var(--p-cop-bg, #f3e6d5); border: 1px solid var(--p-cop, #b47a3c); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }
.sc-tolog .sc-tolog-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; flex: 1 1 auto; }
.sc-tolog .sc-tolog-txt b { font-size: 14px; color: var(--p-cop, #8a6535); }
.sc-tolog .sc-tolog-txt span { font-size: 12px; color: var(--ink-soft, #6b6f76); }
.sc-tolog .btn { flex: 0 0 auto; }

/* Departure alarm (lib/depart-alerts.js): the Home card, and its setting in the Account sheet. Text wraps; the
   two buttons sit side by side and wrap under the text on a narrow phone. */
.depart { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; background: var(--p-amb-bg); border: 1px solid var(--p-amb); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }
.depart.is-late { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad) inset; }
.depart .depart-txt { min-width: 0; flex: 1 1 180px; display: flex; flex-direction: column; line-height: 1.25; }
.depart .depart-txt b { font-size: 15px; color: var(--p-amb); }
.depart.is-late .depart-txt b { color: var(--bad); }
.depart .depart-txt span { font-size: 12px; color: var(--ink-soft, #6b6f76); }
.depart .depart-acts { display: flex; gap: 8px; flex: 1 1 220px; }
.depart .depart-acts .btn { flex: 1 1 0; }
.acc-dep { margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
.acc-dep .acc-h { font-size: 15px; margin: 0 0 4px; }
.acc-dep .seg { margin: 8px 0; }
.acc-dep .acc-dev .btn { margin-left: 6px; }

/* Set up this phone (modules/setup.js): the only screen a phone opens until location, alerts, the Home Screen
   install and the travel profile are done. No tab bar while it is up. */
body[data-setup] #tabbar { display: none; }
/* #1 refit (30 Sep 2026): the field map on its own screen takes the whole phone - the header and the tab bar
 * go for as long as it is open, so the tiles get every pixel (modules/travel.css .fm). The update bar (#upd)
 * deliberately stays: it is how a rep accepts a new shell version, and it must never be unreachable. Alerts
 * and toasts sit above the tab bar normally, so they come down to the safe area while it is gone. */
body[data-fullmap] #hdr,
body[data-fullmap] #tabbar { display: none; }
body[data-fullmap] .alert-host { bottom: calc(var(--safe-b) + 8px); }
body[data-fullmap] .toast-host { bottom: calc(var(--safe-b) + 12px); }
.setup { overflow-y: auto; }
.setup .setup-in { max-width: 520px; margin: 0 auto; padding: 18px 16px 28px; }
.setup .setup-t { font-size: 22px; margin: 0 0 6px; }
.setup .setup-b { color: var(--ink-soft); margin: 0 0 14px; }
.setup .setup-list { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.setup .st-row { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--rule-soft); border-radius: 12px; padding: 12px; }
.setup .st-row.is-done { opacity: .75; }
.setup .st-n { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--p-cop-bg); color: var(--copper-ink, #6E4A22); }
.setup .st-row.is-done .st-n { background: var(--ok-bg); color: var(--ok); }
.setup .st-tx { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; line-height: 1.3; }
.setup .st-tx b { font-size: 15px; }
.setup .st-tx > span { font-size: 13px; color: var(--ink-soft); }
.setup .st-how { font-size: 13px; color: var(--ink, var(--basalt)); background: var(--ground, var(--offwhite)); border-radius: 8px; padding: 8px 10px; }
.setup .st-tx .btn { align-self: flex-start; }
.setup .st-seg { margin-top: 2px; }
.setup .st-skip { margin-top: 8px; }

/* My pool (modules/pool.js) and Home's "My pool" line (26 Sep 2026). */
.pool-line { display: flex; flex-direction: column; gap: 2px; text-decoration: none; background: var(--card); border: 1px solid var(--rule-soft); border-left: 4px solid var(--copper); border-radius: 12px; padding: 9px 12px; margin: 0 0 10px; color: var(--ink, var(--basalt)); }
.pool-line b { font-size: 14px; }
.pool-line span { font-size: 12px; color: var(--ink-soft); }
.pool .pl-b { color: var(--ink-soft); margin: 0 0 10px; }
.pool .pl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pool .pl-row { background: var(--card); border: 1px solid var(--rule-soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.pool .pl-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pool .pl-t { font-weight: 700; font-size: 15px; min-width: 0; }
.pool .pl-sub { font-size: 12px; color: var(--ink-soft); }
.pool .pl-why { display: flex; flex-wrap: wrap; gap: 6px; }
.pool .pl-why:empty { display: none; }
.pool .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.pool .acts .btn { flex: 1 1 90px; }

/* Find (modules/crm.js), New call / task / meeting (modules/activity.js), and Set time / Flexible (26 Sep 2026). */
.crm .seg { margin: 0 0 10px; }
.crm .crm-q { margin: 0 0 10px; }
.crm .crm-hint { color: var(--ink-soft); font-size: 13px; margin: 6px 0 10px; }
.crm .crm-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.crm .crm-row { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink, var(--basalt)); background: var(--card); border: 1px solid var(--rule-soft); border-radius: 12px; padding: 10px 12px; min-height: 44px; }
.crm .crm-row b { font-size: 15px; }
.crm .crm-row span { font-size: 12px; color: var(--ink-soft); }
.crm .acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.crm .acts .btn { flex: 1 1 120px; }
.crm .crm-h { font-size: 15px; margin: 16px 0 6px; }
.crm .crm-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.crm .crm-notes li { background: var(--card); border: 1px solid var(--rule-soft); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; font-size: 13px; }
.crm .crm-note-h { display: block; font-size: 11px; color: var(--ink-soft); margin-bottom: 2px; }
.crm .crm-dupes { background: var(--p-amb-bg); border: 1px solid var(--p-amb); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.crm .crm-dupes ul { margin: 6px 0 10px; padding-left: 18px; }
.act .seg { margin: 0 0 12px; }
.act .act-row { display: flex; flex-wrap: wrap; gap: 0 10px; }
.act .act-row .field { flex: 1 1 140px; }
.act .act-hint, .act-about { color: var(--ink-soft); font-size: 13px; }
/* Who the entry is about. The name and the control sit on one line, and the line wraps rather than
   truncating: a company name a rep cannot read in full is no use for checking the right one is attached. */
.act-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; }
.act-who-n { flex: 1 1 160px; min-width: 0; font: 600 15px/1.35 var(--f-head); color: var(--ink, var(--basalt)); }
.act-who-n.is-none { font-weight: 400; color: var(--ink-soft); }
.act-who .btn { flex: 0 0 auto; }
.act-warn { margin: 0 0 10px; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.sc-sumrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-sumrow .sc-sum { flex: 1 1 auto; min-width: 0; }
.sc-sumrow .btn { flex: 0 0 auto; }
.sc-timing { max-width: 320px; }
.sc-timing-h { font-size: 12px; margin: 4px 0 0; }

/* My pool: Follow-ups and the Sales pool (26 Sep 2026). */
.pool > .seg { margin: 0 0 10px; }
.pool .pl-snooze { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.pool .pl-snooze .btn { flex: 0 0 auto; }

/* The Capture tab (modules/capture.js), meeting invitations on Home, and dictating a note (26 Sep 2026). */
.cap .cap-b { color: var(--ink-soft); font-size: 13px; margin: 4px 0 12px; }
.cap .cap-list { display: flex; flex-direction: column; gap: 10px; }
.cap .cap-row { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink, var(--basalt)); background: var(--card); border: 1px solid var(--rule-soft); border-radius: 12px; padding: 10px 12px; min-height: 56px; }
.cap .cap-ic { flex: 0 0 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--p-amb-bg); color: var(--copper); }
.cap .cap-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cap .cap-txt b { font-size: 15px; }
.cap .cap-txt span { font-size: 12px; color: var(--ink-soft); }
.cap .cap-row.q-off { opacity: .55; }
.mt-capnote { margin: 0 0 10px; }
.btn.mt-cue { box-shadow: 0 0 0 3px var(--copper); }
.invite { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; background: var(--card); border: 1px solid var(--rule-soft); border-left: 4px solid var(--copper); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; }
.invite .invite-txt { min-width: 0; flex: 1 1 180px; display: flex; flex-direction: column; line-height: 1.25; }
.invite .invite-k { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.invite .invite-txt b { font-size: 15px; color: var(--ink, var(--basalt)); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }   /* one line (nowrap is for pills, times and the wordmark only) */
.invite .invite-txt span:last-child { font-size: 12px; color: var(--ink-soft); }
.invite .invite-acts { display: flex; gap: 8px; flex: 1 1 240px; }
.invite .invite-acts .btn { flex: 1 1 0; }
/* Home's fit levels (home.css) reach the attention cards too; buttons keep the 44px floor. */
.homeA.c2 .invite, .homeA.c2 .depart { padding: 8px 10px; gap: 8px; }
.homeA.c2 .pool-line { padding: 7px 12px; }
.homeA.c3 .pool-line span { display: none; }
.sheet-actions.sheet-stack { flex-direction: column; align-items: stretch; }
.sheet-actions.sheet-stack .btn { flex: 0 0 auto; }
.crm-dict { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.crm-dict .btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; }
.crm-dict .crm-hint { margin: 0; font-size: 12px; color: var(--ink-soft); }

/* dark overrides (generated 12 Oct 2026) */
html[data-theme='dark'] .seg{background:var(--card2,#E9E6E1)}
html[data-theme='dark'] .srow.is-pool{background:var(--card,#FCFAF6)}
