/*
 * Savings calculator (/permit-savings-calculator).
 *
 * Everything is scoped under .sc so nothing leaks into the marketing theme
 * (main.css is precompiled; only classes the theme already emitted exist
 * there, so the tool carries its own styles). The left pane imitates the
 * spreadsheet / mail / PDF tools people use today; the right pane uses the
 * Permits2Go app's tokens (Inter, slate, brand purple) so the replay looks
 * like the product. Colours are the design system's.
 */

.sc {
  --sc-ink: #1a1a1c;
  --sc-mute: #45454a;
  --sc-mute-2: #55555b;
  --sc-line: #d7dde5;
  --sc-line-2: #e3e7ed;
  --sc-page: #f2f5fa;
  --sc-brand: #6e3492;
  --sc-ok: #15803d;

  --p2g-purple: #481E68;
  --purple-50: #faf5ff;
  --purple-100: #f3e8ff;
  --purple-200: #e9d5ff;
  --purple-300: #d8b4fe;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --font-app: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  display: flex;
  flex-direction: column;
  gap: 24px;
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--sc-ink);
  text-align: left;
}

.sc *,
.sc *::before,
.sc *::after { box-sizing: border-box; }
/* Resets are wrapped in :where() so they carry no specificity: a component
   class such as .sc-do or .sc-field must always win over them. */
:where(.sc) :where(h2, h3, p) { margin: 0; }
:where(.sc) :where(button) { font: inherit; color: inherit; cursor: pointer; }
:where(.sc) :where(input, textarea, select) { font: inherit; color: inherit; }
.sc button:disabled { cursor: not-allowed; opacity: .45; }
.sc button:focus-visible,
.sc a:focus-visible,
.sc input:focus-visible,
.sc textarea:focus-visible,
.sc select:focus-visible { outline: 2px solid var(--sc-brand); outline-offset: 2px; }
.sc [hidden] { display: none !important; }
.sc h2[tabindex="-1"]:focus, .sc h3[tabindex="-1"]:focus { outline: none; }
/* For screen readers only. */
.sc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@keyframes sc-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes sc-pulse { 50% { opacity: .5; } }
@keyframes sc-bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); }
  50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); }
}
.sc-rise { animation: sc-fade .3s cubic-bezier(.4, 0, .2, 1); }
.sc-ringing { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.sc-ringing-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sc-ok); animation: sc-pulse 1.2s cubic-bezier(.4, 0, .6, 1) infinite; }

/* ------------------------------------------------------------ shared */

