@import url("/app/tokens.css");

/* Phone first (375-390 px). 16px gutter, 44px tap targets, 8px radius on controls, 12px on cards, pills for status only.
   Cards use a 1px border; the one shadow level is for sticky bars and sheets. Money and counts use tabular numbers. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, ul, ol { margin: 0; }
/* The serif (Fraunces) appears in exactly these places (Brandon, Q31): the screen title (every h1 is a screen title or the
   customer's name), the customer's name in a conversation, pop-up titles, "nothing here yet" headlines (and the lead of a
   "being built" screen), and the side menu's wordmark. Every other heading and every number is the sans. */
h1, .sheet h2, .thread-who h2, .state-title, .building-lead, .tabbar .brand {
  font-family: var(--font-display); letter-spacing: -0.01em; font-optical-sizing: auto;
}
.card { box-shadow: var(--shadow-card); }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 13px; }
.muted { color: var(--ink-3); }
.boot { padding: 24px var(--gutter); color: var(--ink-3); }

/* ------------------------------------------------------------------ shell */
.app { min-height: 100vh; min-height: 100dvh; }
.screen {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) var(--gutter) 8px;
}
.topbar h1 { font-size: 28px; line-height: 34px; font-weight: 600; }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--evergreen); border: 0;
  font-size: 13px; font-weight: 600; color: var(--on-evergreen);
}
.backlink {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: var(--tap); margin-left: -8px; padding: 0 8px;
  color: var(--copper-text); text-decoration: none; font-size: 15px; font-weight: 500;
}
.backlink svg { width: 20px; height: 20px; }

/* Phone: a 5-tab bottom bar (Today, Schedule, Customers, Inbox, More). Computer (1024px and up): the same nav becomes a
   left side menu with every section; .nav-desk items show only there, .nav-phone items only on the phone. */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.tabbar .brand { display: none; }
.tabbar ul { display: flex; width: 100%; max-width: 640px; }
.tabbar li { flex: 1; min-width: 0; }
.tabbar li.nav-desk { display: none; }
.tabbar a, .tabbar span.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--tabbar-h); padding: 6px 2px 4px;
  font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); text-decoration: none;
  text-align: center; overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.tabbar svg {
  box-sizing: content-box; width: 24px; height: 24px; padding: 2px 16px; border-radius: 14px;
  transition: background-color var(--dur-release) var(--ease-out), transform var(--dur-release) var(--ease-out);
}
.tabbar a:active svg { transform: scale(var(--press-scale)); transition-duration: var(--dur-press); }
.tabbar a[aria-current="page"] { color: var(--copper-text); font-weight: 600; }
.tabbar a[aria-current="page"] svg { background: var(--copper-tint); }
.tabbar span.tab { opacity: .55; }
.tabbar .soon { font-size: 12px; line-height: 16px; font-weight: 400; }

@media (min-width: 1024px) {
  .tabbar {
    top: 0; right: auto; width: var(--sidebar-w); flex-direction: column; justify-content: flex-start;
    border-top: 0; border-right: 1px solid var(--line); padding: 20px 12px;
    background: var(--surface);
  }
  .tabbar .brand {
    display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px;
    font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--ink); text-decoration: none;
  }
  .tabbar .brand .mark {
    width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    background: var(--evergreen); color: var(--on-evergreen); font-size: 16px;
  }
  .tabbar ul { flex-direction: column; gap: 2px; max-width: none; }
  .tabbar li { flex: none; }
  .tabbar li.nav-desk { display: block; }
  .tabbar li.nav-phone { display: none; }
  .tabbar li.nav-sep { height: 1px; background: var(--line); margin: 10px 10px; }
  .tabbar a, .tabbar span.tab {
    flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 40px; padding: 0 12px;
    border-radius: 10px; font-size: 15px; line-height: 20px; text-align: left; color: var(--ink-2);
  }
  .tabbar a[aria-current="page"] { background: var(--copper-tint); color: var(--copper-text); }
  .tabbar svg { box-sizing: border-box; width: 20px; height: 20px; padding: 0; border-radius: 0; background: none; color: var(--ink-3); }
  .tabbar a[aria-current="page"] svg { background: none; color: var(--copper-text); }
  .tabbar a:active svg { transform: none; }
  .tabbar a:active { background: var(--press-bg); }
  .tabbar .tab-badge { position: static; margin-left: auto; }
  .screen { max-width: 960px; padding-bottom: 48px; margin-left: calc(var(--sidebar-w) + max(24px, (100vw - var(--sidebar-w) - 960px) / 2)); margin-right: 24px; }
  .topbar { padding-top: 28px; }
}
@media (min-width: 1024px) and (hover: hover) {
  .tabbar a:hover { background: var(--surface-2); color: var(--ink); }
  .tabbar a[aria-current="page"]:hover { background: var(--copper-tint); color: var(--copper-text); }
}

/* ------------------------------------------------------------------ icons */
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ buttons (feel spec 5.1; Brandon Q32)
   Press: every button darkens and gives (scale .97) in 80 ms and springs back in 160 ms; reduced motion darkens only
   (--press-scale is 1 there). Sizes: 44 on touch (48 for the main action); with a mouse on a computer 36 (44 for main).
   Sizes interface for other screens: .btn, .btn-primary, .btn-main (the ONE main action, 48 px, full width), .action-bar
   (the bottom container that holds .btn-main), .btn-sm. Do not invent new button sizes. */
.btn, .btn-main {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-size: 15px; line-height: 20px; font-weight: 500; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-user-select: none; user-select: none;
  --spin: var(--ink-2);
  transition: background-color var(--dur-release) var(--ease-out), border-color var(--dur-release) var(--ease-out),
    color var(--dur-release) var(--ease-out), transform var(--dur-release) var(--ease-out);
}
.btn:active, .btn-main:active { background: var(--press-bg); transform: scale(var(--press-scale)); transition-duration: var(--dur-press); }

