:root {
  --bg: #f4f5f2; --panel: #ffffff; --ink: #1d2421; --muted: #66706b; --line: #dfe3dd;
  --accent: #1f7a5c; --accent-ink: #ffffff; --red: #b42318; --red-bg: #fdecea; --blue: #1d4ed8;
  --warn-bg: #fff4d6; --warn: #8a6100; --ai: #6d28d9; --ai-bg: #f1eafe; --human-bg: #e6f4ee;
  /* #97 themes: every color the app uses has a variable; app/static/themes.css holds the dark values and
     app.services.appearance writes the per-theme ones (backgrounds, text, accent) into the page head. */
  --panel-2: #eef0ec; --input-bg: #ffffff; --blue-bg: #e0e9ff; --selected: #eef6f2; --job-bg: #f3f8f5;
  --hour-line: #f0f2ee; --ai-line: #ddd0fb; --human-line: #c4e3d4; --green: #166534; --green-bg: #dcfce7;
  --dept: #3730a3; --dept-bg: #eef2ff; --warn-line: #f0d58a; --hover: rgba(11, 11, 11, .04); --on-red: #ffffff;
  --shadow: rgba(0, 0, 0, .08); --border: var(--line); --card: var(--panel);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14px; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: 12px; } .error { color: var(--red); }
.pre { white-space: pre-wrap; }
.btn { border: 1px solid var(--line); background: var(--panel); padding: 6px 12px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-danger { color: var(--red); border-color: var(--red); }
.btn.confirm { background: var(--warn-bg); border-color: var(--warn); }
.btn-link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg); color: var(--ink); }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.tag-red { background: var(--red-bg); color: var(--red); } .tag-blue { background: var(--blue-bg); color: var(--blue); }
.tag-ai { background: var(--ai-bg); color: var(--ai); } .tag-human { background: var(--human-bg); color: var(--accent); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; } .pill-warn { background: var(--warn-bg); color: var(--warn); } .pill-ok { background: var(--human-bg); color: var(--accent); }

/* The top bar reads --bar* variables (app.services.appearance): the panel color by default, the company's brand color
   when the page takes the company's colors (html.brand-bar). The fallbacks keep pages without the theme block as before. */
