/* Runwell design system. One set of tokens, used by every screen. */
:root {
  --sidebar: #111827;
  --sidebar-hover: #1b2433;
  --sidebar-active: #1e2a44;
  --sidebar-ink: #cbd5e1;
  --sidebar-muted: #7c8aa0;
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-soft: #edf1f5;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-wash: #eff4ff;
  --gold: #f4b400;
  --green: #10b981;
  --green-ink: #047857;
  --green-wash: #ecfdf5;
  --amber: #f59e0b;
  --amber-ink: #b45309;
  --amber-wash: #fffbeb;
  --red: #ef4444;
  --red-ink: #b91c1c;
  --red-wash: #fef2f2;
  --purple: #7c3aed;
  --purple-ink: #6d28d9;
  --purple-wash: #f5f3ff;
  --cyan-ink: #0e7490;
  --cyan-wash: #ecfeff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-pop: 0 12px 32px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .08);
  --radius: 10px;
  --soft: #fafbfc;
  --soft-2: #eef2f6;
  --line-strong: #cbd5e1;
  --faint: #94a3b8;
  --blue-line: #c7d7fb;
  --amber-line: #fde68a;
  --amber-text: #78350f;
  --red-line: #fecaca;
  --red-text: #7f1d1d;
  --purple-line: #e4dcfb;
  --purple-text: #3b2a70;
  --green-line: #a7f3d0;
  --gold-wash: #fff8e1;
  --gold-wash-2: #fde9a8;
  --topbar: rgba(245, 247, 250, .92);
  --inverse: #0f172a;
  --inverse-ink: #ffffff;
  color-scheme: light;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Dark mode: the same tokens, darker. Chosen per device under the user menu (Light, Dark, or match the device). */
:root[data-theme="dark"] {
  --sidebar: #0a0f1c;
  --sidebar-hover: #141c2e;
  --sidebar-active: #1a2540;
  --bg: #0d1322;
  --card: #151d2e;
  --ink: #e7ebf2;
  --ink-2: #c2cad7;
  --muted: #8e9aad;
  --border: #263149;
  --border-soft: #1d2639;
  --blue: #3b82f6;
  --blue-dark: #93c5fd;
  --blue-wash: rgba(59, 130, 246, .16);
  --green-ink: #34d399;
  --green-wash: rgba(16, 185, 129, .15);
  --amber-ink: #fbbf24;
  --amber-wash: rgba(245, 158, 11, .14);
  --red-ink: #f87171;
  --red-wash: rgba(239, 68, 68, .15);
  --purple: #8b5cf6;
  --purple-ink: #c4b5fd;
  --purple-wash: rgba(139, 92, 246, .18);
  --cyan-ink: #67e8f9;
  --cyan-wash: rgba(6, 182, 212, .15);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-pop: 0 14px 36px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .35);
  --soft: #19223a;
  --soft-2: #1f2a42;
  --line-strong: #3a4763;
  --faint: #6f7d93;
  --blue-line: rgba(96, 165, 250, .35);
  --amber-line: rgba(245, 158, 11, .35);
  --amber-text: #fcd34d;
  --red-line: rgba(248, 113, 113, .38);
  --red-text: #fca5a5;
  --purple-line: rgba(167, 139, 250, .38);
  --purple-text: #ddd6fe;
  --green-line: rgba(52, 211, 153, .35);
  --gold-wash: rgba(244, 180, 0, .15);
  --gold-wash-2: rgba(244, 180, 0, .28);
  --topbar: rgba(13, 19, 34, .9);
  --inverse: #e7ebf2;
  --inverse-ink: #0d1322;
  color-scheme: dark;
}
:root[data-theme="dark"] .sidebar { border-right: 1px solid var(--border-soft); }
:root[data-theme="dark"] .btn.primary:hover { background: #2f74e6; }
:root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: var(--faint); }
:root[data-theme="dark"] .mail-frame { border-radius: 8px; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; line-height: 1.2; }
h2 { font-size: 15px; }
h3 { font-size: 13.5px; }
p { margin: 0 0 10px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
svg.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; color: #fff; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand svg.logo { height: 30px; width: auto; display: block; color: #F6F7F9; }
.gate .brand svg.logo { height: 34px; color: var(--ink); }
.brand b { display: block; font-size: 17px; font-weight: 700; letter-spacing: .09em; line-height: 1.1; }
.brand span { font-size: 11.5px; color: var(--sidebar-muted); }
.workspace { margin: 0 12px 10px; padding: 9px 10px; border-radius: 8px; background: #1a2333; border: 1px solid #263145; display: flex; align-items: center; gap: 10px; cursor: pointer; color: #fff; width: calc(100% - 24px); text-align: left; font: inherit; }
.workspace:hover { background: #202b3f; border-color: #314059; }
.workspace.static { cursor: default; } .workspace.static:hover { background: #1a2333; border-color: #263145; }
.workspace .ws-ico { width: 30px; height: 30px; border-radius: 7px; background: rgba(244, 180, 0, .14); color: var(--gold); display: grid; place-items: center; flex: none; }
.workspace b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace small { color: var(--sidebar-muted); font-size: 11.5px; }
.workspace > svg { color: var(--sidebar-muted); margin-left: auto; }
.nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav .group { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; color: #5b6b83; padding: 14px 10px 5px; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 7px; color: var(--sidebar-ink); font-weight: 500; font-size: 13.5px; position: relative; }
.nav a:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav a.on { background: var(--sidebar-active); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); }
.nav a .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 0 6px; line-height: 18px; }
.nav a.ai svg { color: #a78bfa; }
.userbox { border-top: 1px solid #1f2937; padding: 10px 12px; }
.userbox button { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #fff; padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left; font: inherit; }
.userbox button:hover { background: var(--sidebar-hover); }
.userbox b { display: block; font-size: 13px; font-weight: 600; }
.userbox small { color: var(--sidebar-muted); font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #334155; color: #fff; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; flex: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; background: var(--soft-2); color: var(--ink-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; background: var(--topbar); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 10px 24px; display: flex; align-items: center; gap: 12px; }
.topbar .hamb { display: none; }
.cmd { position: relative; flex: 1; max-width: 760px; }
.cmd input { width: 100%; height: 38px; padding: 0 56px 0 38px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); font: inherit; color: var(--ink); box-shadow: var(--shadow); }
.cmd input::placeholder { color: var(--faint); }
.cmd > svg { position: absolute; left: 12px; top: 10px; color: var(--faint); }
.cmd kbd { position: absolute; right: 9px; top: 8px; font: 500 11px var(--font); color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; background: var(--bg); }
.cmd-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop); max-height: 420px; overflow: auto; padding: 6px; }
.cmd-results .grp { font-size: 11px; font-weight: 600; color: var(--muted); padding: 8px 10px 4px; text-transform: uppercase; letter-spacing: .06em; }
.cmd-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 7px; color: var(--ink); }
.cmd-results a:hover, .cmd-results a.sel { background: var(--blue-wash); text-decoration: none; }
.cmd-results .none { padding: 12px 10px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.iconbtn { width: 38px; height: 38px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; position: relative; flex: none; }
.iconbtn:hover { background: var(--card); border-color: var(--border); }
.iconbtn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.content { padding: 22px 24px 60px; max-width: 1560px; width: 100%; }

/* ---------- Buttons and forms ---------- */
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--ink); font: 500 13px var(--font); cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); }
.btn:hover { border-color: var(--line-strong); background: var(--soft); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.ai { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn.ai:hover { background: var(--purple-ink); }
.btn.ghost { border-color: transparent; background: none; box-shadow: none; color: var(--blue); }
.btn.ghost:hover { background: var(--blue-wash); }
.btn.danger { color: var(--red-ink); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 38px; padding: 0 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg.ico { width: 15px; height: 15px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-weight: 500; font-size: 13px; }
.linkbtn:hover { text-decoration: underline; }
input, select, textarea { font: 400 13.5px/1.35 var(--font); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--card); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(37, 99, 235, .25); border-color: var(--blue); }
textarea { resize: vertical; min-height: 68px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--blue); flex: none; padding: 0; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
label.check { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 12px; cursor: pointer; }
label.check input { margin-top: 2px; }
label.check small { display: block; color: var(--muted); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.fgrid .full { grid-column: 1 / -1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.form-error { color: var(--red-ink); font-weight: 500; margin-bottom: 10px; }

/* ---------- Cards, layout ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border-soft); }
.card > header .ttl { display: flex; align-items: center; gap: 9px; min-width: 0; }
.card > header .ttl svg { color: var(--ink-2); }
.card > .body { padding: 14px 16px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.row { display: flex; gap: 16px; align-items: flex-start; }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.cols-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.list > div, .list > a { display: flex; gap: 12px; align-items: flex-start; padding: 11px 16px; border-bottom: 1px solid var(--border-soft); color: inherit; }
.list > :last-child { border-bottom: 0; }
.list > a:hover { background: var(--soft); text-decoration: none; }
.empty { padding: 26px 16px; color: var(--muted); text-align: center; }
.empty b { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 3px; }
.empty .btn { margin-top: 10px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; background: var(--soft); }
td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--soft); }
th.right, td.right { text-align: right; }

/* ---------- Status badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--soft-2); color: var(--ink-2); white-space: nowrap; line-height: 17px; }
.pill.blue { background: var(--blue-wash); color: var(--blue-dark); }
.pill.cyan { background: var(--cyan-wash); color: var(--cyan-ink); }
.pill.purple { background: var(--purple-wash); color: var(--purple-ink); }
.pill.orange { background: var(--amber-wash); color: var(--amber-ink); }
.pill.green { background: var(--green-wash); color: var(--green-ink); }
.pill.red { background: var(--red-wash); color: var(--red-ink); }
.ai-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--purple-wash); color: var(--purple-ink); line-height: 16px; vertical-align: 1px; white-space: nowrap; }
.ai-tag svg { width: 10px; height: 10px; stroke-width: 2.2; }
.ai-note { background: var(--purple-wash); border: 1px solid var(--purple-line); border-radius: 8px; padding: 10px 12px; color: var(--purple-text); }
.ai-note b { color: var(--purple-ink); }

/* ---------- Menus and dialogs ---------- */
.menu { position: fixed; z-index: 80; min-width: 210px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 6px; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 7px; border: 0; background: none; font: 500 13px var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--bg); text-decoration: none; }
.menu .sep { height: 1px; background: var(--border-soft); margin: 5px 0; }
.menu .note { padding: 8px 10px; font-size: 12.5px; color: var(--muted); max-width: 260px; }
.menu svg { color: var(--muted); }
.panel-pop { position: fixed; z-index: 80; width: 360px; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop); overflow: hidden; }
.panel-pop header { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; }
.panel-pop .list { max-height: 420px; overflow: auto; }
dialog { background: var(--card); border: 0; border-radius: 14px; padding: 0; width: min(620px, calc(100vw - 24px)); box-shadow: var(--shadow-pop); color: var(--ink); }
dialog::backdrop { background: rgba(15, 23, 42, .45); }
dialog > header { padding: 16px 20px 0; display: flex; justify-content: space-between; align-items: center; }
dialog > header h2 { font-size: 16px; }
dialog .dbody { padding: 14px 20px 4px; max-height: 68vh; overflow: auto; }
dialog > footer { padding: 12px 20px 16px; display: flex; gap: 8px; align-items: center; }
dialog > footer .spacer { flex: 1; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--inverse); color: var(--inverse-ink); padding: 10px 16px; border-radius: 9px; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 100; max-width: 90vw; font-weight: 500; box-shadow: var(--shadow-pop); }
#toast.show { opacity: 1; }
#toast.bad { background: var(--red-ink); }

/* ---------- Tabs, filters, segmented ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; font: 500 13.5px var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); }
.tabs .count { font-size: 11px; background: var(--soft-2); color: var(--muted); border-radius: 999px; padding: 0 6px; margin-left: 5px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { width: auto; height: 34px; padding: 0 10px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.seg button { border: 0; background: none; height: 32px; padding: 0 12px; font: 500 13px var(--font); color: var(--ink-2); cursor: pointer; border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--inverse); color: var(--inverse-ink); }

/* ---------- Dashboard ---------- */
.greet h1 { font-size: 26px; letter-spacing: -.02em; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 15px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 13px; align-items: center; position: relative; }
.kpi .kico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; grid-row: 1 / span 3; align-self: start; }
.kpi .kico svg { width: 20px; height: 20px; }
.kpi .kico.blue { background: var(--blue-wash); color: var(--blue); } .kpi .kico.green { background: var(--green-wash); color: var(--green-ink); }
.kpi .kico.purple { background: var(--purple-wash); color: var(--purple); } .kpi .kico.gold { background: var(--gold-wash); color: #c98f00; }
.kpi .lbl { color: var(--ink-2); font-weight: 500; font-size: 13px; }
.kpi .val { font-size: 27px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; grid-column: 2; }
.kpi .cmp { font-size: 12.5px; color: var(--muted); grid-column: 2 / span 2; }
.kpi .cmp .up { color: var(--green-ink); font-weight: 600; } .kpi .cmp .down { color: var(--red-ink); font-weight: 600; }
.kpi .more { grid-column: 3; grid-row: 1; background: none; border: 0; color: var(--faint); cursor: pointer; padding: 2px; border-radius: 6px; }
.kpi .more:hover { background: var(--bg); color: var(--ink-2); }
.kpi .spark { grid-column: 3; grid-row: 2; width: 92px; height: 38px; align-self: end; }
.insight { display: flex; gap: 13px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 10px; }
.insight:last-child { margin-bottom: 0; }
.insight .iico { width: 36px; height: 36px; border-radius: 8px; background: var(--purple-wash); color: var(--purple); display: grid; place-items: center; flex: none; }
.insight b { display: block; font-weight: 600; }
.insight .x { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 4px; border-radius: 6px; }
.insight .x:hover { background: var(--bg); color: var(--ink); }
.beta { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--purple-ink); background: var(--purple-wash); border: 1px solid var(--purple-line); border-radius: 5px; padding: 1px 6px; }
.ai-ico { color: var(--purple); }
.timeline .tl { display: grid; grid-template-columns: 62px 16px minmax(0, 1fr) auto; gap: 0 8px; padding: 0 16px; align-items: start; }
.timeline .tl .t { font-weight: 500; font-size: 12.5px; padding-top: 12px; } .timeline .tl .t small { display: block; color: var(--muted); font-weight: 400; }
.timeline .tl .rail { align-self: stretch; display: flex; flex-direction: column; align-items: center; }
.timeline .tl .rail i { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); margin-top: 16px; flex: none; }
.timeline .tl .rail i.gray { background: var(--faint); } .timeline .tl .rail i.gold { background: var(--gold); }
.timeline .tl .rail::after { content: ""; flex: 1; width: 1px; background: var(--border); margin-top: 4px; }
.timeline .tl:last-child .rail::after { display: none; }
.timeline .tl .what { padding: 11px 0 13px; min-width: 0; } .timeline .tl .what b { font-weight: 600; }
.timeline .tl .act { padding-top: 9px; }
.mini-board { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; padding: 14px 16px 16px; overflow-x: auto; }
.mini-col { border-radius: 9px; padding: 9px; background: var(--soft); border: 1px solid var(--border-soft); border-top: 3px solid var(--blue); min-width: 0; }
.mini-col.visit { border-top-color: #06b6d4; } .mini-col.sent { border-top-color: var(--purple); background: var(--purple-wash); }
.mini-col.neg { border-top-color: var(--amber); background: var(--amber-wash); } .mini-col.won { border-top-color: var(--green); background: var(--green-wash); }
.mini-col h3 { font-size: 13px; } .mini-col .tot { font-size: 12.5px; color: var(--muted); margin: 1px 0 8px; } .mini-col .tot b { color: var(--ink); font-weight: 700; margin-right: 6px; }
.opp { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 7px; padding: 7px 9px; margin-bottom: 6px; color: inherit; }
.opp:hover { border-color: var(--line-strong); text-decoration: none; box-shadow: var(--shadow); }
.opp b { display: block; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp span { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.mini-col .morelink { font-size: 12px; color: var(--muted); padding: 2px 2px 0; }
.tasks .list > div { padding: 9px 16px; align-items: center; }
.tasks .due { font-size: 12.5px; color: var(--muted); white-space: nowrap; } .tasks .due.late { color: var(--red-ink); font-weight: 600; } .tasks .due.today { color: var(--red-ink); font-weight: 500; }
.feed .ficon { width: 32px; height: 32px; border-radius: 50%; background: var(--soft-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.feed .ficon svg { width: 15px; height: 15px; }
.feed .ficon.ai { background: var(--purple-wash); color: var(--purple); } .feed .ficon.green { background: var(--green-wash); color: var(--green-ink); }

/* ---------- Pipeline board ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat { padding: 13px 16px; } .stat span { color: var(--muted); font-size: 12.5px; font-weight: 500; } .stat b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.stat small { color: var(--muted); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(236px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: start; }
.lane { background: var(--soft-2); border-radius: 10px; padding: 9px; min-height: 160px; border-top: 3px solid var(--faint); }
.lane.over { outline: 2px dashed var(--blue); outline-offset: -2px; }
.lane[data-stage=new_lead], .lane[data-stage=contacted] { border-top-color: var(--blue); } .lane[data-stage=visit_scheduled] { border-top-color: #06b6d4; }
.lane[data-stage=estimate_sent] { border-top-color: var(--purple); } .lane[data-stage=negotiation] { border-top-color: var(--amber); }
.lane[data-stage=won] { border-top-color: var(--green); } .lane[data-stage=lost] { border-top-color: var(--red); }
.lane > header { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 9px; gap: 6px; }
.lane > header b { font-size: 13px; font-weight: 600; } .lane > header span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.deal { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.deal:hover { border-color: var(--line-strong); } .deal.dragging { opacity: .45; }
.deal .who { font-weight: 600; } .deal .proj { color: var(--ink-2); font-size: 13px; }
.deal .amt { font-weight: 700; margin: 5px 0 6px; }
.deal .meta { font-size: 12px; color: var(--muted); display: grid; gap: 2px; }
.deal .meta b { color: var(--ink-2); font-weight: 500; }
.deal .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 6px; }
.deal select { height: 26px; padding: 0 6px; font-size: 12px; width: auto; max-width: 130px; color: var(--muted); }

/* ---------- Detail headers ---------- */
.hero { padding: 18px 20px; margin-bottom: 16px; display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.hero h1 { font-size: 22px; }
.hero .path { display: flex; gap: 6px; align-items: center; margin-top: 6px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.hero .big { font-size: 20px; font-weight: 700; letter-spacing: -.02em; } .hero .big small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.hero .figs { display: flex; gap: 26px; flex-wrap: wrap; }
.dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; overflow-wrap: anywhere; }
.lifecycle { display: flex; gap: 0; overflow-x: auto; padding: 16px 16px 14px; }
.lifecycle .step { flex: 1; min-width: 96px; text-align: center; position: relative; font-size: 12px; color: var(--muted); }
.lifecycle .step::before { content: ""; position: absolute; top: 11px; left: -50%; right: 50%; height: 2px; background: var(--border); }
.lifecycle .step:first-child::before { display: none; }
.lifecycle .step.done::before { background: var(--green); }
.lifecycle .step i { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); background: var(--card); display: grid; place-items: center; margin: 0 auto 6px; color: #fff; font-style: normal; }
.lifecycle .step.done i { background: var(--green); border-color: var(--green); } .lifecycle .step.done { color: var(--ink); font-weight: 500; }
.lifecycle .step.next i { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.lifecycle .step button { display: block; margin: 4px auto 0; }
.lifecycle .step i svg { width: 13px; height: 13px; stroke-width: 3; }
.progress { height: 6px; border-radius: 999px; background: var(--soft-2); overflow: hidden; min-width: 70px; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.note-form { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.note-form textarea { min-height: 38px; height: 38px; }
.history > div { padding: 10px 16px; border-bottom: 1px solid var(--border-soft); display: flex; gap: 12px; }
.history > div:last-child { border-bottom: 0; }
.history .when { width: 84px; flex: none; font-size: 12.5px; color: var(--muted); padding-top: 1px; }

/* ---------- Estimate editor ---------- */
.items input, .items select { padding: 6px 8px; font-size: 13px; }
.items td { padding: 4px 5px; border-bottom: 0; vertical-align: middle; } .items th { padding: 7px 5px; background: none; }
.items .c-cat { width: 13%; } .items .c-qty { width: 8%; } .items .c-unit { width: 9%; } .items .c-price { width: 12%; } .items .c-tax { width: 44px; text-align: center; } .items .c-total { width: 11%; } .items .c-x { width: 34px; }
.totals { margin-left: auto; width: 300px; max-width: 100%; }
.totals div { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; gap: 10px; }
.totals input { width: 110px; text-align: right; padding: 5px 8px; }
.totals .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 9px; font-size: 20px; font-weight: 700; }
.banner { border-radius: 9px; padding: 11px 14px; margin-bottom: 16px; border: 1px solid; }
.banner.ai { background: var(--purple-wash); border-color: var(--purple-line); color: var(--purple-text); }
.banner.ok { background: var(--green-wash); border-color: var(--green-line); display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.banner.ok img { max-width: 220px; max-height: 70px; background: #fff; border-radius: 6px; padding: 4px 8px; }

/* ---------- Calendar ---------- */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-bar .actions { display: flex; gap: 6px; align-items: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal .dow { padding: 8px 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--soft); text-transform: uppercase; letter-spacing: .04em; }
.cal .day { min-height: 108px; padding: 5px 5px 7px; border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); cursor: pointer; min-width: 0; }
.cal .day:nth-child(7n) { border-right: 0; } .cal .day:hover { background: var(--soft); } .cal .day.other { background: var(--soft); } .cal .day.other .dnum { color: var(--faint); }
.cal .dnum { font-size: 12.5px; font-weight: 600; padding: 2px 5px 4px; }
.cal .day.today .dnum { display: inline-block; background: var(--blue); color: #fff; border-radius: 999px; padding: 1px 8px; margin-bottom: 3px; }
.cal.week .day { min-height: 340px; }
.chip { display: block; width: 100%; text-align: left; font: 400 12px/1.25 var(--font); padding: 4px 6px; margin: 0 0 3px; border: 0; border-left: 3px solid var(--blue); border-radius: 4px; background: var(--blue-wash); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal.week .chip { white-space: normal; padding: 6px 7px; }
.chip:hover { filter: brightness(.97); }
.chip.t-estimate_review { border-left-color: var(--purple); background: var(--purple-wash); } .chip.t-job_start { border-left-color: var(--gold); background: var(--gold-wash); }
.chip.t-meeting, .chip.t-other { border-left-color: var(--faint); background: var(--soft-2); }
.chip.completed { opacity: .6; } .chip.cancelled, .chip.no_show { text-decoration: line-through; opacity: .5; }
.cal .more { border: 0; background: none; color: var(--blue); font-size: 12px; padding: 2px 6px; cursor: pointer; }

/* ---------- Communications ---------- */
.split { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.conv { cursor: pointer; } .conv.on { background: var(--blue-wash); }
.conv .cico { width: 34px; height: 34px; border-radius: 50%; background: var(--soft-2); display: grid; place-items: center; flex: none; color: var(--ink-2); }
.conv.in .cico { background: var(--green-wash); color: var(--green-ink); } .conv.out .cico { background: var(--blue-wash); color: var(--blue); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kv div { background: var(--soft); border: 1px solid var(--border-soft); border-radius: 8px; padding: 9px 11px; } .kv span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; } .kv b { font-weight: 600; }
.transcript { background: var(--bg); border-radius: 8px; padding: 12px 14px; max-height: 320px; overflow: auto; }
.transcript p { margin: 0 0 8px; } .transcript b { font-weight: 600; }

/* ---------- Charts ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font: 11px var(--font); fill: var(--muted); }
.hbar { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar .track { height: 10px; background: var(--soft-2); border-radius: 999px; overflow: hidden; } .hbar .track i { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.funnel { display: grid; gap: 8px; } .funnel div { display: grid; grid-template-columns: 80px minmax(0, 1fr) 60px; gap: 10px; align-items: center; }
.funnel i { display: block; height: 26px; border-radius: 6px; background: var(--blue); min-width: 4px; } .funnel div:nth-child(2) i { background: var(--purple); } .funnel div:nth-child(3) i { background: var(--green); }

/* ---------- Sign-in ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--sidebar); }
.gate .box { width: min(430px, 100%); background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-pop); }
.gate .inner { padding: 26px 28px 28px; }
.gate .brand { color: var(--ink); padding: 0 0 18px; } .gate .brand span { color: var(--muted); }

.hours { display: grid; grid-template-columns: 60px 1fr 1fr 80px; gap: 6px 10px; align-items: center; }
.steps { list-style: none; margin: 0; padding: 0; } .steps li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); } .steps li:last-child { border-bottom: 0; }
.steps .dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); flex: none; margin-top: 2px; } .steps .dot.ok { background: var(--green); border-color: var(--green); }
.copyrow { display: flex; gap: 8px; margin-bottom: 10px; } .copyrow input { font-size: 12.5px; }
details { border-top: 1px solid var(--border-soft); padding: 10px 0; } details summary { cursor: pointer; font-weight: 500; }
.print-sheet { display: none; }
.scrim { display: none; }

/* ---------- Smaller screens ---------- */
@media (max-width: 1280px) { .kpis, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .18s; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 35; }
  .topbar .hamb { display: grid; }
  .cols-2-1, .cols-2, .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .topbar { padding: 10px 14px; } .content { padding: 16px 14px 50px; }
  .kpis, .stats { grid-template-columns: minmax(0, 1fr); }
  .cmd kbd { display: none; } .cmd input { padding-right: 12px; }
  .fgrid, .grid2, .grid3 { grid-template-columns: 1fr; }
  .items { min-width: 720px; }
  .cal .day { min-height: 70px; padding: 3px; } .cal.month .chip { font-size: 10.5px; padding: 2px 3px; border-left-width: 2px; }
  .cal.week { grid-template-columns: 1fr; } .cal.week .day { min-height: 0; border-right: 0; }
  .timeline .tl { grid-template-columns: 54px 14px minmax(0, 1fr); } .timeline .tl .act { grid-column: 3; padding: 0 0 12px; }
  .greet h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Printing an estimate ---------- */
@media print {
  body { background: #fff; font-size: 12.5px; }
  .app, #toast, dialog, .menu, .panel-pop { display: none !important; }
  .print-sheet { display: block; padding: 0 6px; }
  .print-sheet .ph { display: flex; justify-content: space-between; border-bottom: 3px solid #000; padding-bottom: 12px; margin-bottom: 16px; }
  .print-sheet h1 { font-size: 24px; }
  .print-sheet .two { display: flex; justify-content: space-between; gap: 30px; margin-bottom: 16px; }
  .print-sheet th { border-bottom: 1.5px solid #000; color: #000; background: none; }
  .print-sheet td { border-bottom: 1px solid #ccc; padding: 6px 12px; }
  .print-sheet .cat td { font-weight: 600; background: #f1f1f1; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-sheet .totals { margin-top: 12px; }
  .print-sheet .sig { display: flex; gap: 40px; margin-top: 30px; align-items: flex-end; }
  .print-sheet .sig > div { flex: 1; font-size: 12px; }
  .print-sheet .sig .mark { height: 64px; display: flex; align-items: flex-end; }
  .print-sheet .sig .mark img { max-height: 64px; max-width: 260px; }
  .print-sheet .sig .cap { border-top: 1px solid #000; padding-top: 4px; }
  .print-sheet .terms { margin-top: 18px; white-space: pre-wrap; }
}

/* ---------- Layout refinements ---------- */
.kpi .lbl { grid-column: 2 / span 2; grid-row: 1; padding-right: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .more { position: absolute; top: 12px; right: 10px; }
.kpi .val { grid-row: 2; }
.kpi .cmp { grid-row: 3; }
.mini-board { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1280px) { .mini-board { grid-template-columns: repeat(5, minmax(140px, 1fr)); } }
.deal .ai-tag { white-space: normal; border-radius: 8px; }
.stats { align-items: stretch; }
@media (max-width: 700px) {
  .topbar .spacer { display: none; }
  .topbar .btn.primary { padding: 0 11px; }
  .card > header { flex-wrap: wrap; gap: 6px; }
  .card > header .ttl .muted.small { display: none; }
  .insight { flex-wrap: wrap; }
  .insight .grow { flex-basis: calc(100% - 100px); }
  .insight .btn { margin-left: 49px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .hero .figs { gap: 16px; }
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Photos ---------- */
.photo-box { margin-top: 14px; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.photo-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo { margin: 0; position: relative; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; background: var(--soft-2); }
.photo figcaption { font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo .pdel { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(17, 24, 39, .72); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo .pdel svg { width: 14px; height: 14px; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.photo-actions label.btn { cursor: pointer; }

/* ---------- Assistant ---------- */
.assist-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; height: 46px; padding: 0 18px 0 14px; border-radius: 999px; border: 0; background: var(--purple); color: #fff; font: 600 14px var(--font); display: flex; align-items: center; gap: 8px; cursor: pointer; box-shadow: 0 10px 28px rgba(124, 58, 237, .38); }
.assist-fab:hover { background: #6d28d9; }
.assist { position: fixed; right: 22px; bottom: 22px; z-index: 70; width: 400px; max-width: calc(100vw - 24px); height: min(620px, calc(100vh - 44px)); background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: hidden; }
.assist[hidden], .assist-fab[hidden] { display: none; }
.assist > header { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border-soft); }
.assist > header .ttl, .assist > header > div { display: flex; align-items: center; gap: 8px; }
.assist-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--soft); }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.assistant p { margin: 0 0 6px; } .msg.assistant p:last-child { margin: 0; } .msg.assistant ul { margin: 2px 0 6px; padding-left: 18px; }
.msg.thinking { color: var(--muted); font-style: italic; }
.assist-empty { margin: auto 0; text-align: center; color: var(--ink-2); } .assist-empty p { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.chipbtn { border: 1px solid var(--border); background: var(--card); border-radius: 9px; padding: 8px 10px; font: 500 13px var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.chipbtn:hover { border-color: var(--purple); color: var(--purple-ink); }
.assist form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border-soft); align-items: flex-end; }
.assist form textarea { flex: 1; resize: none; min-height: 38px; max-height: 120px; }
.assist-foot { margin: 0; padding: 0 12px 9px; font-size: 11px; color: var(--muted); }
@media (max-width: 700px) { .assist { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; border-radius: 0; } .assist-fab span { display: none; } .assist-fab { padding: 0; width: 48px; justify-content: center; right: 14px; bottom: 14px; } }
@media print { .assist, .assist-fab { display: none !important; } }

/* ---------- Switch ---------- */
.switch { flex: none; width: 44px; height: 26px; border-radius: 999px; border: 0; background: var(--line-strong); position: relative; cursor: pointer; padding: 0; transition: background .15s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .15s; }
.switch[aria-checked=true] { background: var(--green); } .switch[aria-checked=true] i { transform: translateX(18px); }

label.field[hidden] { display: none; }

.tlink { color: inherit; font-weight: 500; } .tlink:hover { color: var(--blue); }
.history > div.fresh { background: var(--blue-wash); border-radius: 8px; }

/* ---------- Lead Autopilot ---------- */
.ap-flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.ap-flow > div { padding: 12px 14px 13px; border-right: 1px solid var(--border-soft); display: grid; gap: 2px; align-content: start; }
.ap-flow > div:last-child { border-right: 0; }
.ap-flow .n { width: 28px; height: 28px; border-radius: 8px; background: var(--purple-wash); color: var(--purple); display: grid; place-items: center; margin-bottom: 6px; }
.ap-flow .n svg { width: 15px; height: 15px; }
.ap-flow b { font-size: 13px; } .ap-flow small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.ap-flow .you { background: var(--blue-wash); } .ap-flow .you .n { background: var(--blue); color: #fff; }
.ap-h { font-size: 15px; margin: 22px 2px 10px; display: flex; align-items: center; gap: 8px; }
.ap-h .count { font-size: 12px; font-weight: 600; background: var(--border); color: var(--ink-2); border-radius: 999px; padding: 0 8px; line-height: 20px; }
.ap-card { border-color: var(--blue-line); box-shadow: 0 1px 2px rgba(37, 99, 235, .08); }
.ap-lines { border: 1px solid var(--border-soft); border-radius: 9px; }
.ap-line { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border-soft); }
.ap-line:last-child { border-bottom: 0; }
.ap-line .grow { min-width: 0; display: grid; } .ap-line b { font-weight: 500; }
.ap-line label { position: relative; flex: none; margin: 0; }
.ap-line .cur { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ap-line input { width: 112px; padding-left: 20px; text-align: right; font-variant-numeric: tabular-nums; }
.ap-line.need input { border-color: var(--amber); background: var(--amber-wash); }
.ap-line .lt { width: 84px; text-align: right; color: var(--muted); flex: none; }
.ap-open { margin-top: 12px; color: var(--ink-2); } .ap-open ul, .ap-card .ai-note ul { margin: 4px 0 0; padding-left: 20px; }
.ap-flag { background: var(--amber-wash); border: 1px solid var(--amber-line); color: var(--amber-text); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ap-foot { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border-soft); background: var(--soft); border-radius: 0 0 var(--radius) var(--radius); }
.ap-foot > div:first-child { display: grid; } .ap-total { font-size: 22px; line-height: 1.2; }
.ap-need.warn { color: var(--amber-ink); } .ap-need.ok { color: var(--green-ink); }
.ap-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.lg svg { width: 16px; height: 16px; }
.list > .ap-row { align-items: center; flex-wrap: wrap; }
.ap-row .grow { min-width: 220px; flex: 1; }
.ap-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ap-track { list-style: none; display: flex; gap: 0; margin: 8px 0 0; padding: 0; max-width: 620px; }
.ap-track li { flex: 1; min-width: 0; position: relative; padding-top: 14px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-track li::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: var(--border); }
.ap-track li:last-child::before { right: auto; width: 10px; }
.ap-track li i { position: absolute; left: 0; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--border); }
.ap-track li.done { color: var(--ink-2); } .ap-track li.done::before { background: var(--blue); } .ap-track li.done i { background: var(--blue); border-color: var(--blue); }
.ap-track li.cur { color: var(--blue-dark); font-weight: 600; } .ap-track li.cur i { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.ap-track li.skip { text-decoration: line-through; } .ap-track li.lost i { background: var(--red); border-color: var(--red); } .ap-track li.lost { color: var(--red-ink); }
.ap-callout { display: flex; align-items: center; gap: 14px; background: var(--blue-wash); border: 1px solid var(--blue-line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; color: var(--ink); }
.ap-callout:hover { text-decoration: none; border-color: var(--blue); }
.ap-callout .n { width: 36px; height: 36px; border-radius: 9px; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; }
.ap-callout .grow { display: grid; min-width: 0; flex: 1; } .ap-callout small { color: var(--muted); }
.banner.ap-status { background: var(--blue-wash); border-color: var(--blue-line); color: var(--ink); display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.banner.ap-status svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 6px; color: var(--blue); }
.ap-send { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) { .ap-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ap-flow > div:nth-child(3) { border-right: 0; } .ap-flow > div:nth-child(-n+3) { border-bottom: 1px solid var(--border-soft); } }
@media (max-width: 700px) {
  .ap-flow { display: none; }
  .ap-line { flex-wrap: wrap; gap: 6px 10px; } .ap-line .grow { flex-basis: 100%; } .ap-line label { flex: 1; } .ap-line input { width: 100%; height: 42px; font-size: 16px; } .ap-line .lt { width: auto; min-width: 70px; }
  .ap-foot { flex-direction: column; align-items: stretch; } .ap-btns .btn { flex: 1; justify-content: center; } .ap-btns .btn.primary { order: -1; flex-basis: 100%; height: 48px; font-size: 15px; }
  .ap-track li span { display: none; } .ap-track li.cur span { display: inline; } .ap-track li.cur { overflow: visible; }
  .ap-acts { width: 100%; } .ap-callout .btn { display: none; }
  .ap-send .btn { flex: 1 1 100%; justify-content: center; height: 46px; }
}

/* ---------- Schedule kinds, time clock, daily log, before and after, campaigns, custom reports ---------- */
label.check[hidden] { display: none; }
.cal-bar .kinds { margin-left: 12px; } .seg .count { font-size: 11px; opacity: .7; margin-left: 6px; }
.chip.k-job { border-left-color: var(--gold); background: var(--gold-wash); }
.chip.allday { background: var(--gold-wash-2); border-left-color: #d97706; font-weight: 500; }
.cal-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 5px 0 12px; vertical-align: -1px; background: var(--blue); }
.cal-legend .lg:first-child { margin-left: 0; } .cal-legend .lg.review { background: var(--purple); } .cal-legend .lg.job { background: var(--gold); } .cal-legend .lg.other { background: var(--faint); }
.tc { text-align: center; padding: 10px 6px 4px; }
.tc-state { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 3px 12px; border-radius: 999px; background: var(--soft-2); color: var(--ink-2); }
.tc.on .tc-state { background: var(--green-wash); color: var(--green-ink); } .tc.brk .tc-state { background: var(--amber-wash); color: var(--amber-ink); }
.tc-time { font-size: 52px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin-top: 8px; }
.tc-job { margin-bottom: 14px; }
.tc-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tc .btn.lg { height: 52px; padding: 0 26px; font-size: 16px; } .tc-in { width: 100%; max-width: 360px; justify-content: center; }
.tc-photo { margin-top: 10px; } .tc.off select { height: 44px; font-size: 15px; }
.tc-range { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; } .tc-range .field { margin: 0; } .tc-total { display: grid; text-align: right; margin-right: 6px; } .tc-total b { font-size: 20px; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ba-head { margin-bottom: 8px; } .ba-empty { border: 1px dashed var(--border); border-radius: 9px; padding: 18px 14px; color: var(--muted); font-size: 13px; }
.ba-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 16px; border-radius: 10px; overflow: hidden; }
.ba-pair figure { margin: 0; position: relative; } .ba-pair img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.ba-pair figcaption { position: absolute; left: 10px; top: 10px; background: rgba(15, 23, 42, .82); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 3px 9px; border-radius: 5px; }
.camp-prev { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--soft); }
.camp-prev.sms .msg { display: inline-block; background: var(--soft-2); border-radius: 16px 16px 16px 4px; padding: 9px 13px; max-width: 100%; overflow-wrap: anywhere; }
.camp-prev.email { background: var(--card); } .camp-prev .subj { font-weight: 600; border-bottom: 1px solid var(--border-soft); padding-bottom: 8px; margin-bottom: 10px; } .camp-prev.email .msg { overflow-wrap: anywhere; font-size: 13.5px; }
.rep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.rep-card { padding: 16px; display: grid; gap: 4px; color: inherit; } .rep-card:hover { text-decoration: none; border-color: var(--blue); }
.rep-card .n { width: 32px; height: 32px; border-radius: 8px; background: var(--blue-wash); color: var(--blue); display: grid; place-items: center; margin-bottom: 6px; }
.rep-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.rep-form .field { margin-bottom: 12px; } .rep-form div.field > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.rep-filter { display: grid; grid-template-columns: 1.1fr .9fr 1.4fr auto; gap: 6px; margin-bottom: 6px; } .rep-filter select, .rep-filter input { min-width: 0; }
.rep-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; } .rep-cols .check { margin: 0 0 5px; }
table.rep tfoot td { border-top: 2px solid var(--border); background: var(--soft); }
@media (max-width: 1100px) { .rep-layout { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .cal-bar { flex-wrap: wrap; } .cal-bar .kinds { margin: 8px 0 0; order: 3; width: 100%; display: flex; } .cal-bar .kinds button { flex: 1; padding: 0 6px; }
  .tc-time { font-size: 44px; } .tc-btns .btn { flex: 1; } .tc-photo { width: 100%; justify-content: center; }
  .ba { grid-template-columns: 1fr; } .rep-filter { grid-template-columns: 1fr 1fr; } .rep-cols { grid-template-columns: 1fr; }
  .tc-range .grow { display: none; } .tc-range .field { flex: 1; }
}

/* ---------- Import data ---------- */
.imp-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.imp-kind { text-align: left; padding: 18px; display: grid; gap: 6px; align-content: start; cursor: pointer; font: inherit; color: inherit; }
.imp-kind:hover { border-color: var(--blue); } .imp-kind b { font-size: 15px; }
.imp-kind .n { width: 36px; height: 36px; border-radius: 9px; background: var(--blue-wash); color: var(--blue); display: grid; place-items: center; margin-bottom: 4px; }
.imp-drop { display: grid; justify-items: center; gap: 6px; padding: 34px 16px; border: 2px dashed var(--border); border-radius: 12px; cursor: pointer; background: var(--soft); text-align: center; }
.imp-drop:hover, .imp-drop.over { border-color: var(--blue); background: var(--blue-wash); } .imp-drop svg { width: 26px; height: 26px; color: var(--blue); }
.imp-file { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; } .imp-file svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
table.imp-map td { vertical-align: middle; } table.imp-map select { min-width: 200px; } .imp-ex { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.imp-grp td { background: var(--soft); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.imp-problems { border: 1px solid var(--amber-line); background: var(--amber-wash); border-radius: 9px; padding: 10px 12px; } .imp-problems summary { cursor: pointer; }
.imp-problems .list > div { background: transparent; padding: 6px 0; align-items: center; }
@media (max-width: 700px) { table.imp-map select { min-width: 0; width: 100%; } table.imp-map th:nth-child(3), table.imp-map td.imp-ex { display: none; } }

/* Calendar on your phone */
.cal-steps { margin: 0 0 8px; padding-left: 20px; line-height: 1.6; } .cal-steps code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.cal-connect { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-top: 12px; }
.cal-connect .field { margin: 0; }
@media (max-width: 700px) { .cal-connect { grid-template-columns: 1fr; } }
.cal-reads, form[data-form="cal-choose"] fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0; display: grid; gap: 6px; }
form[data-form="cal-choose"] legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.cal-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.cal-status { display: flex; gap: 10px; align-items: flex-start; }
.cal-status > .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--orange, #f59e0b); flex: none; margin-top: 6px; } .cal-status > .dot.ok { background: var(--green); }
.chip.busy { background: repeating-linear-gradient(135deg, var(--soft-2), var(--soft-2) 6px, var(--soft) 6px, var(--soft) 12px); color: var(--ink-2); border-left-color: var(--faint) !important; cursor: default; }
.chip.busy.free { opacity: .6; }
.busy-row { color: var(--ink-2); }

/* Job costing */
.jc { display: grid; gap: 2px; }
.jc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.jc-row span { display: flex; flex-direction: column; } .jc-row small { color: var(--muted); font-size: 12px; font-weight: 400; }
.jc-row.total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 10px; font-size: 16px; }
tr.sum td { background: var(--bg); }

.stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stats.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .stats.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* To Do */
.todo-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.todo-chips span { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); }
.todo-chips span.on { background: var(--blue-wash); border-color: var(--blue-line); color: var(--ink); }
.todo-chips b { color: var(--ink); margin-right: 3px; }
.todo-group header a h2 { color: var(--ink); }
.todo-rows > .ap-row, .todo-rows > .insight, .todo-rows > .list > div { border-top: 1px solid var(--border); }
.todo-rows > :first-child, .todo-rows > .list:first-child > div { border-top: 0; }
.todo-rows > .insight { margin: 0; border-radius: 0; padding: 12px 16px; }
.todo-rows .ap-row { padding: 12px 16px; }
.todo-more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; flex-wrap: wrap; }
.todo-more > summary::-webkit-details-marker { display: none; }
.todo-more > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.todo-more[open] > summary::before { transform: rotate(90deg); }
.todo-more > summary .count { background: var(--bg); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.todo-more + .todo-more { margin-top: 12px; }
.todo-sub { font-size: 13px; margin: 6px 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.iico.sm { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--purple-wash); color: var(--purple); }
.iico.sm svg { width: 15px; height: 15px; }

/* Notifications */
.push-on { display: flex; gap: 10px; align-items: flex-start; }
.push-on .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-top: 6px; flex: none; }
.push-prefs { display: grid; gap: 10px; }

.crew-title { font-size: 16px; }

/* ---------- Email ---------- */
.mail { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 0 16px; align-items: start; }
.mail-folders { grid-column: 1 / -1; display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.mail-folders button { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 11px; margin-bottom: -1px; font: 500 13.5px var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; }
.mail-folders button svg { width: 15px; height: 15px; }
.mail-folders button:hover { color: var(--ink); }
.mail-folders button.on { color: var(--blue); border-bottom-color: var(--blue); }
.mail-folders .count { font-size: 11px; font-weight: 600; background: var(--blue); color: #fff; border-radius: 999px; padding: 0 6px; line-height: 17px; }
.mail-search { margin-left: auto; padding: 4px 0; flex: none; }
.mail-search input { width: 220px; }
.mail-list { max-height: calc(100dvh - 230px); overflow: auto; position: sticky; top: 12px; }
.mail-row { display: flex; gap: 10px; padding: 11px 14px 11px 10px; border-bottom: 1px solid var(--border-soft); color: inherit; text-decoration: none; }
.mail-row:hover { background: var(--soft); }
.mail-row:hover, .mail-row:focus, .mail-row:hover * { text-decoration: none; }
.mail-compose .mail-cc[hidden] { display: none; }
.mail-row.on { background: var(--blue-wash); }
.mail-row .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.mail-row.unread .dot { background: var(--blue); }
.mail-row .l1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mail-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; min-width: 0; }
.mail-row.unread .who, .mail-row.unread .subj { font-weight: 700; }
.mail-row .l1 .pill { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.mail-row .when { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; flex: none; }
.mail-row .when svg, .mail-row .who svg { width: 13px; height: 13px; }
.mail-row .who svg { vertical-align: -2px; margin-right: 2px; }
.mail-row .when svg.flag { color: var(--gold); }
.mail-row .subj { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.mail-row .subj svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 4px; }
.mail-row .snip { font-size: 12.5px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: 1px; }
.mail-row .snip svg { width: 12px; height: 12px; vertical-align: -2px; }
.mail-more { padding: 12px; text-align: center; }
.mail-read { min-width: 0; }
.mail-read > .card { overflow: hidden; min-height: 300px; }
.mail-read > .stack { min-width: 0; }
.mail-sub { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.mail-sub button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 4px 11px; font: 500 12.5px var(--font); color: var(--ink-2); cursor: pointer; }
.mail-sub button svg { width: 13px; height: 13px; }
.mail-sub button.on { background: var(--blue-wash); border-color: var(--blue-line); color: var(--blue-dark); }
.mail-sub button b { color: var(--blue); }
.mail-folders .count.grey { background: var(--soft-2); color: var(--ink-2); }
.mail-row .kind { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--blue-wash); color: var(--blue); }
.mail-row .kind svg { width: 12px; height: 12px; }
.mail-row .kind.in { background: var(--green-wash); color: var(--green-ink); }
.mail-row .kind.out { background: var(--soft-2); color: var(--ink-2); }
.mail-row .l1 .pill:not(.blue) { flex: none; }
.mail-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--border-soft); }
.mail-head h2 { font-size: 18px; margin: 0 0 12px; overflow-wrap: anywhere; }
.mail-back { display: none; margin: -4px 0 8px -8px; }
.mail-from { display: flex; gap: 10px; align-items: flex-start; }
.mail-from .avatar { width: 36px; height: 36px; background: var(--blue-wash); color: var(--blue-dark); }
.mail-from .grow > div { overflow-wrap: anywhere; }
.mail-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.mail-acts .spacer { flex: 1; }
.mail-acts svg, .mail-from .pill svg, .mail-att svg { width: 14px; height: 14px; }
.mail-atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px 0; }
.mail-att { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px; color: var(--ink); text-decoration: none; font-size: 13px; max-width: 100%; }
.mail-att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-att small { color: var(--muted); }
.mail-att .iconbtn { width: 22px; height: 22px; }
a.mail-att:hover { border-color: var(--blue); }
.mail-body { padding: 14px 18px 18px; }
.mail-frame { width: 100%; border: 0; min-height: 80px; display: block; background: #fff; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; }
.mail-quote { margin-top: 10px; color: var(--muted); }
.mail-quote summary { cursor: pointer; font-size: 12.5px; color: var(--blue); list-style: none; }
.mail-quote summary::before { content: '··· '; }
.mail-thread { border-top: 1px solid var(--border-soft); padding: 12px 18px 16px; }
.mail-thread > summary { cursor: pointer; color: var(--blue); font-size: 13px; }
.mail-tmsg { border-left: 3px solid var(--border); padding: 6px 0 6px 12px; margin-top: 12px; }
.mail-compose .mail-cc { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.mail-compose textarea { font: 14px/1.5 var(--font); min-height: 220px; }
.mail-compose div.field > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.mail-files { display: flex; flex-wrap: wrap; gap: 8px; }
.mail-cust .mail-row { padding-left: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 12px; }
.steps-list { margin: 0 0 12px; padding-left: 20px; } .steps-list li { margin-bottom: 6px; }
@media (max-width: 900px) {
  .mail { grid-template-columns: minmax(0, 1fr); }
  .mail .mail-read { display: none; }
  .mail.reading .mail-list, .mail.reading .mail-folders { display: none; }
  .mail.reading .mail-read { display: block; }
  .mail-list { max-height: none; position: static; }
  .mail-back { display: inline-flex; }
  .mail-search { margin-left: 8px; } .mail-search input { width: 150px; }
}
@media (max-width: 700px) {
  .mail-head { padding: 12px 14px 10px; } .mail-body { padding: 12px 14px 14px; } .mail-atts { padding: 10px 14px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .mail-compose .mail-cc { grid-template-columns: 1fr; }
}

/* Printing always uses the light colors. */
@media print {
  :root[data-theme="dark"] { --bg: #fff; --card: #fff; --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --border: #e2e8f0; --border-soft: #edf1f5; --soft: #fafbfc; --soft-2: #eef2f6; --faint: #94a3b8; color-scheme: light; }
}

/* Appearance picker in the user menu */
.menu .theme-pick { display: flex; gap: 4px; padding: 4px 6px 6px; }
.menu .theme-pick button { flex: 1; justify-content: center; gap: 5px; padding: 7px 6px; border: 1px solid var(--border); border-radius: 7px; font-size: 12.5px; }
.menu .theme-pick button.on { border-color: var(--blue); background: var(--blue-wash); color: var(--blue-dark); }
.menu .theme-pick button svg { width: 14px; height: 14px; }