.btn-primary, .btn-main { background: var(--copper); border-color: var(--copper); color: var(--on-copper); font-weight: 600; --spin: var(--on-copper); }
.btn-primary:active, .btn-main:active { background: var(--copper-press); border-color: var(--copper-press); }
.btn-accent { border-color: var(--copper); color: var(--copper-text); --spin: var(--copper-text); }   /* copper outline */
.btn-quiet { border-color: transparent; background: transparent; color: var(--copper-text); padding: 0 10px; --spin: var(--copper-text); }
.btn-danger { border-color: var(--danger-fill); background: var(--danger-fill); color: #FFFFFF; font-weight: 600; --spin: #FFFFFF; }
.btn-danger:active { background: var(--danger-fill); border-color: var(--danger-fill); filter: brightness(.88); }
.btn-danger-outline { border-color: var(--danger-text); background: var(--surface); color: var(--danger-text); --spin: var(--danger-text); }
.btn-danger-outline:active { background: var(--danger-bg); }
.btn-sm.btn-danger { background: transparent; border-color: var(--line-2); color: var(--danger-text); --spin: var(--danger-text); }
.btn-sm.btn-danger:active { background: var(--danger-bg); filter: none; }

.btn-block { width: 100%; }
/* the one main action: 48 px, full width, 16 px / 600, copper. Also what a sheet's buttons and a sign-in button become. */
.btn-main, .btn-lg, .btn-primary.btn-block, .sheet-actions .btn { min-height: var(--tap-lg); padding: 0 20px; font-size: 16px; }
.btn-main { width: 100%; }
.btn-lg { font-weight: 600; }
.btn-sm { padding: 0 12px; gap: 6px; font-size: 14px; }   /* still drawn 44 px tall on touch: Q32 says never under 44 on a phone */
.btn .icon, .btn-main .icon { width: 20px; height: 20px; }
.btn-sm .icon { width: 18px; height: 18px; }

.btn-icon {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-2); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color var(--dur-release) var(--ease-out), color var(--dur-release) var(--ease-out), transform var(--dur-release) var(--ease-out);
}
.btn-icon .icon { width: 22px; height: 22px; }
.btn-icon:active { background: var(--press-bg); color: var(--ink); transform: scale(var(--press-scale)); transition-duration: var(--dur-press); }

/* the bottom container for the main action. Phone: it stays above the tab bar and the home-indicator inset while the
   screen scrolls (position: sticky, in flow, so it never covers content and never fights the on-screen keyboard). Inside a
   sheet or on a computer it is just a row at the end of the content. */
.action-bar {
  position: sticky; z-index: 15; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  display: grid; gap: 8px; margin: 16px calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter);
  background: var(--paper); border-top: 1px solid var(--line);
}
.screen.has-thread .action-bar { bottom: env(safe-area-inset-bottom); }   /* a conversation hides the tab bar */
.sheet .action-bar { position: static; margin: 16px 0 0; padding: 0; background: none; border-top: 0; }

/* disabled: readable, not faded */
.btn[disabled], .btn[aria-disabled="true"], .btn-main[disabled], .btn-main[aria-disabled="true"] {
  background: var(--muted-bg); border-color: transparent; color: var(--ink-3); cursor: default; transform: none; filter: none;
}
.btn-quiet[disabled], .btn-quiet[aria-disabled="true"] { background: transparent; }
.btn-icon[disabled] { color: var(--ink-3); opacity: .6; cursor: default; transform: none; }

/* loading: set aria-busy="true" from script. The label stays (hidden, so the width is kept), a ring turns, taps are ignored.
   The spinner after 300 ms is the caller's job (set the attribute only once a request has been running that long). */
.btn[aria-busy="true"], .btn-main[aria-busy="true"] { color: transparent; pointer-events: none; }
.btn[aria-busy="true"] > *, .btn-main[aria-busy="true"] > * { visibility: hidden; }
.btn[aria-busy="true"]::after, .btn-main[aria-busy="true"]::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid var(--spin); border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (hover: hover) {
  .btn:hover, .btn-main:hover { background: var(--surface-2); }
  .btn-primary:hover, .btn-main:hover { background: var(--copper-hover); border-color: var(--copper-hover); }
  .btn-accent:hover, .btn-quiet:hover { background: var(--copper-tint); }
  .btn-danger:hover { background: var(--danger-fill); filter: brightness(.92); }
  .btn-danger-outline:hover { background: var(--danger-bg); }
  .btn-icon:hover { background: var(--surface-2); color: var(--ink); }
  .btn[disabled]:hover, .btn[aria-disabled="true"]:hover, .btn-main[disabled]:hover { background: var(--muted-bg); filter: none; }
  .btn-quiet[disabled]:hover, .btn-quiet[aria-disabled="true"]:hover { background: transparent; }
}

/* a mouse on a computer: 36 px floor (main action 44). Phones, tablets and touch laptops never match this block. */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .btn, .btn-sm { min-height: var(--ctl-desk); }
  .btn-main, .btn-lg, .btn-primary.btn-block, .sheet-actions .btn { min-height: var(--tap); }
  .btn-icon { width: var(--ctl-desk); height: var(--ctl-desk); }
  .action-bar { position: static; margin: 16px 0 0; padding: 0; background: none; border-top: 0; }
  .btn-main { width: auto; min-width: 200px; justify-self: start; }
}
@media (min-width: 1024px) { .action-bar { position: static; margin: 16px 0 0; padding: 0; background: none; border-top: 0; } }

@media (prefers-reduced-motion: reduce) {
  .btn[aria-busy="true"]::after, .btn-main[aria-busy="true"]::after { animation-duration: 1.6s; }   /* still turns: it says "working", slowly */
}

/* ------------------------------------------------------------------ pills */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; line-height: 22px; font-weight: 500; white-space: nowrap;
  background: var(--muted-bg); color: var(--muted-text);
}
.pill.ok { background: var(--ok-bg); color: var(--ok-text); }
.pill.attn { background: var(--attn-bg); color: var(--attn-text); }
.pill.danger { background: var(--danger-bg); color: var(--danger-text); }
.pill.info { background: var(--info-bg); color: var(--info-text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--attn-text); flex: none; }
.dot.danger { background: var(--danger-text); }
.site-flag { display: inline-block; width: 15px; height: 15px; margin-left: 3px; vertical-align: -2px; color: var(--attn-text); }   /* ≥ 3:1 in both themes */

