/* SavedJob owner app (src/owner-app.js). Phone first: bottom tab bar, one pane at a time.
   From 900px: left sidebar, multi-column Today, two-pane Inbox / Customers / Settings, week view. */
/* Colors and type follow savedjob.com (site/public/styles.css): paper, ink and safety orange, condensed
   headings, hard-edged cards. --accent is the darker orange so it passes contrast as text; --orange is the
   bright one, used behind ink text (primary buttons, the current tab). */
:root {
  --bg: #f5f1e7; --surface: #fff; --surface-2: #fbfaf6; --surface-3: #f1ece0;
  --ink: #1d1a14; --text: #2b271f; --muted: #6a6252; --line: #e2dccc; --line-strong: #c9bfa9;
  --accent: #b5530a; --accent-ink: #fff; --accent-soft: #fff0e0; --focus: #ff8a1f;
  --brand: #12304f; --brand-amber: #f5a524; --orange: #ff8a1f; --edge: #1d1a14; --hard-c: #1d1a14;
  --side-bg: #1d1a14; --side-ink: #fbfaf6; --side-muted: #b3ab98; --side-hover: #2c2820; --side-line: #37322a;
  --green: #12703c; --green-bg: #e3f4ea; --amber: #7a4800; --amber-bg: #fff1d9; --red: #b42318; --red-bg: #fdecea;
  --blue: #1a56c9; --blue-bg: #e7efff; --gray: #4f4a3f; --gray-bg: #efeadf; --violet: #5b3cc4; --violet-bg: #eeeaff;
  --s1: #12304f; --s2: #ff8a1f; --s3: #6a5acd;
  --bubble-in: #fff; --bubble-bot: #efe9dc; --bubble-mine: #12304f; --on-mine: #fff;
  --shadow: 0 1px 2px rgba(29, 26, 20, .06); --shadow-lg: 0 8px 30px rgba(29, 26, 20, .16);
  --hard: 3px 3px 0 var(--hard-c); --hard-sm: 2px 2px 0 var(--hard-c);
  --font-head: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --font-word: "Archivo", "Arial Black", system-ui, sans-serif;
  --font-body: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 8px; --r-sm: 6px;
  --sp1: 8px; --sp2: 16px; --sp3: 24px; --sp4: 32px;
  --top-h: 60px; --tab-h: 64px; --side-w: 248px;
  /* Names the classic page's feature sections use, so they look at home here. */
  --soft: var(--surface-3); --panel: var(--surface);
  --toast-bg: #1d1a14; --toast-ink: #fbfaf6; --toast-bad-bg: #8f1d14; --toast-bad-ink: #fff; --av-bg-l: 90%; --av-bg-s: 55%; --av-ink-l: 30%; --av-ink-s: 50%;
  color-scheme: light;
}
/* Dark: chosen in Settings > Appearance (data-theme="dark"), or the system setting when the owner left it on System. */
:root[data-theme="dark"] {
    --bg: #13110c; --surface: #1d1a14; --surface-2: #24201a; --surface-3: #2c2820;
    --ink: #f4efe3; --text: #e3ddce; --muted: #a8a08d; --line: #37322a; --line-strong: #4d473b;
    --accent: #ffa24d; --accent-ink: #1d1a14; --accent-soft: #3a2410; --focus: #ffa24d;
    --brand: #0b1a2c; --edge: #5c5444; --hard-c: #000;
    --side-bg: #0c0b08; --side-ink: #f4efe3; --side-muted: #a8a08d; --side-hover: #24201a; --side-line: #2c2820;
    --green: #7fd8a0; --green-bg: #123323; --amber: #f3c26e; --amber-bg: #35270d; --red: #ff9f96; --red-bg: #3b1716;
    --blue: #a3c1ff; --blue-bg: #142a4f; --gray: #bdb5a4; --gray-bg: #2c2820; --violet: #c4b5ff; --violet-bg: #2a2350;
    --s1: #8fb3e6; --s2: #ff8a1f; --s3: #9085e9;
    --bubble-in: #24201a; --bubble-bot: #2f2a21; --bubble-mine: #ff8a1f; --on-mine: #1d1a14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 34px rgba(0, 0, 0, .5);
    color-scheme: dark;
    --toast-bg: #f4efe3; --toast-ink: #13110c; --toast-bad-bg: #ff9f96; --toast-bad-ink: #2a0b08; --av-bg-l: 24%; --av-bg-s: 30%; --av-ink-l: 85%; --av-ink-s: 70%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13110c; --surface: #1d1a14; --surface-2: #24201a; --surface-3: #2c2820;
    --ink: #f4efe3; --text: #e3ddce; --muted: #a8a08d; --line: #37322a; --line-strong: #4d473b;
    --accent: #ffa24d; --accent-ink: #1d1a14; --accent-soft: #3a2410; --focus: #ffa24d;
    --brand: #0b1a2c; --edge: #5c5444; --hard-c: #000;
    --side-bg: #0c0b08; --side-ink: #f4efe3; --side-muted: #a8a08d; --side-hover: #24201a; --side-line: #2c2820;
    --green: #7fd8a0; --green-bg: #123323; --amber: #f3c26e; --amber-bg: #35270d; --red: #ff9f96; --red-bg: #3b1716;
    --blue: #a3c1ff; --blue-bg: #142a4f; --gray: #bdb5a4; --gray-bg: #2c2820; --violet: #c4b5ff; --violet-bg: #2a2350;
    --s1: #8fb3e6; --s2: #ff8a1f; --s3: #9085e9;
    --bubble-in: #24201a; --bubble-bot: #2f2a21; --bubble-mine: #ff8a1f; --on-mine: #1d1a14;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 10px 34px rgba(0, 0, 0, .5);
    color-scheme: dark;
    --toast-bg: #f4efe3; --toast-ink: #13110c; --toast-bad-bg: #ff9f96; --toast-bad-ink: #2a0b08; --av-bg-l: 24%; --av-bg-s: 30%; --av-ink-l: 85%; --av-ink-s: 70%;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.01em; }
p { margin: 0 0 var(--sp1); }
img, svg, video { max-width: 100%; }
.i { flex: none; vertical-align: middle; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 8px; }
.sub { color: var(--muted); font-size: .92rem; }
.center { text-align: center; }
.dim { opacity: .55; }
.opt { color: var(--muted); font-weight: 400; }
kbd { font: 600 .75rem ui-monospace, Menlo, Consolas, monospace; background: var(--surface-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }

/* --- Frame ------------------------------------------------------------------------------------- */
.frame { min-height: 100vh; }
.side { display: none; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: var(--top-h); padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top-logo { border-radius: 8px; }
.top-back { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: -10px; border-radius: 12px; color: var(--ink); }
.top-back:hover { background: var(--surface-3); }
.top-t { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.top-t h1 { margin: 0; font-size: 1.15rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-shop { color: var(--muted); font-size: .78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-a { display: flex; gap: 8px; }
.main { padding: var(--sp2) 16px calc(var(--tab-h) + var(--sp4) + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; outline: none; }

.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); }
.tabbar .nav-i { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; letter-spacing: .01em; }
.tabbar .nav-i[aria-current="page"] { color: var(--accent); }
.tabbar .nav-i[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tabbar .nav-l { white-space: nowrap; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #e5484d; color: #fff; font-size: .72rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.badge[hidden] { display: none; }
.tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: .66rem; box-shadow: 0 0 0 2px var(--surface); }

@media (min-width: 900px) {
  .side { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side-w); padding: 20px 12px; background: var(--surface); border-right: 1px solid var(--line); z-index: 25; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; text-decoration: none; color: var(--ink); }
  .brand img { border-radius: 9px; }
  .brand span { display: flex; flex-direction: column; min-width: 0; }
  .brand b { font-size: 1.05rem; letter-spacing: -.01em; }
  .brand small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav { display: flex; flex-direction: column; gap: 2px; }
  .nav .nav-i { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
  .nav .nav-i:hover { background: var(--surface-2); }
  .nav .nav-i[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
  .nav .nav-l { flex: 1; }
  .side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
  .side-foot a { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; text-decoration: none; min-height: 36px; }
  .side-foot a:hover { color: var(--accent); }
  .content { margin-left: var(--side-w); }
  .tabbar { display: none; }
  .top { padding: 10px 32px; }
  .top-logo { display: none; }
  .top-t h1 { font-size: 1.35rem; }
  .main { max-width: 1240px; padding: var(--sp3) 32px var(--sp4); }
  body.s-inbox .top-back, body.s-customers .top-back, body.s-settings .top-back { display: none; }
}

/* --- Basics: cards, buttons, pills, forms -------------------------------------------------------- */
.card, .embed .card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp2); box-shadow: var(--shadow); margin: 0 0 var(--sp2); }
.card-h { font-size: 1.02rem; margin: 0 0 var(--sp1); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-h { font-size: 1.1rem; margin: var(--sp4) 0 var(--sp2); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.btn, .embed .small, .embed .send, .mk .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 650; font-size: .95rem; line-height: 1.1; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .08s; -webkit-tap-highlight-color: transparent; }
.btn:hover, .embed .small:hover { border-color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn.primary, .embed .send, .mk .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover, .embed .send:hover { filter: brightness(1.06); }
.btn.quiet, .mk .btn.quiet { background: var(--surface-3); border-color: transparent; }
.btn.quiet:hover { border-color: var(--line-strong); }
.btn.danger { color: var(--red); }
.btn.off { opacity: .6; cursor: default; }
.btn.sm, .btn.small-btn { min-height: 36px; padding: 0 12px; font-size: .88rem; border-radius: 10px; }
.btn.icon-btn { width: 44px; padding: 0; }
.btn.icon-btn.sm { width: 36px; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.actions, .btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
form.inline { display: inline-flex; margin: 0; }
.embed .send { width: 100%; margin-top: var(--sp2); }

.pill, .tag, .embed .tm-pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 9px; font-size: .74rem; font-weight: 700; line-height: 1.2; white-space: nowrap; vertical-align: middle; background: var(--gray-bg); color: var(--gray); }
.t-green { background: var(--green-bg) !important; color: var(--green) !important; }
.t-amber { background: var(--amber-bg) !important; color: var(--amber) !important; }
.t-red { background: var(--red-bg) !important; color: var(--red) !important; }
.t-blue { background: var(--blue-bg) !important; color: var(--blue) !important; }
.t-gray { background: var(--gray-bg) !important; color: var(--gray) !important; }
.t-violet { background: var(--violet-bg) !important; color: var(--violet) !important; }
.embed .tag.ok, .embed .tm-pill.on { background: var(--green-bg); color: var(--green); }
.embed .tm-pill.warn, .embed .tag { background: var(--amber-bg); color: var(--amber); }

label, .label { display: block; font-weight: 650; font-size: .92rem; margin: 0 0 6px; color: var(--ink); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 44px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; padding: 10px 12px; }
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 20px; height: 20px; }
.hint { color: var(--muted); font-size: .84rem; margin: 6px 0 0; }
.field { margin-top: var(--sp2); }
.field:first-child { margin-top: 0; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.two > .field { margin-top: 0; }
form.card > .two { margin-top: var(--sp2); }
@media (min-width: 600px) { .two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form-foot { display: flex; justify-content: flex-end; margin-top: var(--sp2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 2px; flex: none; }
.copy-in, textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .84rem; }

/* Toggle switch on a real checkbox */
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 600; margin: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-track { position: relative; flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line-strong); transition: background-color .2s; margin-top: -2px; }
.sw-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .sw-track { background: var(--accent); }
.switch input:checked + .sw-track::after { transform: translateX(20px); }
.switch input:focus-visible + .sw-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch + .hint { margin-left: 60px; }

details > summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 650; }
details > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 1.2rem; line-height: 1; }
details.more[open] > summary::before { transform: rotate(90deg); }

/* Empty states, notices, toast */
.empty { text-align: center; padding: var(--sp4) var(--sp2); }
.empty-ic { width: 64px; height: 64px; margin: 0 auto var(--sp2); border-radius: 50%; display: grid; place-items: center; background: var(--green-bg); color: var(--green); }
.empty h2 { font-size: 1.2rem; margin: 0 0 6px; }
.empty p { color: var(--muted); max-width: 30em; margin: 0 auto var(--sp2); }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--blue-bg); color: var(--ink); margin: 0 0 12px; font-size: .94rem; }
.notice .i { color: var(--blue); margin-top: 1px; }
.notice.bad { background: var(--red-bg); }
.notice.bad .i { color: var(--red); }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 14px;
  background: var(--toast-bg); color: var(--toast-ink); font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--toast-bad-bg); color: var(--toast-bad-ink); }
@media (min-width: 900px) { .toast { bottom: 24px; left: calc(50% + var(--side-w) / 2); } }

/* Segmented control and filter chips */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 12px; margin: 0 0 var(--sp2); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 650; font-size: .9rem; white-space: nowrap; }
.seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 8px; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); text-decoration: none; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.chip em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-current="true"] em { color: inherit; opacity: .7; }

