/*
 * Product drawings. Every screen on the site is drawn in HTML and CSS from
 * the apps' own source, not from screenshots. Each block names the files its
 * values come from; when a token or a word changes in the app, change it here.
 * Demo data only: every name, property and time is invented.
 */

/* ---------- Worker app: the building screen ---------- */
  /*
   * The worker app's building screen, drawn from the app's own source rather
   * than from a screenshot. Every value below is traceable:
   *   apps/worker/src/theme/tokens.ts               colors, space, radius, type, touch
   *   apps/worker/src/components/location-tile.tsx  the tile and RESOLVED_ALPHA
   *   apps/worker/src/components/button.tsx         BUTTON_VARIANTS.secondary
   *   apps/worker/src/components/sync-badge.tsx     the Synced pill
   *   apps/worker/src/app/(app)/session/[sessionId]/locations/[groupId].tsx
   * React Native points map 1:1 to CSS pixels at the panel's 390px width.
   */
.screen {
    /* theme/tokens.ts */
    --background: #0B0F14; --surface: #151C24; --surface-raised: #1E2833; --border: #2A3644;
    --text: #F2F6FA; --text-muted: #93A3B4;
    --primary: #93c5fd;                       /* dark.accent */
    --pending: #a1a1aa; --collected: #4ade80; --exception: #fbbf24;
    /* The same colors at RESOLVED_ALPHA 0.65, how a resolved tile recedes. */
    --collected-faded: rgba(74,222,128,.65);
    --exception-faded: rgba(251,191,36,.65);
    --muted-faded: rgba(147,163,180,.65);

    position: relative;
    width: 100%; max-width: 390px; margin: 0 auto;
    padding: 0 16px 16px;                     /* screenInner paddingHorizontal: space.lg */
    background: var(--background); color: var(--text);
    border-radius: 28px; overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 0 0 1px #1c232c, 0 24px 60px -24px rgba(9, 9, 11, .45);
    -webkit-user-select: none; user-select: none;
  }

  /* header: paddingVertical space.md, columnGap space.md */
.screen .scr-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; }
.screen .scr-head .right { display: flex; align-items: center; gap: 12px; }
.screen .back { font-size: 15px; font-weight: 600; color: var(--text-muted); }  /* type.label */
  /* sync-badge.tsx: surface pill, paddingHorizontal space.sm / vertical space.xs, gap space.xs */
.screen .synced {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 8px; border-radius: 999px; background: var(--surface);
    font-size: 13px; font-weight: 500; color: var(--text-muted);  /* type.caption */
  }
.screen .synced::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--text-muted); }

  /* titleRow: gap space.md, paddingBottom space.md; titleBlock gap 2 */
.screen .title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; }
.screen .title-block { display: grid; gap: 2px; }
.screen .title-block h2 { font-size: 22px; font-weight: 700; line-height: 1.15; }  /* type.title */
.screen .cap { font-size: 13px; font-weight: 500; color: var(--text-muted); }      /* type.caption */
  /* filter: minHeight touch.minTarget, paddingHorizontal space.lg, pill, 1px border */
.screen .filter {
    flex: none; display: grid; place-items: center;
    min-height: 56px; padding: 0 16px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    font-size: 15px; font-weight: 600; color: var(--text-muted); white-space: nowrap;
  }

  /* grid: gap space.sm, numColumns 4 */
.screen .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
  /* location-tile.tsx: minHeight touch.tile 64, radius.md 12, borderWidth 1.5, gap space.xs */
.screen .u {
    position: relative; min-height: 64px; border-radius: 12px;
    border: 1.5px solid var(--pending); background: var(--surface);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 0 4px;
    font-size: 19px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1;
    transition: transform .1s ease, background-color .1s ease, border-color .12s ease, color .12s ease;
  }
.screen .u::after { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--pending); }
  /* resolved: the background drops to the screen's own, label and border fade */
.screen .u[data-s] { background: var(--background); color: var(--muted-faded); }
.screen .u[data-s="collected"] { border-color: var(--collected-faded); }
.screen .u[data-s="collected"]::after { background: var(--collected); }
.screen .u[data-s="exception"] { border-color: var(--exception-faded); }
.screen .u[data-s="exception"]::after { background: var(--exception); }
.screen .u.is-pressed { background: var(--surface-raised); transform: scale(.97); }
.screen .lbl { display: block; }
.screen .still { margin-top: 8px; }
  /* footer: paddingVertical space.md; Button large + secondary */