/* ------------------------------------------------------------------ states */
.state { padding: 40px var(--gutter); text-align: center; color: var(--ink-2); }
.state > * { max-width: 34ch; margin-left: auto; margin-right: auto; }
.state-badge {
  width: 64px; height: 64px; margin-bottom: 16px; border-radius: 50%; display: grid; place-items: center;
  background: var(--evergreen-tint); border: 1px solid var(--evergreen-tint-line); color: var(--evergreen-text);
}
.state-badge .icon { width: 28px; height: 28px; }
.state .state-title { font-size: 22px; line-height: 28px; font-weight: 600; color: var(--ink); }
.state .state-title + p { margin-top: 6px; font-size: 15px; line-height: 22px; }
.state .btn { margin-top: 16px; }
.skeleton { padding: 8px var(--gutter); }
.sk-line { height: 14px; border-radius: 6px; background: var(--skeleton); margin: 10px 0; animation: pulse 1.2s ease-in-out infinite; }
.sk-line.w60 { width: 60%; } .sk-line.w40 { width: 40%; } .sk-line.w80 { width: 80%; } .sk-line.tall { height: 28px; }
@keyframes pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .sk-line { animation: none; } }

/* ------------------------------------------------------------------ customers list */
.search-wrap {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  padding: 8px var(--gutter) 0;
}
.search {
  display: flex; align-items: center; gap: 8px;
  min-height: var(--tap-lg); padding: 0 12px;
  background: var(--surface); border: 1px solid var(--field-line); border-radius: var(--r-sm);
  transition: border-color var(--dur-release) var(--ease-out), box-shadow 120ms var(--ease-out);
}
.search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--copper-tint-line); }
.search .icon { color: var(--ink-3); }
.search input {
  flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; outline: none;
  font-size: 16px; /* 16px stops iOS zooming on focus */
}
.search input::placeholder { color: var(--ink-3); }
.search .clear { min-width: var(--tap); min-height: var(--tap); margin-right: -12px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 10px var(--gutter) 10px; margin: 0 calc(-1 * var(--gutter));
  scroll-padding: 0 var(--gutter);
}
.search-wrap .chips { margin: 0 calc(-1 * var(--gutter)); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  position: relative; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color var(--dur-release) var(--ease-out), border-color var(--dur-release) var(--ease-out), transform var(--dur-release) var(--ease-out);
}
.chip:active { background: var(--press-bg); transform: scale(var(--press-scale)); transition-duration: var(--dur-press); }
.chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip .count { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 400; }
.chip[aria-pressed="true"] { background: var(--copper-tint); border-color: var(--copper); color: var(--ink); font-weight: 600; }
.chip[aria-pressed="true"]:active { background: var(--copper-tint); }
.chip[aria-pressed="true"] .count { color: var(--ink-2); }
@media (hover: hover) { .chip:hover { border-color: var(--ink-3); } .chip[aria-pressed="true"]:hover { border-color: var(--copper); } }

.list-meta { padding: 4px var(--gutter) 6px; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.rows { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.row {
  display: block; min-height: 72px; padding: 12px var(--gutter);
  text-decoration: none; color: inherit; border-bottom: 1px solid var(--line);
  -webkit-tap-highlight-color: transparent;
}
.row:last-child { border-bottom: 0; }
.row:active { background: var(--press-bg); }
.row-l1 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
/* position: relative keeps the visually hidden " (has a site note)" span inside the row, so overflow clips it
   (demo dry-run J10-01: it sat against the page and widened it to 644 px) */
.row-name { position: relative; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-amount { flex: none; font-variant-numeric: tabular-nums; font-weight: 500; }
.row-amount .upto { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-right: 3px; }
.row-l2 {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--ink-3);
}
.row-l2 .pill { flex: none; }
.row-next { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--attn-text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-next.danger { color: var(--danger-text); }
.row-time { flex: none; margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13px; }
.row-addr { margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-more { display: flex; justify-content: center; padding: 16px var(--gutter); }

/* ------------------------------------------------------------------ customer file */
.file-top { padding: calc(4px + env(safe-area-inset-top)) var(--gutter) 0; }
.identity { padding: 4px var(--gutter) 0; }
.identity h1 { font-size: 24px; line-height: 30px; font-weight: 600; overflow-wrap: anywhere; }
.identity .pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.address {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); margin-top: 2px;
  color: var(--ink-2); font-size: 15px; line-height: 20px; text-decoration-color: var(--line); text-underline-offset: 3px;
}
.address .icon { width: 18px; height: 18px; color: var(--ink-3); }
.address.none { color: var(--ink-3); }
.site-note {
  display: flex; align-items: flex-start; gap: 8px; width: 100%;
  margin-top: 6px; padding: 10px 12px; min-height: var(--tap);
  background: var(--attn-bg); color: var(--attn-text);
  border: 0; border-radius: var(--r-sm); text-align: left; cursor: pointer;
  font-size: 14px; line-height: 20px;
}
.site-note .icon { width: 18px; height: 18px; margin-top: 1px; }
.site-note span { overflow-wrap: anywhere; }

.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px var(--gutter) 0; }
@media (max-width: 300px) { .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }   /* 360px at 200% zoom: 2×2 */
.action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 60px; padding: 6px 2px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  font-size: 13px; line-height: 16px; font-weight: 500; text-decoration: none; cursor: pointer;
  text-align: center; overflow-wrap: anywhere; min-width: 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color var(--dur-release) var(--ease-out), transform var(--dur-release) var(--ease-out);
}
.action:active { background: var(--press-bg); transform: scale(var(--press-scale)); transition-duration: var(--dur-press); }
.action.primary:active { background: var(--copper-press); border-color: var(--copper-press); }
@media (hover: hover) { .action:hover { background: var(--surface-2); } .action.primary:hover { background: var(--copper-hover); } }
.action .icon { width: 22px; height: 22px; }
.action.primary { background: var(--copper); border-color: var(--copper); color: var(--on-copper); }
.action[aria-disabled="true"], .action[disabled] { opacity: .45; cursor: default; }

.money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 14px var(--gutter) 0; border: 1px solid var(--card-line); border-radius: var(--r-md); background: var(--surface); }
.money > div { padding: 10px 14px; }
.money > div + div { border-left: 1px solid var(--line); }
.money > div { min-width: 0; }
.money b { display: block; font-size: clamp(17px, 6vw, 22px); line-height: 28px; overflow-wrap: anywhere; font-weight: 600; font-variant-numeric: tabular-nums; }
.money .upto { font-size: 13px; font-weight: 400; color: var(--ink-3); margin-right: 3px; }
.money span { font-size: 13px; line-height: 18px; color: var(--ink-3); }