.topbar { display: flex; align-items: center; gap: 24px; padding: 0 16px; height: 52px; background: var(--bar, var(--panel)); border-bottom: 1px solid var(--bar-line, var(--line)); }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand-mark { background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 2px 6px; font-size: 12px; letter-spacing: .5px; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { padding: 6px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.topbar nav a.active { background: var(--human-bg); color: var(--accent); font-weight: 600; }
.topbar .brand { color: var(--bar-ink, var(--ink)); }
.topbar .brand-mark { background: var(--bar-mark, var(--accent)); color: var(--bar-mark-ink, var(--accent-ink)); }
.topbar .mainnav > a { color: var(--bar-ink, var(--ink)); }
html.brand-bar .topbar .mainnav > a.active { background: var(--bar-active); color: var(--bar-ink); }
html.brand-bar .topbar img.brand-logo { background: #fff; border-radius: 6px; padding: 2px 4px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-right form { margin: 0; }

.center-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; }
.login { width: min(360px, 100%); display: grid; gap: 12px; }
.login h1 { font-size: 18px; margin: 0; display: flex; gap: 8px; align-items: center; }
.login label { display: grid; gap: 4px; }

/* inbox */
.inbox { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 52px); }
.inbox-list { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.search { padding: 10px; } .search input { width: 100%; }
.search.wide { padding: 0 0 12px; max-width: 480px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px 8px; border-bottom: 1px solid var(--line); }
.tabs a { font-size: 12px; padding: 3px 8px; border-radius: 6px; text-decoration: none; color: var(--muted); }
.tabs a.active { background: var(--human-bg); color: var(--accent); font-weight: 600; }
.count { background: var(--red); color: var(--on-red); border-radius: 999px; padding: 0 5px; font-size: 10px; }
.conv-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.conv-list li a { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.conv-list li.selected a { background: var(--selected); }
.conv-list li.unread strong::before { content: "● "; color: var(--blue); }
.conv-list .empty { padding: 16px; }
.row-top { display: flex; justify-content: space-between; gap: 8px; }
.row-mid { margin: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.inbox-thread { min-width: 0; min-height: 0; }
.empty-state { padding: 48px; text-align: center; }
.thread-grid { display: grid; grid-template-columns: 1fr 320px; height: 100%; }
.thread-main { display: flex; flex-direction: column; min-height: 0; }
.thread-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.thread-head h2 { margin: 0; font-size: 17px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.banner { padding: 8px 16px; } .banner-red { background: var(--red-bg); color: var(--red); }
.messages { list-style: none; margin: 0; padding: 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 72%; }
.msg-meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.email-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.email-thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.msg-body { white-space: pre-wrap; padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.msg-outbound { align-self: flex-end; }
.msg-assistant .msg-body { background: var(--ai-bg); border-color: var(--ai-line); }
.msg-staff .msg-body { background: var(--human-bg); border-color: var(--human-line); }
.msg-internal { align-self: center; max-width: 90%; }
.msg-internal .msg-body { background: var(--warn-bg); border-style: dashed; font-size: 12px; }
.composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.composer textarea { flex: 1; resize: vertical; }
.thread-side { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 12px 16px; }
.thread-side h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 12px 0 6px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 8px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); text-transform: capitalize; } .kv dd { margin: 0; overflow-wrap: anywhere; }
.audit { list-style: none; padding: 0; margin: 0; font-size: 12px; display: grid; gap: 6px; }
.job-chip { display: block; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; text-decoration: none; color: inherit; }

/* dispatch */
.dispatch-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.dispatch-head h2 { margin: 0; font-size: 18px; } .dispatch-head form { margin: 0; }
.dispatch { display: grid; grid-template-columns: 1fr 360px; gap: 16px; padding: 0 16px 16px; }
.board { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.board-gutter { width: 64px; flex: none; border-right: 1px solid var(--line); }
.col-head { height: 52px; padding: 6px 8px; border-bottom: 1px solid var(--line); font-weight: 600; }
.hour { height: 60px; font-size: 11px; color: var(--muted); padding: 2px 6px; border-bottom: 1px solid var(--hour-line); }
.board-col { flex: 1; min-width: 180px; border-right: 1px solid var(--line); }
.col-body { position: relative; }
.hour-line { height: 60px; border-bottom: 1px solid var(--hour-line); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.job { position: absolute; left: 4px; right: 4px; background: var(--job-bg); border: 1px solid var(--line); border-left: 4px solid; border-radius: 6px; padding: 4px 6px; font-size: 12px; overflow: hidden; color: inherit; text-decoration: none; }
.job.selected { outline: 2px solid var(--accent); }
.job.status-cancelled { opacity: .45; text-decoration: line-through; }
.job.status-completed { background: var(--panel-2); }
.job-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; align-self: start; }
.job-panel h3 { margin-top: 0; }
.status-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.reschedule .row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.slot-list { list-style: none; padding: 0; display: grid; gap: 4px; }
.slot-list .slot { width: 100%; text-align: left; }
.tag.status-en_route { background: var(--green-bg); color: var(--green); }
.omw { margin: 12px 0; } .omw-big { width: 100%; min-height: 56px; font-size: 1.15rem; font-weight: 700; }
.omw-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; } .omw-pick p { width: 100%; margin: 0; }
.omw-min { min-height: 48px; flex: 1 1 20%; }
.cu-row textarea { width: 100%; box-sizing: border-box; } .cu-tools { gap: 8px; align-items: center; }
.cu-out { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; } .cu-out.error { color: var(--danger, #b91c1c); }
.cu-status { display: grid; gap: 6px; } .cu-status.cu-live { border-color: var(--accent); }
.tag.status-scheduled { background: var(--blue-bg); color: var(--blue); } .tag.status-dispatched { background: var(--warn-bg); color: var(--warn); }
.tag.status-in_progress { background: var(--ai-bg); color: var(--ai); } .tag.status-completed { background: var(--human-bg); color: var(--accent); }
.tag.status-cancelled { background: var(--red-bg); color: var(--red); }

.email-row { margin-bottom: 4px; }

/* alerts */
.alert-card { margin-bottom: 10px; display: grid; gap: 6px; border-left: 4px solid var(--line); }
.alert-card.sev-critical { border-left-color: var(--red); }
.alert-card.sev-warning { border-left-color: var(--warn); }
.alert-card.sev-info { border-left-color: var(--blue); }
.alert-card .row { display: flex; gap: 6px; flex-wrap: wrap; }

/* settings */
.settings-form { display: grid; gap: 16px; max-width: 560px; }
.settings-form label { display: grid; gap: 6px; }

/* customers */
.page { padding: 16px; max-width: 1100px; }
.table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.plain { list-style: none; padding: 0; display: grid; gap: 8px; }
.property { margin-bottom: 8px; }

@media (max-width: 900px) {
  .dispatch:has(#new-job) .job-panel { order: -1; }
  .inbox, .thread-grid, .dispatch, .grid-2 { grid-template-columns: 1fr; height: auto; }
  .inbox-list { max-height: 40vh; }
  .topbar { flex-wrap: wrap; height: auto; padding: 8px 16px; gap: 8px; }
}

/* team */
.notice { background: var(--warn-bg); margin-bottom: 16px; display: grid; gap: 6px; }
.notice code { font-size: 1.1em; padding: 2px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input, .inline-form select { min-width: 0; }
.team-users input.u-name { width: 100%; min-width: 120px; }
.team-users tr.inactive td, .tech-card.inactive { opacity: 0.6; }
.nowrap { white-space: nowrap; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tech-card { display: grid; gap: 8px; align-content: start; }
.tech-card label { display: flex; gap: 6px; align-items: center; }
.tech-card .row-top input[name=name] { flex: 1; min-width: 0; }
.tech-card .skills { display: flex; gap: 12px; flex-wrap: wrap; }
.tech-card .hours { border-collapse: collapse; }
.tech-card .hours td { padding: 2px 4px 2px 0; }
.tech-card .hours input[type=time] { width: 7.5em; }
.page.narrow { max-width: 560px; }
.small.error, .error { color: var(--red); }
@media (max-width: 700px) { .team-users { display: block; overflow-x: auto; } }

/* settings: checkbox with its label on one line */
.inline-check { display: flex; align-items: center; gap: .5rem; flex-direction: row; }
.inline-check input { width: auto; }

/* ------------------------------------------------------------- phone calls */
.tag-sim { background: var(--warn-bg); color: var(--warn); font-weight: 600; letter-spacing: .02em; }
.call-grid, .sim-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 800px) { .call-grid, .sim-grid { grid-template-columns: 1fr; } }
.transcript { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.transcript li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); }
.transcript .who { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.transcript .t-caller { background: var(--blue-bg); align-self: flex-end; max-width: 85%; }
.transcript .t-agent { background: var(--ai-bg); max-width: 85%; }
.transcript .t-note { background: var(--warn-bg); font-size: 13px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 12px 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; }
pre.code, .sim-log { background: #1d2421; color: #e7ece8; border-radius: 8px; padding: 10px; overflow-x: auto; font-size: 12px; }
.sim-log { list-style: none; margin: 0; max-height: 560px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.sim-log li { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Consolas, monospace; }
.sim-log .in { color: #9ecbff; } .sim-log .out { color: #b5f0c8; } .sim-log .note { color: #f3d27a; }
.sim-start { display: flex; flex-direction: column; gap: 10px; }
.sim-status { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.sim-say { display: flex; gap: 8px; } .sim-say input { flex: 1; min-width: 0; }
.sim-keypad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 10px; }
.sim-keypad .key { padding: 6px 0; font-variant-numeric: tabular-nums; }
.sim-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* Manual scheduling (dispatch board) */
.new-job-btn { margin-left: auto; }
.board.can-book .col-body { cursor: copy; }
.board.can-book .col-body .job { cursor: pointer; }
.new-job fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; }
.new-job legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.new-job input, .new-job select, .new-job textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; }
.new-job textarea { margin-top: 6px; resize: vertical; }
.new-job .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.new-job .grid2 .span2, .new-job .grid2 .btn-link { grid-column: 1 / -1; text-align: left; }
.new-job .row { display: flex; gap: 6px; margin-top: 8px; }
.new-job label.small { display: flex; gap: 6px; align-items: center; }
.new-job label.small input { width: auto; }
.pick-list { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; }
.pick-list button { width: 100%; text-align: left; }
.picked { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
#nj-addr-new { margin-top: 6px; }
/* Quick booking: Who -> What -> When, extras under More options */
.nj-step { border-top: 1px solid var(--line); padding: 10px 0 8px; }
.nj-step h4 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.nj-num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; display: inline-grid; place-items: center; }
.new-job #nj-search { padding: 9px 10px; font-size: 15px; }
.pick-list .nj-add { color: var(--accent); border-style: dashed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.chip { border: 1px solid var(--line); background: var(--panel); color: inherit; font: inherit; padding: 7px 12px; border-radius: 999px; cursor: pointer; min-height: 36px; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--human-bg); border-color: var(--accent); color: var(--accent); font-weight: 600; }
#nj-addr { margin-top: 8px; }
.slot-days { display: grid; gap: 8px; }
.slot-day-name { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.slot-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.slot-days .slot { border: 1px solid var(--line); background: var(--panel); color: inherit; font: inherit; border-radius: 8px; padding: 7px 8px; text-align: left; cursor: pointer; display: grid; gap: 1px; min-height: 44px; }
.slot-days .slot:hover { border-color: var(--accent); }
.slot-days .slot b { font-size: 13px; }
.slot-days .slot span { font-size: 11px; color: var(--muted); }
.slot-days .slot.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.slot-days .slot.on span { color: var(--accent-ink); }
.nj-chosen { background: var(--human-bg); color: var(--accent); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.nj-more { border-top: 1px solid var(--line); padding: 8px 0; }
.nj-more summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 4px 0; }
.nj-more > label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.nj-more > label select { color: var(--ink); }
.nj-exact { margin-top: 10px; display: grid; gap: 4px; }
.nj-more label.check { display: flex; color: var(--ink); }
.nj-exact .btn-small { justify-self: start; }
.new-job .nj-book { width: 100%; padding: 11px; font-size: 15px; margin: 8px 0 6px; }
.new-job .nj-book:disabled { opacity: .55; cursor: default; }
.check-group { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.check-group legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.skills .muted.small { display: block; width: 100%; }

.help section { margin: 12px 0; }
.help h3 { margin-top: 0; }
.help-toc { padding: 10px 16px; }

.support-banner { background: var(--red); color: var(--on-red); padding: 8px 16px; font-weight: 600; }
.support-banner .btn-link { color: var(--on-red); text-decoration: underline; }
form.inline { display: inline; }

/* Platform admin */
/* Platform admin bar: dark gray until VisionaryIT's branding is synced (then html.brand-bar and the theme's --bar*). */
html:not(.brand-bar) .admin-topbar { --bar: #1f2937; --bar-ink: #f9fafb; --bar-muted: #e5e7eb; --bar-active: rgba(255,255,255,.12);
  --bar-mark: var(--accent); --bar-mark-ink: var(--accent-ink); }
.admin-topbar .muted, .admin-topbar .btn-link { color: var(--bar-ink); }
.brand-sub { font-weight: 400; font-size: 13px; color: var(--bar-muted, var(--muted)); }
.brand-now .brand-logo { height: 28px; } .brand-now .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); vertical-align: middle; }
.admin-login-brand { display: flex; align-items: center; gap: 10px; } .admin-login-brand .brand-logo { height: 44px; }
html.brand-bar body.center-page { background: var(--bg); }
.admin-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.admin-head h2 { margin: 0; }
.admin-head .btn-primary { margin-left: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--panel); }
.admin-table th, .admin-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table .num { text-align: right; }
.admin-table tr.inactive { opacity: .55; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; margin: 12px 0; }
.admin-grid .card, section.card { margin-bottom: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 22px; }
.narrow-form { max-width: 640px; }
.answer-row { display: grid; grid-template-columns: 140px 1fr 2fr auto auto; gap: 6px; align-items: start; }
@media (max-width: 800px) { .answer-row { grid-template-columns: 1fr; } }
.link-box { display: flex; gap: 8px; align-items: center; background: var(--panel-2); padding: 8px; border-radius: 6px; overflow-x: auto; }
.mono { font-family: ui-monospace, monospace; word-break: break-all; }
.num-input { width: 80px; }
.ok-note { color: var(--accent); font-weight: 400; }

/* customer edits */
.btn-small { padding: 2px 10px; font-size: 0.85em; }
.edit-box { margin: 6px 0 10px; }
.edit-box > summary { list-style: none; display: inline-block; cursor: pointer; }
.edit-box > summary::-webkit-details-marker { display: none; }
.edit-box[open] > summary { margin-bottom: 8px; }
.edit-box .inline-form label, .edit-inline .inline-form label { display: flex; flex-direction: column; font-size: 0.85em; gap: 2px; }
.inline-form input.short { width: 7em; }
/* Edit button on the same line as what it edits (#106; macro in _edit_inline.html). The wrapper's first child is the
   line; the summary is pinned to that line's right end (or right after the text with .fit) and the form opens below. */
.edit-line { position: relative; }
.edit-line.fit { width: fit-content; max-width: 100%; }
.edit-line > :first-child { padding-right: 80px; min-height: 24px; }
.edit-inline { margin: 0; }
.edit-inline > summary { position: absolute; top: var(--ei-top, 0); right: 0; list-style: none; cursor: pointer;
  white-space: nowrap; line-height: 1.4; }
.edit-inline > summary::-webkit-details-marker { display: none; }
.edit-inline[open] { margin: 6px 0 12px; }
.edit-inline .ei-close, .edit-inline[open] .ei-open { display: none; }
.edit-inline[open] .ei-close { display: inline; }
.edit-line > h2:first-child ~ .edit-inline > summary { top: 6px; }
.edit-line > h3:first-child ~ .edit-inline > summary, .edit-line > h4:first-child ~ .edit-inline > summary { top: -1px; }
.edit-line > p:first-child { margin-bottom: 4px; }
.kv-head { margin: 12px 0 6px; font-size: 13px; }
.equip-item.edit-line > .edit-inline > summary { top: 8px; right: 10px; }
.prop-head { margin-bottom: 6px; }
@media (max-width: 700px) {  /* buttons are 40px tall on phones: centre the label and leave the line room for it */
  .edit-inline > summary { display: inline-flex; align-items: center; }
  .edit-line > :first-child { min-height: 40px; }
}

/* customer import */
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.import-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; margin-bottom: 10px; }
.import-fields label { display: flex; flex-direction: column; font-size: 0.85em; gap: 2px; }

/* branding */
.brand-logo { height: 40px; max-width: 170px; object-fit: contain; vertical-align: middle; margin-right: 4px; }
.brand-preview { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 12px; border: 1px dashed var(--line); border-radius: 8px; }
.brand-preview .logo-box { width: 180px; height: 90px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.brand-preview .logo-box img { max-width: 170px; max-height: 82px; object-fit: contain; }
.brand-preview .sample-btn { border: 0; border-radius: 999px; padding: 8px 16px; font-weight: 600; }
.brand-preview .sample-bubble { border-radius: 12px; padding: 7px 11px; max-width: 220px; }
input[type=color] { width: 44px; height: 32px; padding: 2px; vertical-align: middle; }
.busy-note { margin: 4px 0 8px; padding: 8px 10px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
           border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
/* setup checklist + advanced folds (Settings) */
.setup-list, .advanced { margin-bottom: 16px; }
.setup-list > summary, .advanced > summary { cursor: pointer; }
.setup-list ol { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.setup-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.setup-list .tick { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 2px solid var(--line);
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; }
.setup-list li.done .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
.setup-list li.done a { color: inherit; }
.advanced[open] > summary { margin-bottom: 14px; }
.advanced .check-group { flex-direction: column; }
.settings-form label.inline-check { display: flex; gap: 8px; align-items: center; }
.settings-form label .label-line { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
#people { margin-bottom: 16px; }
#people .edit-box { display: inline-block; }
#people .edit-box[open] { display: block; margin: 8px 0; }
tr.unheard td { font-weight: 600; }
[hidden] { display: none !important; }

/* job checklist link on the Dispatch job panel */
.checklist-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 12px 14px;
  border: 1px solid var(--accent); border-radius: 10px; background: var(--human-bg); color: var(--ink); text-decoration: none; }
.checklist-link > span:first-child { display: grid; gap: 2px; }
.checklist-go { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* Settings > Website: copy the current site */
.site-copy { border: 1px dashed var(--accent); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; background: var(--human-bg); }
.site-copy p { margin: 6px 0; }
.site-copy .row { display: flex; gap: 8px; flex-wrap: wrap; }
.site-copy input { flex: 1; min-width: 220px; }

/* platform admin: phone system */
.routing-form { display: grid; gap: 14px; }
.routing-form label { display: grid; gap: 5px; font-size: 13px; }
.routing-form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 10px; }
.routing-form legend { font-weight: 600; padding: 0 4px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.menu-table input, .menu-table select { width: 100%; box-sizing: border-box; }
.menu-table td:first-child { width: 64px; }
.menu-ring { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
@media (max-width: 800px) { .grid-3, .menu-ring { grid-template-columns: 1fr; } }
.routing-form .check-group label { display: flex; gap: 6px; align-items: center; }
.user-email { display: flex; gap: 6px; margin-top: 4px; }
.user-email input { min-width: 0; flex: 1; font-size: 12px; padding: 3px 6px; }
.tag-dept { background: var(--dept-bg); color: var(--dept); }
.u-depts .inline-check { display: inline-flex; gap: 3px; margin-right: 8px; white-space: nowrap; }
.appt { max-width: 460px; }
.appt-logo { max-height: 52px; max-width: 220px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.appt-form { display: grid; gap: 8px; margin: 12px 0; }
.appt-slot { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.appt-cancel { margin-top: 12px; }
.appt-cancel form { display: grid; gap: 8px; margin-top: 8px; }

/* ------------------------------------------------------------ invoices */
.table .num, .inv-lines .num { text-align: right; white-space: nowrap; }
.inv-lines input { width: 100%; }
.inv-lines input.short { width: 6em; text-align: right; }
.inv-totals { max-width: 280px; margin-left: auto; }
.inv-totals dd { text-align: right; }
.billing-tabs { border-bottom: 0; padding: 0; }
.plain-link { text-decoration: none; color: inherit; }
.stat strong.red, .red { color: var(--red); }
.tag.inv-draft { background: var(--panel-2); color: var(--muted); }
.tag.inv-sent, .tag.inv-viewed { background: var(--blue-bg); color: var(--blue); }
.tag.inv-partial { background: var(--warn-bg); color: var(--warn); }
.tag.inv-paid { background: var(--human-bg); color: var(--accent); }
.tag.inv-overdue, .tag.inv-void { background: var(--red-bg); color: var(--red); }
.invoice-page .card h3 { margin-top: 1em; }
.invoice-page .card h3:first-child { margin-top: 0; }

/* phones + installed app (PWA / native wrapper): respect notches, no sideways page scroll */
html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; } /* clip: no scroll box, so short pages do not cut off open menus */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); }
.topbar { padding-top: env(safe-area-inset-top); min-height: calc(52px + env(safe-area-inset-top)); }
.dispatch > *, .inbox > *, .thread-grid > *, .grid-2 > * { min-width: 0; }
.table { max-width: 100%; }
img, video { max-width: 100%; }
@media (max-width: 900px) { .topbar { padding-top: max(8px, env(safe-area-inset-top)); } }
@media (max-width: 700px) {
  body { font-size: 15px; }
  .topbar { gap: 6px; padding-left: 12px; padding-right: 12px; }
  .topbar nav { flex-wrap: wrap; width: 100%; order: 3; }
  .topbar nav a { padding: 8px 10px; }
  .topbar-right { gap: 8px; flex-wrap: wrap; }
  .topbar-right .pill { display: none; }
  .page { padding: 12px; }
  .dispatch, .dispatch-head { padding-left: 12px; padding-right: 12px; }
  .btn, input, select, textarea { min-height: 40px; }
  input, select, textarea { font-size: 16px; } /* iOS zooms into smaller inputs */
  .table { display: block; overflow-x: auto; }
}
@media (display-mode: standalone) { .center-page { min-height: 100dvh; } }

/* bulk archive + search */
.bulk-bar { display: flex; gap: 8px; align-items: center; padding: 6px 10px; flex-wrap: wrap; }
.conv-list li { position: relative; }
.conv-list li .bulk-pick { position: absolute; left: 6px; top: 12px; z-index: 1; }
.conv-list li:has(.bulk-pick) > a { padding-left: 28px; }
.top-search input { width: 160px; padding: 5px 8px; }
@media (max-width: 900px) { .top-search { order: 4; width: 100%; } .top-search input { width: 100%; } }
.search-page-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-page-form input { flex: 1; max-width: 520px; }
.search-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
/* search (#107): filter chips, why-it-matched, highlighted snippets, and the as-you-type list under the topbar box */
.search-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.search-chip { padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); text-decoration: none; font-size: 13px; white-space: nowrap; }
.search-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.search-chip.on .muted { color: inherit; opacity: .8; }
.search-section h3 { margin: 16px 0 4px; font-size: 15px; }
.search-hit { padding: 8px 0; }
.search-hit-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.search-hit-top a { font-weight: 600; }
.search-why { font-size: 12px; color: var(--accent); }
.search-snippet { color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.search-snippet mark, .sd-snip mark { background: var(--warn-bg); color: var(--ink); padding: 0 1px; border-radius: 2px; }
.top-search { position: relative; }
.search-drop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 60; width: min(440px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow-y: auto; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px 0; }
.search-drop[hidden] { display: none; }
.sd-group { padding: 6px 12px 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sd-item { display: block; padding: 6px 12px; color: var(--ink); text-decoration: none; line-height: 1.3; }
.sd-item.active, .sd-item:hover { background: var(--selected); }
.sd-label { font-weight: 600; font-size: 14px; }
.sd-why { font-size: 12px; color: var(--accent); margin-left: 6px; font-weight: 400; }
.sd-sub, .sd-snip { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-all { border-top: 1px solid var(--line); margin-top: 4px; font-weight: 600; color: var(--accent); }
.sd-empty { padding: 10px 12px; font-size: 13px; color: var(--muted); }
@media (max-width: 900px) { .search-drop { width: 100%; } }

/* dispatch week view + drag to reschedule */
.week-wrap { overflow-x: auto; padding: 0 16px 16px; }
.week { width: 100%; border-collapse: collapse; background: var(--panel); min-width: 900px; }
.week th, .week td { border: 1px solid var(--line); vertical-align: top; padding: 4px; }
.week thead th { font-size: 13px; padding: 6px; }
.week thead th.today { background: var(--human-bg); }
.week-tech { width: 130px; text-align: left; font-size: 13px; white-space: nowrap; }
.week-cell { min-width: 110px; height: 70px; }
.week-job { display: block; border-left: 4px solid; background: var(--job-bg); border-radius: 4px; padding: 3px 5px; margin-bottom: 3px;
  font-size: 12px; text-decoration: none; color: inherit; }
.week-job[draggable=true], .job[draggable=true] { cursor: grab; }
.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--human-bg); }

/* HVAC job planner */
.planner-grid { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; }
.planner-grid > * { min-width: 0; }
.planner-form label { display: block; margin: 0 0 8px; }
.planner-form label > input, .planner-form label > select { display: block; width: 100%; margin-top: 2px; }
.planner-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.planner-form fieldset { border: 0; padding: 0; margin: 0 0 10px; }
.room-rows { width: 100%; border-collapse: collapse; }
.room-rows td { padding: 2px 2px; }
.room-rows input, .room-rows select { width: 100%; }
.room-rows .area { width: 70px; } .room-rows .floor { width: 46px; }
.plan-note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; }
.plan-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; }
.plan-stats .card { padding: 10px 12px; }
.plan-stats b { display: block; font-size: 1.25em; }
.plan-diagram { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; margin: 0 0 12px; }
.plan-diagram svg { max-width: 100%; height: auto; display: block; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.plan-section h3 { margin: 16px 0 6px; }
/* Job planner: house plans with routing layers (planner_sheets.js) */
.plan-sheets { margin-top: 16px; }
.ps-steps { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
.ps-tools, .ps-layers, .ps-zoom { margin: 6px 0; gap: 10px; }
.ps-layers label { display: inline-flex; align-items: center; gap: 4px; }
.ps-swatch { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; }
.ps-viewport { overflow: auto; max-height: 75vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ps-viewport svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; }
.ps-viewport svg.ps-crosshair { cursor: crosshair; }
.ps-room { fill: #6366f1; fill-opacity: 0.08; stroke: #4f46e5; }
.ps-room.sel { fill-opacity: 0.18; stroke: #1d4ed8; }
.ps-handle { fill: #fff; stroke: #1d4ed8; cursor: nwse-resize; }
.ps-side { margin-top: 10px; }
.ps-side h4 { margin: 12px 0 4px; }
.ps-trade { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.ps-trade h4 { margin: 0 0 6px; }
.ps-trade .table { margin-bottom: 8px; }
.plan-overlay-print { width: 100%; height: auto; display: block; border: 1px solid var(--line); }
@media (max-width: 900px) { .planner-grid { grid-template-columns: 1fr; } }
@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; font-size: 11px; }
  .plan-diagram { border: 0; page-break-inside: avoid; }
}
.room-rows .r-type { width: 86px; } .room-rows .r-name { min-width: 120px; }

/* ---- schedule import, blocked time, calendar invites ---- */
.job.blocked { background: repeating-linear-gradient(135deg, var(--panel-2), var(--panel-2) 6px, var(--line) 6px, var(--line) 12px);
  border-left-color: #94a3b8; color: var(--muted); z-index: 0; }
.job.blocked .block-del { float: right; }
.more-inline { position: relative; }
.more-inline > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.more-inline-body { position: absolute; right: 0; z-index: 20; min-width: 280px; margin-top: 6px; line-height: 1.8; }
.block-form { display: grid; gap: 6px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.block-form label { display: grid; font-size: 13px; }
.import-options { display: grid; gap: 8px; }
.import-options label { font-size: 14px; }
.import-rows td { vertical-align: top; }
.import-rows .row-skip { color: var(--muted); }
.import-rows .row-exists { color: var(--muted); font-style: italic; }
.invite-card { margin-bottom: 12px; }
.invite-card .invite-form { display: grid; gap: 8px; margin-top: 8px; }
.invite-card .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px; }
.invite-card .grid2 label { display: grid; font-size: 13px; }
.feed-link { word-break: break-all; font-size: 12px; }

/* top bar: "More" menu for less-used pages */
.nav-more { position: relative; }
.nav-more summary { cursor: pointer; list-style: none; padding: 6px 10px; border-radius: 6px; color: var(--muted); }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: " ▾"; }
.nav-more[open] summary, .nav-more:has(a.active) summary { color: var(--ink); background: var(--bg); }
.nav-more-menu { position: absolute; top: 100%; left: 0; z-index: 50; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 6px 20px var(--shadow); padding: 6px; display: grid; min-width: 170px; }
.nav-more-menu a { padding: 7px 10px; border-radius: 6px; white-space: nowrap; }
/* grouped "More" menu (#70): headings over small groups; several columns on wide screens */
.nav-more-menu .nav-group { display: grid; align-content: start; }
.nav-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 8px 10px 2px; }
.nav-more-wide .nav-more-menu { left: auto; right: 0; }
@media (min-width: 701px) { .nav-groups { grid-template-columns: repeat(3, minmax(170px, auto)); gap: 2px 8px; } }
.topbar-right .nav-user summary { color: var(--muted); }
.nav-user .nav-more-menu { left: auto; right: 0; }
.nav-user .nav-more-menu form { margin: 0; padding: 4px 10px 6px; border-top: 1px solid var(--line); }
.admin-topbar .nav-more-menu a { color: var(--ink); }
@media (max-width: 700px) {
  /* phones: menus open full width under the bar and scroll if long */
  .nav-more-menu { position: fixed; left: 12px; right: 12px; top: auto; max-height: 70vh; overflow-y: auto; }
  .nav-more-wide .nav-more-menu, .nav-user .nav-more-menu { left: 12px; right: 12px; }
  .nav-more-menu a { padding: 10px 12px; }
}

/* Platform admin > Feature tracker */
.ft-summary { display: grid; gap: 10px; }
.ft-overall { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ft-big { font-size: 28px; color: var(--accent); }
.ft-bar { display: block; height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.ft-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.ft-bar-big { height: 12px; }
.ft-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.ft-cat-line { display: grid; grid-template-columns: 1fr 90px 44px; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-size: 13px; }
.ft-cat-line:hover .ft-cat-name { color: var(--accent); }
.ft-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.ft-filters .chips { margin: 0; }
.ft-filters a.chip { text-decoration: none; display: inline-flex; align-items: center; }
.ft-filters input[type="search"] { flex: 1 1 200px; min-width: 0; padding: 8px 10px; }
.ft-group > summary { cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.ft-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ft-row { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.ft-row:first-child { border-top: 0; }
.ft-check input[type="checkbox"] { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.ft-main { flex: 1; min-width: 0; }
.ft-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ft-row.is-done .ft-title strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--muted); }
.ft-note { margin-top: 3px; }
.ft-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.ft-more { margin-top: 4px; }
.ft-more > summary { cursor: pointer; color: var(--accent); }
.ft-details { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.ft-details label { display: grid; gap: 2px; }
.ft-details input[name="note"] { min-width: 240px; }
.ft-notes { max-width: 860px; line-height: 1.5; }
.ft-notes li:target { background: var(--warn-bg); }
@media (max-width: 600px) {
  .ft-cat-line { grid-template-columns: 1fr 70px 40px; }
  .ft-details input[name="note"] { min-width: 0; width: 100%; }
  .ft-details label { flex: 1 1 100%; }
}
.ft-group, .ft-summary + .ft-filters ~ details.card { margin-top: 8px; }

/* Device enrollment: link + QR + email */
.enroll-share { display: flex; gap: 1em; align-items: flex-start; flex-wrap: wrap; margin: .5em 0; }
.enroll-qr svg { display: block; width: 168px; height: 168px; }
.enroll-email { display: flex; gap: .4em; flex-wrap: wrap; margin-top: .5em; }
.enroll-email input { min-width: 12em; }
.enroll-row summary { cursor: pointer; }

/* ---- Dashboard and reports (app.services.reports). Chart colours: the dataviz reference palette's first three
   categorical slots (blue, orange, aqua), assigned in fixed order; text never wears a series colour. ---- */
.viz, .dash, .reports {
  --viz-surface: #ffffff; --viz-grid: #e1e0d9; --viz-axis: #c3c2b7; --viz-muted: #898781; --viz-ink2: #52514e;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --good-ink: #006300; --bad-ink: #b42318;
}
.dash-section { margin: 18px 0; }
.dash-section h3 { margin: 0 0 8px; font-size: 15px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; min-height: 84px; }
a.kpi:hover, a.kpi:focus-visible { border-color: var(--accent); }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 650; line-height: 1.2; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.kpi-alert { border-left: 4px solid var(--red); }
.kpi-flag { font-size: 11px; color: var(--red); background: var(--red-bg); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.delta { font-weight: 600; } .delta.good { color: var(--good-ink); } .delta.bad { color: var(--bad-ink); }
.period-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; margin: 14px 0 4px; }
.period-picker > a, .period-custom > summary { border: 1px solid var(--line); background: var(--panel); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; text-decoration: none; color: inherit; cursor: pointer; list-style: none; }
.period-custom > summary::-webkit-details-marker { display: none; }
.period-picker > a.active, .period-custom > summary.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.period-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 8px; }
.period-form label, .report-filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
.period-label { margin: 4px 0 0; }
.report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.report-card { display: flex; flex-direction: column; gap: 4px; }
.report-card:hover { border-color: var(--accent); }
.report-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 10px 0; }
.report-filters .custom-dates { display: flex; gap: 10px; }
.report-filters .custom-dates[hidden] { display: none; }
.table-wrap { overflow-x: auto; margin: 10px 0; }
.report-table tfoot th { border-top: 2px solid var(--line); }
.report-table .num, .report-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* chart chrome */
.viz { background: var(--viz-surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 8px 0 12px; }
.viz-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.viz-title { font-weight: 600; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--viz-ink2); }
.viz-key { display: inline-flex; align-items: center; gap: 5px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.s1 { background: var(--s1); } .s2 { background: var(--s2); } .s3 { background: var(--s3); }
.vchart { position: relative; height: 200px; padding-left: 52px; padding-bottom: 20px; }
.vgrid { position: absolute; left: 52px; right: 0; top: 0; bottom: 20px; }
.vtick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--viz-grid); }
.vtick span { position: absolute; right: calc(100% + 6px); top: -8px; font-size: 11px; color: var(--viz-muted);
  white-space: nowrap; font-variant-numeric: tabular-nums; }
.vgrid .vtick:last-child { border-top-color: var(--viz-axis); }
.vcols { position: absolute; left: 52px; right: 0; top: 0; bottom: 0; display: flex; gap: 2px; align-items: stretch; }
.vcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding-bottom: 20px; position: relative; outline: none; cursor: default; }
.vcol:hover, .vcol:focus-visible { background: var(--hover); }
.vstack { width: 100%; max-width: 24px; display: flex; flex-direction: column; gap: 2px; }
.vseg { display: block; flex-basis: 0; min-height: 1px; }
.vstack .vseg:first-child { border-radius: 4px 4px 0 0; }
.vcol:hover .vseg, .vcol:focus-visible .vseg { filter: brightness(1.12); }
.vlabel { position: absolute; bottom: 0; font-size: 11px; color: var(--viz-muted); white-space: nowrap; }
.hchart { display: flex; flex-direction: column; gap: 6px; }
.hrow { display: grid; grid-template-columns: minmax(90px, 180px) 1fr minmax(64px, auto); gap: 10px; align-items: center; font-size: 13px;
  padding: 2px 4px; border-radius: 4px; outline: none; }
.hrow:hover, .hrow:focus-visible { background: var(--hover); }
.hlabel { color: var(--viz-ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htrack { height: 18px; display: flex; align-items: center; border-left: 1px solid var(--viz-axis); }
.hbar { display: block; height: 18px; border-radius: 0 4px 4px 0; min-width: 1px; }
.hvalue { font-variant-numeric: tabular-nums; white-space: nowrap; }
.viz-tip { position: absolute; z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12); padding: 6px 10px; font-size: 12px; pointer-events: none; max-width: 260px; }
.viz-tip-head { color: var(--muted); margin-bottom: 2px; }
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 20px; }
  .vchart { height: 170px; padding-left: 44px; } .vgrid, .vcols { left: 44px; }
  .report-filters label { flex: 1 1 140px; }
}
@media (forced-colors: active) { .vseg, .hbar, .sw { forced-color-adjust: none; border: 1px solid CanvasText; } }
/* Settings > Checklists */
.cka-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.cka-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0; }
.cka-row.is-off { opacity: .65; }
.cka-move { display: flex; flex-direction: column; gap: 4px; }
.cka-main { flex: 1; min-width: 200px; }
.cka-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cka-assign { border: 0; padding: 0; margin: 0; }
.cka-assign legend { font-weight: 600; margin-bottom: 4px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cka-items { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.cka-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 6px; background: var(--panel); }
.cka-item.is-heading { background: var(--panel-2); }
.cka-item.is-heading input[data-f="label"] { font-weight: 700; }
.cka-item-top { display: flex; gap: 8px; flex-wrap: wrap; }
.cka-item-top input { flex: 1; min-width: 180px; }
.cka-item-more { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cka-item-more input[data-f="hint"] { flex: 1; min-width: 160px; }
.cka-item-more input.short { width: 9em; }
.cka-item-tools { display: flex; gap: 6px; justify-content: flex-end; }
/* Recurring jobs */
.repeat-icon { font-weight: 700; margin-left: 2px; }
.series-visits { list-style: none; padding: 0; margin: 0; }
.series-visits li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.series-visits li .when { min-width: 12em; }
.series-form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .series-form .grid2 { grid-template-columns: 1fr; } }

/* Software catalog: app icons, script viewer, group picker (admin_device_catalog / admin_app_detail) */
.app-icon { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; border-radius: 4px; }
.app-icon-cell { width: 32px; }
.script-view { width: 100%; font-size: 12px; white-space: pre; overflow: auto; }
.pick-list { max-height: 220px; overflow: auto; margin: 4px 0 8px 20px; }
.pre-line { white-space: pre-line; }

/* ---------------------------------------------------------------- field operations (#57) */
.tray { margin: 8px 0; padding: 8px 12px; }
.tray summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.count.count-zero { background: var(--muted, #888); }
.tray-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 8px; }
.tray-item { border: 1px solid var(--border, #ddd); border-left: 4px solid var(--accent); border-radius: 6px; padding: 6px 8px;
  background: var(--card, #fff); }
.tray-item[draggable=true] { cursor: grab; }
.tray-item.urgent { border-left-color: var(--red); }
.tray-summary { overflow: hidden; text-overflow: ellipsis; }
.tray-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.job.crew-helper, .week-job.crew-helper { border-left-style: dashed; opacity: .85; }
/* Multi-day jobs (app.services.multiday) */
.day-of { font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.project-box { border: 1px solid var(--border, #e5e7eb); border-radius: 8px; padding: 8px 10px; margin: 10px 0; }
.project-box h4 { margin: 0 0 6px; }
.project-box .progress { height: 6px; background: var(--border, #e5e7eb); border-radius: 3px; overflow: hidden; }
.project-box .progress span { display: block; height: 100%; background: #16a34a; }
.project-days { width: 100%; border-collapse: collapse; margin: 6px 0; }
.project-days th, .project-days td { text-align: left; padding: 3px 4px; border-bottom: 1px solid var(--border, #eee); vertical-align: top; }
.project-days .pd-skipped td { opacity: .6; text-decoration: line-through; }
.project-days .pd-skipped td:nth-child(3) { text-decoration: none; }
.project-days .pd-today td { background: rgba(37, 99, 235, .07); }
.md-weekdays { border: 0; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.md-weekdays legend { width: 100%; }
.multi-box { margin: 8px 0; }
.crew-box, .my-time, .history-box, .cost-box { margin: 10px 0; }
.history-box summary, .cost-box summary { cursor: pointer; }
.history-visit { border-top: 1px solid var(--border, #eee); padding: 6px 0; }
.history-visit .media-strip img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
.time-page { max-width: 640px; }
.clock-card { text-align: center; }
.clock-big { width: 100%; font-size: 1.25rem; padding: 16px; margin: 8px 0; }
.clock-totals { margin: 4px 0 0; }
.time-job { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between;
  padding: 6px 0; border-top: 1px solid var(--border, #eee); }
.time-entry { padding: 3px 0; }
.fix-req { padding: 6px 0; border-top: 1px solid var(--border, #eee); }
.timesheet td, .timesheet th { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.expense-form input[name=description] { flex: 1; min-width: 140px; }
/* sign-in pages: "Remember my email" checkbox and the phone app's biometric button (native.js) */
.login label.check { display: flex; gap: 8px; align-items: center; }
.about-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.about-list dt { color: var(--muted, #66706b); }
.about-list dd { margin: 0; }

/* Two-step setup: the QR SVG has only a viewBox, so give it a real size (it collapsed to 0 inside inline-block). */
.qr-box { background: #fff; display: inline-block; padding: 8px; margin: 8px 0; border: 1px solid #e2e8f0; border-radius: 8px; }
.qr-box svg { display: block; width: 220px; height: 220px; }
.setup-key { font-size: 1.15em; letter-spacing: .08em; user-select: all; word-break: break-all; }

/* Job panel: notes & files timeline (#64) */
.notes-box { margin: 12px 0; }
.note-form textarea { width: 100%; }
.note-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.note-attach { cursor: pointer; }
.note-list { list-style: none; padding: 0; margin: 8px 0 0; }
.note-item { border-left: 3px solid var(--line); padding: 4px 8px; margin: 6px 0; }
.note-item.note-customer { border-left-color: #059669; }
.note-item.note-conflict { border-left-color: #d97706; background: rgba(217, 119, 6, .07); }
.note-media { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }
.note-media img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
/* #65 browser phone, notifications, follow-ups */
.softphone .sp-status { font-weight: 600; }
.softphone .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #b8bdb9; }
.softphone .dot-ok { background: #1f9d55; }
.sp-dial { display: flex; gap: 8px; margin: 10px 0; }
.sp-dial input { flex: 1; font-size: 1.2rem; }
.sp-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 280px; margin-bottom: 10px; }
.sp-pad .btn { font-size: 1.1rem; padding: 10px 0; }
.sp-incoming, .sp-incall { padding: 10px; border-radius: 10px; background: var(--panel-2); margin: 8px 0; }
.snippet { width: 100%; font-family: ui-monospace, monospace; font-size: 12px; }
.follow-up-card textarea { width: 100%; }

/* Platform admin > Devices: less-used tools tucked under "More tools" (#70) */
.nav-tools { display: inline-block; }
.nav-tools summary { list-style: none; cursor: pointer; }
.nav-tools summary::-webkit-details-marker { display: none; }
.nav-tools[open] .nav-tools-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* Settings: section headings and the "Jump to" index (#70) */
.settings-index { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 10px 14px; }
.settings-index a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: 14px; }
.settings-index a:hover { border-color: var(--accent); color: var(--accent); }
h2.settings-section { margin-top: 36px; padding-top: 14px; border-top: 2px solid var(--line); color: var(--accent); font-size: 22px; scroll-margin-top: 12px; }
h2.settings-section + h2, h2.settings-section + .card, h2.settings-section + form { margin-top: 8px; }
.nav-more-menu a { color: var(--ink); text-decoration: none; display: block; }
.nav-more-menu a:hover { background: var(--bg); }
.nav-more-menu a.active { background: var(--human-bg); color: var(--accent); font-weight: 600; }
.mainnav .nav-more summary { color: var(--ink); padding: 6px 12px; }
/* Menus on the top bar follow its colors (the menus themselves stay panel-colored). */
.topbar .nav-more > summary { color: var(--bar-ink, var(--ink)); }
.topbar .topbar-right .nav-user > summary { color: var(--bar-muted, var(--muted)); }
.topbar .nav-more[open] > summary, .topbar .nav-more:has(a.active) > summary { color: var(--bar-ink, var(--ink)); background: var(--bar-active, var(--bg)); }
.nav-tools summary::after { content: " ▾"; }

/* Bottom tab bar on phones (#74): everyday pages one thumb away; the top bar keeps search, Sales/Money/More and you. */
.tabbar { display: none; }
@media (max-width: 700px) {
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--panel);
            border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
            box-shadow: 0 -2px 10px var(--shadow); }
  .tabbar .tab { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
                 padding: 6px 2px 4px; min-height: 52px; border: 0; background: transparent; color: var(--muted);
                 font: inherit; font-size: 11px; line-height: 1.2; text-decoration: none; border-radius: 10px; cursor: pointer; }
  .tabbar .tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8;
                     stroke-linecap: round; stroke-linejoin: round; }
  .tabbar .tab[data-tab-more] svg { fill: currentColor; stroke: none; }
  .tabbar .tab.active { color: var(--tab-active, var(--accent)); background: var(--tab-active-bg, transparent); font-weight: 600; }
  html.brand-bar .tabbar { border-top: 3px solid var(--bar); }
  .tabbar .tab.active svg { stroke-width: 2.2; }
  .tabbar .tab:active { background: var(--human-bg); }
  .tabbar .tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
                       border-radius: 999px; background: #c2410c; color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; }
  .mainnav .tab-dup { display: none; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  body .vsc-root[data-mode="app"] { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media print { .tabbar { display: none !important; } }
/* #79 Settings > Website > More options: voice in the chat */
fieldset.plain { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0; display: grid; gap: 6px; }

/* Several locations (#83) */
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.loc-grid .loc-form textarea { width: 100%; }
.loc-filter select { max-width: 12rem; }

/* Schedule job panel "Full screen" (focus on one job) */
.panel-focus-btn { float: right; font-weight: 500; }
.job .job-full { display: none; }
.job.selected .job-full, .job:hover .job-full, .job:focus-visible .job-full { display: grid; }
.job .job-full { position: absolute; top: 2px; right: 2px; z-index: 2; width: 24px; height: 24px; place-items: center;
                 border-radius: 5px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; line-height: 1; cursor: pointer; opacity: .85; }
.job .job-full:hover, .job .job-full:focus-visible { opacity: 1; outline: 2px solid var(--accent, #2563eb); }
.job-panel.focus { position: fixed; inset: 0; z-index: 60; max-width: none; border-radius: 0; overflow-y: auto;
                   padding: calc(16px + env(safe-area-inset-top)) max(16px, calc((100vw - 900px) / 2)) calc(24px + env(safe-area-inset-bottom)); }
body.panel-focused { overflow: hidden; }
body.panel-focused .tabbar, body.panel-focused .vsc-root { display: none !important; }

/* Devices > Get the apps */
.get-apps summary { cursor: pointer; }
.get-apps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 12px; }
.get-app h4 { margin: 0 0 8px; }
.get-app .qr-box svg { width: 180px; height: 180px; }
.get-app a { word-break: break-all; }
/* Settings > Phone system (#90) */
.phs-status { font-weight: 600; }
.phs-on { color: var(--accent); }
.phs-off { color: var(--muted, #777); }
.phs-steps { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
.phs-trunk { margin: 10px 0; }
.phs-dialog { max-width: min(680px, calc(100vw - 32px)); }
.phs-creds { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; align-items: center; }
.phs-creds dd { margin: 0; word-break: break-all; }
.phs-sample { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--surface-2, #f4f4f4); padding: 8px; border-radius: 6px; }

/* Job types (#91): chips, "Color by" (type | tech | status), legends, Settings editor. */
.jt-tag, .jt-chip { display: inline-block; border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 600;
  line-height: 17px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.jt-chip { font-size: 12px; padding: 1px 9px; line-height: 18px; }
.job .jt-tag, .week-job .jt-tag { float: right; margin-left: 4px; }
[data-color-by="type"] .job.has-type, [data-color-by="type"] .week-job.has-type { background: color-mix(in srgb, var(--jt) 18%, var(--panel)); }
[data-color-by="tech"] .job, [data-color-by="tech"] .week-job { background: color-mix(in srgb, var(--tc) 15%, var(--panel)); }
[data-color-by="status"] .job, [data-color-by="status"] .week-job { background: color-mix(in srgb, var(--st) 16%, var(--panel)); }
[data-color-by="tech"] .jt-tag, [data-color-by="status"] .jt-tag { background: var(--panel) !important; color: var(--ink) !important; border: 1px solid var(--line); }
.job.blocked { background: repeating-linear-gradient(135deg, #eef0ec, #eef0ec 6px, #e4e7e1 6px, #e4e7e1 12px) !important; }
.color-by-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 4px 0 8px; }
.color-by-bar .seg { display: inline-flex; align-items: center; gap: 4px; }
.seg-btn { border: 1px solid var(--line); background: var(--panel); color: inherit; border-radius: 6px; padding: 3px 9px; font: inherit; font-size: 13px; cursor: pointer; }
.seg-btn.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.color-legend { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; }
.legend-item .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.jt-chips .chip .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.jt-chips .chip.on { border-color: var(--jt); box-shadow: inset 0 0 0 1px var(--jt); }
.jt-list { list-style: none; padding: 0; margin: 8px 0; }
.jt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.jt-row.off { opacity: .55; }
.jt-row-actions { margin-left: auto; }
.jt-editor { margin-top: 10px; }
.jt-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.jt-palette { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.jt-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.jt-swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.jt-suggest-list { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-bottom: 6px; }

/* Visit pack (#92): recommendation priority tags on the job panel and customer page. */
.prio { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.prio-urgent { background: #fdecea; color: #8a1c12; }
.prio-soon { background: #fff4d6; color: #6b4e00; }
.prio-someday { background: #e8f0fb; color: #1d4a8a; }
.serial-nudge { border-left: 4px solid #f59e0b; }

/* Personal menus (#95): "Your shortcuts" in More, Customize page lists, Platform admin > Usage bars. */
.nav-shortcuts { background: var(--human-bg); border-radius: 8px; }
.nav-shortcuts .shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.nav-shortcuts .shortcut-row > a { flex: 1; }
.nav-shortcuts .shortcut-pin button { padding: 4px 8px; color: var(--muted); }
.sort-list { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 6px; }
.sort-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line);
             border-radius: 8px; background: var(--panel); }
.sort-item.dragging { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.sort-item .sort-label { flex: 1; font-weight: 600; }
.sort-item .sort-buttons { display: flex; gap: 4px; }
.sort-item .sort-buttons .btn { min-width: 36px; min-height: 36px; }
.drag-handle { cursor: grab; touch-action: none; user-select: none; color: var(--muted); padding: 6px 4px; font-size: 18px; letter-spacing: -3px; }
.usage-bar { display: block; width: 100%; max-width: 180px; height: 10px; }
.usage-bar rect.track { fill: var(--line); }
.usage-bar rect.fill { fill: var(--accent); }
.usage-trend { width: 100%; height: 90px; display: block; }
.usage-trend rect { fill: var(--accent); }
.usage-trend rect:hover, .usage-trend rect:focus { fill: var(--ink); outline: none; }
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.usage-grid table { width: 100%; }
.usage-hint { color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* #99 server health sparklines (admin Health page) */
.spark-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 6px 0; }
.spark-label { min-width: 90px; }
.spark-cell { display: inline-flex; flex-direction: column; color: var(--accent); }
.spark-cell .muted { color: var(--muted); }
.spark { max-width: 100%; height: 32px; }
/* Set up with AI (#104) */
.setup-ai { max-width: 640px; }
.setup-ai .sa-card { margin-bottom: 16px; display: grid; gap: 10px; }
.setup-ai .sa-card h3 { margin: 0; }
.sa-progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.sa-progress span { display: block; height: 100%; background: var(--accent); }
.sa-found { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.sa-saved ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.setup-ai textarea, .setup-ai input[name=text] { width: 100%; box-sizing: border-box; }
.setup-ai-banner { margin-bottom: 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