.screen .scr-foot { padding: 12px 0 0; }
.screen .scr-foot .sec {
    display: grid; place-items: center; min-height: 56px; padding: 0 16px;
    border: 1px solid var(--primary); border-radius: 12px; background: var(--surface);
    font-size: 17px; font-weight: 700; color: var(--primary); text-align: center;
  }

  /* The finger. Not part of the app. */
.screen .touch {
    position: absolute; left: 0; top: 0; width: 42px; height: 42px; margin: -21px 0 0 -21px;
    border-radius: 50%; background: rgba(242,246,250,.18); box-shadow: 0 0 0 1px rgba(242,246,250,.3);
    opacity: 0; pointer-events: none; z-index: 2;
    transition: left .16s cubic-bezier(.3,.7,.3,1), top .16s cubic-bezier(.3,.7,.3,1), opacity .12s ease, transform .12s ease;
  }
.screen .touch.is-down { opacity: 1; transform: scale(.85); }
  /* A hold runs 350ms in the app (delayLongPress), shown as a filling ring. */
.screen .touch.is-hold::after {
    content: ""; position: absolute; inset: -6px; border-radius: 50%;
    border: 2px solid var(--exception); animation: hold .35s linear both;
  }
@keyframes hold { from { transform: scale(.55); opacity: .25; } to { transform: scale(1); opacity: 1; } }

/* ---------- Product screens: attention card, sweep sheet ----------
 * Same source trail as the hero screen above:
 *   apps/worker/src/components/card.tsx                Card, TONE_COLOR, RECEDED_ALPHA
 *   apps/worker/src/components/sweep-confirmation.tsx  the sheet
 *   apps/worker/src/components/button.tsx              BUTTON_VARIANTS
 *   apps/worker/src/app/(app)/session/[sessionId]/attention.tsx
 *   packages/shared/src/domain/batch.ts                batchConfirmation()
 */