.next { margin: 12px var(--gutter) 0; padding: 14px; border: 1px solid var(--card-line); border-radius: var(--r-md); background: var(--surface); }
.next.firing { border-color: var(--copper); }
.next.urgent { border-color: var(--danger-text); }
.next-label { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.next.urgent .next-label { color: var(--danger-text); }
.next-summary { margin-top: 4px; font-size: 17px; line-height: 24px; font-weight: 600; }
.next-time { font-size: 13px; line-height: 18px; color: var(--ink-3); }
.quote {
  margin-top: 10px; padding: 8px 12px;
  border-left: 3px solid var(--line); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 22px; color: var(--ink-2);
}
.next-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.next-cta .btn-accent { flex: 1 1 auto; }
.next-detail { margin-top: 4px; font-size: 15px; line-height: 22px; color: var(--ink-2); }
.next-hint { margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.next-also { margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.next.empty .next-summary { font-weight: 500; color: var(--ink-2); font-size: 16px; }

.tabs {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px; padding: 0 var(--gutter);
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.tabs button {
  min-height: var(--tap); border: 0; background: transparent; cursor: pointer;
  font-size: 15px; font-weight: 500; color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--copper); }
@media (max-width: 300px) {   /* 360px at 200% zoom: no sideways scroll */
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabbar a, .tabbar span.tab { font-size: 10px; padding: 6px 0; }
}
.tabs .badge { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink-3); margin-left: 3px; }
.panel { padding: 12px var(--gutter) 0; }

/* activity */
.filters { margin: -4px calc(-1 * var(--gutter)) 4px; }
.timeline { border: 1px solid var(--card-line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.tl-item { border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-head {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: start;
  width: 100%; min-height: 56px; padding: 10px 12px;
  border: 0; background: transparent; text-align: left; cursor: default;
}
button.tl-head { cursor: pointer; }

.tl-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.tl-icon .icon { width: 17px; height: 17px; }
.tl-icon.customer { background: var(--info-bg); color: var(--info-text); }
.tl-icon.blocked { background: var(--danger-bg); color: var(--danger-text); }
.tl-icon.good { background: var(--ok-bg); color: var(--ok-text); }
.tl-icon.urgent { background: var(--danger-bg); color: var(--danger-text); }
.tl-kind { display: block; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.tl-summary { display: block; font-size: 15px; line-height: 21px; overflow-wrap: anywhere; }
.tl-time { font-size: 13px; line-height: 18px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 1px; }
.tl-more { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--copper-text); }
.tl-body { padding: 0 12px 12px 54px; }
.tl-body .quote { margin-top: 0; }
.tl-player { display: grid; gap: 6px; margin-bottom: 8px; }
.tl-player audio { width: 100%; max-width: 420px; }
.tl-by { margin-top: 6px; font-size: 13px; color: var(--ink-3); }

/* cards (work, notes, info) */
.section-title { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--evergreen-text); margin: 24px 0 8px; }
.section-title:first-child { margin-top: 4px; }
.card { border: 1px solid var(--card-line); border-radius: var(--r-md); background: var(--surface); padding: 12px 14px; }
.card + .card { margin-top: 8px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { font-weight: 600; overflow-wrap: anywhere; }
.card-title::first-letter { text-transform: uppercase; }
.card-amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.card-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 14px; line-height: 20px; color: var(--ink-3); }
.card-actions { display: flex; gap: 8px; margin-top: 10px; }
.versions { margin-top: 10px; border-top: 1px solid var(--line); }
.version { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; }
.version:last-child { border-bottom: 0; padding-bottom: 0; }
.version-head { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.version ul { margin-top: 2px; color: var(--ink-2); }
.version li { display: flex; gap: 6px; }
.version li .k { color: var(--ink-3); min-width: 72px; }
.version li.good { color: var(--ok-text); }
.version li.bad { color: var(--danger-text); }
.version .quote { font-size: 14px; line-height: 20px; margin-top: 4px; }
.version.old { color: var(--ink-3); }
.empty-line { color: var(--ink-3); font-size: 15px; padding: 6px 0; }

/* notes */
.note { padding: 12px 14px; }
.note.pinned { border-color: var(--attn-text); background: var(--attn-bg); }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.note.pinned .note-meta { color: var(--attn-text); }
/* The composer sits at the bottom of the notes, above the tab bar. It is not position: sticky: on a 390px phone a sticky
   composer covered most of the notes it belongs to. */
.composer {
  margin: 12px calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter) 0;
  border-top: 1px solid var(--line);
}
.composer textarea, .field textarea, .field input, .field-row input, .field select {
  display: block; width: 100%; min-height: var(--tap-lg);
  padding: 12px; border: 1px solid var(--field-line); border-radius: var(--r-sm); background: var(--surface);
  font-size: 16px; line-height: 24px; color: var(--ink); resize: vertical;
  transition: border-color var(--dur-release) var(--ease-out), box-shadow 120ms var(--ease-out);
}
.composer textarea::placeholder, .field textarea::placeholder, .field input::placeholder, .field-row input::placeholder, .card-note textarea::placeholder { color: var(--ink-3); }
.composer textarea:focus, .field textarea:focus, .field input:focus, .field-row input:focus, .field select:focus, .card-note textarea:focus {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--copper-tint-line);
}
.field input:disabled, .field textarea:disabled, .field input[readonly], .field-row input:disabled { background: var(--surface-2); border-color: var(--line); color: var(--ink-3); }
@media (hover: hover) {
  .field input:hover:not(:focus):not(:disabled), .field-row input:hover:not(:focus):not(:disabled), .field textarea:hover:not(:focus):not(:disabled) { border-color: var(--ink-3); }
}
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .field input, .field-row input, .field select { min-height: 40px; padding: 8px 12px; }
  .search { min-height: 40px; }
  .search input { height: 38px; }
}
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.counter { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--danger-text); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: var(--tap); font-size: 15px; color: var(--ink-2); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--copper); margin: 0; flex: none; }
.form-error { margin-top: 6px; font-size: 14px; color: var(--danger-text); }
.form-status { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.form-status:empty { display: none; }

/* info */
.kv { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 8px 12px; font-size: 15px; line-height: 22px; }
.kv dt { color: var(--ink-3); }
.kv dd { overflow-wrap: anywhere; }
.kv a { color: var(--copper-text); text-underline-offset: 3px; }
.status-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.status-line:last-child { border-bottom: 0; }
.status-sub { display: block; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.status-line .pill { flex: none; }
.kv a { display: inline-block; padding: 11px 0; margin: -11px 0; }   /* 22 + 22 = 44px tap target */
.mode-line { margin-top: 10px; font-size: 14px; line-height: 20px; color: var(--ink-2); }

/* ------------------------------------------------------------------ sheet + toast */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); animation: fade-in var(--dur-scrim) linear both; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 640px; margin: 0 auto; max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow);
  padding: 8px max(var(--gutter), env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  animation: sheet-in var(--dur-sheet-in) var(--ease-out) both;
}
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 12px; }
.sheet h2 { font-size: 20px; line-height: 26px; font-weight: 600; }
.sheet .sheet-body { margin-top: 6px; color: var(--ink-2); font-size: 15px; line-height: 22px; }
.sheet .menu { margin-top: 8px; }
.sheet .menu a, .sheet .menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 4px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; text-decoration: none; font-size: 16px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background-color var(--dur-release) var(--ease-out);
}
.sheet .menu a:active, .sheet .menu button:active { background: var(--press-bg); transition-duration: var(--dur-press); }
.sheet .menu li:last-child a, .sheet .menu li:last-child button { border-bottom: 0; }
.sheet .menu .icon { color: var(--ink-3); }
.sheet .menu small { display: block; font-size: 13px; color: var(--ink-3); }
/* buttons: stacked and full width on a phone, Cancel above the main action (the markup order already gives this) */
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.sheet-actions > span:empty { display: none; }        /* fab.js and file-header.js pass an empty span before Cancel */
.sheet-actions .btn { width: 100%; }