/* Avatars */
.av { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; font-weight: 750; font-size: .9rem; background: hsl(var(--h) var(--av-bg-s) var(--av-bg-l)); color: hsl(var(--h) var(--av-ink-s) var(--av-ink-l)); }
.av-lg { width: 48px; height: 48px; }
.av-xl { width: 64px; height: 64px; font-size: 1.2rem; }

/* --- Today ------------------------------------------------------------------------------------- */
.hello { margin: 0 0 var(--sp2); }
.hello h2 { font-size: 1.55rem; margin: 0; line-height: 1.2; }
.hello p { margin: 4px 0 0; font-size: 1rem; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp2); grid-template-areas: "month" "queue" "up"; }
.dash > * { min-width: 0; }
.dash-month { grid-area: month; }
.dash-queue { grid-area: queue; }
.dash-up { grid-area: up; }
.dash-month .card, .dash-up .card { margin: 0; }
@media (min-width: 1100px) {
  .dash { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "queue month" "queue up"; gap: var(--sp2) var(--sp3); align-items: start; }
}
.group { margin: 0 0 var(--sp3); }
.group-h { display: flex; align-items: center; gap: 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.group-act { margin-left: auto; text-transform: none; letter-spacing: 0; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp2); box-shadow: var(--shadow); margin: 0 0 12px; transition: opacity .25s, transform .25s, max-height .3s; outline: none; }
.task.leaving { opacity: 0; transform: translateX(24px); }
.task-h { display: flex; gap: 12px; align-items: flex-start; }
.task-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.task-t { min-width: 0; flex: 1; }
.task-t h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.task-t .sub { margin: 2px 0 0; }
.task-b { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; font-size: .94rem; }
.task-b .i { color: var(--muted); margin-top: 3px; }
.task-b.muted { color: var(--muted); }
.chips-inline { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.lead-no { color: var(--muted); font-weight: 600; font-size: .85rem; }
.quote-in { margin: 12px 0 0; padding: 10px 14px; border-left: 3px solid var(--line-strong); background: var(--surface-2); border-radius: 4px 12px 12px 4px; font-size: .95rem; overflow-wrap: anywhere; }
.draft { margin: 12px 0 0; padding: 10px 14px; background: var(--accent-soft); border-radius: 12px; }
.draft-l { display: block; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 2px; }
.draft-v { margin: 0; white-space: pre-line; overflow-wrap: anywhere; font-size: .95rem; }
.draft-edit textarea { margin-top: 8px; }
.draft.editing .draft-v { display: none; }
.stars { color: #e8a200; letter-spacing: 1px; font-size: .95rem; }
.stars .dim { color: var(--line-strong); opacity: 1; }
.bubble { background: var(--bubble-bot); border-radius: 18px 18px 18px 4px; padding: 10px 14px; margin: 12px 0 0; max-width: 34em; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .95rem; }
.vid { display: block; width: 200px; max-width: 100%; border-radius: 12px; background: #000; margin-top: 12px; }

.month { background: linear-gradient(140deg, #0f2238, #1c4f8f); color: #fff; border: 0; }
.month h2, .month .card-link { color: #fff; }
.month-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 6px; }
.month-top h2 { font-size: 1rem; margin: 0; }
.card-link { display: inline-flex; align-items: center; gap: 2px; font-size: .88rem; font-weight: 650; text-decoration: none; min-height: 32px; }
.month .card-link { opacity: .85; }
.month-big { display: flex; flex-direction: column; margin: 4px 0 12px; }
.month-big .big { font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.month-big .sub { color: rgba(255,255,255,.78); }
.month-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.month-stats div { background: rgba(255,255,255,.1); border-radius: 12px; padding: 10px 12px; }
.month-stats dt { font-size: .76rem; opacity: .82; font-weight: 600; }
.month-stats dd { margin: 0; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mini-list li:first-child { border-top: 0; }
.mini-list .when { flex: none; width: 92px; font-weight: 700; font-size: .9rem; color: var(--ink); display: flex; flex-direction: column; }
.mini-list .when small, .mini-list .what small { color: var(--muted); font-weight: 500; font-size: .82rem; }
.mini-list .what { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.mini-list .what a { color: inherit; text-decoration: none; }
.mini-list .amt { font-variant-numeric: tabular-nums; }

/* --- Split panes (Inbox, Customers, Settings) ------------------------------------------------------ */
.split .pane-detail { display: none; }
.split.open .pane-list { display: none; }
.split.open .pane-detail { display: block; }
.pane-empty { display: none; }
@media (min-width: 900px) {
  body.s-inbox .main, body.s-customers .main.customers:not(.wide), body.s-settings .main { max-width: none; }
  .split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 0; height: calc(100vh - var(--top-h) - 48px); min-height: 480px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
  body.s-customers .split { height: calc(100vh - var(--top-h) - 110px); }
  .split .pane-list, .split.open .pane-list { display: block; overflow-y: auto; border-right: 1px solid var(--line); padding: 12px; }
  .split .pane-detail { display: block; overflow-y: auto; padding: var(--sp3); }
  .pane-empty { display: grid; place-items: center; height: 100%; }
  .s-settings .pane-detail { background: var(--bg); }
}

/* Rows (conversations, customers) */
.rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.rows > li { min-width: 0; }
.row { display: flex; min-width: 0; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; color: inherit; text-decoration: none; }
.row:hover { background: var(--surface-2); }
.row.on { background: var(--accent-soft); }
.row-m { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.row-1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.row-1 b { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.row-1 .pill { flex: none; }
.row-1 time { flex: none; color: var(--muted); font-size: .8rem; }
.row-2 { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-3 { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.src { color: var(--muted); font-size: .78rem; font-weight: 600; }
@media (max-width: 899px) { .rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px; box-shadow: var(--shadow); } }
.pane-head { margin: 0 0 8px; }

/* Thread */
.thread-wrap { display: flex; flex-direction: column; min-height: 100%; }
@media (min-width: 900px) { .thread-top { position: sticky; z-index: 5; top: calc(-1 * var(--sp3)); background: var(--surface); padding-top: var(--sp2); margin-top: calc(-1 * var(--sp2)); } }
.thread-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.thread-who { min-width: 0; flex: 1; }
.thread-who h2 { margin: 0; font-size: 1.2rem; }
.thread-who p { margin: 2px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.decide { background: var(--amber-bg); border-radius: var(--r-sm); padding: 12px 14px; margin: 0 0 12px; }
.decide p { margin: 0; color: var(--ink); }
.decide .actions { margin-top: 10px; }
.facts { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 14px; margin: 0 0 12px; }
.facts dl, .kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 4px 0 12px; }
.facts dt, .kv dt { color: var(--muted); font-size: .9rem; }
.facts dd, .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts .actions { margin: 0 0 12px; }
.thread { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 16px; flex: 1; }
.msg { max-width: min(84%, 560px); padding: 9px 13px; border-radius: 18px; overflow-wrap: anywhere; }
.msg p { margin: 0; white-space: pre-wrap; }
.msg small { display: block; margin-top: 3px; font-size: .72rem; opacity: .7; }
.msg.in { align-self: flex-start; background: var(--bubble-in); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.bot { align-self: flex-end; background: var(--bubble-bot); border-bottom-right-radius: 5px; }
.msg.mine { align-self: flex-end; background: var(--bubble-mine); color: var(--on-mine); border-bottom-right-radius: 5px; }
.msg.vm { align-self: flex-start; background: var(--violet-bg); border-bottom-left-radius: 5px; }
.vm-h { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .82rem; color: var(--violet); margin-bottom: 4px; }
.msg.vm a { display: inline-block; margin-top: 6px; font-weight: 650; font-size: .88rem; }
.note { align-self: center; max-width: 92%; text-align: center; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.note.bad { color: var(--red); }
.composer { position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; padding: 10px 0; background: var(--bg); border-top: 1px solid var(--line); }
.composer textarea { min-height: 48px; max-height: 40vh; resize: none; border-radius: 22px; padding: 12px 16px; }
.composer .send-btn { border-radius: 999px; min-height: 48px; }
.composer .hint { grid-column: 1 / -1; margin: 0; }
@media (max-width: 520px) { .composer .send-btn span { display: none; } .composer .send-btn { width: 48px; padding: 0; } .kb-hint { display: none; } }
@media (hover: none) { .kb-hint { display: none; } }
@media (min-width: 900px) { .composer { bottom: calc(-1 * var(--sp3)); background: var(--surface); padding-bottom: var(--sp2); } .split .pane-detail { padding-bottom: var(--sp3); } }

/* --- Schedule ---------------------------------------------------------------------------------- */
.sched-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 var(--sp2); }
.sched-head .sub { margin: 0; }
.week { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 0 0 var(--sp2); }
.day-col h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; font-size: 1rem; }
.day-col h3 small { color: var(--muted); font-weight: 600; font-size: .85rem; }
.day-col h3 .count, .day-col h3 .pill { margin-left: auto; }
.day-col.is-today h3 span { color: var(--accent); }
.day-empty { color: var(--muted); font-size: .88rem; margin: 0; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.jobs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.job-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 12px; box-shadow: var(--shadow); }
.job-card.held { border-left-color: var(--brand-amber); }
.job-main { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px 4px; color: inherit; text-decoration: none; }
.job-time { font-size: .8rem; font-weight: 800; color: var(--accent); }
.job-main b { color: var(--ink); }
.job-sub { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.job-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px 8px 12px; flex-wrap: wrap; }
.job-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.sched-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp2); }
.switch-row { display: flex; gap: 12px; align-items: flex-start; }
.switch-row .card-h { margin-bottom: 2px; }
.switch-card.paused { border-color: color-mix(in srgb, var(--brand-amber) 55%, var(--line)); }
.chip-list { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip-list li { display: inline-flex; align-items: center; gap: 2px; padding-left: 12px; border-radius: 999px; background: var(--surface-3); font-weight: 600; font-size: .88rem; }
@media (min-width: 640px) { .sched-cards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 1100px) {
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; box-shadow: var(--shadow); }
  .day-col { min-width: 0; min-height: 260px; padding: 4px; border-radius: 10px; }
  .job-foot { flex-direction: column; align-items: flex-start; }
  .job-foot .pill { white-space: normal; }
  .job-main b { font-size: .92rem; }
  .day-col.is-today { background: var(--accent-soft); }
  .day-col.is-off { background: repeating-linear-gradient(135deg, transparent 0 8px, var(--surface-2) 8px 16px); }
  .day-col h3 { flex-wrap: wrap; font-size: .92rem; }
  .job-card { box-shadow: none; }
  .job-sub { font-size: .8rem; }
  .sched-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
}

/* --- Customers --------------------------------------------------------------------------------- */
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.stat-strip div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.stat-strip.card div { background: var(--surface-3); }
.stat-strip dt { color: var(--muted); font-size: .76rem; font-weight: 650; line-height: 1.25; }
.stat-strip dd { margin: 2px 0 0; font-size: 1.35rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.search { position: relative; margin: 0 0 8px; }
.search .i { position: absolute; left: 14px; top: 13px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 42px !important; border-radius: 999px !important; }
.list-meta { display: flex; align-items: center; gap: 8px; justify-content: space-between; color: var(--muted); font-size: .85rem; margin: 0 0 8px; }
.sort { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.sort label { margin: 0; font-weight: 600; color: var(--muted); font-size: .85rem; }
.sort select { width: auto; min-height: 36px; padding: 4px 8px; }
.cust-head { display: flex; gap: 16px; align-items: center; }
.cust-head h2 { margin: 0; font-size: 1.4rem; }
.cust-head p { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.big-actions .btn { flex: 1 1 auto; }
.callout { display: flex; gap: 8px; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; margin: 16px 0 0; }
.block { border-top: 1px solid var(--line); margin-top: var(--sp2); padding-top: var(--sp2); }
.block h3 { margin: 0 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.block .actions { margin-top: 8px; }
.due { color: var(--red); font-weight: 700; }
.ok-line { display: flex; align-items: center; gap: 6px; color: var(--green); font-weight: 700; margin: 0; }
.date-set { gap: 6px; }
.date-set input { width: auto; min-height: 44px; }
.facts-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.facts-list li { display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; }
.facts-list .i { color: var(--muted); margin-top: 2px; }
.jamt { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.jamt > span { width: 110px; font-weight: 600; font-size: .9rem; }
.amt { display: flex; gap: 8px; align-items: center; margin: 0; }
.amt-in { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 10px; background: var(--surface); min-height: 44px; flex: 0 1 150px; margin: 0; font-weight: 600; }
.amt-in input { border: 0 !important; box-shadow: none !important; padding: 0 !important; min-height: 40px !important; background: transparent !important; }
.amt .small { min-height: 44px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: flex; gap: 12px; padding: 0 0 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-ic { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.timeline b { display: block; font-size: .94rem; color: var(--ink); }
.timeline small, .tl-d { display: block; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.tl-d { color: var(--text); }
.rv-stats { display: flex; gap: var(--sp2); align-items: center; flex-wrap: wrap; }
.rv-stats > div { display: flex; flex-direction: column; }
.rv-stats .big { font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.rv-stats p { flex: 1; min-width: 220px; margin: 0; }
.rv-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 900px) { .rv-list { grid-template-columns: 1fr 1fr; } }
.rv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--sp2); box-shadow: var(--shadow); }
.rv-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-h small { color: var(--muted); }
.rv form { margin-top: 12px; }
.reply-line { margin: 10px 0 0; font-size: .92rem; color: var(--muted); }
.main.wide { max-width: 1100px; }

/* Past-customer marketing, shown inside the app (src/marketing.js) */
.mk .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 8px; }
.mk .stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); }
.mk .stat b { display: block; font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.mk .stat span { color: var(--muted); font-size: .8rem; display: block; line-height: 1.3; }
.mk h2 { font-size: 1.1rem; margin: var(--sp4) 0 12px; }
.mk .card h3 { margin: 0 0 6px; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mk .note { display: block; text-align: left; align-self: auto; max-width: none; margin: 8px 0 0; font-size: .88rem; }
.mk .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding: 0; }
.mk .row:hover { background: none; }
.mk .nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; text-align: center; }
.mk .nums b { display: block; font-size: 1.25rem; color: var(--ink); }
.mk .nums span { font-size: .75rem; color: var(--muted); }
.mk .f { display: grid; gap: 12px; }
.mk label.l { font-size: .9rem; }
.mk .rule { display: grid; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.mk .rule:first-of-type { border-top: 0; }
@media (min-width: 600px) { .mk .three { grid-template-columns: 2fr 1fr 2fr; } }
.mk .list { list-style: none; margin: 0; padding: 0; }
.mk .list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mk .list li:first-child { border-top: 0; }
.mk .list small { display: block; color: var(--muted); }
.mk .legal { background: var(--surface-3); border-radius: 12px; padding: 12px 14px; font-size: .85rem; color: var(--muted); margin-top: var(--sp3); }
@media (min-width: 1000px) { .mk { columns: 2; column-gap: var(--sp3); } .mk > * { break-inside: avoid; } .mk .stats, .mk > .note { column-span: all; } .mk h2:first-of-type { margin-top: var(--sp2); } }

/* --- Results ----------------------------------------------------------------------------------- */
.res-head .sub { margin: -8px 0 var(--sp2); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 var(--sp2); }
.kpi { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.kpi-k { color: var(--muted); font-size: .82rem; font-weight: 650; }
.kpi-v { font-size: 1.75rem; font-weight: 800; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-s { color: var(--muted); font-size: .8rem; }
@media (max-width: 899px) { .kpis > .kpi.hero ~ .kpi:nth-child(4) { grid-column: 1 / -1; } }
.kpi.hero { grid-column: 1 / -1; background: linear-gradient(140deg, #0f2238, #1c4f8f); border: 0; color: #fff; }
.kpi.hero .kpi-k, .kpi.hero .kpi-s { color: rgba(255,255,255,.8); }
.kpi.hero .kpi-v { color: #fff; font-size: 2.4rem; }
.kpi.hero .delta { background: rgba(255,255,255,.16); color: #fff; }
@media (min-width: 900px) { .kpis { grid-template-columns: 1.6fr 1fr 1fr 1fr; } .kpi.hero { grid-column: auto; } }
.delta { display: inline-flex; align-items: center; gap: 3px; border-radius: 999px; padding: 1px 8px; font-size: .74rem; font-weight: 750; margin-left: 6px; background: var(--gray-bg); color: var(--muted); }
.delta.good { background: var(--green-bg); color: var(--green); }
.delta.bad { background: var(--red-bg); color: var(--red); }
.res-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp2); }
@media (min-width: 900px) { .res-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.frow { display: flex; justify-content: space-between; font-weight: 700; color: var(--ink); }
.fnum { font-variant-numeric: tabular-nums; }
.fbar { height: 10px; background: var(--surface-3); border-radius: 999px; margin: 6px 0 4px; overflow: hidden; }
.fbar span { display: block; height: 100%; background: var(--s1); border-radius: 999px; transform-origin: left; animation: grow .7s cubic-bezier(.2,.7,.2,1) both; }
.funnel li:last-child .fbar span { background: var(--s2); }
.fhint { color: var(--muted); font-size: .8rem; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--muted); stroke-width: 1; opacity: .5; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
@media (max-width: 600px) { .chart .axis { font-size: 19px; } }
.chart .s1 { fill: var(--s1); } .chart .s2 { fill: var(--s2); } .chart .s3 { fill: var(--s3); }
.chart .hit { fill: transparent; } .chart .col:hover .hit, .chart .col:focus .hit { fill: var(--surface-3); } .chart .col { outline: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; font-size: .84rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.s1 { background: var(--s1); } .sw.s2 { background: var(--s2); } .sw.s3 { background: var(--s3); }
.more-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp2); }
@media (min-width: 900px) { .more-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.more-card { padding: 0; }
.more-card > summary { padding: 0 var(--sp2); min-height: 56px; color: var(--ink); justify-content: space-between; }
.more-card > summary .chev { transition: transform .15s; color: var(--muted); }
.more-card[open] > summary .chev { transform: rotate(90deg); }
.more-body { padding: 0 var(--sp2) var(--sp2); }
.mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; margin: 0 0 8px; }
.mini .v { font-size: 1.4rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.mini .k { color: var(--muted); font-size: .78rem; }
.stat-line { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--muted); font-size: .86rem; }
.stat-line b { color: var(--ink); }
.fine { color: var(--muted); font-size: .8rem; margin: 10px 0 0; }
.insights { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: right; padding: 6px 8px; border-top: 1px solid var(--line); }
table.data th:first-child, table.data td:first-child { text-align: left; }
.foot { color: var(--muted); font-size: .84rem; margin-top: var(--sp3); }

/* --- Settings ---------------------------------------------------------------------------------- */
.list-h { font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: var(--sp2) 4px 8px; }
.list-h:first-child { margin-top: 4px; }
.set-list { list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.set-list a { display: flex; gap: 12px; align-items: center; padding: 10px; min-height: 56px; border-radius: 12px; color: inherit; text-decoration: none; }
.set-list a:hover { background: var(--surface-2); }
.set-list a[aria-current="true"] { background: var(--accent-soft); }
.set-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--accent); }
.set-t { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.set-t b { color: var(--ink); font-size: .96rem; }
.set-t small { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { color: var(--muted); }
@media (min-width: 900px) { .s-settings .set-list { border: 0; box-shadow: none; padding: 0; } .s-settings .pane-list { background: var(--surface); } }
.detail-inner { max-width: 760px; }
.detail-h { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; margin: 0 0 var(--sp2); }
.detail-h .i { color: var(--accent); }
@media (max-width: 899px) { .detail-h { display: none; } }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list > li { padding: 12px 0; border-top: 1px solid var(--line); }
.plain-list > li:first-child { border-top: 0; padding-top: 4px; }
.li-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.li-row small { display: block; color: var(--muted); font-size: .82rem; }
.vm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vm-row small { color: var(--muted); margin-left: auto; }
.meter { height: 12px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: 4px 0 12px; }
.meter span { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.meter.warn span { background: var(--brand-amber); }
.meter.bad span { background: var(--red); }

/* The classic page's feature sections (src/extensions.js ownerSections) inside Settings */
.embed h2 { font-size: 1.02rem; margin: var(--sp3) 0 10px; }
.embed > h2:first-child, .embed > style:first-child + h2 { margin-top: 0; }
.embed h3 { font-size: .95rem; }
.embed .note { display: block; color: var(--muted); font-size: .88rem; text-align: left; max-width: none; align-self: auto; }
.embed .card .card { box-shadow: none; }
.embed .job { padding: 12px 0; border-top: 1px solid var(--line); }
.embed .job:first-of-type { border-top: 0; padding-top: 0; }
.embed .log { list-style: none; padding: 0; margin: 0; }
.embed .log li { padding: 8px 0; border-top: 1px solid var(--line); }
.embed .log li:first-child { border-top: 0; }
.embed .toggle { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.embed .toggle input { margin-top: 2px; flex: none; }
.embed .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0; }
.embed .row:hover { background: none; }
.embed .row select, .embed .row input { width: auto; flex: 1; min-width: 120px; }
.embed .ok { background: var(--green-bg); }
.embed .err { color: var(--red); font-size: .88rem; margin-top: 4px; }
.embed summary { font-size: .95rem; }
.embed code { font-size: .85em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.embed textarea[readonly] { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .84rem; }
.embed .wl-qr .code { background: #fff; }
.embed .tm-wait { background: var(--amber-bg); border-color: transparent; }

/* The week grid and days-off picker (src/intake.js weekWidget / datesWidget) */
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .x, .x { border: 0; background: none; color: inherit; padding: 0 0 0 6px; font-size: 1.1rem; line-height: 1; cursor: pointer; min-height: 0; }
.day { display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.day:first-of-type { border-top: 0; }
.day .toggle { display: flex; align-items: center; gap: 8px; font-weight: 650; margin: 0; }
.day .times { display: flex; gap: 6px; align-items: center; }
.day .times select { padding: 6px 8px; min-height: 40px; }
.day .closed { color: var(--muted); font-size: .92rem; }
#hours .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
#hours .row select, #hours .row input { width: auto; flex: 1; min-width: 120px; }
#hours .small { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
#hours .chips { flex-wrap: wrap; overflow: visible; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print { .tabbar, .side, .top, .composer, .actions { display: none !important; } .content { margin: 0; } }

@media (max-width: 899px) { .detail-open > .seg { display: none; } }

/* --- Round 2: appearance, More sheet, scrollers, days off, marketing, reports, install ---------------- */
.js .no-js-only { display: none; }
.theme-btn .i { color: var(--muted); }
.theme-btn:hover .i { color: var(--accent); }
.top-a .theme-form { display: inline-flex; }
@media (min-width: 900px) { .top-a .top-theme { display: none; } }
.side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.theme-pick { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-opt { margin: 0; cursor: pointer; }
.theme-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.theme-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface-2); min-height: 112px; font-weight: 400; }
.theme-card .i { color: var(--accent); }
.theme-card b { color: var(--ink); }
.theme-card small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.theme-opt input:checked + .theme-card { border-color: var(--accent); background: var(--accent-soft); }
.theme-opt input:focus-visible + .theme-card { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 420px) { .theme-pick { grid-template-columns: 1fr; } .theme-card { min-height: 0; flex-direction: row; align-items: center; flex-wrap: wrap; } .theme-card small { width: 100%; padding-left: 30px; } }

/* "More" sheet (phones) */
.sheet { border: 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; background: var(--bg); color: var(--text); box-shadow: var(--shadow-lg); }
.sheet::backdrop { background: rgba(8, 15, 25, .45); }
.sheet[open] { animation: sheet-up .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 4px auto 10px; }
.sheet h2 { font-size: 1.05rem; margin: 0 4px 10px; }
.sheet .set-list .badge { margin-right: 4px; }
.sheet-close { width: 100%; margin-top: 12px; }
.set-list .badge { flex: none; }

/* Horizontal scrollers (filter pills, section tabs): fades and arrows show there's more */
.scroller { position: relative; margin: 0 0 var(--sp2); }
.scroller > .chips, .scroller > .seg { margin: 0; scroll-snap-type: x proximity; scroll-padding-inline: 24px; }
.scroller > .chips { padding: 2px 0 4px; flex-wrap: nowrap; }
.scroller .chip, .scroller .seg a { scroll-snap-align: start; flex: none; }
.scroller::before, .scroller::after { content: ""; position: absolute; top: 0; bottom: 0; width: 36px; pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 1; }
.scroller::before { left: 0; background: linear-gradient(90deg, var(--fade-bg, var(--bg)), transparent); border-radius: 12px 0 0 12px; }
.scroller::after { right: 0; background: linear-gradient(270deg, var(--fade-bg, var(--bg)), transparent); border-radius: 0 12px 12px 0; }
.scroller.more-left::before, .scroller.more-right::after { opacity: 1; }
.scroller:has(> .seg) { --fade-bg: var(--surface-3); }
.pane-list .scroller { --fade-bg: var(--surface); }
.sc-btn { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); display: none; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; place-items: center; padding: 0; }
.sc-btn.prev { left: -4px; } .sc-btn.next { right: -4px; }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) { .scroller.more-left .sc-btn.prev, .scroller.more-right .sc-btn.next { display: grid; } }
.seg a[aria-current="page"] { scroll-snap-align: center; }

/* Days off */
.dayoff { grid-column: 1 / -1; }
.dayoff-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp2) var(--sp3); margin-top: 12px; }
.dayoff-form input { width: 100%; }
.btn.block { width: 100%; }
.mini-h { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.dayoff-list .plain-list > li:first-child { padding-top: 0; }
@media (min-width: 760px) { .dayoff-grid { grid-template-columns: minmax(260px, 1fr) minmax(0, 1.3fr); } .dayoff-list { border-left: 1px solid var(--line); padding-left: var(--sp3); } }
.sched-cards .card { margin-bottom: var(--sp2); }

/* Business details */
.money-in { position: relative; }
.money-in span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money-in input { padding-left: 28px !important; }
.inline-field { display: flex; gap: 8px; align-items: center; }
.inline-field select { flex: 1; min-width: 0; }

/* Results: custom dates and reports */
.range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; margin: 0 0 var(--sp2); }
.range label { font-size: .82rem; color: var(--muted); }
.range .btn { min-height: 44px; }
.range:not(.on) { opacity: .92; }
@media (min-width: 900px) { .res-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--sp2); align-items: end; } .res-head .scroller { margin: 0 0 var(--sp2); } .range { max-width: 460px; justify-self: end; } .res-head > p, .res-head > .notice { grid-column: 1 / -1; } }
.reports .actions .btn { flex: 1 1 auto; }
.report-freq { margin-top: var(--sp2); padding-top: var(--sp2); border-top: 1px solid var(--line); }

/* Marketing */
.mk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp2); align-items: start; }
@media (min-width: 1000px) { .mk-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .mk-grid > .wide { grid-column: 1 / -1; } }
.stat-strip.four { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: var(--sp2); }
@media (min-width: 700px) { .stat-strip.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-strip.four div { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.attention { border-color: color-mix(in srgb, var(--brand-amber) 55%, var(--line)); }
.run-list { list-style: none; margin: 0; padding: 0; }
.run-list a { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; border-radius: 10px; }
.run-list li:first-child a { border-top: 0; }
.run-list a:hover { background: var(--surface-2); }
.run-list .set-t small { white-space: normal; }
.rule-set { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 12px 0 0; }
.rule-set legend { font-weight: 700; font-size: .82rem; color: var(--muted); padding: 0 4px; }
.rule-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 600px) { .rule-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr); } }
.camp-list { columns: auto; }
.mk.camp-list .card { margin-bottom: 12px; }
.proof { flex: none; }
.proof > summary { min-height: 36px; font-size: .88rem; }
.proof[open] { flex-basis: 100%; }
.li-row { flex-wrap: wrap; }
.fine { color: var(--muted); font-size: .8rem; margin: 10px 0 0; }

/* Install the app */
.install-hint { display: flex; gap: 12px; align-items: flex-start; }
.install-hint[hidden] { display: none; }
.install-hint img { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.install-hint .actions { margin-top: 8px; }
.mini-list .pill { flex: 0 1 auto; max-width: 45%; white-space: normal; text-align: center; }
.mini-list .what { min-width: 96px; }

/* --- savedjob.com look (design B) -------------------------------------------------------------- */
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(font-barlow-condensed-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url(font-barlow-condensed-800.woff2) format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 800 900; font-stretch: 100% 125%; font-display: swap; src: url(font-archivo.woff2) format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 400 700; font-display: swap; src: url(font-public-sans.woff2) format("woff2"); }

h1, h2, h3, .card-h, .section-h, .task-t h3, .day-col h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: .005em; }
.top-t h1 { font-size: 1.45rem; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: 1.1; }
.hello h2 { font-size: 2.1rem; font-weight: 800; text-transform: uppercase; line-height: 1; }
.section-h, .mk h2 { font-size: 1.4rem; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }
.card-h { font-size: 1.3rem; }
.task-t h3 { font-size: 1.3rem; line-height: 1.15; }
.thread-who h2, .cust-head h2, .empty h2 { font-size: 1.55rem; }
.day-col h3 { font-size: 1.2rem; }
.group-h { font-family: var(--font-head); font-weight: 700; font-size: 1rem; letter-spacing: .08em; color: var(--ink); }
.kpi-v, .month-big .big, .stat-strip dd, .rv-stats .big, .mk .stat b { font-family: var(--font-head); font-weight: 800; letter-spacing: 0; }
.kpi-v { font-size: 2.2rem; line-height: 1; }
.month-big .big { font-size: 3rem; line-height: .95; }
.stat-strip dd { font-size: 1.7rem; line-height: 1.05; }
.rv-stats .big { font-size: 2.5rem; }
.mk .stat b { font-size: 1.9rem; }

/* Hard-edged cards: ink border and offset shadow, like the site. Cards inside cards stay flat. */
.card, .embed .card, .task { border: 2px solid var(--edge); border-radius: var(--r); box-shadow: var(--hard); }
.card .card, .embed .card .card, .card .task { border-width: 1.5px; box-shadow: none; }
.job-card { border: 1.5px solid var(--edge); border-left: 5px solid var(--green); border-radius: var(--r-sm); box-shadow: var(--hard-sm); }

.btn, .embed .small, .embed .send, .mk .btn { border: 2px solid var(--edge); border-radius: var(--r-sm); font-weight: 700; }
.btn:hover, .embed .small:hover { border-color: var(--edge); background: var(--surface-3); }
.btn.primary, .embed .send, .mk .btn.primary { background: var(--orange); border-color: var(--edge); color: #1d1a14; box-shadow: var(--hard-sm);
  font-family: var(--font-head); font-size: 1.12rem; text-transform: uppercase; letter-spacing: .05em; }
.btn.primary:hover, .embed .send:hover { background: #ff9a3c; filter: none; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--hard-c); }
.btn.primary:active { transform: translate(1px, 1px); box-shadow: none; }
.btn.primary.sm { font-size: 1rem; }
.btn.quiet, .mk .btn.quiet { background: var(--surface-3); border-color: transparent; }
.btn.quiet:hover { border-color: var(--edge); }
.btn.sm, .btn.small-btn { border-radius: var(--r-sm); }

.pill, .tag, .embed .tm-pill { border-radius: 4px; }
.chip { border: 1.5px solid var(--edge); border-radius: 4px; }
.seg { border-radius: var(--r-sm); }
.seg a { border-radius: 4px; }
.seg a[aria-current="page"] { box-shadow: inset 0 0 0 1.5px var(--edge); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); }
input:focus, select:focus, textarea:focus { border-color: var(--edge); }
.notice { border-radius: var(--r-sm); border-left: 4px solid var(--blue); }
.notice.bad { border-left-color: var(--red); }
.toast { border-radius: var(--r-sm); }

/* Phone frame: ink rule under the header, orange marker on the current tab. */
.top { border-bottom: 2px solid var(--edge); }
.top-logo { border-radius: 6px; }
.tabbar { border-top: 2px solid var(--edge); }
.tabbar .nav-i[aria-current="page"] { color: var(--ink); }
.tabbar .nav-i[aria-current="page"]::before { width: 36px; height: 4px; border-radius: 0; background: var(--orange); }

/* Wide screens: the sidebar is the site's dark ink band, with the wordmark. */
@media (min-width: 900px) {
  .side { background: var(--side-bg); color: var(--side-ink); border-right: 0; }
  .brand { color: var(--side-ink); padding-bottom: 24px; }
  .brand img { border-radius: 8px; }
  .brand b { font-family: var(--font-word); font-stretch: 115%; font-weight: 900; font-size: 1.35rem; letter-spacing: -.025em; line-height: 1; color: var(--side-ink); }
  .brand b i { font-style: normal; color: var(--orange); }
  .brand small { color: var(--side-muted); margin-top: 4px; }
  .nav .nav-i { color: var(--side-ink); border-radius: var(--r-sm); }
  .nav .nav-i:hover { background: var(--side-hover); }
  .nav .nav-i[aria-current="page"] { background: var(--orange); color: #1d1a14; }
  .side-foot { border-top-color: var(--side-line); }
  .side-foot a, .side-foot button { color: var(--side-muted); }
  .side-foot a:hover, .side-foot button:hover { color: var(--side-ink); background: var(--side-hover); }
  .side .badge { box-shadow: 0 0 0 2px var(--side-bg); }
}

@media (min-width: 900px) { .side-foot .theme-btn .i { color: var(--side-muted); } .side-foot .theme-btn:hover .i { color: var(--side-ink); } }
@media (min-width: 900px) { .side-foot .theme-btn { background: transparent; } }

/* The month and hero results panels: the site's dark numbers band, amber figures on ink. */
.month, .kpi.hero { background: #1d1a14; color: #fbfaf6; border: 2px solid var(--edge); box-shadow: 3px 3px 0 var(--orange); }
.month h2, .month .card-link { color: #fbfaf6; }
.month h2 { font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #f5a524; }
.month-big .big, .kpi.hero .kpi-v { color: #f5a524; }
.month-big .sub, .kpi.hero .kpi-k, .kpi.hero .kpi-s { color: #c9c1ae; }
.month-stats div { background: rgba(251, 250, 246, .07); border: 1px solid rgba(251, 250, 246, .14); border-radius: 4px; }
.month-stats dt { text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; }
.month-stats dd { font-family: var(--font-head); font-size: 1.7rem; line-height: 1.05; }
.kpi.hero .delta { background: rgba(251, 250, 246, .12); color: #fbfaf6; }
@media (min-width: 900px) { .split { border: 2px solid var(--edge); box-shadow: var(--hard); } .split .pane-list, .split.open .pane-list { border-right: 2px solid var(--line); } }

.theme-form, .side-foot > a { display: none !important; }
.toast { bottom: 84px !important; }
@media (max-width: 760px) { .toast { bottom: 150px !important; } }
.demo-pill { position: fixed; z-index: 60; right: 18px; bottom: 18px; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); padding: 10px 12px 10px 18px; border-radius: 999px; background: #1d1a14; color: #fbfaf6; font-size: 14px; box-shadow: 0 6px 22px rgba(0,0,0,.28); }
.demo-pill b { color: #f5a524; white-space: nowrap; }
.demo-pill a { background: #ff8a1f; color: #1d1a14; font-weight: 700; text-decoration: none; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 760px) { .demo-pill { right: 8px; left: 8px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); justify-content: space-between; } .demo-pill span { display: none; } }