.sc-card { background: #fff; border-radius: 20px; padding: 20px; }
.sc-col { display: flex; flex-direction: column; }
.sc-gap-4 { gap: 4px; } .sc-gap-6 { gap: 6px; } .sc-gap-8 { gap: 8px; }
.sc-gap-12 { gap: 12px; } .sc-gap-16 { gap: 16px; }
.sc-wrap { display: flex; flex-wrap: wrap; }
.sc-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.sc-grow { flex: 1 1 220px; min-width: 0; }
.sc-nums { font-variant-numeric: tabular-nums; }
.sc-ok { color: var(--sc-ok) !important; }

.sc-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px;
  border: 1px solid var(--sc-line); border-radius: 999px;
  background: #fff; color: var(--sc-ink);
  font-size: 15px; font-weight: 500; text-decoration: none;
  transition: transform .2s cubic-bezier(.4, 0, .2, 1);
}
.sc-pill:hover:not(:disabled) { transform: scale(1.03); }
.sc-pill:active:not(:disabled) { transform: scale(.97); }
.sc-pill.is-dark { background: var(--sc-ink); border-color: var(--sc-ink); color: #fff; }
.sc-pill.is-well { gap: 12px; padding: 4px 4px 4px 20px; }
.sc-pill.is-plain { border-color: transparent; background: transparent; text-decoration: underline; }
.sc-well {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 40px; border-radius: 999px;
  background: linear-gradient(180deg, #ead9f5, #cfaee6);
}
.sc-well.is-dark { background: var(--sc-ink); }

/* ------------------------------------------------- your numbers card */

.sc-setup { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 32px; padding: 20px 24px; background: #fff; border-radius: 20px; }
.sc-setup.is-inset { background: var(--sc-page); border-radius: 16px; }
.sc-ask { flex: 1 1 260px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; font-weight: 500; }
.sc-ask-row { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.sc-ask-row .sc-field { max-width: 140px; }
.sc-ask-unit { font-size: 14px; color: var(--sc-mute); }
.sc-setup-note { flex: 1 1 100%; font-size: 13px; line-height: 1.5; color: var(--sc-mute); }

/* -------------------------------------------------------- task rail */

.sc-rail { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-rail-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  flex: 1 1 132px; min-width: 132px; min-height: 72px; padding: 10px 16px;
  border: 1px solid var(--sc-line); border-radius: 16px;
  background: #fff; color: var(--sc-ink); text-align: left;
}
.sc-rail-num { font-family: var(--font-mono); font-size: 12px; color: var(--sc-mute-2); }
.sc-rail-label { font-size: 15px; font-weight: 500; }
.sc-rail-meta { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--sc-mute-2); }
.sc-rail-btn.is-done .sc-rail-num,
.sc-rail-btn.is-done .sc-rail-meta { color: var(--sc-brand); }
.sc-rail-btn.is-on { background: var(--sc-ink); border-color: var(--sc-ink); color: #fff; }
.sc-rail-btn.is-on .sc-rail-num,
.sc-rail-btn.is-on .sc-rail-meta { color: #d4d4d8; }

/* -------------------------------------------- task brief and result */

.sc-task { display: flex; flex-direction: column; gap: 16px; }
.sc-brief { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; padding: 28px 32px; background: #fff; border-radius: 20px; }
.sc-brief-text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-brief-no { font-size: 14px; font-weight: 500; color: var(--sc-brand); }
.sc-brief h2 { font-size: clamp(26px, 2.6vw, 36px); line-height: 1.2; font-weight: 400; color: var(--sc-ink); }
.sc-brief p { max-width: 780px; font-size: 16px; line-height: 1.5; color: var(--sc-mute); }
.sc-brief-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-brief p.sc-brief-then { margin-top: 4px; font-size: 14px; }

/* The instructions, one numbered step per line. A step's number turns into a
   tick when it is done; the step to do next is the dark one. */
.sc-steps { display: flex; flex-direction: column; gap: 10px; max-width: 780px; margin: 8px 0 0; padding: 0; list-style: none; }
.sc-step { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; line-height: 1.5; color: var(--sc-ink); }
.sc-step-num { flex: 0 0 28px; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--sc-line); border-radius: 999px; background: var(--sc-page); font-size: 14px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; transition: background-color .2s, border-color .2s, color .2s; }
.sc-step-text { padding-top: 2px; }
.sc-step.is-current .sc-step-num { border-color: var(--sc-ink); background: var(--sc-ink); color: #fff; }
.sc-step.is-current .sc-step-text { font-weight: 500; }
.sc-step.is-done .sc-step-num { border-color: #86efac; background: #dcfce7; color: var(--sc-ok); }
.sc-step.is-done .sc-step-text { color: var(--sc-mute); }

.sc-result { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; padding: 24px 32px; background: var(--sc-ink); color: #fff; border-radius: 20px; scroll-margin-top: 110px; }
.sc-result-label { font-size: 13px; color: #d4d4d8; }
.sc-result-time { font-size: 40px; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; }
.sc-result-time.is-p2g { color: #dcc2ee; }
.sc-result p { flex: 1 1 320px; font-size: 15px; line-height: 1.5; color: #ececf0; }
.sc-result .sc-pill { border: 0; }

/* ----------------------------------------------------------- panes */

/* One pane is in view at a time: the task by hand, then the Permits2Go replay
   in its place. It is as wide as the task card above it and lines up with
   that card's text. */
.sc-pane { padding: 24px 32px 32px; background: #fff; border-radius: 20px; }
.sc-pane-inner { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.sc-pane-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.sc-pane-id { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.sc-pane-tag { padding: 4px 12px; border-radius: 999px; background: #eef1f5; font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--sc-ink); scroll-margin-top: 110px; }
.sc-pane-tag.is-p2g { background: linear-gradient(180deg, #ead9f5, #cfaee6); }
.sc-pane-note { font-size: 13px; color: var(--sc-mute-2); }
.sc-pane-clock { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.sc-pane-clock small { font-size: 12px; color: var(--sc-mute-2); }
.sc-pane-clock strong { font-size: 40px; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; }
.sc-pane-clock strong.is-p2g { color: var(--sc-brand); }
.sc-pane-clocks { display: flex; align-items: flex-end; gap: 28px; }
.sc-pane-clock.is-small strong { font-size: 20px; line-height: 40px; white-space: nowrap; }

/* --------------------------------- left pane: the tools of today */

.sc-app { display: flex; flex-direction: column; gap: 12px; font-family: var(--font-app); }
.sc-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-tab { min-height: 44px; padding: 8px 16px; border: 1px solid var(--slate-300); border-radius: 10px; background: #fff; color: var(--sc-ink); font-size: 14px; font-weight: 600; }
.sc-tab[aria-pressed="true"] { background: var(--sc-ink); color: #fff; }

.sc-field,
.sc-area,
.sc-cell { width: 100%; background: #fff; font-size: 14px; font-weight: 400; color: var(--slate-900); }
.sc-field { min-height: 44px; padding: 8px 10px; border: 1px solid var(--slate-300); border-radius: 6px; line-height: 1.4; }
.sc-area { min-height: 88px; padding: 8px 10px; border: 1px solid var(--slate-300); border-radius: 6px; line-height: 1.45; resize: vertical; }
.sc-cell { min-width: 0; min-height: 44px; padding: 8px 10px; border: 0; border-left: 1px solid var(--slate-200); border-radius: 0; }
.sc-field::placeholder,
.sc-area::placeholder { color: var(--slate-500); opacity: 1; }
select.sc-field { appearance: auto; }

.sc-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--slate-700); }
.sc-label-top { display: flex; justify-content: space-between; gap: 8px; }
.sc-mark { color: var(--sc-ok); }

.sc-note { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--slate-200); border-radius: 10px; background: var(--slate-50); }
.sc-note-meta { font-size: 12px; font-weight: 600; color: var(--slate-600); }
.sc-note-title { font-size: 15px; font-weight: 600; color: var(--slate-900); }
.sc-note-body { font-size: 14px; line-height: 1.5; color: var(--slate-700); }

.sc-win { border: 1px solid var(--slate-300); border-radius: 10px; overflow: hidden; background: #fff; }
.sc-win-bar { padding: 10px 14px; border-bottom: 1px solid var(--slate-300); background: var(--slate-100); font-size: 13px; font-weight: 600; color: var(--slate-700); }
.sc-win-bar.is-sheet { background: #217346; border-bottom-color: #1a5c38; color: #fff; }
.sc-win-bar.is-mail { background: #0f6cbd; border-bottom-color: #0c5a9e; color: #fff; }
.sc-win-bar.is-pdf { background: #b30b00; border-bottom-color: #8f0900; color: #fff; }
.sc-win-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.sc-hint { font-size: 14px; line-height: 1.45; color: var(--slate-700); }
.sc-between > .sc-hint { flex: 1 1 220px; }
.sc-hint.is-strong { font-weight: 500; }
.sc-do { min-height: 44px; padding: 10px 20px; border: 0; border-radius: 999px; background: var(--sc-ink); color: #fff; font-size: 15px; font-weight: 500; transition: transform .2s cubic-bezier(.4, 0, .2, 1); }
.sc-do:hover:not(:disabled) { transform: scale(1.03); }
.sc-do:active:not(:disabled) { transform: scale(.97); }

.sc-scroll { overflow-x: auto; }
.sc-sheet { min-width: var(--sc-sheet-min, 640px); }
.sc-cellwrap { display: contents; }
.sc-cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sc-grid { display: grid; grid-template-columns: var(--sc-cols); }
.sc-grid-head { background: var(--slate-50); border-bottom: 1px solid var(--slate-200); font-size: 12px; font-weight: 600; color: var(--slate-600); }
.sc-grid-head > div { padding: 8px 10px; border-left: 1px solid var(--slate-200); }
.sc-grid-head > div:first-child { border-left: 0; padding: 8px 6px; }
.sc-grid-row { border-bottom: 1px solid var(--slate-200); font-size: 14px; color: var(--slate-900); }
.sc-grid-row > div { padding: 12px 10px; border-left: 1px solid var(--slate-200); }
.sc-grid-row > div:first-child { border-left: 0; padding: 12px 6px; text-align: center; font-size: 12px; color: var(--slate-600); background: var(--slate-50); }

.sc-brief-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-size: 14px; line-height: 1.45; color: var(--slate-900); }
.sc-form-title { font-size: 16px; font-weight: 700; color: var(--slate-900); }
.sc-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }

.sc-pattern { padding: 12px 14px; border: 1px solid var(--slate-200); border-radius: 8px; background: var(--slate-50); font-size: 14px; line-height: 1.5; color: var(--slate-700); }
.sc-pattern strong { font-family: var(--font-mono); font-size: 13px; color: var(--slate-900); overflow-wrap: anywhere; }
.sc-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--slate-200); }
.sc-file-cur { flex: 1 1 170px; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--slate-900); }
.sc-file-new { flex: 2 1 280px; min-width: 0; display: flex; align-items: center; gap: 6px; }
.sc-file-ext { font-size: 14px; color: var(--slate-600); }
.sc-file-mark { min-width: 62px; font-size: 13px; font-weight: 600; color: var(--sc-ok); }

.sc-letter { display: flex; flex-direction: column; gap: 14px; padding: 20px; font-size: 14px; line-height: 1.55; color: var(--slate-900); }
.sc-letter small { font-size: 13px; color: var(--slate-600); }
.sc-resp { display: flex; flex-wrap: wrap; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--slate-200); }
.sc-resp-n { flex: 0 0 24px; padding-top: 28px; font-size: 14px; font-weight: 700; color: var(--slate-700); }
.sc-resp .sc-label { flex: 1 1 220px; min-width: 0; }

.sc-inbox { display: flex; flex-wrap: wrap; }
.sc-inbox-list { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--slate-200); }
.sc-inbox-empty { padding: 14px; font-size: 14px; line-height: 1.5; color: var(--slate-600); }
.sc-inbox-item { display: flex; flex-direction: column; gap: 2px; min-height: 56px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--slate-200); border-radius: 0; background: #fff; text-align: left; }
.sc-inbox-item[aria-pressed="true"] { background: #eef1f5; }
.sc-inbox-item strong { font-size: 14px; font-weight: 700; color: var(--slate-900); }
.sc-inbox-item.is-read strong { font-weight: 500; }
.sc-inbox-item span { font-size: 13px; color: var(--slate-600); }
.sc-inbox-read { flex: 2 1 300px; min-width: 0; min-height: 140px; padding: 14px 16px; font-size: 14px; line-height: 1.55; color: var(--slate-900); }
.sc-inbox-read small { display: block; margin-bottom: 8px; font-size: 13px; color: var(--slate-600); }
.sc-compose { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-top: 1px solid var(--slate-300); background: var(--slate-50); }
.sc-compose-title { font-size: 13px; font-weight: 700; color: var(--slate-700); }

.sc-contact { flex: 1 1 240px; min-width: 0; }
.sc-contact-name { font-size: 16px; font-weight: 600; color: var(--slate-900); }
.sc-contact-number { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--slate-900); }
.sc-plan { flex: 0 1 190px; width: 190px; height: 190px; object-fit: cover; border: 1px solid var(--slate-300); border-radius: 10px; }
.sc-dial { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sc-dial > * { width: 100%; max-width: 300px; }
.sc-dial-screen { min-height: 52px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--slate-300); border-radius: 10px; background: var(--slate-50); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: .04em; color: var(--slate-900); }
.sc-keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sc-key { min-height: 52px; border: 1px solid var(--slate-300); border-radius: 10px; background: #fff; font-size: 20px; font-weight: 600; color: var(--slate-900); }
.sc-key:hover { background: #eef1f5; }
.sc-dial-actions { display: flex; gap: 8px; }
.sc-dial-actions button { min-height: 48px; border: 1px solid var(--slate-300); border-radius: 10px; background: #fff; font-size: 15px; font-weight: 600; color: var(--slate-900); }
.sc-dial-actions .is-call { flex: 2 1 0; border-color: var(--sc-ink); background: var(--sc-ink); color: #fff; }
.sc-dial-actions .is-del { flex: 1 1 0; }
.sc-dial-hint { font-size: 14px; color: var(--slate-700); text-align: center; }
.sc-line { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 0; text-align: center; }
.sc-line-title { font-size: 20px; font-weight: 600; color: var(--slate-900); }
.sc-line-clock { font-size: 40px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--slate-900); }
.sc-line-sub { font-size: 14px; color: var(--slate-700); }
.sc-line-fine { font-size: 13px; color: var(--slate-600); }
.sc-talk-title { font-size: 15px; font-weight: 600; color: var(--slate-900); }
.sc-talk-clock { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--slate-600); }
.sc-minor { min-height: 44px; padding: 8px 16px; border: 1px solid var(--slate-300); border-radius: 10px; background: #fff; font-size: 14px; font-weight: 600; color: var(--slate-900); }
.sc-link { min-height: 44px; padding: 8px 0; border: 0; background: transparent; font-size: 14px; font-weight: 600; color: var(--slate-700); text-decoration: underline; text-align: left; }
.sc-caps { width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--slate-200); border-radius: 10px; background: var(--slate-50); font-size: 14px; line-height: 1.5; color: var(--slate-900); }
.sc-notes-view { font-size: 14px; line-height: 1.5; color: var(--slate-900); white-space: pre-wrap; }

/* ------------------------- right pane: the Permits2Go replay */

/* The replay and a simulated dialog share one grid cell, so the stage is as
   tall as the taller of the two and nothing inside it scrolls. */
.sc-stage { container-type: inline-size; position: relative; display: grid; overflow: hidden; overflow: clip; border: 1px solid var(--slate-200); border-radius: 16px; background: var(--slate-50); font-family: var(--font-app); color: var(--slate-600); }
.sc-stage > * { grid-area: 1 / 1; min-width: 0; }
.sc-stage-body { display: flex; flex-direction: column; gap: 16px; padding: 16px; }

.sc-p2g-card { overflow: hidden; border: 1px solid var(--slate-200); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05); }
.sc-p2g-card-head { padding: 24px; border-bottom: 1px solid var(--slate-200); }
.sc-p2g-card-title { font-size: 18px; line-height: 1.375; font-weight: 700; color: var(--slate-900); }
.sc-p2g-card-sub { margin-top: 2px; font-size: 14px; color: var(--slate-500); }
.sc-p2g-card-body { padding: 24px; }
.sc-p2g-card-body.is-flush { padding: 0; }
.sc-p2g-card.is-raised { position: relative; z-index: 3; overflow: visible; }

.sc-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 9999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .025em; white-space: nowrap; }
.sc-badge.is-submitted { background: #dbeafe; color: #1d4ed8; }
.sc-badge.is-review { background: #e0e7ff; color: #4338ca; }
.sc-badge.is-processing { background: var(--purple-100); color: var(--p2g-purple); }
.sc-badge.is-approved { background: #dcfce7; color: #15803d; }

.sc-bubble-row { display: flex; animation: sc-fade .3s cubic-bezier(.4, 0, .2, 1); }
.sc-bubble-row.is-right { justify-content: flex-end; }
.sc-bubble { max-width: 80%; padding: 12px 16px; border: 1px solid var(--slate-200); border-radius: 16px; border-bottom-left-radius: 6px; background: var(--slate-100); color: var(--slate-800); font-size: 14px; line-height: 1.625; }
.sc-bubble.is-user { border: 0; border-radius: 16px; border-bottom-right-radius: 6px; background: var(--p2g-purple); color: #fff; }
.sc-bubble.is-other { border-radius: 16px; border-bottom-right-radius: 6px; background: #fff; }
.sc-bubble-who { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--p2g-purple); }
.sc-bubble.is-other .sc-bubble-who { color: var(--slate-600); }
.sc-bubble-time { display: block; margin-top: 4px; font-size: 10px; text-align: right; color: rgb(255 255 255 / .75); }
.sc-typing { display: flex; gap: 6px; padding: 12px 16px; border: 1px solid var(--slate-200); border-radius: 16px; border-bottom-left-radius: 6px; background: var(--slate-100); }
.sc-typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--p2g-purple); animation: sc-bounce 1s infinite; }
.sc-typing span:nth-child(2) { animation-delay: 150ms; }
.sc-typing span:nth-child(3) { animation-delay: 300ms; }

.sc-ring { position: relative; width: 40px; height: 40px; flex: 0 0 40px; }
.sc-ring svg { transform: rotate(-90deg); }
.sc-ring path { transition: stroke-dasharray .5s cubic-bezier(.4, 0, .2, 1); }
.sc-ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--slate-700); }
.sc-p2g-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.sc-p2g-field-label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--slate-600); }
.sc-p2g-field-value { min-height: 40px; display: flex; align-items: center; padding: 8px 12px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; font-size: 14px; color: var(--slate-900); transition: background-color .3s; }
.sc-p2g-field-value.is-filled { background: var(--purple-50); }

.sc-banner { padding: 16px; border: 1px solid #bbf7d0; border-radius: 12px; background: #f0fdf4; font-family: var(--font-app); font-size: 14px; color: #166534; }
.sc-banner.is-error { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.sc-banner strong { display: block; font-weight: 600; }

.sc-select-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px; padding: 12px; border: 1px solid var(--purple-200); border-radius: 16px; background: var(--purple-50); }
.sc-select-count { flex: 1 1 auto; font-size: 12px; font-weight: 700; color: var(--p2g-purple); }
.sc-p2g-btn { display: inline-flex; align-items: center; justify-content: center; padding: 6px 12px; border: 1px solid transparent; border-radius: 8px; background: var(--p2g-purple); color: #fff; font-size: 12px; line-height: 1.2; font-weight: 700; text-align: center; box-shadow: 0 10px 15px -3px rgb(88 28 135 / .2), 0 4px 6px -4px rgb(88 28 135 / .2); }
.sc-p2g-btn.is-md { padding: 10px 20px; border-radius: 12px; font-size: 14px; width: 100%; }
.sc-p2g-btn.is-secondary { background: #fff; border-color: var(--slate-200); color: var(--slate-700); font-weight: 600; box-shadow: none; }
/* Not yet usable. Greyed with solid colours, not opacity, so its label stays readable. */
.sc-p2g-btn.is-off { background: var(--slate-200); color: var(--slate-600); box-shadow: none; }
.sc-check { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.5; color: var(--slate-600); }
.sc-check-box { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 3px; border: 1px solid var(--slate-500); border-radius: 4px; background: #fff; }
.sc-check-box.is-on { border-color: var(--p2g-purple); background: var(--p2g-purple) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5'/%3E%3C/svg%3E") center / 14px no-repeat; }
.sc-drawing { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 24px; border-top: 1px solid var(--slate-100); }
.sc-drawing-tag { margin-left: auto; font-size: 12px; font-weight: 700; color: #15803d; }

.sc-comment { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; animation: sc-fade .3s cubic-bezier(.4, 0, .2, 1); }
.sc-comment-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sc-comment-code { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--p2g-purple); }
.sc-chip { padding: 2px 10px; border-radius: 9999px; background: var(--slate-100); font-size: 12px; font-weight: 600; color: var(--slate-700); }
.sc-chip.is-status { margin-left: auto; background: var(--purple-100); font-weight: 700; color: var(--p2g-purple); }
.sc-comment-text { font-size: 14px; line-height: 1.5; color: var(--slate-700); }
.sc-comment-box { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); font-size: 14px; line-height: 1.5; color: var(--slate-800); animation: sc-fade .3s cubic-bezier(.4, 0, .2, 1); }
.sc-comment-box.is-draft { border-color: var(--purple-200); background: var(--purple-50); }
.sc-comment-box b { font-size: 12px; font-weight: 700; color: var(--slate-700); }
.sc-comment-box.is-draft b { color: var(--p2g-purple); }
.sc-comment-sent { font-size: 12px; overflow-wrap: anywhere; color: var(--slate-600); animation: sc-fade .3s cubic-bezier(.4, 0, .2, 1); }

.sc-kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.sc-kv-key { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-500); }
.sc-kv-val { display: block; font-size: 14px; line-height: 1.5; color: var(--slate-800); }
.sc-live { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; font-weight: 600; color: var(--p2g-purple); }

.sc-scrim { z-index: 2; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px 16px; background: rgb(0 0 0 / .5); backdrop-filter: blur(4px); animation: sc-fade .3s cubic-bezier(.4, 0, .2, 1); }
.sc-scrim.is-tight { padding-top: 24px; }
.sc-dialog { width: 100%; max-width: 448px; overflow: hidden; border-radius: 16px; background: #fff; box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25); }
.sc-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: var(--p2g-purple); color: #fff; font-size: 18px; font-weight: 700; }
.sc-dialog-head { gap: 12px; }
.sc-dialog-head svg { flex: 0 0 auto; color: rgb(255 255 255 / .7); }
.sc-dialog-head small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; font-weight: 400; color: rgb(255 255 255 / .9); }
.sc-dialog-body { padding: 24px; font-size: 14px; line-height: 1.5; color: var(--slate-600); }
.sc-dialog-body strong { color: var(--slate-900); }
.sc-dialog-foot { display: flex; gap: 12px; padding: 0 24px 24px; }
.sc-notify { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding: 12px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); transition: background-color .3s, border-color .3s; }
.sc-notify.is-on { border-color: var(--purple-300); background: var(--purple-50); }
.sc-notify-fine { padding-left: 28px; font-size: 12px; line-height: 1.5; color: var(--slate-600); }
.sc-batch { display: flex; flex-direction: column; gap: 12px; }
.sc-batch-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sc-batch-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--slate-700); }
.sc-batch-input { display: block; min-height: 40px; padding: 9px 16px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); font-size: 14px; line-height: 20px; color: var(--slate-900); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sc-batch-input.is-empty { color: var(--slate-600); }
.sc-batch-input.is-active { border-color: var(--p2g-purple); background: #fff; box-shadow: 0 0 0 3px rgb(72 30 104 / .15); }
.sc-batch-input.is-tall { min-height: 60px; }
.sc-cases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--slate-200); border-radius: 12px; }
.sc-cases span { padding: 8px 4px; background: #fff; font-size: 12px; font-weight: 600; text-align: center; color: var(--slate-600); }
.sc-cases span.is-on { background: var(--p2g-purple); color: #fff; }
.sc-preview-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-500); }
.sc-preview { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--slate-100); border-radius: 12px; background: var(--slate-50); }
.sc-preview-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; color: var(--slate-600); }
.sc-preview-row.is-changed { border-color: var(--slate-200); background: #fff; }
.sc-preview-row b { font-weight: 700; color: var(--slate-900); overflow-wrap: anywhere; }
.sc-preview-row i { margin-left: auto; }

/* ---- the replay's screens: the application page, a mailbox, the Notes tab */

/* Two things side by side (the application and a mailbox, or the call and the
   Notes tab). Each side is its own container, so what is inside restacks by
   the side's width, not the stage's. */
.sc-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sc-split > * { container-type: inline-size; min-width: 0; }
/* The second side stays in view while a long first side scrolls past it. */
.sc-split > :last-child { position: sticky; top: 126px; }
.sc-stage-body > .sc-mock-mail { align-self: center; width: 100%; max-width: 760px; }

.sc-apptabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; }
.sc-apptabs span { padding: 6px 12px; border-radius: 8px; font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--slate-600); }
.sc-apptabs span.is-on { background: var(--p2g-purple); color: #fff; }

.sc-kv-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sc-status-cell { position: relative; }
.sc-status-cell .sc-badge { margin-top: 4px; }
.sc-badge.is-button { gap: 6px; }
.sc-badge.is-button::after { content: ''; width: 0; height: 0; margin-top: 3px; border: 4px solid transparent; border-top-color: currentColor; }
.sc-menu { position: absolute; top: 100%; left: 0; z-index: 3; width: 210px; margin-top: 6px; padding: 6px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; box-shadow: 0 20px 25px -5px rgb(0 0 0 / .15), 0 8px 10px -6px rgb(0 0 0 / .1); }
.sc-menu-head { padding: 4px 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-600); }
.sc-menu-item { padding: 5px 10px; border-radius: 8px; font-size: 13px; line-height: 1.4; color: var(--slate-800); }
.sc-menu-item.is-current { font-weight: 700; color: var(--p2g-purple); }
.sc-menu-item.is-target { background: var(--purple-50); }

.sc-rev-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, .6fr); gap: 12px; align-items: center; padding: 12px 24px; border-bottom: 1px solid var(--slate-100); font-size: 14px; color: var(--slate-800); }
.sc-rev-row.is-head { background: var(--slate-50); border-bottom-color: var(--slate-200); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-600); }
.sc-rev-input { display: block; min-height: 36px; padding: 7px 10px; border: 1px solid var(--slate-200); border-radius: 8px; background: #fff; font-size: 14px; line-height: 20px; color: var(--slate-900); white-space: nowrap; overflow: hidden; }
.sc-rev-input.is-active { border-color: var(--p2g-purple); box-shadow: 0 0 0 3px rgb(72 30 104 / .15); }
.sc-rev-empty { padding: 16px 24px; border-bottom: 1px solid var(--slate-100); font-size: 14px; }
.sc-rev-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 24px; }
.sc-saved { font-size: 12px; font-weight: 700; color: #15803d; }
.sc-text-btn { font-size: 12px; font-weight: 700; color: var(--p2g-purple); }
.sc-select-bar .sc-text-btn { padding: 4px 6px; }
.sc-select-bar.is-idle { border-color: var(--slate-200); background: #fff; }
.sc-select-bar.is-idle .sc-select-count { color: var(--slate-600); }
.sc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sc-change-list { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); font-size: 13px; color: var(--slate-800); }

/* Somebody else's mailbox, in the mail tool's colours. */
.sc-mock-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid var(--slate-200); background: #fff; font-size: 13px; line-height: 1.45; color: var(--slate-600); }
.sc-mock-item strong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--slate-900); }
.sc-mock-item.is-open { background: #eef1f5; box-shadow: inset 3px 0 0 #0f6cbd; }
.sc-mock-item.sc-glow { --sc-glow: #bfdcff; }
.sc-mock-item .sc-chip { background: #dbeafe; color: #1d4ed8; }
.sc-mock-read { padding: 16px; }
.sc-mail-doc { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.55; color: var(--slate-800); }
.sc-mail-doc p { margin: 0; font-size: inherit; line-height: inherit; color: inherit; }
.sc-mail-doc b { font-weight: 700; color: var(--slate-900); }
.sc-mail-band { padding: 10px 14px; border-radius: 8px; background: var(--p2g-purple); font-size: 14px; font-weight: 700; color: #fff; }
.sc-mail-h { font-size: 16px; line-height: 1.35; font-weight: 700; color: var(--slate-900); }
.sc-mail-rows { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 8px; background: var(--slate-50); font-size: 13px; }
.sc-mail-rows span { font-weight: 600; color: var(--slate-600); }
.sc-mail-by { padding: 8px 12px; border-left: 3px solid var(--p2g-purple); background: var(--purple-50); font-size: 13px; }
.sc-mail-by span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-600); }
.sc-mail-doc .sc-mail-label { font-size: 12px; font-weight: 700; color: var(--slate-700); }
.sc-mail-doc .sc-mail-quote { padding: 8px 12px; border-left: 3px solid var(--slate-300); background: var(--slate-50); font-size: 13px; }
.sc-mail-doc .sc-mail-foot,
.sc-mail-doc .sc-mail-meta { font-size: 12px; color: var(--slate-600); }

/* Upload City Comments, and the file picker it opens. */
.sc-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 12px; border: 2px dashed var(--slate-300); border-radius: 12px; background: var(--slate-50); text-align: center; font-size: 14px; color: var(--slate-700); }
.sc-drop small { font-size: 12px; line-height: 1.4; color: var(--slate-600); }
.sc-drop-browse { font-weight: 700; color: var(--p2g-purple); text-decoration: underline; }
.sc-picker { overflow: hidden; border: 1px solid var(--slate-300); border-radius: 10px; background: #fff; box-shadow: 0 10px 25px -5px rgb(0 0 0 / .2); }
.sc-picker-bar { padding: 8px 12px; border-bottom: 1px solid var(--slate-300); background: var(--slate-100); font-size: 12px; font-weight: 600; color: var(--slate-700); }
.sc-picker-file { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--slate-100); font-size: 13px; color: var(--slate-800); }
.sc-picker-file:last-child { border-bottom: 0; }
.sc-picker-file span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.sc-picker-file small { font-size: 12px; white-space: nowrap; color: var(--slate-600); }
.sc-picker-file svg, .sc-upfile svg { flex: 0 0 auto; color: var(--slate-600); }
.sc-picker-file.is-pick { background: #dbeafe; }
.sc-upfile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; font-size: 13px; color: var(--slate-800); }
.sc-upfile-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.sc-upfile small { font-size: 12px; white-space: nowrap; color: var(--slate-600); }
.sc-progress { height: 6px; overflow: hidden; border-radius: 999px; background: var(--slate-200); }
.sc-progress i { display: block; height: 100%; border-radius: inherit; background: var(--p2g-purple); transition: width .2s linear; }
.sc-cycle { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-cycle span { padding: 4px 12px; border: 1px solid var(--slate-200); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 600; color: var(--slate-600); }
.sc-cycle span.is-on { border-color: var(--p2g-purple); background: var(--purple-50); color: var(--p2g-purple); }
.sc-cc-note { padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); font-size: 12px; line-height: 1.5; color: var(--slate-600); }
.sc-cc-note b { color: var(--slate-900); }

/* A reply filed under its comment, and the call note on the Notes tab. */
.sc-reply { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; }
.sc-reply-head { font-size: 12px; font-weight: 700; color: var(--slate-700); }
.sc-reply-card { display: flex; align-items: flex-start; gap: 10px; }
.sc-reply-avatar { flex: 0 0 32px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--purple-100); font-size: 12px; font-weight: 700; color: var(--p2g-purple); }
.sc-reply-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sc-reply-who { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--slate-900); }
.sc-reply-who svg { color: var(--slate-600); }
.sc-reply-meta { font-size: 12px; color: var(--slate-600); overflow-wrap: anywhere; }
.sc-reply-text { margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--slate-800); }
.sc-reply-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.sc-updates { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--purple-200); border-radius: 12px; background: var(--purple-50); }
.sc-updates .sc-kv-key { color: var(--slate-700); }
.sc-updates .sc-check { color: var(--slate-800); }
.sc-updates-note { font-size: 12px; line-height: 1.5; color: var(--slate-600); }
.sc-note-entry { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; }
.sc-note-entry-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; font-size: 14px; color: var(--slate-900); }
.sc-note-entry-top .sc-chip { margin-left: 0; }
.sc-note-entry-when { margin-left: auto; font-size: 12px; color: var(--slate-600); }
.sc-note-entry-text { font-size: 14px; line-height: 1.55; color: var(--slate-800); }

/* The replay's mouse pointer and keystrokes. The view moves the pointer to
   whichever control derive() names (matched by a data-cur attribute); a ring
   pulses on each click and typed text grows behind a blinking caret. All of it
   is decoration: the Activity log says the same thing in words. How long the
   pointer takes to travel is set by the view, from POINTER_TRAVEL_MS. */
.sc-cursor { position: absolute; top: 0; left: 0; z-index: 5; width: 0; height: 0; opacity: 0; pointer-events: none; transition: transform .4s cubic-bezier(.3, .1, .2, 1), opacity .25s; }
.sc-cursor svg { position: absolute; top: -3px; left: -4px; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .35)); }
.sc-cursor-click { position: absolute; top: -16px; left: -16px; width: 32px; height: 32px; border: 2px solid var(--p2g-purple); border-radius: 50%; background: rgb(72 30 104 / .18); opacity: 0; animation: sc-click .5s ease-out; }
@keyframes sc-click { from { opacity: 1; transform: scale(.25); } to { opacity: 0; transform: scale(1.25); } }
.sc-caret { display: inline-block; width: 1.5px; height: 1.1em; margin-left: 1px; background: var(--slate-900); vertical-align: text-bottom; animation: sc-blink 1s steps(1) infinite; }
@keyframes sc-blink { 50% { opacity: 0; } }
/* A value that has just changed: a brief ring so the eye catches it. */
.sc-flash { animation: sc-flash 1.1s ease-out; }
@keyframes sc-flash { 0% { box-shadow: 0 0 0 0 rgb(72 30 104 / .55); } 100% { box-shadow: 0 0 0 12px rgb(72 30 104 / 0); } }
.sc-rise.sc-flash { animation: sc-fade .3s cubic-bezier(.4, 0, .2, 1), sc-flash 1.1s ease-out; }
/* The same idea for something a ring cannot go round (a row inside a clipped
   card or window): its background is tinted, then settles. */