.scrim.closing, .sheet.closing { pointer-events: none; }
.scrim.closing { animation: fade-out var(--dur-sheet-out) linear forwards; }
.sheet.closing { animation: sheet-out var(--dur-sheet-out) var(--ease-in) forwards; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }

@media (hover: hover) { .sheet .menu a:hover, .sheet .menu button:hover { background: var(--surface-2); } }

/* a computer: a centered dialog, not a panel stuck to the bottom */
@media (min-width: 1024px) {
  .sheet {
    left: 50%; right: auto; top: 16vh; bottom: auto; width: 480px; max-width: calc(100vw - 48px); max-height: 72vh; margin: 0;
    transform: translateX(-50%); border-radius: var(--r-lg); padding: 24px;
    animation-name: dialog-in;
  }
  .sheet.closing { animation-name: dialog-out; }
  .sheet-grip { display: none; }
  .sheet-actions { flex-direction: row; justify-content: flex-end; margin-top: 24px; }
  .sheet-actions .btn { width: auto; }
}
@keyframes dialog-in { from { opacity: 0; transform: translateX(-50%) translateY(8px); } }
@keyframes dialog-out { to { opacity: 0; transform: translateX(-50%); } }

/* after the 1024 px block, so it wins there too; fade-in and fade-out touch opacity only, so the dialog's translateX(-50%) is kept */
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet.closing { animation-duration: 120ms; }
  .sheet { animation-name: fade-in; }
  .sheet.closing { animation-name: fade-out; }
}
.field { margin-top: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.field .hint { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.field .hint.ok { color: var(--ok-text); }
.sheet .hint { margin-top: 6px; font-size: 13px; line-height: 18px; color: var(--ink-3); }   /* a hint line in any sheet (was in schedule.css, which styled every sheet) */
.sheet .btn-block + .btn-block { margin-top: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 9.5rem; gap: 8px; }
.field-row label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field-row > div { min-width: 0; }
.field-row input { width: 100%; }
@media (max-width: 400px) { .field-row { grid-template-columns: 1fr; } }
.field legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
fieldset.field { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }

/* The Done bar (feel spec 5.2; Brandon Q33): toast() and undoBar() both draw in .toast-region, one bar at a time. */
.toast-region {
  position: fixed; left: 0; right: 0; z-index: 50; pointer-events: none;
  bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom));
  display: flex; justify-content: center;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}
/* a screen with a main-action bar: sit above it */
.app:has(.action-bar) ~ .toast-region { bottom: calc(var(--tabbar-h) + 88px + env(safe-area-inset-bottom)); }
/* a conversation hides the tab bar and has the reply box at the bottom */
.app:has(.screen.inbox.has-thread) ~ .toast-region { bottom: calc(96px + env(safe-area-inset-bottom)); }

.toast {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px; min-height: 52px;
  padding: 4px 4px 4px 14px; border-radius: var(--r-md);
  background: var(--brand-fill); color: var(--on-evergreen); box-shadow: var(--shadow);
  font-size: 15px; line-height: 21px; font-weight: 500; pointer-events: auto;
  animation: bar-in var(--dur-bar-in) var(--ease-out) both;
}
.toast.plain { padding-right: 14px; }
.toast > .icon { width: 20px; height: 20px; flex: none; stroke-width: 2.25; }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; padding: 8px 0; }
.toast-action {
  flex: none; min-width: var(--tap); min-height: var(--tap); padding: 0 14px;
  border: 0; border-radius: var(--r-sm); background: transparent; cursor: pointer;
  color: var(--brand-action); font-size: 15px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color var(--dur-release) var(--ease-out), transform var(--dur-release) var(--ease-out);
}
.toast-action:active { background: var(--brand-press); transform: scale(var(--press-scale)); transition-duration: var(--dur-press); }
.toast-action:focus-visible { outline-color: var(--on-evergreen); }   /* copper on green is too faint */
@media (hover: hover) { .toast-action:hover { background: var(--brand-press); } }
.toast.leaving { animation: bar-out var(--dur-bar-out) var(--ease-in) forwards; }