.screen--card { padding: 16px; }
.screen--card .a-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-top: 4px; }
.screen--card .a-head .txt { display: grid; gap: 4px; }
.screen--card .a-title { font-size: 22px; font-weight: 700; line-height: 1.15; }   /* type.title */
.screen--card .a-sub { font-size: 17px; font-weight: 500; color: var(--text-muted); } /* type.body, muted */
.screen--card .a-list { display: grid; gap: 16px; padding: 16px 0; }               /* list gap: space.md */
/* Card: surface, radius.lg 16, 1px border, padding space.lg, gap space.sm */
.screen--card .a-card {
  background: var(--surface); border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 16px; padding: 16px; display: grid; gap: 8px; min-height: 56px;
  transition: background-color .15s ease, border-color .2s ease;
}
.screen--card .a-card--warning { border-left-color: #FFB020; }    /* colors.warning */
.screen--card .a-card--critical { border-left-color: #FF6B6B; }   /* colors.danger */
/* The tone's word is part of the tone: a stripe is never drawn without it. */
.screen--card .a-tone { font-size: 13px; font-weight: 700; }
.screen--card .a-card--warning .a-tone { color: #FFB020; }
.screen--card .a-card--critical .a-tone { color: #FF6B6B; }
.screen--card .a-row { display: flex; align-items: center; gap: 12px; }
.screen--card .a-name { flex: 1; font-size: 17px; font-weight: 500; }
.screen--card .a-note { font-size: 13px; font-weight: 500; color: var(--text-muted); line-height: 19px; }
.screen--card .a-check {
  width: 26px; height: 26px; border-radius: 999px; flex: none;
  border: 1px solid var(--border); display: grid; place-items: center;
  font-size: 15px; font-weight: 700; color: transparent;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.screen--card .is-ack .a-check { background: var(--primary); border-color: var(--primary); color: var(--background); }
/* RECEDED_ALPHA 0.8: the surface and content fade, the stripe and its word never do. */
.screen--card .is-ack { background: rgba(21,28,36,.8); border-color: rgba(42,54,68,.8); }
.screen--card .is-ack.a-card--warning { border-left-color: #FFB020; }
.screen--card .is-ack.a-card--critical { border-left-color: #FF6B6B; }
.screen--card .is-ack .a-row, .screen--card .is-ack .a-note { opacity: .8; }
.screen--card .a-foot { font-size: 13px; font-weight: 500; color: var(--text-muted); }

.screen--sheet { padding: 16px; min-height: 540px; display: flex; flex-direction: column; }
.screen--sheet .s-behind { flex: 1; }            /* the grid the sheet opens over */
.screen--sheet .s-title { font-size: 22px; font-weight: 700; line-height: 1.15; }
.screen--sheet .s-sub { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.screen--sheet .s-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.screen--sheet .s-mini {
  min-height: 64px; border-radius: 12px; border: 1.5px solid var(--pending); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 13px; font-weight: 500; text-align: center; padding: 0 4px;
}
.screen--sheet .s-mini::after { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--pending); }
/* backdrop rgba(0,0,0,0.6); the sheet sits at the bottom, padding space.lg */
.screen--sheet .s-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; padding: 16px; }
.screen--sheet .s-sheet {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; display: grid; gap: 16px;   /* radius.md, space.lg/md */
}
.screen--sheet .s-body { font-size: 17px; font-weight: 500; }
.screen--sheet .s-note { font-size: 13px; font-weight: 500; color: var(--text-muted); }
/* Stacked, the sweep on top and the way out nearest the thumb. */
.screen--sheet .s-stack { display: grid; gap: 8px; padding-top: 4px; }
.screen--sheet .s-btn {
  min-height: 56px; border-radius: 12px; padding: 0 16px; border: 1px solid transparent;
  display: grid; place-items: center; font-size: 17px; font-weight: 700; text-align: center;
}
.screen--sheet .s-btn--primary { background: var(--primary); border-color: var(--primary); color: var(--background); }
.screen--sheet .s-btn--quiet { border-color: var(--border); color: var(--text-muted); }


/* ---------- Worker exception screen ----------
 * apps/worker/src/app/(app)/session/[sessionId]/exception/[locationId].tsx
 *   header paddingTop space.lg, reasons wrap with gap space.sm
 *   reason: pill, minHeight touch.minTarget - 12 (44), paddingHorizontal space.lg
 *   reasonOn: colors.exception fill, textInverse label
 *   describeRequirements(): "Requires 1 photo."
 * apps/worker/src/components/photo-capture.tsx  the compact frame and shutter
 */
.screen--exception { padding: 0 16px 16px; min-height: 640px; display: flex; flex-direction: column; }
.screen--exception .x-body { flex: 1; display: grid; gap: 16px; align-content: start; padding-top: 16px; }
.screen--exception .x-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.screen--exception .x-head .txt { display: grid; gap: 2px; }
.screen--exception .x-title { font-size: 22px; font-weight: 700; line-height: 1.15; }
.screen--exception .x-cancel { font-size: 15px; font-weight: 600; color: var(--text-muted); padding: 4px 0; }
.screen--exception .x-group { display: grid; gap: 8px; }
.screen--exception .x-reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.screen--exception .x-reason {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 15px; font-weight: 600; color: var(--text);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.screen--exception .x-reason.is-on { background: var(--exception); border-color: var(--exception); color: var(--background); }
.screen--exception .x-reason.is-pressed { background: var(--surface-raised); }
.screen--exception .x-need { display: grid; gap: 12px; }
.screen--exception .x-hint { font-size: 17px; font-weight: 500; color: var(--text-muted); }
.screen--exception .x-frame {
  position: relative; height: 150px; border-radius: 12px; overflow: hidden;
  background: radial-gradient(120% 90% at 40% 70%, #3a4552 0%, #1b232c 55%, #0f141a 100%);
}
/* A tied-off bag, roughly, so the viewfinder is not an empty box. */
.screen--exception .x-frame svg { position: absolute; left: 50%; top: 46%; width: 92px; transform: translate(-50%, -50%); opacity: .55; }
.screen--exception .x-shutter {
  position: absolute; left: 50%; bottom: 12px; width: 52px; height: 52px; margin-left: -26px;
  border-radius: 50%; border: 3px solid var(--text); display: grid; place-items: center;
}
.screen--exception .x-shutter::after { content: ""; width: 38px; height: 38px; border-radius: 50%; background: var(--text); transition: transform .12s ease; }
.screen--exception .x-shutter.is-pressed::after { transform: scale(.85); }
.screen--exception .x-flash { position: absolute; inset: 0; background: #fff; opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.screen--exception .x-flash.is-on { opacity: .7; transition: none; }
.screen--exception .x-prompt { position: absolute; left: 12px; top: 10px; right: 12px; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.screen--exception .x-thumbs { display: flex; gap: 8px; min-height: 64px; }
.screen--exception .x-thumb {
  position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden;
  background: radial-gradient(120% 90% at 40% 70%, #4b5866 0%, #232c36 60%, #141a21 100%);
}
.screen--exception .x-thumb svg { position: absolute; left: 50%; top: 50%; width: 40px; transform: translate(-50%, -50%); opacity: .6; }
.screen--exception .x-thumb::after {
  content: "\00d7"; position: absolute; top: 0; right: 0; width: 22px; height: 22px;
  display: grid; place-items: center; font-size: 16px; line-height: 1;
  background: rgba(11,15,20,.8); color: var(--text); border-bottom-left-radius: 8px;
}
.screen--exception .x-foot { padding-top: 16px; }
.screen--exception .x-save {
  min-height: 56px; border-radius: 12px; display: grid; place-items: center;
  font-size: 17px; font-weight: 700; border: 1px solid var(--primary);
  background: var(--primary); color: var(--background); transition: opacity .15s ease;
}
.screen--exception .x-save.is-off { opacity: .4; }
.screen--exception [hidden] { display: none !important; }

/* ---------- ProofServ Office screens ----------
 * Drawn from apps/admin: the shell in app/(office)/layout.tsx and
 * components/office-nav.tsx, the parts in components/ui.tsx, Last night in
 * app/(office)/nights/page.tsx, the Service Record in nights/[sessionId], and
 * the week in schedule/week-view.tsx. Its words come from lib/night.ts,
 * lib/service-record.ts and lib/week.ts. Gray is zinc, as the design-tokens
 * Tailwind preset sets it; amber and blue are Tailwind's own.
 */
.office {
  --o-50: #fafafa; --o-100: #f4f4f5; --o-200: #e4e4e7; --o-300: #d4d4d8; --o-400: #a1a1aa;
  --o-500: #71717a; --o-600: #52525b; --o-700: #3f3f46; --o-800: #27272a; --o-900: #18181b;
  --amber-50: #fffbeb; --amber-200: #fde68a; --amber-300: #fcd34d; --amber-900: #78350f;
  position: relative;
  border: 1px solid var(--o-200); border-radius: 14px; overflow: hidden;
  background: var(--o-50); color: var(--o-900);
  font-size: 14px; line-height: 1.45; text-align: left;
  box-shadow: 0 24px 60px -28px rgba(9, 9, 11, .28);
  -webkit-user-select: none; user-select: none;
}
.office__chrome { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; background: #fff; border-bottom: 1px solid var(--o-200); }
.office__chrome i { width: 10px; height: 10px; border-radius: 50%; background: var(--o-200); }
.office__chrome span { margin-left: 12px; font-size: 12px; color: var(--o-500); }
.office__body { display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .office--nav .office__body { grid-template-columns: 172px 1fr; } }
.office__side { display: none; background: #fff; border-right: 1px solid var(--o-200); padding: 18px 10px; }
@media (min-width: 900px) { .office--nav .office__side { display: block; } }
.office__brand { padding: 0 10px 18px; }
.office__brand b { display: block; font-size: 13px; font-weight: 600; }
.office__brand small { display: block; font-size: 12px; color: var(--o-500); }
.office__navhead { padding: 0 10px 4px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--o-400); }
.office__navhead + .office__link { margin-top: 0; }
.office__link { display: block; padding: 7px 10px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--o-600); }
.office__link.is-on { background: var(--o-100); color: var(--o-900); }
.office__gap { height: 14px; }
.office__main { padding: clamp(16px, 3vw, 28px); min-width: 0; }
.o-title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.o-desc { margin-top: 2px; font-size: 13px; color: var(--o-600); }
.o-back { font-size: 13px; color: var(--o-500); }
.o-date { margin-top: 16px; font-size: 16px; font-weight: 600; }
.o-summary { color: var(--o-600); }
.o-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.o-card { background: #fff; border: 1px solid var(--o-200); border-radius: 12px; padding: 14px 16px; }
.o-card--follow { border-color: var(--amber-300); }
.o-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; }
.o-row .left { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.o-name { font-size: 15px; font-weight: 600; }
.o-status { font-size: 13px; color: var(--o-500); }
.o-link { font-size: 13px; font-weight: 500; color: var(--accent); }
.o-line { margin-top: 3px; font-size: 13px; color: var(--o-700); }
.o-meta { margin-top: 8px; font-size: 13px; color: var(--o-500); }
.o-meta b { font-weight: 400; color: var(--o-600); }
.o-facts { margin-top: 10px; border: 1px solid; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.o-facts p { font-weight: 600; }
.o-facts ul { margin: 2px 0 0; padding-left: 18px; }
.o-facts--follow { border-color: var(--amber-200); background: var(--amber-50); color: var(--amber-900); }
.o-facts--look { border-color: var(--o-100); background: var(--o-50); color: var(--o-800); }
.o-badge { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #eff6ff; color: #1d4ed8; }

.o-panels { display: grid; gap: 12px; margin-top: 16px; }
.o-panel { background: #fff; border: 1px solid var(--o-200); border-radius: 12px; padding: 14px 18px; }
.o-panel h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.o-dl { display: grid; grid-template-columns: 7.5rem 1fr; gap: 3px 16px; margin: 0; font-size: 13px; }
.o-dl dt { color: var(--o-500); }
.o-dl dd { margin: 0; }
.o-dl dd span { color: var(--o-500); }
.o-small { margin-top: 8px; font-size: 12px; color: var(--o-500); }
.o-bullets { margin: 0; padding-left: 18px; font-size: 13px; color: var(--o-800); display: grid; gap: 2px; }
.o-time { list-style: none; margin: 0 -18px; padding: 0; border-top: 1px solid var(--o-100); font-size: 13px; }
.o-time li { display: grid; grid-template-columns: 4.6rem 1fr; gap: 10px; padding: 7px 18px; border-bottom: 1px solid var(--o-100); }
.o-time .t { color: var(--o-500); font-variant-numeric: tabular-nums; }
.o-time .who { color: var(--o-500); }
.o-time .kind { display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--o-500); }
.o-time .kind--x { color: var(--status-exception); }
.o-time .sub { display: block; color: var(--o-600); }
.o-photos { display: flex; gap: 6px; margin-top: 6px; }
.o-photos i { width: 44px; height: 44px; border-radius: 6px; background: radial-gradient(120% 90% at 40% 70%, #8a96a3 0%, #4b5563 60%, #27313b 100%); }

/* The week: a property per row, a night per cell. */
.o-week { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.o-week th { padding: 6px 4px; font-weight: 500; color: var(--o-500); text-align: left; }
.o-week th:first-child { width: 128px; padding-left: 0; }
.o-week td { padding: 3px; vertical-align: top; }
.o-week td:first-child { padding-left: 0; font-size: 13px; font-weight: 500; color: var(--o-900); vertical-align: middle; }
.o-cell { display: block; min-height: 40px; border-radius: 6px; padding: 4px 6px; border: 1px solid var(--o-200); background: #fff; line-height: 1.3; }
.o-cell small { display: block; font-size: 11px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-cell--none { background: transparent; border-style: dashed; color: var(--o-400); }
.o-cell--needs { border-color: var(--amber-300); background: var(--amber-50); color: var(--amber-900); }
.o-cell--done { background: var(--o-100); color: var(--o-600); }
.o-cell--off { color: var(--o-500); text-decoration: line-through; }
.o-scroll { overflow-x: auto; margin-top: 14px; background: #fff; border: 1px solid var(--o-200); border-radius: 12px; padding: 10px 14px; }
.o-scroll .o-week { min-width: 620px; }

/* ---------- Worker app: a Tier 1 visit ----------
 * apps/worker/src/app/(app)/visit/[sessionId]/index.tsx   title, caption, the log, three buttons
 * apps/worker/src/components/button.tsx                    primary, quiet, secondary
 * Words: "Visit under way", "N places logged", "Log a place",
 * "Record an observation", "Depart".
 */
.screen--visit { padding: 0 16px 16px; min-height: 600px; display: flex; flex-direction: column; }
.screen--visit .v-body { flex: 1; display: grid; gap: 12px; align-content: start; padding-top: 16px; }
.screen--visit .v-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.screen--visit .v-head .txt { display: grid; gap: 2px; }
.screen--visit .v-title { font-size: 22px; font-weight: 700; line-height: 1.15; }
.screen--visit .v-log { display: grid; gap: 8px; }
.screen--visit .v-row {
  display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
}
.screen--visit .v-row .top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.screen--visit .v-row .name { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; }
.screen--visit .v-row .name::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--collected); }
.screen--visit .v-row[data-s="exception"] .name::before { background: var(--exception); }
.screen--visit .v-row .time { font-size: 13px; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.screen--visit .v-row .cap { padding-left: 15px; }
.screen--visit .v-row.is-new { animation: v-in .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes v-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.screen--visit .v-foot { display: grid; gap: 8px; padding-top: 16px; }
.screen--visit .v-btn {
  min-height: 56px; border-radius: 12px; display: grid; place-items: center; padding: 0 16px;
  font-size: 17px; font-weight: 700; border: 1px solid transparent;
}
.screen--visit .v-btn--primary { background: var(--primary); color: var(--background); }
.screen--visit .v-btn--quiet { border-color: var(--border); color: var(--text-muted); }
.screen--visit .v-btn--secondary { border-color: var(--primary); color: var(--primary); background: var(--surface); }

/* ---------- Property Portal ----------
 * apps/admin/app/property/layout.tsx              the bar: "ProofServ Service records"
 * apps/admin/app/property/[propertyId]/page.tsx   header, Latest service card, The last 7 days
 * apps/admin/components/portal.tsx                Card, StatusChip, OutcomeBar, OutcomeLegend
 * packages/shared/src/domain/portal.ts            "Your service team visited",
 *   "locations with an outcome", "N collected", "N with an issue"
 * Gray is zinc (the design-tokens preset); the bar is a gray-50 page.
 */
.portal {
  --p-50: #fafafa; --p-100: #f4f4f5; --p-200: #e4e4e7; --p-300: #d4d4d8; --p-500: #71717a; --p-600: #52525b; --p-700: #3f3f46; --p-900: #18181b;
  position: relative; width: 100%;
  border: 1px solid var(--p-200); border-radius: 16px; overflow: hidden;
  background: var(--p-50); color: var(--p-900);
  font-size: 14px; line-height: 1.45; text-align: left;
  box-shadow: 0 40px 80px -40px rgba(9, 9, 11, .35);
  -webkit-user-select: none; user-select: none;
}
.portal__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; background: rgba(255,255,255,.9); border-bottom: 1px solid rgba(228,228,231,.8); font-size: 13px; }
.portal__bar b { font-weight: 600; }
.portal__bar b span { font-weight: 400; color: var(--p-500); }
.portal__bar small { font-size: 13px; color: var(--p-500); }
.portal__main { padding: 24px clamp(16px, 3vw, 28px) 28px; }
.portal__h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.portal__sub { margin-top: 2px; font-size: 13px; color: var(--p-500); }
.portal__tonight { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 14px; border-radius: 12px; background: #fff; border: 1px solid rgba(228,228,231,.8); font-size: 13px; }
.portal__tonight b { font-weight: 500; }
.portal__tonight span { color: var(--p-500); }
.portal__tonight i { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--p-500); }
.portal__card { margin-top: 12px; background: #fff; border: 1px solid rgba(228,228,231,.8); border-radius: 14px; padding: 20px; }
.portal__k { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.portal__k p { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--p-500); }
.portal__chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--p-100); color: var(--p-700); }
.portal__chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--p-700); }
.portal__visit { margin-top: 10px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.portal__cov { margin-top: 14px; font-size: 13px; color: var(--p-600); }
.portal__cov b { font-size: 17px; font-weight: 600; color: var(--p-900); font-variant-numeric: tabular-nums; }
.portal__bar-outcome { display: flex; gap: 2px; height: 8px; margin-top: 8px; border-radius: 999px; overflow: hidden; background: var(--p-100); }
.portal__bar-outcome i { display: block; height: 100%; }
.portal__bar-outcome .ok { background: #10b981; }
.portal__bar-outcome .issue { background: #f59e0b; }
.portal__legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--p-600); }
.portal__legend span { display: inline-flex; align-items: center; gap: 6px; }
.portal__legend span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: #10b981; }
.portal__legend .issue::before { background: #f59e0b; }
.portal__notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.portal__notes span { padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: #fffbeb; color: #78350f; box-shadow: inset 0 0 0 1px rgba(217,119,6,.15); }
.portal__open { margin-top: 14px; font-size: 13px; font-weight: 500; color: var(--accent); }
.portal__section { margin-top: 22px; font-size: 14px; font-weight: 600; }
.portal__week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; }
.portal__day { display: grid; justify-items: center; gap: 6px; padding: 10px 2px; border-radius: 10px; background: #fff; border: 1px solid rgba(228,228,231,.8); font-size: 11px; color: var(--p-500); }
.portal__day b { font-size: 13px; font-weight: 600; color: var(--p-900); font-variant-numeric: tabular-nums; }
.portal__day i { width: 14px; height: 14px; border-radius: 50%; background: #10b981; }
.portal__day--issue i { background: #fff; border: 3px solid #f59e0b; }
.portal__day--none i { background: transparent; border: 1.5px dashed var(--p-300); }
.portal__day--tonight { border-color: var(--p-300); }
.portal__day--tonight i { background: transparent; border: 2px solid var(--p-500); }

/* The night itself: locations and what happened at each. */
.portal__rows { margin-top: 12px; background: #fff; border: 1px solid rgba(228,228,231,.8); border-radius: 14px; overflow: hidden; }
.portal__search { padding: 12px 16px; border-bottom: 1px solid var(--p-100); }
.portal__search span { display: block; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--p-300); font-size: 13px; color: var(--p-500); }
.portal__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--p-100); font-size: 13px; }
.portal__row:last-child { border-bottom: 0; }
.portal__row b { font-weight: 500; }
.portal__row small { display: block; font-size: 12px; color: var(--p-500); }
.portal__result { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: #047857; white-space: nowrap; }
.portal__result::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #10b981; }
.portal__result--issue { color: #92400e; }
.portal__result--issue::before { background: #f59e0b; }

/* ---------- Resident Portal ----------
 * apps/resident/components/tonight-view.tsx   the home screen, top to bottom
 * packages/shared/src/domain/resident.ts      tonightState(), guidanceSummary(), helpModel(),
 *   "Service is underway", "Your valet arrived at…", "Set out by…",
 *   "Something missed?", "Ask your valet to come back", "How service works here"
 */
.resident {
  position: relative; width: 100%; max-width: 390px; margin: 0 auto;
  border-radius: 28px; overflow: hidden; padding: 24px 20px 24px;
  background: #f9fafb; color: #111827; border: 1px solid #e5e7eb;
  font-size: 15px; line-height: 1.5; text-align: left;
  box-shadow: 0 40px 80px -36px rgba(9, 9, 11, .5);
  -webkit-user-select: none; user-select: none;
}
.resident__brand { font-size: 13px; font-weight: 600; color: #6b7280; }
.resident__name { margin-top: 14px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.resident__home { margin-top: 2px; font-size: 14px; color: #4b5563; }
.resident__date { margin-top: 24px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: #6b7280; }
.resident__status { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.resident__mark { position: relative; width: 28px; height: 28px; flex: none; border-radius: 50%; background: #dbeafe; }
.resident__mark::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #2563eb; animation: r-pulse 2.4s ease-in-out infinite; }
@keyframes r-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.7); } }
.resident__status h4 { font-size: 26px; font-weight: 600; line-height: 1.15; letter-spacing: -0.025em; }
.resident__detail { margin-top: 10px; font-size: 16px; color: #374151; }
.resident__guide { margin-top: 20px; padding: 14px 18px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px #e5e7eb; }
.resident__guide b { display: block; font-size: 16px; font-weight: 600; }
.resident__guide span { display: block; margin-top: 2px; font-size: 15px; color: #374151; }
.resident__help { margin-top: 22px; }
.resident__help h5 { font-size: 15px; font-weight: 600; }
.resident__help p { margin-top: 6px; font-size: 14px; color: #1f2937; }
.resident__ask { margin-top: 12px; display: grid; place-items: center; min-height: 48px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px #d1d5db; font-size: 15px; font-weight: 600; }
.resident__row { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px #e5e7eb; }
.resident__row b { display: block; font-size: 15px; font-weight: 600; }
.resident__row span { display: block; font-size: 13px; color: #6b7280; }
.resident__row i { font-style: normal; color: #9ca3af; font-size: 18px; }

/* attention.tsx: "Start service", pinned under the footnote (Button primary, large) */
.screen--card .a-start {
  display: grid; place-items: center; margin-top: 12px; min-height: 56px; border-radius: 12px;
  background: var(--primary); color: var(--background); font-size: 17px; font-weight: 700;
}