.sc-glow { animation: sc-glow 1.3s ease-out; }
@keyframes sc-glow { from { background-color: var(--sc-glow, #e9d5ff); } }

.sc-act > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.sc-act { display: flex; align-items: baseline; gap: 12px; font-size: 14px; line-height: 1.5; color: var(--slate-800); animation: sc-fade .3s cubic-bezier(.4, 0, .2, 1); }
.sc-act-at { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--p2g-purple); }

/* ---------------------------------------------------------- results */

.sc-results { display: flex; flex-direction: column; gap: 24px; padding: 32px; background: #fff; border-radius: 20px; }
.sc-results h2 { font-size: clamp(28px, 3vw, 44px); line-height: 1.2; font-weight: 400; color: var(--sc-ink); }
.sc-results-note { max-width: 820px; font-size: 16px; line-height: 1.5; color: var(--sc-mute); }
.sc-fine { font-size: 14px; line-height: 1.5; color: var(--sc-mute); }
.sc-fine.is-brand { color: var(--sc-brand); }
.sc-switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 0; border: 0; background: transparent; color: var(--sc-ink); font-size: 15px; font-weight: 500; }
.sc-switch-track { display: inline-flex; align-items: center; justify-content: flex-start; width: 48px; height: 28px; padding: 3px; border-radius: 999px; background: #8a8f98; transition: background-color .2s; }
.sc-switch-track i { width: 22px; height: 22px; border-radius: 999px; background: #fff; transition: transform .2s cubic-bezier(.4, 0, .2, 1); }
.sc-switch[aria-checked="true"] .sc-switch-track { background: var(--sc-brand); }
.sc-switch[aria-checked="true"] .sc-switch-track i { transform: translateX(20px); }

.sc-table { position: relative; overflow: hidden; border: 1px solid var(--sc-line-2); border-radius: 16px; }
.sc-table-row { display: grid; grid-template-columns: minmax(0, 2fr) repeat(5, minmax(0, 1fr)); gap: 16px; align-items: center; padding: 18px 24px; border-top: 1px solid var(--sc-line-2); }
.sc-table-row.is-head { padding: 14px 24px; border-top: 0; background: var(--sc-page); font-size: 14px; font-weight: 500; color: var(--sc-mute); }
.sc-table-row.is-total { border-top-color: var(--sc-line); background: var(--sc-page); font-weight: 600; }
.sc-table-name { display: block; font-size: 18px; }
.sc-table-basis { display: block; margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--sc-mute); }
.sc-table-num { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-table-row.is-total .sc-table-num { font-weight: 600; }
.sc-table-num.is-p2g { color: var(--sc-brand); }
.sc-table .sc-field { max-width: 110px; }
.sc-table-num.is-money { font-weight: 600; }

.sc-keep { display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid var(--sc-line-2); border-radius: 16px; }
.sc-keep h3 { font-size: 24px; line-height: 1.2; font-weight: 400; color: var(--sc-ink); }
.sc-keep-cols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px 40px; }
.sc-keep-doc { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.sc-keep-mail { flex: 2 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.sc-keep-title { font-size: 16px; font-weight: 500; }
.sc-keep-mail .sc-field { max-width: 360px; }
.sc-keep-label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.sc-bot { min-height: 65px; }
.sc-optin { display: flex; align-items: center; gap: 12px; min-height: 44px; font-family: var(--font-app); font-size: 14px; color: var(--slate-600); cursor: pointer; }
.sc-optin input { width: 18px; height: 18px; margin: 0; accent-color: var(--p2g-purple); flex-shrink: 0; }
.sc-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sc-print-head { display: none; }

/* ------------------------------------------- layouts that restack
   Nothing in the tool needs sideways scrolling on a phone: the results table,
   the tracker spreadsheet and the replay's application list each turn into a
   labelled card per row. */

/* Results: below the width where six columns fit, the task name gets its own
   line and each figure shows its column name. The header row stays for screen
   readers. */
@media (max-width: 1249px) {
  .sc-table-row.is-head { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .sc-table-row { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; gap: 12px 16px; }
  .sc-table-row:nth-child(2) { border-top: 0; }
  .sc-table-task { grid-column: 1 / -1; }
  .sc-table-num { white-space: normal; }
  .sc-table-row > [data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 13px; line-height: 1.3; font-weight: 400; color: var(--sc-mute); }
}
@media (max-width: 720px) {
  .sc-table-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .sc-table-row > .is-money { grid-column: 1 / -1; padding-top: 12px; border-top: 1px dashed var(--sc-line); }
  .sc-table-gap { display: none; }
  .sc-table .sc-field { max-width: none; }
}

/* Tracker spreadsheet: one card per row, with every cell labelled. */
@media (max-width: 760px) {
  .sc-sheet { min-width: 0; }
  .sc-sheet .sc-grid-head { display: none; }
  .sc-sheet .sc-grid-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 14px; }
  .sc-sheet .sc-grid-row > div { padding: 0; border: 0; background: none; text-align: left; font-size: 15px; }
  .sc-sheet .sc-grid-row > .sc-rownum { grid-column: 1 / -1; padding: 0; font-size: 12px; font-weight: 600; color: var(--slate-600); background: none; text-align: left; }
  .sc-sheet .sc-rownum::before { content: 'Row '; }
  .sc-sheet .sc-grid-row > [data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--slate-600); }
  .sc-cellwrap { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; min-width: 0; }
  .sc-cellwrap:last-child { grid-column: 1 / -1; }
  .sc-cell-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; font-size: 12px; font-weight: 600; color: var(--slate-600); }
  .sc-cell { border: 1px solid var(--slate-300); border-radius: 6px; }
}

@container (max-width: 460px) {
  .sc-cases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* A popup's two buttons sit one above the other on the narrowest phones. */
@container (max-width: 340px) {
  .sc-dialog-foot { flex-direction: column-reverse; }
}

/* The replay's two sides sit one above the other when the stage is narrow. */
@container (max-width: 899px) {
  .sc-split { grid-template-columns: minmax(0, 1fr); }
  .sc-split > :last-child { position: static; }
}
@container (max-width: 599px) {
  .sc-apptabs span { padding: 5px 8px; font-size: 12px; }
}
/* Reviewers: one labelled card per row, like the tracker spreadsheet. */
@container (max-width: 499px) {
  .sc-kv-grid.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-rev-row.is-head { display: none; }
  .sc-rev-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 14px 16px; }
  .sc-rev-row > [data-label]:first-child { grid-column: 1 / -1; }
  .sc-rev-row > [data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--slate-600); }
  .sc-rev-empty, .sc-rev-actions { padding: 14px 16px; }
  .sc-note-entry-when { margin-left: 0; }
}

/* ------------------------------------------------------ small screens */

@media (max-width: 640px) {
  /* 16px stops iOS zooming the page when a field takes focus. */
  .sc-field, .sc-area, .sc-cell { font-size: 16px; }
  .sc-brief { padding: 20px; }
  .sc-result { padding: 20px; gap: 16px 24px; }
  .sc-pane { padding: 14px; }
  .sc-results { padding: 20px 16px; }
  .sc-keep { padding: 16px; }
  .sc-stage-body { padding: 10px; }
  .sc-scrim { padding: 20px 10px 10px; }
  .sc-p2g-card-head, .sc-p2g-card-body { padding: 16px; }
  .sc-dialog-body { padding: 16px; }
  .sc-dialog-foot { padding: 0 16px 16px; }
  .sc-form-grid, .sc-p2g-fields { grid-template-columns: minmax(0, 1fr); }
  .sc-rail-btn { flex-basis: 30%; min-width: 96px; padding: 10px 12px; }
  .sc-plan { flex: 1 1 100%; width: 100%; height: 160px; }
  .sc-inbox-list { border-right: 0; border-bottom: 1px solid var(--slate-200); }
}

@media (prefers-reduced-motion: reduce) {
  .sc *, .sc *::before, .sc *::after { animation: none !important; transition: none !important; }
}

/* -------------------------------------------------------------- print
   "Print or save as PDF" prints the results table on its own page. */

@media print {
  body { background: #fff !important; }
  header, footer, [data-sc-noprint], .sc-rail, .sc-keep, .sc-cta, .sc-switch, .sc-setup-note { display: none !important; }
  main, main > section, .main-container { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .sc-results { padding: 0; }
  .sc-print-head { display: block; font-size: 12px; color: var(--sc-mute); }
  .sc-scroll { overflow: visible; }
  .sc-table-row { gap: 8px; padding: 10px 12px; }
  .sc-table-name { font-size: 13px; }
  .sc-table-num { font-size: 13px; white-space: normal; }
  .sc-table-basis { font-size: 10px; }
  .sc-field { border: 0; padding: 0; min-height: 0; font-size: 13px; }
  .sc-setup.is-inset { background: #fff; padding: 0; }
}

/* =====================================================================
   Page sections around the tool (public/permit-savings-calculator.html).
   Prefixed .scp- and written here, not as theme utilities, because the
   precompiled theme only contains the classes its own pages already use.
   ===================================================================== */

html { scroll-padding-top: 110px; }
.scp-tool { padding-top: 48px; scroll-margin-top: 110px; }
/* The tool's height on its first screen (measured from 1440 down to 390 wide),
   held until the script mounts so the sections below do not jump. */
.scp-host { min-height: 1230px; }
.scp-host.sc { min-height: 0; }
@media (max-width: 1100px) { .scp-host { min-height: 1290px; } }
@media (max-width: 800px) { .scp-host { min-height: 1480px; } }
@media (max-width: 760px) { .scp-host { min-height: 2150px; } }
@media (max-width: 480px) { .scp-host { min-height: 2660px; } }
.scp-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 320px; padding: 32px 24px; background: #fff; border-radius: 20px; text-align: center; }
.scp-loading-title { font-size: 18px; color: #1a1a1c; }

.scp-section { padding-top: 96px; scroll-margin-top: 40px; }
.scp-head { display: flex; flex-direction: column; gap: 12px; max-width: 780px; margin: 0 auto 40px; text-align: center; }
/* The theme's paragraph grey is 4.4:1 on the page background, a hair under AA. */
.scp-head p, p.scp-lead { color: #45454a; }

.scp-steps, .scp-tasks, .scp-method { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.scp-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scp-tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scp-method { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.scp-method-wide { grid-column: 1 / -1; }

.scp-card { display: flex; flex-direction: column; gap: 12px; padding: 28px; background: #fff; border-radius: 20px; }
.scp-card h3 { font-size: 24px; line-height: 1.25; font-weight: 400; color: #1a1a1c; }
.scp-card p, .scp-card dd, .scp-card li { font-size: 16px; line-height: 1.55; color: #45454a; }
.scp-num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: #6e3492; }
.scp-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; }
.scp-pair dt { margin-bottom: 4px; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: #1a1a1c; }
.scp-pair dd { margin: 0; }
.scp-link { display: inline-flex; align-items: center; align-self: flex-start; min-height: 44px; margin-top: auto; font-size: 16px; font-weight: 500; color: #6e3492; text-decoration: underline; text-underline-offset: 3px; }
.scp-link:hover { color: #481E68; }
.scp-links { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: auto; }
.scp-card-dark { background: #1a1a1c; }
.scp-card-dark h3 { color: #fff; }
.scp-card-dark p { color: #d4d4d8; }
.scp-card-dark .scp-num, .scp-card-dark .scp-link { color: #dcc2ee; }
.scp-card-dark .scp-link:hover { color: #fff; }

.scp-formula, .scp-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.scp-formula li { padding: 12px 16px; border-radius: 12px; background: #f2f5fa; color: #1a1a1c; }
.scp-formula strong { font-weight: 600; }
.scp-list { padding-left: 20px; list-style: disc; }
.scp-table-wrap { overflow-x: auto; }
.scp-table-wrap:focus-visible { outline: 2px solid #6e3492; outline-offset: 2px; }
.scp-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; color: #45454a; text-align: left; }
.scp-table caption { caption-side: bottom; padding-top: 12px; font-size: 14px; color: #45454a; text-align: left; }
.scp-table th, .scp-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid #e3e7ed; vertical-align: top; }
.scp-table thead th { font-size: 13px; font-weight: 600; color: #1a1a1c; }
.scp-table tbody th { font-weight: 500; color: #1a1a1c; }
.scp-table td:nth-child(2) { font-variant-numeric: tabular-nums; }

@media (max-width: 1023px) {
  .scp-steps, .scp-tasks, .scp-method { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .scp-section { padding-top: 72px; }
  .scp-card { padding: 20px; }
  .scp-pair { grid-template-columns: minmax(0, 1fr); }
  .scp-head { margin-bottom: 28px; }
}

.sc-fine a { color: var(--sc-brand); text-decoration: underline; text-underline-offset: 2px; }