@keyframes bar-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes bar-out { to { opacity: 0; transform: translateY(6px); } }

@media (min-width: 1024px) {
  .toast-region, .app:has(.screen.inbox.has-thread) ~ .toast-region, .app:has(.action-bar) ~ .toast-region {
    bottom: 24px; left: var(--sidebar-w); justify-content: flex-start; padding: 0 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation-name: fade-in; animation-duration: 120ms; }
  .toast.leaving { animation-name: fade-out; animation-duration: 120ms; }
}

/* ------------------------------------------------------------------ placeholder screens */
.placeholder { padding: 24px var(--gutter); }
.placeholder p { color: var(--ink-2); }
/* the sign-in screen sits in .placeholder: its error stays red, and the field it is about says so (demo J10-07) */
.placeholder .form-error { color: var(--danger-text); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger-text); }
.field input[aria-invalid="true"]:focus, .field textarea[aria-invalid="true"]:focus { border-color: var(--danger-text); box-shadow: 0 0 0 3px var(--danger-bg); }
.placeholder .btn { margin-top: 16px; }
/* /auth/* pages (services/auth/pages.js: no script, no topbar): the same heading as an app screen */
.auth-page h1 { font-size: 24px; line-height: 30px; font-weight: 600; margin-bottom: 12px; }
.auth-page p + p, .auth-page h1 + form { margin-top: 12px; }

/* ------------------------------------------------------------------ desktop (after Dec 1: prepared, not tested) */
@media (min-width: 1024px) {
  :root { --gutter: 24px; }
  .screen.file { max-width: 1320px; display: grid; grid-template-columns: 300px minmax(0, 1fr) 360px; grid-template-areas: "top top top" "a c b"; gap: 0 24px; align-items: start; }
  .screen.file > .file-top { grid-area: top; }
  .screen.file > .col-a { grid-area: a; }
  .screen.file > .col-b { grid-area: b; }
  .screen.file > .col-c { grid-area: c; }
  .screen.file .identity, .screen.file .actions, .screen.file .panel { padding-left: 0; padding-right: 0; }
  .screen.file .money, .screen.file .next { margin-left: 0; margin-right: 0; }
}

/* one clear button: ours (44px), not the browser's */
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* ------------------------------------------------------------------ today + alerts (docs/specs/today-screen.md section 5) */
.topbar-sub { margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--ink-3); }
.today { padding: 0 var(--gutter); }
.today .section-title { display: flex; align-items: baseline; gap: 8px; }
.section-title .count { font-size: 14px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.section-sub { margin: -4px 0 8px; font-size: 14px; line-height: 20px; color: var(--ink-3); }
.banner { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; line-height: 20px; }
.banner.info { background: var(--info-bg); color: var(--info-text); }
.banner.ok { background: var(--ok-bg); color: var(--ok-text); }
.banner.attn { background: var(--attn-bg); color: var(--attn-text); }
.banner.danger { background: var(--danger-bg); color: var(--danger-text); }
.banner .btn { margin-left: auto; flex: none; }
.banner > span { flex: 1; min-width: 0; }
.banner .icon { width: 18px; height: 18px; margin-top: 1px; }

.need-list > li + li { margin-top: 8px; }
.card.need { padding: 12px 14px 14px; }
.card.need + .card.need { margin-top: 8px; }
.card.need.urgent { border-color: var(--danger-text); }
.need-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pill .pill-icon { width: 13px; height: 13px; }
.need-time { font-size: 13px; line-height: 18px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.need-name {
  display: inline-block; margin: 0 0 -6px; padding: 10px 0; min-height: var(--tap); font-size: 17px; line-height: 24px; font-weight: 600;
  color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; overflow-wrap: anywhere;
}
.need-summary { font-size: 15px; line-height: 22px; color: var(--ink-2); }
.need-detail { margin-top: 4px; font-size: 15px; line-height: 22px; color: var(--ink-2); }
.need-cta { margin-top: 12px; }
/* line-clamp clips at the padding box: no bottom padding while clamped, so line 7 never peeks out (demo J10-06) */
.quote.clamp { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; padding-bottom: 0; border-bottom: 8px solid transparent; }
.quote.clamp-6 { -webkit-line-clamp: 6; line-clamp: 6; }
.quote.clamp-4 { -webkit-line-clamp: 4; line-clamp: 4; }
.quote.clamp.open { display: block; -webkit-line-clamp: unset; line-clamp: none; }
.more-toggle { margin-top: 2px; }
.card-note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.card-note label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.card-note textarea {
  display: block; width: 100%; min-height: var(--tap-lg); padding: 12px;
  border: 1px solid var(--field-line); border-radius: var(--r-sm); background: var(--surface);
  font-size: 16px; line-height: 22px; resize: vertical;
  transition: border-color var(--dur-release) var(--ease-out), box-shadow 120ms var(--ease-out);
}
.card-note .hint { font-size: 13px; line-height: 18px; color: var(--ink-3); }

.new-leads { margin-top: 8px; }
.lead-rows { margin: 0; border: 1px solid var(--card-line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.lead-row { padding-left: 14px; padding-right: 14px; }
.lead-row { display: block; padding: 12px var(--gutter); text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); -webkit-tap-highlight-color: transparent; }
.lead-rows li:last-child .lead-row { border-bottom: 0; }
.lead-row:active { background: var(--press-bg); }
.lead-row .quote { margin-top: 8px; }
.lead-none { margin-top: 6px; font-size: 14px; color: var(--ink-3); }

.week { margin-top: 8px; }
.week-range { margin: -4px 0 8px; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.week-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--card-line); border-radius: var(--r-md); background: var(--surface); }
.week-cells > div { padding: 10px 12px; min-width: 0; }
.week-cells > div + div { border-left: 1px solid var(--line); }
.week-cells b { display: block; font-size: 22px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.week-cells span { display: block; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.week-cells small { display: block; font-size: 13px; line-height: 18px; color: var(--ok-text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.choices { margin-top: 14px; }
.field .choice, .choice {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px; min-height: var(--tap);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-release) var(--ease-out), border-color var(--dur-release) var(--ease-out);
}
.choice + .choice { margin-top: 8px; }
.choice input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--copper); flex: none; }
.choice b { display: block; font-weight: 600; }
.choice small { display: block; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.choice:active { background: var(--press-bg); transition-duration: var(--dur-press); }
.choice:has(input:checked) { border-color: var(--copper); background: var(--copper-tint); }
@media (hover: hover) { .choice:hover:not(:has(input:checked)) { background: var(--surface-2); } }

.tabbar a { position: relative; }
.tab-badge {
  position: absolute; top: 4px; left: calc(50% + 8px);
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--danger-text); color: var(--surface);
  font-size: 12px; line-height: 20px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums;
}

.topbar .chip { flex: none; }
.alerts { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.alert-row { border-bottom: 1px solid var(--line); }
.alert-row:last-child { border-bottom: 0; }
.alert-main {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: start;
  min-height: 64px; padding: 12px var(--gutter); text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent;
}
.alert-main:active { background: var(--press-bg); }
.alert-text { display: block; min-width: 0; }
.alert-l1 { display: flex; align-items: center; gap: 6px; }
.alert-title { display: block; margin-top: 4px; font-size: 15px; line-height: 21px; color: var(--ink-2); overflow-wrap: anywhere; }
.alert-row.unread .alert-title { color: var(--ink); font-weight: 600; }
.alert-who { display: block; font-size: 14px; line-height: 20px; color: var(--ink-3); }
.alert-acked { display: block; font-size: 13px; line-height: 18px; color: var(--ok-text); }
.alert-actions { display: flex; justify-content: flex-end; padding: 0 var(--gutter) 12px 58px; margin-top: -4px; }

/* Send proposal (Dec 1): the contractor's own estimate, preview, send by email or copy link */
.screen.send > :not(.file-top) { margin-left: var(--gutter); margin-right: var(--gutter); }   /* W3 QA: the screen had no side gutter on a phone */
.send > h1.section-title { margin-top: 8px; font-size: 22px; line-height: 28px; }
.send .lede { margin-top: 4px; color: var(--ink-2); overflow-wrap: anywhere; }
.send .section-title + .card { margin-top: 8px; }
.notice { border-color: var(--line); background: var(--surface-2); margin-top: 12px; }
.notice.good { border-color: var(--ok-text); background: var(--ok-bg); }
.card-actions.wrap { flex-wrap: wrap; }
.send-actions { display: grid; gap: 8px; margin-top: 10px; }
.hint.warn { display: flex; gap: 6px; align-items: flex-start; color: var(--ink-2); margin-top: 6px; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.link-box { width: 100%; min-width: 0; font-size: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ wording (founders only, docs/WORDING.md) */
.wd-pad { padding: 0 var(--gutter); }
.wd-intro { padding: 0 var(--gutter); margin-bottom: 4px; font-size: 15px; line-height: 22px; color: var(--ink-2); }
.wording .chips { margin: 0; padding: 10px var(--gutter); }
.wording .chip { text-decoration: none; position: relative; }
.wd-files { padding: 0 var(--gutter); }
.wd-link { color: var(--ink); text-decoration: none; }
.wd-status { margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.wd-filter { margin: 12px 0 4px; }
.wd-rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wd-rows > li + li { border-top: 1px solid var(--line); }
.wd-row { display: block; padding: 10px var(--gutter); color: var(--ink); text-decoration: none; min-height: var(--tap); }
.wd-row:active { background: var(--press-bg); }
.wd-row-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.wd-key { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.wd-row-kind { margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.wd-preview { margin-top: 4px; font-size: 15px; line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wd-meta { font-size: 13px; line-height: 18px; color: var(--ink-3); overflow-wrap: anywhere; }
.wd-note { margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.wording .field textarea { min-height: 96px; }
.wd-checks { margin-top: 8px; font-size: 14px; line-height: 20px; }
.wd-problems, .wd-warnings, .wd-vars, .wd-history { list-style: none; margin: 0; padding: 0; }
.wd-problems li { display: flex; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--danger-bg); color: var(--danger-text); }
.wd-problems li + li, .wd-warnings li + li { margin-top: 6px; }
.wd-problems .icon, .wd-ok .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.wd-warnings { margin-top: 6px; }
.wd-warnings li { padding: 8px 10px; border-radius: var(--r-sm); background: var(--attn-bg); color: var(--attn-text); }
.wd-ok { display: flex; gap: 8px; color: var(--ok-text); }
.wd-actions { margin-top: 8px; }
.wd-actions .card-actions { flex-wrap: wrap; }
.wd-vars li { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.wd-vars .chip { flex: none; font-size: 13px; }
.wd-var-text { font-size: 14px; line-height: 20px; color: var(--ink-2); padding-top: 8px; overflow-wrap: anywhere; }
.wd-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 22px; }
.wd-sample { padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: var(--surface); }
.wd-default { margin-top: 16px; }
.wd-default summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; color: var(--copper-text); font-weight: 500; }
.wd-default .wd-text { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.wd-history li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 20px; }
.wd-history li:last-child { border-bottom: 0; }
.wd-hist-head { font-weight: 500; }
.wd-history .wd-text { margin-top: 4px; font-size: 14px; line-height: 20px; }
.wd-wrap { flex-wrap: wrap; }
.banner.wd-safety { background: var(--danger-bg); color: var(--danger-text); }
.wd-live { margin-top: 8px; }

/* ------------------------------------------------------------------ More list and sections being built (2026-11-17) */
.more-list { padding: 4px 0; margin: 16px var(--gutter) 0; }
.placeholder .more-list { margin: 0 0 16px; }
.more-list li + li { border-top: 1px solid var(--line); }
.more-link {
  display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 16px;
  color: var(--ink); text-decoration: none;
}
.more-link > span { flex: 1; min-width: 0; display: grid; }
.more-link b { font-weight: 600; }
.more-link small { color: var(--ink-3); font-size: 13px; line-height: 18px; }
.more-link > .icon:first-child { color: var(--evergreen-text); }
.more-link > .icon:last-child { transform: rotate(180deg); color: var(--ink-3); width: 18px; height: 18px; }
.building-lead { font-size: 20px; line-height: 28px; color: var(--ink) !important; max-width: 34ch; }
.building-list { margin-top: 18px; padding: 6px 16px; }
.building-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; color: var(--ink-2); }
.building-list li + li { border-top: 1px solid var(--line); }
.building-list .icon { color: var(--evergreen-text); margin-top: 2px; }

/* ------------------------------------------------------------------ shared modifiers (moved out of the feature blocks, 2026-11-18)
 * App-wide rules a feature had added at the end of this file. They stay here, after every base rule, so they still win
 * over it; feature stylesheets (web/app/css/*.css, served as /app/features.css) load after this file. */
.topbar h1 { font-size: 26px; line-height: 32px; }   /* E: every screen title */
.avatar.sm { width: 40px; height: 40px; font-size: 14px; }   /* B: the Inbox rows; the estimate picker scopes its own 32px (.pick .avatar.sm, css/estimates.css) */
.icon.sm { width: 15px; height: 15px; }
.icon.lg { width: 36px; height: 36px; }
/* schedule.css has a bare `.sm` month-card rule (white fill, edge, shadow) that also lands on every .avatar.sm and .icon.sm; these
   keep the small avatar and icon what they are until that rule is scoped to the month view (hand-over in docs/build-log/W1-0-feel.md) */
.avatar.sm { background: var(--evergreen); border: 0; border-radius: 50%; box-shadow: none; overflow: visible; }
.icon.sm { background: none; border: 0; border-radius: 0; box-shadow: none; }

/* ---- feel (docs/build/wave1/feel-spec.md; Brandon Q30 to Q35). Shared rules every screen uses. */

/* list rows: pressed = darker beige at once, no scale (a whole row shrinking looks broken); hover only with a mouse */
.row, .irow, .lead-row, .alert-main, .more-link, .pick, .wd-row, button.tl-head {
  cursor: pointer; transition: background-color var(--dur-release) var(--ease-out);
}
.row:active, .irow:active, .lead-row:active, .alert-main:active, .more-link:active, .pick:active, .wd-row:active, button.tl-head:active {
  background: var(--press-bg); transition-duration: var(--dur-press);
}
@media (hover: hover) {
  .row:hover, .irow:hover, .lead-row:hover, .alert-main:hover, .more-link:hover, .pick:hover, .wd-row:hover, button.tl-head:hover { background: var(--surface-2); }
}
.row[aria-current="page"] { background: var(--copper-tint); box-shadow: inset 3px 0 0 var(--copper); }
.irow[aria-current="page"] { background: var(--copper-tint); border-left-color: var(--copper); }
.tabs button:active { background: var(--press-bg); }

/* Rules about shapes that live in a screen's own stylesheet. The Today ones moved to web/app/css/today.css (wave 1, brief 3). */
/* touch floor: the Inbox "Let automatic replies continue" button was 28 px tall; the negative margin keeps the layout */
.auto .btn-quiet { min-height: var(--tap); margin: -8px 0; }

/* the big-moment card (MomentCard, components/moment-card.js; Brandon Q34): quiet, a check and the amount, no confetti */
.moments { display: grid; gap: 8px; }
.moment {
  position: relative;
  display: grid; grid-template-columns: 36px minmax(0, 1fr) var(--tap); gap: 12px; align-items: start;
  padding: 12px 4px 12px 14px; border: 1px solid var(--evergreen-tint-line); border-radius: var(--r-md);
  background: var(--evergreen-tint); color: var(--ink);
  animation: card-in var(--dur-card) var(--ease-out) both;
  transition: transform var(--dur-release) var(--ease-out);
}
.moment.leaving { animation: fade-out var(--dur-bar-out) linear forwards; }
.moment-check {
  width: 36px; height: 36px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center;
  background: var(--evergreen); color: var(--on-evergreen);
}
.moment-check .icon { width: 20px; height: 20px; stroke-width: 2.5; }
.moment-check .icon path { stroke-dasharray: 23; stroke-dashoffset: 23; animation: draw var(--dur-check) var(--ease-out) 120ms forwards; }
.moment-link {
  display: grid; gap: 1px; min-width: 0; min-height: var(--tap); color: inherit; text-decoration: none;
  -webkit-tap-highlight-color: transparent; border-radius: var(--r-sm);
}
.moment-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-md); }   /* the whole card opens the link; Dismiss sits above it */
.moment-close { position: relative; z-index: 1; }
.moment-kind { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--evergreen-text); }
.moment-amount { font-size: 22px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.moment-sub { font-size: 14px; line-height: 20px; color: var(--ink-2); overflow-wrap: anywhere; }
.moment-close { margin: -8px 0; color: var(--ink-3); }   /* a .btn-icon; the negative margin keeps the card compact */
.moment:has(.moment-link:active) { transform: scale(var(--press-scale-lg)); transition-duration: var(--dur-press); }
@media (hover: hover) { .moment-link:hover .moment-amount { text-decoration: underline; text-underline-offset: 3px; } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .moment { animation-name: fade-in; animation-duration: 120ms; }
  .moment-check .icon path { animation: none; stroke-dashoffset: 0; }
}
/* the Day / Week / Month and Everything / Messages-only switches (.seg-btn, inbox.css and schedule.css) have no pressed state of their own */
.seg-btn { touch-action: manipulation; transition: background-color var(--dur-release) var(--ease-out), transform var(--dur-release) var(--ease-out); }
.seg-btn:active { background: var(--press-bg); transform: scale(var(--press-scale)); transition-duration: var(--dur-press); }
.seg-btn[aria-pressed="true"]:active { background: var(--surface); }
