/* AEGIS CRM. Calm, premium, readable outdoors, big targets for gloved hands. */
:root {
  --forest: #1F3A2E;
  --forest-2: #2C4F3F;
  --forest-soft: #E3EAE4;
  --ivory: #F4F1EA;
  --paper: #FBFAF6;
  --stone: #D9D4C7;
  --stone-2: #EAE6DC;
  --brown: #7A5C3E;
  --amber: #A86B1D;
  --amber-soft: #F6EAD5;
  --ink: #1B1F1C;
  --muted: #5F665F;
  --red: #A83A2C;
  --red-soft: #F6E1DD;
  --radius: 14px;
  --tap: 52px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabbar: 68px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--font);
  font-size: 17px; line-height: 1.4; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px);
}
a { color: var(--forest); }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.pre { white-space: pre-wrap; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --- top bar --- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--forest); color: var(--ivory);
}
.brand { color: var(--ivory); text-decoration: none; font-weight: 700; letter-spacing: 0.24em; font-size: 15px; }
.top-title { flex: 1; font-size: 19px; display: flex; align-items: center; gap: 6px; }
.back { color: var(--ivory); text-decoration: none; font-size: 30px; line-height: 1; padding: 0 10px 4px 0; }
.btn-top { min-height: 40px; padding: 8px 14px; font-size: 15px; }
.top .btn-ghost { color: var(--ivory); border-color: rgba(244,241,234,.5); background: transparent; }
.top .btn-primary { background: var(--ivory); color: var(--forest); }

.main { max-width: 680px; margin: 0 auto; padding: 14px 14px 24px; }
.main.wide { max-width: 1400px; }

/* --- bottom tab bar (thumb zone) --- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: var(--paper);
  border-top: 1px solid var(--stone); padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; min-height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600;
}
.tab.on { color: var(--forest); }
.tab-add svg { background: var(--forest); color: var(--ivory); border-radius: 50%; width: 40px; height: 40px; padding: 8px; }
.tab-add.on svg { background: var(--forest-2); }
.badge { background: var(--red); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 12px; }

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap);
  padding: 12px 18px; border-radius: 12px; border: 1.5px solid var(--stone); background: var(--paper);
  color: var(--forest); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform .06s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--forest); border-color: var(--forest); color: var(--ivory); }
.btn-big { width: 100%; min-height: 58px; font-size: 18px; }
.btn-ghost { background: transparent; }
.btn-lost { color: var(--red); border-color: #E0B7AF; }
.btn[disabled], .btn.busy, .htmx-request .btn, .btn.htmx-request { opacity: .6; pointer-events: none; }
.btn.busy::after, .htmx-request > .btn::after, .btn.htmx-request::after {
  content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap);
  border-radius: 12px; border: 1.5px solid var(--stone); color: var(--forest); background: var(--paper);
}

/* --- chips / filters --- */
.chips { display: flex; gap: 8px; margin: 2px 0 12px; }
.chips.scroll { overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px;
  border-radius: 22px; border: 1.5px solid var(--stone); background: var(--paper); color: var(--ink);
  text-decoration: none; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.chip.on { background: var(--forest); border-color: var(--forest); color: var(--ivory); }
.chip .n { font-weight: 500; opacity: .7; }
.chip.ghost { color: var(--muted); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- labels --- */
.label { flex: none; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .05em; }
.label.big { font-size: 13px; padding: 5px 12px; }
.label.lbl-serious { background: var(--forest); color: var(--ivory); }
.label.lbl-check { background: var(--amber-soft); color: #7A4A0C; }
.label.lbl-unlikely { background: var(--stone-2); color: var(--muted); }

/* --- cards (phone list) --- */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex; align-items: stretch; background: var(--paper); border-radius: var(--radius);
  border: 1px solid var(--stone); border-left: 5px solid var(--stone); overflow: hidden;
}
.card.lbl-serious { border-left-color: var(--forest); }
.card.lbl-check { border-left-color: var(--amber); }
.card.overdue { box-shadow: 0 0 0 1.5px rgba(168, 58, 44, .55) inset; }
.card.moved { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--forest-soft); } to { background: var(--paper); } }
.card-main { flex: 1; min-width: 0; padding: 12px 12px 12px 14px; color: inherit; text-decoration: none; }
.card-row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-name { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-row2 { color: var(--muted); font-size: 15px; margin-top: 2px; }
.card-row3 { font-size: 14px; margin-top: 4px; color: var(--muted); }
.stage-name { font-weight: 650; color: var(--forest); }
.late { color: var(--red); font-weight: 700; }
.waiting.late { color: var(--red); }
.card-actions { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 10px 10px 10px 0; }
.card-actions form { margin: 0; }
.btn-next { min-height: var(--tap); padding: 10px 12px; font-size: 15px; white-space: nowrap; background: var(--forest-soft); border-color: transparent; }
.alert-line { background: var(--red-soft); color: var(--red); font-weight: 650; border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }

/* --- board (desktop) --- */
.board-view { display: none; }
@media (min-width: 1000px) {
  .list-view { display: none; }
  .board-view { display: block; }
  .board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 220px; gap: 14px; align-items: start; }
  .col { background: var(--stone-2); border-radius: var(--radius); padding: 10px; min-height: 300px; }
  .col-head { font-size: 15px; padding: 4px 4px 10px; display: flex; justify-content: space-between; }
  .col-head .n { color: var(--muted); font-weight: 500; }
  .col-body { display: flex; flex-direction: column; gap: 8px; min-height: 240px; border-radius: 10px; }
  .col-empty { color: var(--muted); text-align: center; font-size: 14px; padding: 20px 0; }
  .mini {
    display: flex; flex-direction: column; gap: 2px; background: var(--paper); border-radius: 10px; padding: 10px 12px;
    border-left: 4px solid var(--stone); color: inherit; text-decoration: none; cursor: grab;
  }
  .mini.lbl-serious { border-left-color: var(--forest); }
  .mini.lbl-check { border-left-color: var(--amber); }
  .mini.overdue { box-shadow: 0 0 0 2px var(--red) inset; }
  .mini.dragging { opacity: .4; }
  .mini-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
  .mini-sub { font-size: 13px; color: var(--muted); }
  .dropzone.over { outline: 2px dashed var(--forest); outline-offset: 2px; background: var(--forest-soft); }
  .col-end { background: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
  .dropzone.end { min-height: 110px; border: 2px dashed var(--stone); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; color: var(--muted); }
  .dropzone.end.won { color: var(--forest); }
  .dropzone.end.lost { color: var(--red); }
  .dropzone.end.lost.over { background: var(--red-soft); outline-color: var(--red); }
}

/* --- forms --- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-size: 15px; font-weight: 650; color: var(--forest); padding: 0; }
input, select, textarea {
  font: inherit; font-size: 18px; color: var(--ink); width: 100%; min-height: var(--tap); padding: 12px 14px;
  border: 1.5px solid var(--stone); border-radius: 12px; background: var(--paper);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--forest-soft); }
.has-error input, .has-error textarea { border-color: var(--red); }
.err { color: var(--red); font-style: normal; font-size: 14px; font-weight: 600; }
.form-error { background: var(--red-soft); color: var(--red); padding: 12px 14px; border-radius: 12px; font-weight: 650; margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; }
.check input { width: 24px; height: 24px; min-height: 0; accent-color: var(--forest); }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.seg.wrap { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg-opt span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: var(--tap); padding: 8px 10px;
  border: 1.5px solid var(--stone); border-radius: 12px; background: var(--paper); font-weight: 600; font-size: 16px; cursor: pointer;
}
.seg-opt input:checked + span { background: var(--forest); border-color: var(--forest); color: var(--ivory); }
.seg-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--forest-soft); }
.more { background: var(--stone-2); border-radius: 12px; padding: 4px 14px; }
.more summary { min-height: 48px; display: flex; align-items: center; font-weight: 650; color: var(--forest); cursor: pointer; }
.more[open] { padding-bottom: 14px; }
.more .field { margin-top: 12px; }
.lead-form { padding-bottom: 8px; }
.form-end { margin-top: 8px; }
.phone-check:empty { display: none; }
.known { background: var(--forest-soft); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.hint-bad { color: var(--amber); font-size: 14px; font-weight: 600; }
.lead-form .tree-only { display: flex; flex-direction: column; gap: 16px; }
.lead-form .tree-only.off { display: none; }

/* --- lead page --- */
.lead-head { padding: 4px 2px 10px; }
.lead-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lead-title h2 { font-size: 26px; }
.lead-head .muted { margin: 4px 0; }
.stage-line { margin: 6px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stage-pill { background: var(--forest-soft); color: var(--forest); font-weight: 700; padding: 4px 12px; border-radius: 20px; font-size: 14px; }
.stage-pill.st-won { background: var(--forest); color: var(--ivory); }
.stage-pill.st-lost { background: var(--red-soft); color: var(--red); }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 6px 0 12px; }
.actions form { margin: 0; display: flex; }
.actions .btn { width: 100%; }
.btn-action { min-height: 58px; }
.panel { background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.panel.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .panel.two { grid-template-columns: 1fr; } }
.panel-head { font-size: 16px; margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.panel.follow.overdue { border-color: var(--red); background: var(--red-soft); }
.score-panel summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; }
.reasons, .flags { margin: 8px 0 0; padding-left: 20px; }
.reasons li, .flags li { margin: 4px 0; }
.flags li { color: #7A4A0C; }
.small-head { font-size: 14px; margin-top: 12px; color: #7A4A0C; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 0; }
.details dt { color: var(--muted); font-size: 15px; }
.details dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 999px) {
  .details { grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 0; }
  .details dt, .details dd { padding: 9px 0; border-top: 1px solid var(--stone-2); }
  .details dt { font-size: 14px; padding-right: 10px; }
  .details dt:first-of-type, .details dt:first-of-type + dd { border-top: 0; }
  .details dd.pre { grid-column: 1 / -1; border-top: 0; padding-top: 0; }
}
.inline-form { margin: 0; }
.note-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.act { padding: 10px 0; border-top: 1px solid var(--stone-2); display: flex; flex-direction: column; gap: 2px; }
.act-note .act-text { font-weight: 500; }
.act-stage .act-text, .act-call .act-text { color: var(--forest); font-weight: 600; }
.act-meta { font-size: 13px; color: var(--muted); }
.act.fresh { animation: flash 1.2s ease-out; }
.plain { margin: 0; padding-left: 18px; }

/* --- dialog (bottom sheet) --- */
.sheet { border: 0; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); width: 100%; max-width: 560px; margin: auto auto 0; background: var(--paper); }
.sheet::backdrop { background: rgba(20, 30, 25, .45); }
.sheet h2 { font-size: 20px; margin-bottom: 12px; }
.sheet form { display: flex; flex-direction: column; gap: 12px; }
.reason-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-reason { min-height: 56px; font-size: 15px; }
@media (min-width: 700px) { .sheet { border-radius: 18px; margin: auto; } }

/* --- toasts & offline --- */
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--forest); color: var(--ivory); padding: 13px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.18); max-width: 520px; width: 100%; animation: toast-in .2s ease-out; pointer-events: auto; }
.toast.error { background: var(--red); }
.toast.info { background: var(--brown); }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
.offline-bar { position: sticky; top: 0; z-index: 60; background: var(--amber); color: #fff; text-align: center; padding: 8px; font-weight: 650; font-size: 15px; }

/* --- settings, misc --- */
.menu { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.menu a { display: flex; flex-direction: column; gap: 2px; background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); min-height: 64px; }
.menu a span { color: var(--muted); font-size: 15px; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { padding: 12px 0; border-top: 1px solid var(--stone-2); }
.people li:first-child { border-top: 0; }
.people li.off { opacity: .6; }
.people details { margin-top: 8px; }
.people summary { min-height: 40px; display: flex; align-items: center; color: var(--forest); font-weight: 650; cursor: pointer; }
.people form { margin-top: 10px; }
.log { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.log li { padding: 8px 0; border-top: 1px solid var(--stone); }
.log-at { color: var(--muted); font-variant-numeric: tabular-nums; }
.log-changes { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 14px; align-items: center; }

/* --- login --- */
.login-page { padding-bottom: 0; }
.login-page .main { min-height: 100vh; display: flex; align-items: center; }
.login-box { width: 100%; max-width: 420px; margin: 0 auto; }
.login-brand { font-size: 30px; font-weight: 700; letter-spacing: .3em; color: var(--forest); }
.login-box .muted { margin: 4px 0 20px; }

/* ---- phase 2 ---- */
.top-search { color: var(--ivory); display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -8px; }
.tab { font-size: 12px; }
.chips-inline { display: inline-flex; gap: 6px; flex: none; }
.label.lbl-small { background: var(--red-soft); color: var(--red); }
.label.lbl-open { background: var(--forest-soft); color: var(--forest); }
.next-line { font-size: 14px; margin-top: 5px; font-weight: 650; color: var(--forest); }
.next-line.late { color: var(--red); }
.visit-time { font-variant-numeric: tabular-nums; color: var(--forest); margin-right: 2px; }
.today-sec { margin-bottom: 18px; }
.sec-head { font-size: 16px; margin: 6px 2px 10px; display: flex; align-items: center; gap: 8px; }
.sec-head .n { font-size: 13px; font-weight: 700; background: var(--stone-2); color: var(--muted); border-radius: 10px; padding: 1px 8px; }
.late-head { color: var(--red); }
.late-head .n { background: var(--red-soft); color: var(--red); }
.upcoming summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.upcoming summary::-webkit-details-marker { display: none; }
.upcoming summary::after { content: "Show"; margin-left: auto; color: var(--forest); font-weight: 650; font-size: 14px; }
.upcoming[open] summary::after { content: "Hide"; }
.all-clear { text-align: center; padding: 36px 16px 28px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.all-clear svg { width: 56px; height: 56px; color: var(--forest); background: var(--forest-soft); border-radius: 50%; padding: 12px; stroke-width: 2.5; }
.all-clear p { margin: 0 0 8px; max-width: 360px; }
.next-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; background: var(--forest-soft); border-radius: 12px; padding: 12px 14px; margin: 4px 0 10px; }
.next-banner.late { background: var(--red-soft); }
.next-banner.late strong, .next-banner.late .next-due { color: var(--red); }
.next-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.next-banner strong { color: var(--forest); font-size: 17px; }
.next-due { font-size: 14px; color: var(--muted); font-weight: 600; }
.ready summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; gap: 8px; }
.ready .ok { color: var(--forest); font-weight: 700; }
.checklist { list-style: none; margin: 8px 0 0; padding: 0; }
.checklist li { padding: 6px 0; display: flex; gap: 10px; align-items: baseline; color: #7A4A0C; }
.checklist li.done { color: var(--muted); }
.checklist .tick { width: 18px; text-align: center; font-weight: 800; }
.checklist li.done .tick { color: var(--forest); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-bottom: 12px; }
.photo { margin: 0; position: relative; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--stone-2); }
.photo figcaption { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.2; }
.photo.pending img { opacity: .5; }
.photo-del { position: absolute; top: 4px; right: 4px; }
.btn-mini { font: inherit; font-size: 12px; font-weight: 700; border: 0; border-radius: 8px; padding: 6px 8px; background: rgba(27,31,28,.65); color: #fff; cursor: pointer; }
.btn-mini.armed { background: var(--red); }
.photo-empty { grid-column: 1 / -1; margin: 0; }
.upload-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.photo-pick { cursor: pointer; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }
.upload-status { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.upload-status:empty { display: none; }
.upload-status li { display: flex; justify-content: space-between; gap: 8px; align-items: center; background: var(--stone-2); border-radius: 10px; padding: 10px 12px; font-size: 15px; font-weight: 600; }
.upload-status li.ok { background: var(--forest-soft); color: var(--forest); }
.upload-status li.err { background: var(--red-soft); color: var(--red); }
.upload-status li button { font: inherit; font-size: 14px; font-weight: 700; border: 1.5px solid currentColor; background: none; color: inherit; border-radius: 8px; padding: 6px 10px; min-height: 40px; cursor: pointer; }
.search-form { display: flex; gap: 8px; margin-bottom: 14px; }
.search-form input { flex: 1; }
.search-form .btn { flex: none; }
.results { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.results a { display: flex; flex-direction: column; gap: 2px; background: var(--paper); border: 1px solid var(--stone); border-radius: 12px; padding: 12px 14px; color: var(--ink); text-decoration: none; min-height: 56px; }
.results span { color: var(--muted); font-size: 14px; }
.plain-link { color: inherit; text-decoration: none; }
.lead-form .size-only.off { display: none; }
.card-row1 .label { flex: none; }
.tab span { white-space: nowrap; }

/* ---- phase 3 ---- */
.top-search + .top-search { margin-left: -6px; }
.approve-card { background: var(--paper); border: 1px solid var(--stone); border-left: 5px solid var(--amber); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.approve-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.approve-who { color: var(--ink); text-decoration: none; font-size: 17px; }
.approve-form { display: flex; flex-direction: column; gap: 6px; }
.approve-form textarea { font-size: 16px; }
.approve-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.approve-actions .btn { flex: 1; }
.sms-count { font-size: 13px; color: var(--muted); text-align: right; min-height: 16px; }
.sms-count.warn { color: var(--amber); font-weight: 700; }
.thread { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 86%; padding: 10px 12px; border-radius: 14px; display: flex; flex-direction: column; gap: 4px; }
.bubble.in { align-self: flex-start; background: var(--stone-2); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--forest-soft); border-bottom-right-radius: 4px; }
.bubble.st-draft { background: var(--amber-soft); border: 1.5px dashed var(--amber); }
.bubble.st-failed { background: var(--red-soft); }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-meta { font-size: 12px; color: var(--muted); }
.st-failed .bubble-meta { color: var(--red); font-weight: 600; }
.inline-actions { display: flex; gap: 6px; margin-top: 4px; }
.inline-actions .btn { min-height: 44px; padding: 8px 12px; font-size: 14px; }
.composer { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--stone-2); padding-top: 12px; }
.quick-texts .chip { font-size: 14px; min-height: 40px; }
.test-line { background: var(--amber-soft); color: #7A4A0C; }
.failed-row { display: flex; gap: 8px; align-items: stretch; }
.failed-row a { flex: 1; }
.failed-row form { display: flex; }
code.copy { display: inline-block; background: var(--stone-2); padding: 6px 8px; border-radius: 8px; font-size: 14px; overflow-wrap: anywhere; user-select: all; }
/* customer page */
body.public { padding-bottom: 24px; }
.pub-head { background: var(--forest); color: var(--ivory); padding: calc(14px + env(safe-area-inset-top)) 16px 14px; }
.pub-head .brand { color: var(--ivory); }
.pub-intro h1 { font-size: 26px; margin: 8px 0 4px; }
.pub-intro p { margin: 0 0 14px; color: var(--muted); }
.pub-ok { background: var(--forest-soft); color: var(--forest); border-radius: 12px; padding: 12px 14px; font-weight: 650; }
.pub-slots { display: flex; flex-direction: column; gap: 12px; }
.pub-slot { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1.5px dashed var(--stone); border-radius: 12px; }
.pub-slot.done { border-style: solid; border-color: var(--forest-soft); background: #F7F9F6; }
.pub-slot strong { display: block; }
.pub-got { margin: 0; }
.pub-got:empty { display: none; }
.got { display: inline-block; background: var(--forest-soft); color: var(--forest); font-weight: 700; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.pub-privacy { margin-top: 18px; }

/* Badges sit on the icon, so five tabs fit on a narrow phone */
.tab { position: relative; min-width: 0; }
.tab .badge { position: absolute; top: 6px; left: 50%; margin-left: 4px; min-width: 18px; text-align: center; line-height: 16px; padding: 1px 5px; font-size: 11px; }
/* Inner pages have a back arrow; drop the wordmark there so Edit, settings and search fit */
.top:has(.back) .brand { display: none; }

/* ---- calendar ---- */
.main.cal-wide { max-width: 1240px; }
.cal-layout { display: grid; gap: 18px; }
@media (min-width: 1000px) { .cal-layout { grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); align-items: start; }
  .cal-right { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; } }
.cal-head { display: flex; align-items: center; gap: 6px; margin: 2px 0 12px; }
.cal-title { font-size: 24px; margin: 0 6px; flex: 1; letter-spacing: -.01em; }
.cal-title span { color: var(--muted); font-weight: 500; }
.cal-head .cal-title { order: 0; }
.cal-nav { order: 1; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--stone); color: var(--forest); text-decoration: none; font-size: 26px; line-height: 1; background: var(--paper); }
.cal-nav:hover { background: var(--forest-soft); }
.cal-today { order: 2; }
.cal { --wk: 22px; --num: 24px; --lane: 18px; background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius);
  overflow: hidden; user-select: none; -webkit-user-select: none; }
.cal-wd, .cal-week { display: grid; grid-template-columns: var(--wk) repeat(7, minmax(0, 1fr)); }
.cal-wd { background: var(--stone-2); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-wd span { padding: 7px 0; text-align: center; }
.cal-wd .we { color: #8B8F88; }
.cal-week { grid-template-rows: var(--num) repeat(3, var(--lane)) 16px; border-top: 1px solid var(--stone-2); position: relative; }
.cal .wk { grid-row: 1 / -1; grid-column: 1; font-size: 10px; color: #8B8F88; text-align: center; padding-top: 6px; background: #F5F3EC;
  border-right: 1px solid var(--stone-2); }
.cal-day { grid-row: 1 / -1; position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 3px 4px 2px;
  border-left: 1px solid var(--stone-2); color: var(--ink); text-decoration: none; min-width: 0; transition: background .12s; }
.cal-day.c1 { grid-column: 2; border-left: 0; } .cal-day.c2 { grid-column: 3; } .cal-day.c3 { grid-column: 4; } .cal-day.c4 { grid-column: 5; }
.cal-day.c5 { grid-column: 6; } .cal-day.c6 { grid-column: 7; } .cal-day.c7 { grid-column: 8; }
.cal-day:hover { background: #F3F6F2; }
.cal-day.we { background: #F7F5EF; }
.cal-day.out { background: #F2EFE7; }
.cal-day.out .num { color: #A9ADA6; }
.cal-day .num { font-size: 13px; font-weight: 650; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-day.today .num { background: var(--forest); color: var(--ivory); }
.cal-day.picked { box-shadow: inset 0 0 0 2px var(--forest); z-index: 0; }
.cal-day.hol .num { color: var(--red); }
.cal-day.today.hol .num { color: var(--ivory); }
.cal-day.blocked { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(168, 58, 44, .08) 6px 9px); }
.day-tag { position: absolute; top: 5px; left: 28px; right: 3px; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none; }
.marks { display: flex; align-items: center; gap: 3px; min-height: 12px; overflow: hidden; }
.vdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: none; }
.vtime { display: none; font-size: 10px; color: var(--amber); font-weight: 700; }
.more { font-style: normal; font-size: 10px; font-weight: 700; color: var(--muted); margin-left: auto; }
.bar { z-index: 1; align-self: center; height: calc(var(--lane) - 3px); margin: 0 1px; padding: 0 5px; font-size: 11px; font-weight: 650; line-height: calc(var(--lane) - 3px);
  color: #fff; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 0; box-shadow: 0 1px 0 rgba(0,0,0,.08); }
.bar.first { border-top-left-radius: 6px; border-bottom-left-radius: 6px; margin-left: 3px; }
.bar.last { border-top-right-radius: 6px; border-bottom-right-radius: 6px; margin-right: 3px; }
.bar:hover, .bar:focus-visible { filter: brightness(1.1); }
.bar.dragging { opacity: .45; }
.bar.c1 { grid-column-start: 2; } .bar.c2 { grid-column-start: 3; } .bar.c3 { grid-column-start: 4; } .bar.c4 { grid-column-start: 5; }
.bar.c5 { grid-column-start: 6; } .bar.c6 { grid-column-start: 7; } .bar.c7 { grid-column-start: 8; }
.bar.s1 { grid-column-end: span 1; } .bar.s2 { grid-column-end: span 2; } .bar.s3 { grid-column-end: span 3; } .bar.s4 { grid-column-end: span 4; }
.bar.s5 { grid-column-end: span 5; } .bar.s6 { grid-column-end: span 6; } .bar.s7 { grid-column-end: span 7; }
.bar.l0 { grid-row: 2; } .bar.l1 { grid-row: 3; } .bar.l2 { grid-row: 4; }
.cal-day.drop { background: var(--forest-soft); box-shadow: inset 0 0 0 2px var(--forest); }
.svc-tree_felling { --svc: #2F5D46; } .svc-garden { --svc: #6B8A3A; } .svc-paving { --svc: #8A6A45; } .svc-other { --svc: #56606C; }
.bar { background: var(--svc, var(--forest)); }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--muted); margin: 8px 2px 0; }
.cal-legend .lg { display: inline-block; width: 14px; height: 8px; border-radius: 3px; background: var(--svc); margin-right: -6px; }
.cal-legend .vdot { margin-right: -6px; }
@media (min-width: 700px) {
  .cal { --wk: 30px; --num: 30px; --lane: 22px; }
  .cal-week { grid-template-rows: var(--num) repeat(3, var(--lane)) 20px; }
  .cal .wk { font-size: 11px; padding-top: 8px; }
  .bar { font-size: 12px; }
  .cal-day .num { font-size: 14px; width: 26px; height: 26px; }
  .day-tag { display: block; top: 8px; left: 34px; }
  .vtime { display: inline; margin-right: 4px; }
}
.day-panel { background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 80px; }
.day-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.day-head h2 { font-size: 19px; margin: 0; }
.btn-sm { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.day-empty { margin: 4px 0; }
.job-card { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--stone); border-left: 5px solid var(--svc, var(--forest));
  border-radius: 12px; padding: 12px 14px; scroll-margin-top: 90px; color: var(--ink); text-decoration: none; }
.job-card h3 { margin: 0; font-size: 18px; }
.job-card p { margin: 0; }
.job-card:target { box-shadow: 0 0 0 3px var(--forest-soft); }
.job-link strong { font-size: 17px; }
.job-card.is-today { border-color: var(--forest); }
.job-top { display: flex; justify-content: space-between; align-items: center; }
.job-time { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--forest); }
.crew-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crew-chip { background: var(--forest-soft); color: var(--forest); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 650; }
.call-link { margin-left: auto; font-weight: 650; white-space: nowrap; }
.job-note { background: var(--amber-soft); color: #6A4510; border-radius: 8px; padding: 6px 9px; font-size: 14px; white-space: pre-wrap; }
.job-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.job-actions .btn, .job-actions form { flex: 1 1 auto; }
.job-actions form .btn { width: 100%; }
.visit-line { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--amber-soft); color: var(--ink); text-decoration: none; }
.visit-line .job-time { color: var(--amber); }
.visit-line > span:last-child { display: flex; flex-direction: column; }
.block-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
  background-image: repeating-linear-gradient(135deg, var(--paper) 0 6px, var(--red-soft) 6px 9px); border: 1px solid var(--red-soft); }
.book-row { display: flex; gap: 8px; align-items: stretch; }
.book-row a:first-child { flex: 1; }
.book-row .btn { align-self: center; }
.cal-foot { margin: 6px 2px; font-size: 14px; }
.job-panel { border-left: 5px solid var(--svc, var(--forest)); }
.job-panel.done { border-left-color: var(--stone); }
.job-when { margin: 0 0 8px; }
.book-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.book-banner strong { flex: 1; }
.form-intro { margin: 0 0 14px; font-size: 17px; }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; max-width: 260px; }
.stepper input { text-align: center; font-size: 20px; font-weight: 700; }
.stepper .btn { font-size: 24px; padding: 0; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick span { display: inline-flex; align-items: center; min-height: 46px; padding: 8px 16px; border-radius: 999px; border: 1.5px solid var(--stone);
  background: var(--paper); font-weight: 650; color: var(--forest); }
.pick input:checked + span { background: var(--forest); border-color: var(--forest); color: var(--ivory); }
.pick input:checked + span::before { content: "✓ "; white-space: pre; }
.pick input:focus-visible + span { outline: 3px solid var(--forest-soft); outline-offset: 2px; }
.job-preview:empty { display: none; }
.job-summary { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--forest-soft); color: var(--forest); font-weight: 650; }
.job-summary svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.clash-list { margin: 8px 0 0; padding-left: 20px; color: #7A4A0C; }
.clash-list li { margin: 3px 0; }
.clash-box { border: 1.5px solid var(--amber); background: var(--amber-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.clash-box .clash-list { margin: 0; }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--stone); border-radius: 12px; background: var(--paper); cursor: pointer; }
.radio-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--forest); flex: none; }
.radio-row > span { display: flex; flex-direction: column; gap: 2px; }
.radio-row:has(input:checked) { border-color: var(--forest); background: #F3F6F2; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.danger-link { text-align: center; margin-top: 18px; }
.danger-link a { color: var(--red); font-weight: 650; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.field > span.muted { font-weight: 400; color: var(--muted); font-size: 13px; }
#cal-main.loading .cal, #cal-main.loading .day-panel { opacity: .6; transition: opacity .15s .1s; }

/* ---- computer layouts: Today and Messages ---- */
.main.wide-page { max-width: 680px; }
.dash { display: flex; flex-direction: column; }
.dash-main, .dash-side { display: contents; }
.dash-top { display: none; }
.o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; }
.o8 { order: 8; } .o9 { order: 9; } .o10 { order: 10; }
.schedule { margin-bottom: 18px; }
.schedule .cards + .cards { margin-top: 10px; }
.empty-schedule { display: none; }
.sec-link { margin-left: auto; font-size: 14px; font-weight: 600; }
.dash-date { font-size: 24px; font-weight: 750; margin: 0 0 14px; letter-spacing: -.01em; }
.dash-date span { color: var(--muted); font-weight: 500; font-size: 18px; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--stone);
  border-radius: 12px; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600; transition: border-color .12s, transform .12s; }
.stat b { font-size: 28px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat:hover { border-color: var(--forest); transform: translateY(-1px); }
.stat.hot { border-color: #E3B5AD; background: var(--red-soft); }
.stat.hot b { color: var(--red); }
.msg-pane { display: none; }
.msg-layout.picked .msg-list { display: none; }
.msg-layout.picked .msg-pane { display: block; }
.conv-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.conv { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--paper);
  border: 1px solid var(--stone); color: var(--ink); text-decoration: none; transition: border-color .12s, background .12s; }
.conv:hover { border-color: var(--forest); }
.conv.on { border-color: var(--forest); background: #F1F5F1; box-shadow: inset 4px 0 0 var(--forest); }
.conv.unread strong { font-weight: 800; }
.conv.unread .conv-snip { color: var(--ink); }
.conv-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--svc, var(--forest)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 750; font-size: 16px; }
.conv-avatar.big { width: 48px; height: 48px; font-size: 20px; }
.conv-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.conv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv-top time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.conv-snip { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.conv-tags:empty { display: none; }
.tag { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.tag-new { background: var(--forest); color: var(--ivory); }
.tag-draft { background: var(--amber-soft); color: #7A4A0C; }
.tag-fail { background: var(--red-soft); color: var(--red); }
.sec-head .n.hot { background: var(--forest); color: var(--ivory); }
.conv-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.conv-head h2 { margin: 0; font-size: 20px; }
.conv-head p { margin: 2px 0 0; }
.conv-acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pane-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 420px; color: var(--muted); }
.pane-empty svg { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 1.6; opacity: .6; }
.msg-layout.loading .msg-pane { opacity: .6; transition: opacity .15s .1s; }
@media (min-width: 1000px) {
  .main.wide-page { max-width: 1280px; padding: 22px 28px 36px; }
  .dash { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 28px; align-items: start; }
  .dash-main, .dash-side { display: flex; flex-direction: column; min-width: 0; }
  .dash-side { align-self: start; }
  .dash-top { display: block; }
  .dash-main .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
  .dash-main .all-clear { background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius); }
  .empty-schedule { display: block; }
  .side-box { background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius); padding: 14px 16px 16px; margin-bottom: 16px; }
  .side-box > :last-child, .side-box .results, .side-box .cards { margin-bottom: 0; }
  .side-box .approve-card { padding: 14px 16px 16px; }
  .side-box .sec-head { margin-top: 2px; }
  .side-box .results a, .side-box .approve-card, .side-box .job-card, .side-box .card { background: #fff; }
  .msg-layout { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 24px; align-items: start; }
  .msg-list, .msg-layout.picked .msg-list { display: block; position: sticky; top: 84px; max-height: calc(100vh - 108px); overflow-y: auto; padding-right: 4px; }
  .msg-pane, .msg-layout.picked .msg-pane { display: block; position: sticky; top: 84px; max-height: calc(100vh - 108px); overflow-y: auto;
    background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius); padding: 18px 20px; }
  .msg-pane .conv-head { position: sticky; top: -18px; background: var(--paper); z-index: 1; padding: 18px 0 12px; margin-top: -18px; border-bottom: 1px solid var(--stone-2); }
  .msg-pane #messages { border: 0; padding: 0; margin: 12px 0 0; background: none; }
  .msg-pane .thread { min-height: 200px; }
  .msg-back { display: none; }
}

/* ---- AI writing assistant ---- */
.ai-box { background: linear-gradient(135deg, #F3F6F2, #F8F3EA); border: 1px solid var(--stone); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ai-row { display: flex; gap: 8px; align-items: stretch; }
.ai-mic { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--forest); color: var(--ivory); font: inherit; font-weight: 700; cursor: pointer; }
.ai-mic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.ai-mic.rec { background: var(--red); animation: pulse 1.2s ease-in-out infinite; }
.ai-mic.busy, .ai-go.busy { opacity: .6; pointer-events: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(168, 58, 44, .45); } 50% { box-shadow: 0 0 0 8px rgba(168, 58, 44, 0); } }
.ai-ask { flex: 1; min-width: 0; min-height: var(--tap); border-radius: 12px; border: 1.5px solid var(--stone); padding: 0 12px; font: inherit; font-size: 16px; background: #fff; }
.ai-go { flex: none; }
.ai-status:empty { display: none; }
.ai-status { font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.ai-status .said { color: var(--muted); }
.ai-status .meaning { color: var(--forest); }
.ai-status .note { color: #7A4A0C; background: var(--amber-soft); border-radius: 8px; padding: 6px 9px; }
.ai-status .working { color: var(--forest); font-weight: 650; }
.ai-status .ai-err { color: var(--red); font-weight: 600; }
.composer-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.composer-tools .sms-count { margin-left: auto; }
.composer textarea.ai-filled { border-color: var(--forest); box-shadow: 0 0 0 3px var(--forest-soft); }
@media (max-width: 420px) { .ai-mic span { display: none; } .ai-mic { padding: 0 14px; } }
/* ---- lead intake ---- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.howto { margin: 10px 0; }
.howto summary { cursor: pointer; font-weight: 650; color: var(--forest); min-height: 40px; display: flex; align-items: center; }
.intake-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.intake-log li { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--stone-2); }
.intake-log .when { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.intake-log li.st-rejected, .intake-log li.st-error { border-color: var(--red-soft); background: #FFF8F6; }
.intake-log li.st-spam { opacity: .6; }
.panel code.copy { display: block; margin: 8px 0; }
.radio-row { align-items: center; }
.radio-row input { min-height: 0; margin: 0; }
.composer-tools [data-ai-polish] { background: none; border: 0; padding: 6px 0; min-height: 40px; font: inherit; font-size: 14px; font-weight: 650;
  color: var(--forest); cursor: pointer; }
.composer-tools [data-ai-polish]:disabled { opacity: .5; }

/* ---------- price engine ---------- */
.seg-tabs { display: flex; gap: 6px; background: var(--stone-2); padding: 4px; border-radius: 14px; margin-bottom: 14px; overflow-x: auto; }
.seg-tabs a { flex: 1; text-align: center; white-space: nowrap; padding: 10px 12px; border-radius: 10px; font-weight: 650; color: var(--ink); text-decoration: none; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.seg-tabs a.on { background: #fff; color: var(--forest); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.found-line { color: var(--forest); font-weight: 650; margin: 0 0 8px; }
.note-line { background: #FFF6E5; color: #7A4B00; padding: 10px 12px; border-radius: 10px; margin: 0 0 8px; font-size: 14px; }
.cat-top { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.cat-search { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-search input[type=search] { grid-column: 1 / -1; }
.cat-go { display: none; }
.cat-add { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.cat-add .btn { white-space: nowrap; flex: none; }
.cat-table { display: flex; flex-direction: column; gap: 6px; }
.cat-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name name" "sup price" "src cost"; gap: 4px 12px; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid var(--stone-2); border-radius: 14px; color: var(--ink); text-decoration: none; }
.cat-row:hover { border-color: var(--forest-soft); }
.cat-head { display: none; }
.cat-name { display: flex; flex-direction: column; grid-area: name; }
.cat-sup { grid-area: sup; } .cat-price { grid-area: price; } .cat-src { grid-area: src; } .cat-cost { grid-area: cost; font-size: 14px; }
.cat-name small, .cat-src small { font-size: 13px; }
.cat-sup { color: var(--muted); font-size: 14px; }
.cat-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.cat-src { display: flex; gap: 8px; align-items: center; }
.star { color: #C98A00; font-style: normal; }
.src { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--stone-2); color: var(--ink); }
.src-link { background: #E7F0FF; color: #1E4FA8; } .src-ai { background: #F1E9FF; color: #5B2DA8; }
.src-file { background: var(--forest-soft); color: var(--forest); }
@media (min-width: 900px) {
  .cat-top { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .cat-search { grid-template-columns: minmax(240px, 1fr) 160px 160px auto; flex: 1 1 620px; max-width: 820px; }
  .cat-search input[type=search] { grid-column: auto; }
  .cat-go { display: inline-flex; }
  .cat-add { margin: 0; padding: 0; overflow: visible; }
  .cat-row { grid-template-columns: minmax(240px, 2.4fr) 1fr 1fr 1fr 1.3fr; grid-template-areas: "name sup price cost src"; padding: 10px 16px; border-radius: 10px; }
  .cat-cost { font-size: inherit; } .ph-only { display: none; }
  .cat-head { display: grid; background: transparent; border: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding-bottom: 0; }
}
.offers { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.offer { background: #fff; border: 1px solid var(--stone-2); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.offer.ok { border-color: var(--forest-soft); }
.offer-main { display: flex; flex-direction: column; gap: 3px; }
.offer-shop { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.offer-price { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.offer-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.offer-check { font-size: 13px; } .offer-check.ok { color: var(--forest); } .offer-check.warn { color: #9A5B00; }
.offer-acts { display: flex; gap: 8px; justify-content: flex-end; }
.prod-head h2 { margin: 0 0 12px; font-size: 20px; }
.prod-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.prod-nums > div { display: flex; flex-direction: column; background: var(--ivory); border-radius: 12px; padding: 12px; }
.prod-nums strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.sup-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.sup-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; background: #fff; border: 1px solid var(--stone-2); border-radius: 14px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.sup-card.off { opacity: .55; }
.sup-name, .sup-disc { display: flex; flex-direction: column; } .sup-disc { text-align: right; }
.sup-disc strong { font-size: 18px; color: var(--forest); }
.grp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.grp-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 6px 10px; background: var(--ivory); border-radius: 10px; }
.row-inline { display: flex; gap: 8px; } .row-inline input:first-child { flex: 1; } .pct-in { width: 80px; }
.center-row { display: flex; justify-content: center; margin: 10px 0 30px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.preview-scroll { overflow-x: auto; border: 1px solid var(--stone-2); border-radius: 10px; }
.pre-table { border-collapse: collapse; font-size: 13px; width: 100%; }
.pre-table th, .pre-table td { padding: 6px 10px; border-bottom: 1px solid var(--stone-2); white-space: nowrap; text-align: left; }
.pre-table th { background: var(--ivory); }
.ph-only { font-size: 12px; }

/* ---------- laptop: the menu moves to the left ---------- */
.side-only { display: none !important; }
@media (min-width: 1000px) {
  :root { --side: 224px; }
  body { padding-left: var(--side); padding-bottom: 24px; }
  .tabbar { top: 0; bottom: 0; right: auto; width: var(--side); flex-direction: column; align-items: stretch; gap: 2px;
            padding: 18px 12px 16px; background: var(--forest); border-top: 0; border-right: 1px solid rgba(0,0,0,.15); overflow-y: auto; }
  .side-only { display: flex !important; }
  .side-brand { flex-direction: column; text-decoration: none; color: var(--ivory); padding: 2px 12px 18px; }
  .side-brand span { font-weight: 800; letter-spacing: .26em; font-size: 16px; }
  .side-brand small { color: rgba(244,241,234,.6); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-label { color: rgba(244,241,234,.45); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 16px 12px 6px; }
  .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px;
         color: rgba(244,241,234,.78); font-size: 15px; font-weight: 600; }
  .tab svg { width: 20px; height: 20px; flex: none; }
  .tab:hover { background: rgba(255,255,255,.06); color: var(--ivory); }
  .tab.on { background: rgba(255,255,255,.12); color: #fff; }
  .tab .badge { position: static; margin-left: 6px; }
  .tab-add { order: -1; background: var(--ivory); color: var(--forest) !important; margin: 0 0 12px; justify-content: center; }
  .tab-add svg { background: none; color: var(--forest); width: 20px; height: 20px; padding: 0; }
  .tab-add:hover { background: #fff; }
  .side-brand { order: -2; }
  .side-end { margin-top: auto; }
  .top .brand { display: none; }
  .toasts { left: calc(var(--side) + 12px); bottom: 20px; }
}

/* ---------- quotes: list, start, lead card ---------- */
.ql-top { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ql-tabs { margin-bottom: 0; }
.ql-list, .lq-list { display: flex; flex-direction: column; gap: 6px; }
.ql-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main money" "status margin"; gap: 6px 12px; align-items: center;
          background: #fff; border: 1px solid var(--stone-2); border-radius: 14px; padding: 12px 14px; color: var(--ink); text-decoration: none; }
.ql-row:hover { border-color: var(--forest-soft); }
.ql-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; }
.ql-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-money { grid-area: money; display: flex; flex-direction: column; text-align: right; font-variant-numeric: tabular-nums; }
.ql-status { grid-area: status; justify-self: start; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--stone-2); }
.ql-status.st-sent { background: #E7F0FF; color: #1E4FA8; } .ql-status.st-accepted { background: var(--forest-soft); color: var(--forest); }
.ql-status.st-declined, .ql-status.st-expired { background: var(--red-soft); color: var(--red); }
.ql-margin { grid-area: margin; justify-self: end; font-size: 14px; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.ql-margin i { width: 9px; height: 9px; border-radius: 50%; background: var(--stone); display: inline-block; }
.m-good i { background: #3E8A4F; } .m-ok i { background: #D99A1E; } .m-bad i { background: var(--red); }
.ql-when { display: none; }
@media (min-width: 900px) {
  .ql-top { flex-direction: row; justify-content: space-between; align-items: center; }
  .ql-search input { width: 320px; }
  .ql-row { grid-template-columns: minmax(0, 2.4fr) 120px 150px 110px 70px; grid-template-areas: "main status money margin when"; padding: 12px 18px; border-radius: 10px; }
  .ql-when { display: block; grid-area: when; text-align: right; }
}
.qn-start { margin: 14px 0 20px; }
.qn-big { width: 100%; display: flex; gap: 16px; align-items: center; text-align: left; padding: 20px; border-radius: 18px; border: 0; cursor: pointer;
          background: linear-gradient(135deg, var(--forest), #2F5A45); color: var(--ivory); font: inherit; box-shadow: 0 8px 24px rgba(31,58,46,.25); }
.qn-big strong { display: block; font-size: 20px; } .qn-big small { color: rgba(244,241,234,.8); font-size: 15px; }
.qn-ico { font-size: 28px; width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.12); display: grid; place-items: center; flex: none; }
.qn-h { font-size: 15px; color: var(--muted); margin: 18px 4px 8px; }
.qn-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.qn-grid form { display: contents; }
.qn-card { display: flex; flex-direction: column; gap: 2px; text-align: left; background: #fff; border: 1px solid var(--stone-2); border-radius: 14px; padding: 14px 16px;
           color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; width: 100%; }
.qn-card small { color: var(--muted); font-size: 14px; } .qn-card:hover { border-color: var(--forest-soft); }
.qn-copy { background: var(--paper); }
@media (min-width: 700px) { .qn-grid { grid-template-columns: 1fr 1fr; } }
.lq-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.lq-head .panel-head { margin: 0; }
.lq-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--stone-2); border-radius: 12px; color: var(--ink); text-decoration: none; }
.lq-row small { display: block; } .lq-money { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.lq-money .ql-margin { font-size: 13px; }
.shop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.shop-list li { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 8px 10px; background: var(--ivory); border-radius: 10px; font-size: 15px; }
.shop-total { text-align: right; margin: 10px 0 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--forest); font: inherit; font-weight: 650; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.danger-text { color: var(--red) !important; }
.toast-btn { margin-left: 10px; background: rgba(255,255,255,.2); color: inherit; border: 0; border-radius: 8px; padding: 4px 10px; font: inherit; font-weight: 700; cursor: pointer; pointer-events: auto; }
.toast { pointer-events: auto; }
.doc-standalone { background: #E9E6DE; padding: 24px 0; }
.doc-standalone-wrap { display: flex; justify-content: center; }
.doc-standalone-wrap .qd-page { box-shadow: 0 10px 40px rgba(0,0,0,.12); }

/* ---------- the quote builder ---------- */
.qb-page .main.qb-main { max-width: 760px; padding: 0 0 120px; }
.qb-head { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.qb-head small { font-size: 13px; font-weight: 500; color: rgba(244,241,234,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-save { font-size: 12px; color: rgba(244,241,234,.75); white-space: nowrap; }
.qb-save.busy { color: #F3D9A4; } .qb-save.err { color: #FFB4A6; font-weight: 700; }
.qb-icon { width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ivory); display: inline-grid; place-items: center; cursor: pointer; flex: none; font: inherit; }
.qb-icon svg { width: 20px; height: 20px; }
.qb-icon:disabled { opacity: .35; cursor: default; }
.qb-icon.dark { color: var(--muted); width: 34px; height: 34px; }
.qb-icon:hover:not(:disabled) { background: rgba(255,255,255,.1); } .qb-icon.dark:hover { background: var(--stone-2); }
.qb-pdf { min-height: 38px !important; padding: 6px 12px !important; }
.qb-tabs { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 15; display: flex; gap: 4px; padding: 6px; margin: 0 0 10px; background: var(--ivory); border-bottom: 1px solid var(--stone-2); }
.qb-tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; }
.qb-tabs button.on { background: #fff; color: var(--forest); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.qb-build, .qb-side { padding: 0 12px; }
.qb[data-tab="build"] .qb-side, .qb[data-tab="doc"] .qb-build, .qb[data-tab="profit"] .qb-build { display: none; }
.qb[data-tab="doc"] .qb-profit, .qb[data-tab="profit"] .qb-doc-bar, .qb[data-tab="profit"] .qb-doc-scroll { display: none; }
.qb-card { background: var(--paper); border: 1px solid var(--stone-2); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.qb-h { font-size: 16px; margin: 0 0 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.qb-lbl { font-weight: 650; font-size: 15px; display: block; margin-bottom: 6px; color: var(--ink); }

/* assistant */
.qb-ai { background: linear-gradient(180deg, #fff, var(--paper)); border-color: var(--forest-soft); box-shadow: 0 6px 20px rgba(31,58,46,.07); }
.qb-ai-row { display: flex; gap: 8px; align-items: flex-end; }
.qb-ai-row textarea { flex: 1; min-height: 52px; resize: none; padding: 14px; border-radius: 14px; border: 1.5px solid var(--stone); font: inherit; background: #fff; }
.qb-ai-row textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--forest-soft); }
.qb-mic { flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 64px; height: 64px; border-radius: 18px;
          border: 0; background: var(--forest); color: var(--ivory); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 16px rgba(31,58,46,.3); }
.qb-mic svg { width: 26px; height: 26px; }
.qb-mic.rec { background: var(--red); animation: qbpulse 1.3s infinite; }
@keyframes qbpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(168,58,44,.45); } 50% { box-shadow: 0 0 0 12px rgba(168,58,44,0); } }
.qb-send { flex: none; width: 52px; height: 52px; border-radius: 14px; border: 1.5px solid var(--stone); background: #fff; color: var(--forest); cursor: pointer; display: grid; place-items: center; }
.ai-busy .qb-send, .ai-busy .qb-mic { opacity: .5; pointer-events: none; }
.qb-ai-hints { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.qb-ai-out:empty { display: none; }
.qb-ai-out { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.qb-ai-out p { margin: 0; }
.qb-ai-out .working { color: var(--forest); font-weight: 650; }
.qb-ai-out .said { color: var(--muted); font-style: italic; }
.qb-ai-out .meaning { font-weight: 650; }
.qb-ai-out .ai-err { color: var(--red); font-weight: 650; }
.qb-ai-out .note { color: #8A5A00; }
.qb-notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.qb-notes li { padding: 6px 10px; border-radius: 10px; background: var(--ivory); }
.qb-notes li.ask { background: var(--amber-soft); }

/* customer + texts */
.qb-cust { display: flex; flex-direction: column; margin-bottom: 10px; }
.qb-cust-name { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.qb-details .field > span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.qb-details .field + .field { margin-top: 10px; }
.qb-details textarea, .qb-incl textarea { resize: none; }
.qb-present .field { margin-bottom: 12px; }
.seg3 { grid-template-columns: repeat(3, 1fr) !important; }
.seg3 .seg-opt span { padding-left: 4px; padding-right: 4px; font-size: 14px; }
.qb-switch { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; font-size: 15px; cursor: pointer; }
.qb-switch input { width: 22px; height: 22px; min-height: 0; accent-color: var(--forest); flex: none; }
.qb-grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qb-more-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.qb-more form { margin: 0; } .qb-tpl { margin: 10px 0; }
.qb-add-sec { width: 100%; margin: 0 0 12px; border-style: dashed; }

/* sections and lines */
.qb-sec-head { display: flex; align-items: center; gap: 8px; }
.qb-sec-title { flex: 1; font-size: 18px; font-weight: 700; border: 0; background: transparent; padding: 6px 4px; min-height: 40px; border-radius: 8px; color: var(--ink); min-width: 0; }
.qb-sec-title:focus, .qb-sec-text:focus { background: #fff; outline: 2px solid var(--forest-soft); }
.qb-sec-total { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--forest); white-space: nowrap; }
.qb-sec-acts { display: flex; }
.qb-sec-text { width: 100%; border: 0; background: transparent; resize: none; font: inherit; font-size: 14px; color: var(--muted); padding: 2px 4px 8px; min-height: 0; border-radius: 8px; }
.qb-lines { display: flex; flex-direction: column; gap: 6px; }
.qb-line { background: #fff; border: 1px solid var(--stone-2); border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.qb-line.open { border-color: var(--forest-soft); box-shadow: 0 4px 14px rgba(31,58,46,.08); }
.qb-line.needs { border-color: #E5B85C; background: #FFFBF1; }
.qb-line.below .qb-total { color: var(--red); }
.qb-line.optional { border-style: dashed; }
.qb-line.optional .qb-total::after { content: " opt."; font-size: 11px; color: var(--muted); font-weight: 600; }
.qb-line.flash { animation: qbflash 1.2s; }
@keyframes qbflash { from { background: var(--forest-soft); } to { background: #fff; } }
.qb-line.dragging { opacity: .4; } .qb-line.drop-before, .qb-add.drop-before { box-shadow: 0 -3px 0 var(--forest); }
.qb-line-main { display: grid; grid-template-columns: 6px minmax(0, 1fr) 64px 70px; grid-template-areas: "kind name name more" "kind qty unit unit" "kind price price total"; gap: 4px 8px; align-items: center; padding: 8px 8px 8px 0; }
.qb-grip { display: none; }
.qb-kind { grid-area: kind; align-self: stretch; border-radius: 0 3px 3px 0; background: var(--stone); }
.k-material { background: #7A5C3E; } .k-hire { background: #A86B1D; } .k-labour { background: #2C4F3F; } .k-machine { background: #4D6B8A; }
.k-disposal { background: #8A8577; } .k-transport { background: #6E8A4D; } .k-subcontract { background: #8A4D6B; }
.qb-line input, .qb-line select { min-height: 42px; padding: 8px 10px; font-size: 16px; border-radius: 10px; }
.qb-name { grid-area: name; font-weight: 650; border-color: transparent !important; background: transparent; padding-left: 6px !important; }
.qb-name:focus { border-color: var(--stone) !important; background: #fff; }
.qb-qty { grid-area: qty; text-align: right; }
.qb-unit { grid-area: unit; }
.qb-price { grid-area: price; text-align: right; }
.qb-total { grid-area: total; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; padding-right: 4px; }
.qb-total em { color: #A86B1D; font-style: normal; font-weight: 650; font-size: 13px; }
.qb-more-btn { grid-area: more; justify-self: end; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; }
.qb-more-btn:hover { background: var(--stone-2); }
.qb-line input.bad { border-color: var(--red); background: var(--red-soft); }
.qb-needs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 10px 10px 14px; font-size: 14px; color: #8A5A00; }
.qb-needs span { flex-basis: 100%; }
.qb-line-more { padding: 4px 12px 12px 14px; border-top: 1px solid var(--stone-2); display: flex; flex-direction: column; gap: 8px; }
.qb-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.qb-mini-grid .field span, .qb-line-more .field span { font-size: 13px; }
.qb-line-sum { margin: 0; font-size: 14px; color: var(--muted); }
.qb-line-sum .pos { color: #2E7A43; } .qb-line-sum .neg { color: var(--red); }
.qb-line-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.qb-line-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.qb-line-acts .btn { min-height: 38px; }
.qb-move-sec { min-height: 38px; width: auto; font-size: 14px; }
.qb-empty { margin: 4px 0 8px; }
.qb-add { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; border-radius: 12px; }
.qb-search { position: relative; }
.qb-search-in { width: 100%; min-height: 48px; border: 1.5px dashed var(--stone); border-radius: 12px; padding: 10px 14px; font: inherit; background: #fff; }
.qb-search-in:focus { border-style: solid; border-color: var(--forest); outline: none; box-shadow: 0 0 0 3px var(--forest-soft); }
.qb-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25; background: #fff; border: 1px solid var(--stone); border-radius: 14px;
              box-shadow: 0 14px 40px rgba(0,0,0,.16); max-height: 360px; overflow-y: auto; padding: 6px; }
.qb-res { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px; border-radius: 10px; font: inherit; cursor: pointer; color: var(--ink); }
.qb-res b { display: block; font-weight: 650; } .qb-res small { color: var(--muted); font-size: 13px; } .qb-res em { color: #A86B1D; font-style: normal; }
.qb-res .r { text-align: right; white-space: nowrap; font-weight: 650; font-variant-numeric: tabular-nums; }
.qb-res.on, .qb-res:hover { background: var(--ivory); }
.qb-res-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 4px 2px; border-top: 1px solid var(--stone-2); margin-top: 4px; }
.qb-res-foot button { border: 0; background: var(--ivory); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px; cursor: pointer; color: var(--forest); font-weight: 600; }
.qb-quick, .qb-add-more { display: flex; flex-wrap: wrap; gap: 6px; }
.qb-quick:empty { display: none; }
.qb-quick .chip { border-left: 4px solid var(--stone); }
.qb-quick .qk-labour { border-left-color: #2C4F3F; } .qb-quick .qk-disposal { border-left-color: #8A8577; } .qb-quick .qk-transport { border-left-color: #6E8A4D; }
.qb-quick .qk-material { border-left-color: #7A5C3E; } .qb-quick .qk-hire { border-left-color: #A86B1D; }

/* profit dashboard */
.qb-profit { background: #fff; border: 1px solid var(--stone-2); border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; }
.pf-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 12px; align-items: start; }
.pf-k { display: flex; flex-direction: column; min-width: 0; }
.pf-k span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.pf-k b { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }
.pf-k small { font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.pf-profit b { color: var(--forest); }
.st-bad .pf-profit b, .st-bad .pf-margin b { color: var(--red); } .st-ok .pf-margin b { color: #A86B1D; } .st-good .pf-margin b { color: #2E7A43; }
.pf-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--stone); }
.st-good .pf-dot { background: #3E8A4F; } .st-ok .pf-dot { background: #D99A1E; } .st-bad .pf-dot { background: var(--red); }
.pf-more { grid-column: 1 / -1; justify-self: start; border: 0; background: none; color: var(--forest); font: inherit; font-weight: 650; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; font-size: 14px; }
.pf-gauge { position: relative; height: 6px; background: var(--stone-2); border-radius: 99px; margin: 10px 0 2px; overflow: visible; }
.pf-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--stone); transition: width .25s; }
.st-good .pf-fill { background: #3E8A4F; } .st-ok .pf-fill { background: #D99A1E; } .st-bad .pf-fill { background: var(--red); }
.pf-target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .55; }
.pf-detail { display: none; margin-top: 12px; }
.detail .pf-detail { display: block; }
.pf-stack { display: flex; height: 14px; border-radius: 6px; overflow: hidden; background: var(--stone-2); margin-bottom: 12px; }
.pf-stack i { display: block; height: 100%; transition: width .25s; }
.pb-material { background: #7A5C3E; } .pb-hire { background: #A86B1D; } .pb-labour { background: #2C4F3F; } .pb-machine { background: #4D6B8A; }
.pb-disposal { background: #8A8577; } .pb-transport { background: #6E8A4D; } .pb-subcontract { background: #8A4D6B; } .pb-other { background: #B5B0A2; }
.pb-overhead { background: #C9C2B1; } .pb-profit { background: #59A86B; }
.pf-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.pf-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: right; padding: 4px 6px; font-weight: 700; }
.pf-table td { padding: 6px; text-align: right; border-top: 1px solid var(--stone-2); white-space: nowrap; }
.pf-table td:first-child, .pf-table th:first-child { text-align: left; white-space: normal; }
.pf-table td small { color: var(--muted); }
.pf-table tfoot td { font-weight: 700; border-top: 2px solid var(--stone); }
.pf-table .neg { color: var(--red); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }
.pf-facts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.pf-facts b { color: var(--ink); }
.pf-warn { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pf-warn li { background: var(--amber-soft); color: #7A4B00; border-radius: 10px; padding: 7px 10px; font-size: 14px; font-weight: 600; }

/* the document pane */
.qb-doc-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 2px 2px 8px; }
.qb-zoom { display: inline-flex; background: #fff; border: 1px solid var(--stone-2); border-radius: 10px; overflow: hidden; }
.qb-zoom button { white-space: nowrap; border: 0; background: none; min-width: 38px; height: 34px; font: inherit; font-weight: 650; cursor: pointer; color: var(--ink); font-size: 14px; }
.qb-zoom button:hover { background: var(--ivory); }
.qb-doc-scroll { background: #E4E0D6; border-radius: 16px; padding: 16px; overflow: auto; }
.qb-doc { width: max-content; margin: 0 auto; }
.qb-doc .qd-page { box-shadow: 0 10px 34px rgba(30,30,20,.16); border-radius: 2px; }

/* phone: the profit bar */
.qb-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 28; display: flex; justify-content: space-between; gap: 8px;
          padding: 8px 16px; background: var(--forest); color: var(--ivory); cursor: pointer; box-shadow: 0 -6px 18px rgba(0,0,0,.12); }
.qb-bar span { display: flex; flex-direction: column; } .qb-bar small { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.qb-bar b { font-size: 17px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.qb-bar .bm { text-align: right; align-items: flex-end; }
.qb[data-tab="profit"] .qb-bar { display: none; }
.qb-page .toasts { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 70px); }
.qb.locked .qb-build { opacity: .7; }

/* sheet (links, price search) */
.qb-sheet { position: fixed; inset: 0; z-index: 60; background: rgba(20,24,20,.45); display: flex; align-items: flex-end; justify-content: center; }
.qb-sheet-box { background: var(--paper); width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.qb-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.qb-sheet-head h3 { font-size: 19px; }
.qb-sheet-msg { margin-top: 10px; } .qb-sheet-msg .working { color: var(--forest); font-weight: 650; }

@media (min-width: 700px) {
  .qb-line-main { grid-template-columns: 6px minmax(0, 1fr) 76px 76px 110px 104px 36px; grid-template-areas: "kind name qty unit price total more"; padding: 4px 4px 4px 0; }
  .qb-grid4 { grid-template-columns: repeat(4, 1fr); }
  .qb-mini-grid { grid-template-columns: repeat(4, 1fr); }
  .pf-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; }
  .pf-more { grid-column: auto; justify-self: end; align-self: center; }
  .qb-sheet { align-items: center; } .qb-sheet-box { border-radius: 20px; }
}
@media (min-width: 1000px) {
  .qb-page .main.qb-main { max-width: none; padding: 0; }
  .qb-page { padding-bottom: 0; }
  .qb { display: grid; grid-template-columns: minmax(560px, 1.12fr) minmax(420px, 1fr); height: calc(100vh - 60px); }
  .qb-tabs, .qb-bar { display: none !important; }
  .qb[data-tab] .qb-build, .qb[data-tab] .qb-side, .qb[data-tab] .qb-profit, .qb[data-tab] .qb-doc-bar, .qb[data-tab] .qb-doc-scroll { display: block; }
  .qb[data-tab] .qb-doc-bar { display: flex; }
  .qb-build { overflow-y: auto; padding: 16px 18px 40px 22px; }
  .qb-side { display: flex !important; flex-direction: column; padding: 16px 22px 16px 6px; min-height: 0; background: linear-gradient(90deg, rgba(0,0,0,.025), transparent 18px); }
  .qb-profit { flex: none; max-height: 52vh; overflow-y: auto; }
  .qb-doc-scroll { flex: 1; min-height: 0; }
  .qb-grip { display: block; grid-area: grip; cursor: grab; color: var(--stone); font-size: 13px; letter-spacing: -2px; text-align: center; user-select: none; }
  .qb-line-main { grid-template-columns: 14px 6px minmax(0, 1fr) 62px 70px 96px 94px 32px; grid-template-areas: "grip kind name qty unit price total more"; gap: 4px 6px; padding-left: 2px; }
  .qb-line input, .qb-line select { font-size: 15px; padding: 8px 8px; }
  .qb-line:hover .qb-grip { color: var(--muted); }
  .qb-page .toasts { bottom: 20px; left: calc(var(--side) + 12px); right: auto; width: min(520px, 40vw); }
}
@media (min-width: 1500px) {
  .qb { grid-template-columns: minmax(640px, 1.1fr) minmax(620px, 1fr); }
}
.chip-sm { font-size: 13.5px; min-height: 36px; padding: 5px 11px; font-weight: 600; text-align: left; }
.ai-try { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 699px) {
  .qb-page .top .top-search, .qb-page [data-qb=redo] { display: none; }
  .qb-page .top { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .qb-page .top-title { font-size: 17px; min-width: 0; }
  .qb-head span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .qb-save { font-size: 11px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
  .qb-details .link-btn { font-size: 14px; white-space: nowrap; }
  .qb-details .field > span { flex-wrap: wrap; }
}

/* =================================================================================================
   LAPTOP SHELL (≥1000px): light top bar with search, dark menu on the left, pages that use the width.
   ================================================================================================= */
.wide-only { display: none !important; }
.narrow-only-block { display: block; }
.wide-only-block { display: none !important; }
.label.lbl-won { background: #DDEBDD; color: #2E6B3A; }
@media (min-width: 1000px) {
  .wide-only { display: flex !important; }
  .narrow-only, .narrow-only-block { display: none !important; }
  .wide-only-block { display: block !important; }

  /* top bar: light, quiet, with search */
  .top { background: rgba(251,250,246,.92); backdrop-filter: saturate(1.4) blur(8px); color: var(--ink); border-bottom: 1px solid var(--stone-2);
         padding: 10px 28px; min-height: 60px; }
  .top-title { font-size: 20px; color: var(--ink); }
  .top .back { color: var(--muted); font-size: 26px; }
  .top .back:hover { color: var(--forest); }
  .top .btn-ghost { color: var(--forest); border-color: var(--stone); background: #fff; }
  .top .btn-primary { background: var(--forest); color: var(--ivory); }
  .top-find { position: relative; align-items: center; width: min(420px, 34vw); margin-left: auto; }
  .top-find svg { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
  .top-find input { width: 100%; min-height: 40px; padding: 8px 40px 8px 38px; border-radius: 12px; border: 1px solid var(--stone); background: #fff; font-size: 15px; }
  .top-find input:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px var(--forest-soft); }
  .top-find kbd { position: absolute; right: 10px; font: 600 12px/1 var(--font); color: var(--muted); border: 1px solid var(--stone); border-radius: 6px; padding: 3px 6px; background: var(--paper); }
  .top-title + .top-find { margin-left: 16px; }
  .top > .btn, .top > .qb-save, .top > .qb-icon { order: 2; }
  .top-find { order: 1; }

  /* menu: user at the bottom */
  .side-user { order: 99; margin-top: 10px; align-items: center; gap: 10px; padding: 12px 8px 2px; border-top: 1px solid rgba(255,255,255,.1); }
  .side-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.14); color: var(--ivory); display: grid; place-items: center; font-weight: 700; flex: none; }
  .side-who { display: flex; flex-direction: column; flex: 1; min-width: 0; color: var(--ivory); line-height: 1.2; }
  .side-who b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .side-who small { color: rgba(244,241,234,.55); font-size: 12px; }
  .side-out { width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: rgba(244,241,234,.7); cursor: pointer; display: grid; place-items: center; }
  .side-out:hover { background: rgba(255,255,255,.1); color: #fff; } .side-out svg { width: 18px; height: 18px; }
  .side-end { margin-top: auto; }

  /* page widths */
  .main { max-width: 980px; padding: 28px 36px 56px; }
  .main.narrow-page { max-width: 780px; }
  .main.wide-page { max-width: 1320px; }
  .main.wide { max-width: none; }
  .main.lead-wide { max-width: 1320px; }
  .main.settings-home { max-width: 1180px; }
  .main.with-subnav { max-width: 1180px; }

  /* settings: sub-menu on the left of the page */
  .settings-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; align-items: start; }
  .settings-body { max-width: 820px; min-width: 0; }
  .settings-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
  .sn-home { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
  .sn-group { display: flex; flex-direction: column; gap: 2px; }
  .sn-group span { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 10px 4px; }
  .sn-group a { padding: 8px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 550; font-size: 15px; }
  .sn-group a:hover { background: var(--stone-2); }
  .sn-group a.on { background: #fff; color: var(--forest); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
  .with-subnav .top .back { display: none; }
  .set-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px 26px; align-items: start; }
  .set-group h2 { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 4px 10px; }
  .set-group .menu { gap: 8px; }
  .set-group .menu a { min-height: 0; padding: 14px 16px; }
  .set-group .menu a:hover { border-color: var(--forest-soft); box-shadow: 0 4px 14px rgba(31,58,46,.06); }

  /* lead and client pages: work on the left, facts on the right */
  .lead-page { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
  .lp-main, .lp-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .lp-side { align-self: start; }
  .lead-page .panel, .lead-page .actions, .lead-page .next-banner, .lead-page .lead-head { margin: 0; }
  .lead-page .lo:empty { display: none; }
  .lead-page .actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .lead-page .actions .btn-action { flex: 0 1 auto; min-width: 130px; }
  .lead-page .actions form { display: contents; }
  .lead-head h2 { font-size: 28px; }
  .lp-side .details { grid-template-columns: max-content 1fr; font-size: 15px; }
  .lp-side .panel.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .lp-main .thread, .lp-main .msg-thread { max-height: 520px; overflow-y: auto; }

  /* client list as a table */
  .list-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
  .list-top .search-form { margin: 0; width: 460px; }
  .ctable { background: #fff; border: 1px solid var(--stone-2); border-radius: 14px; overflow: hidden; }
  .crow { display: grid; grid-template-columns: minmax(220px, 2fr) 170px minmax(140px, 1.2fr) 170px 130px 56px; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--stone-2); }
  .crow:first-child { border-top: 0; }
  .crow:hover:not(.chead) { background: var(--paper); }
  .chead { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: var(--paper); padding-top: 12px; padding-bottom: 12px; }
  .cname { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
  .cname strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cav { width: 34px; height: 34px; border-radius: 50%; background: var(--forest-soft); color: var(--forest); display: grid; place-items: center; font-weight: 700; flex: none; }
  .cphone a { color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; } .cphone a:hover { color: var(--forest); text-decoration: underline; }
  .cleads { display: flex; gap: 6px; flex-wrap: wrap; }
  .cact { justify-self: end; } .cact .btn-icon { width: 40px; height: 40px; }

  /* leads: Board / lists */
  .lead-modes { margin: 0 0 16px; max-width: 760px; }
  .lead-modes .n { color: var(--muted); font-weight: 600; margin-left: 4px; font-size: 13px; }
  .leads-list-mode .list-view { display: block; max-width: 980px; margin: 0 auto; }
  .leads-list-mode .board-view { display: none; }
  .leads-list-mode .list-view > .chips { display: none; }
  .main.wide { padding-left: 28px; padding-right: 28px; }
  .board { grid-template-columns: repeat(4, minmax(240px, 1fr)) 200px; gap: 16px; }
  .col { padding: 12px; }
  .col .card-row1 { flex-wrap: wrap; row-gap: 4px; }
  .col .card-name { flex: 1 1 100%; }
  .col .card-row1 .label { order: 2; }

  /* search, log, forms */
  .log li { display: grid; grid-template-columns: 150px 110px minmax(0, 1fr); gap: 12px; padding: 10px 4px; }
  .log-what { min-width: 0; } .log-changes { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
  .log-areas { margin: 8px 0 12px; }
  .pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }

  /* quote builder header in the light bar */
  .qb-page .top .qb-save { color: var(--muted); } .qb-page .top .qb-save.busy { color: #A86B1D; } .qb-page .top .qb-save.err { color: var(--red); }
  .qb-page .top .qb-icon { color: var(--ink); } .qb-page .top .qb-icon:hover:not(:disabled) { background: var(--stone-2); }
  .qb-head small { color: var(--muted); }
  .qb-page .top-find { width: min(300px, 22vw); }
  .qb { height: calc(100vh - 61px); }
}
@media (max-width: 999px) { .log li > span { margin-right: 6px; } .log-changes { display: block; } }

/* ---------- security and privacy ---------- */
.sec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sec-list li { display: grid; grid-template-columns: 26px 1fr; grid-template-areas: "dot b" "dot s"; column-gap: 8px; padding: 10px 12px; background: #fff; border: 1px solid var(--stone-2); border-radius: 12px; }
.sec-list li::before { grid-area: dot; content: "✓"; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: #DDEBDD; color: #2E6B3A; margin-top: 1px; }
.sec-list li.warn::before { content: "!"; background: var(--amber-soft); color: #8A5A00; }
.sec-list b { grid-area: b; } .sec-list span { grid-area: s; color: var(--muted); font-size: 14px; }
@media (min-width: 1000px) { .sec-list { grid-template-columns: 1fr 1fr; } }
.codes-box { background: var(--amber-soft); border-radius: 12px; padding: 12px 14px; }
.codes { columns: 2; margin: 8px 0 0; padding-left: 22px; } .codes code { font-size: 17px; letter-spacing: .04em; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.qr-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.qr { width: 200px; height: 200px; background: #fff; border-radius: 12px; border: 1px solid var(--stone-2); padding: 6px; }
.key { display: inline-block; margin-top: 4px; font-size: 15px; letter-spacing: .06em; background: var(--ivory); padding: 4px 8px; border-radius: 8px; word-break: break-all; }
.code-input { font-size: 22px !important; letter-spacing: .2em; text-align: center; max-width: 220px; font-variant-numeric: tabular-nums; }
.svc-list { display: grid; gap: 8px; }
.svc { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--stone-2); border-radius: 12px; }
.svc p { margin: 2px 0; font-size: 14px; } .svc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--stone); margin-top: 6px; } .svc-dot.on { background: #3E8A4F; }
@media (min-width: 1000px) { .svc-list { grid-template-columns: 1fr 1fr; } }
.danger-panel { border-color: var(--red-soft); } .danger-panel h2 { font-size: 22px; }
.plain-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.privacy-mini { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .privacy-mini .panel-head { flex-basis: 100%; margin: 0; }

/* lead page order on a phone (one column), two columns on a computer */
.lead-page { display: flex; flex-direction: column; gap: 0; }
.lp-main, .lp-side { display: contents; }
/* phone order: who and what → next step → act → the job → what they want → quote → follow-up → messages → the rest */
.lo1 { order: 1; }
.lo2 { order: 2; }
.lo5 { order: 3; }
.lo3 { order: 4; }
.lo11 { order: 5; }
.lo4 { order: 6; }
.lo6 { order: 7; }
.lo9 { order: 8; }
.lo8 { order: 9; }
.lo7 { order: 10; }
.lo13 { order: 11; }
.lo12 { order: 12; }
.lo10 { order: 13; }
.lo14 { order: 14; }
@media (min-width: 1000px) {
  .lead-page { display: grid; gap: 24px; }
  .lp-main, .lp-side { display: flex; }
  .lead-page .lo { order: 0; }
  .lead-page .lo > .panel, .lead-page .lo > section { margin-bottom: 0; }
  .lead-page .actions .btn-action { width: auto; flex: 1 1 130px; }
  .lead-page .actions .btn-action.btn-primary { flex: 1.4 1 160px; }
  .mini-top { flex-wrap: wrap; row-gap: 4px; }
  .mini-top strong { flex: 1 1 100%; }
  .board { grid-template-columns: repeat(4, minmax(230px, 1fr)) 170px; }
}
@media (min-width: 1000px) {
  body:has(.with-subnav) .top .back { display: none; }
  /* the quote builder gets the whole screen: the menu folds into a rail and opens when you point at it */
  body.qb-page { --side: 72px; }
  .qb-page .tabbar { transition: width .18s ease, box-shadow .18s; overflow-x: hidden; }
  .qb-page .tabbar:not(:hover) .tab span, .qb-page .tabbar:not(:hover) .side-label, .qb-page .tabbar:not(:hover) .side-brand small,
  .qb-page .tabbar:not(:hover) .side-who, .qb-page .tabbar:not(:hover) .side-out { display: none !important; }
  .qb-page .tabbar:not(:hover) .tab { justify-content: center; padding: 0; }
  .qb-page .tabbar:not(:hover) .side-brand span { letter-spacing: 0; font-size: 0; }
  .qb-page .tabbar:not(:hover) .side-brand span::before { content: "A"; font-size: 18px; }
  .qb-page .tabbar:not(:hover) .side-brand { align-items: center; padding-left: 0; padding-right: 0; }
  .qb-page .tabbar:not(:hover) .side-user { justify-content: center; padding-left: 0; padding-right: 0; }
  .qb-page .tabbar:hover { width: 224px; box-shadow: 12px 0 40px rgba(0,0,0,.25); }
  .qb-page .top-find { display: none !important; }
  .qb { grid-template-columns: minmax(600px, 1.15fr) minmax(420px, 1fr); }
}
/* the lead form's "More" box (a calendar rule also uses .more) */
details.more { font-style: normal; font-size: inherit; font-weight: inherit; color: inherit; margin-left: 0; }
details.more summary { font-size: 15px; font-weight: 650; color: var(--forest); }
@media (min-width: 1000px) {
  .tab-add.on { background: #fff; }
  .tab-add.on svg { background: none; }
  /* sign-in: brand on the left, form on the right */
  .login-page { padding-left: 0; }
  .login-page .main { max-width: none; padding: 0; min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: stretch; }
  .login-page .main::before { content: "AEGIS"; display: flex; align-items: flex-end; padding: 56px; font-size: 64px; font-weight: 800; letter-spacing: .2em; color: var(--ivory);
                              background: radial-gradient(120% 90% at 20% 10%, #2F5A45 0%, var(--forest) 55%, #14281F 100%); }
  .login-page .login-box { align-self: center; padding: 40px; }
}

/* lead form: two columns on a computer */
.lf-cols, .lf-col { display: contents; }
@media (min-width: 1000px) {
  .lf-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 40px; align-items: start; }
  .lf-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  .main:has(.lead-form) { max-width: 1120px; }
  .lead-form > .btn-big, .lead-form > .form-end { max-width: 420px; margin-left: auto; }
}
.ql-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.ql-kpis > div { background: #fff; border: 1px solid var(--stone-2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.ql-kpis span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.ql-kpis b { font-size: 22px; font-variant-numeric: tabular-nums; } .ql-kpis small { color: var(--muted); font-size: 13px; }
.ql-kpis .ql-new .btn { align-self: flex-start; margin: 4px 0 2px; }
@media (min-width: 1000px) { .ql-kpis { grid-template-columns: repeat(4, 1fr); gap: 14px; } }

/* ===================== The customer's quote page (/t/…) ===================== */
.tq-body { --tq-brand: #5E700F; --tq-ink: #23261F; --tq-line: #E4E0D5; background: #F3F0E8; padding-bottom: 0; }
.tq-head { background: #FFFFFF; border-bottom: 1px solid var(--tq-line); position: sticky; top: 0; z-index: 10; }
.tq-head-in { max-width: 1240px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 18px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tq-word { font-weight: 800; font-size: 26px; letter-spacing: -0.06em; color: var(--tq-brand); line-height: 1; }
.tq-head-meta { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--muted); }
.tq-call { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--tq-ink); font-weight: 600; border: 1px solid var(--tq-line); border-radius: 999px; padding: 6px 12px; }
.tq-call svg { width: 16px; height: 16px; }
.tq-main { max-width: 1240px; padding: 22px 18px 40px; }
.tq-staff { background: var(--amber-soft); color: #6B4511; border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 0 0 14px; }
.tq-hero { margin: 4px 0 20px; max-width: 760px; }
.tq-kicker { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tq-brand); }
.tq-kicker.tq-ok { color: #2E6B3A; } .tq-kicker.tq-warn { color: var(--amber); }
.tq-hero h1 { font-size: clamp(26px, 4.2vw, 40px); line-height: 1.1; letter-spacing: -0.025em; color: var(--tq-ink); }
.tq-lead { margin: 10px 0 0; font-size: 18px; color: #4D524A; max-width: 640px; }
.tq-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tq-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; padding: 6px 12px; border-radius: 999px; background: #FFFFFF; border: 1px solid var(--tq-line); color: var(--tq-ink); }
.tq-chip-link { text-decoration: none; font-weight: 600; } .tq-chip-link:hover { border-color: var(--tq-brand); }
.tq-chip svg { width: 16px; height: 16px; }
.tq-error { background: var(--red-soft); color: var(--red); border-radius: 12px; padding: 12px 14px; font-weight: 600; max-width: 760px; }

.tq-grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.tq-docwrap { min-width: 0; }
.tq-doc-frame { position: relative; overflow: hidden; border-radius: 6px; box-shadow: 0 1px 2px rgba(30,30,20,.06), 0 12px 40px rgba(30,30,20,.10); background: #fff; }
.tq-doc { transform-origin: 0 0; }
.tq-terms { margin-top: 18px; background: #FFFFFF; border: 1px solid var(--tq-line); border-radius: 14px; }
.tq-terms summary { cursor: pointer; padding: 16px 18px; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.tq-terms summary::-webkit-details-marker { display: none; }
.tq-terms summary span { font-weight: 700; font-size: 17px; color: var(--tq-ink); }
.tq-terms summary span::after { content: " +"; color: var(--tq-brand); }
.tq-terms[open] summary span::after { content: " –"; }
.tq-terms summary small { color: var(--muted); font-size: 14px; }
.tq-terms-body { padding: 0 18px 18px; font-size: 15px; line-height: 1.55; color: #3C4039; max-width: 760px; }
.tq-terms-body h3 { font-size: 16px; margin: 18px 0 6px; color: var(--tq-ink); }
.tq-terms-body p { margin: 0 0 8px; } .tq-terms-body ul { margin: 0 0 8px; padding-left: 20px; }

.tq-side { display: flex; flex-direction: column; gap: 14px; }
.tq-card { background: #FFFFFF; border: 1px solid var(--tq-line); border-radius: 18px; padding: 20px; box-shadow: 0 1px 2px rgba(30,30,20,.04); display: flex; flex-direction: column; gap: 14px; }
.tq-card-kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tq-price { margin: -6px 0 0; font-size: 40px; font-weight: 750; letter-spacing: -0.03em; color: var(--tq-ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tq-price small { font-size: 20px; font-weight: 600; color: var(--muted); }
.tq-price-sub { margin: -10px 0 0; color: var(--muted); font-size: 14px; }
.tq-options { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tq-options legend { font-weight: 700; font-size: 15px; margin-bottom: 6px; padding: 0; }
.tq-options legend .muted { font-weight: 400; font-size: 14px; }
.tq-opt { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: start; padding: 12px; border: 1.5px solid var(--tq-line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.tq-opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--tq-brand); }
.tq-opt.on { border-color: var(--tq-brand); background: #F6F8EE; }
.tq-opt-name { font-size: 15px; font-weight: 600; } .tq-opt-name small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.tq-opt-price { font-size: 15px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tq-name input { font-size: 17px; }
.tq-check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 14px; color: #4D524A; line-height: 1.45; }
.tq-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--tq-brand); }
.tq-note summary { cursor: pointer; font-size: 15px; font-weight: 600; color: var(--tq-ink); }
.tq-note textarea { margin-top: 8px; width: 100%; }
.tq-summary { background: #F7F5EF; border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #4D524A; }
.tq-summary p { margin: 0 0 4px; } .tq-summary p:last-child { margin: 0; } .tq-summary b { color: var(--tq-ink); }
.tq-accept { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; font-size: 19px; background: var(--tq-brand); border-color: var(--tq-brand); color: #fff; border-radius: 14px; }
.tq-accept small { font-size: 13px; font-weight: 500; opacity: .9; }
.tq-accept:hover { filter: brightness(1.06); }
.tq-fine { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.tq-h3 { font-size: 17px; margin: 0; color: var(--tq-ink); }
.tq-help textarea { width: 100%; }
.tq-decline summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.tq-decline form { margin-top: 10px; }
.tq-radio { display: flex; gap: 8px; align-items: center; font-size: 15px; padding: 4px 0; }

.tq-receipt { background: #FFFFFF; border: 1px solid #CFE0CF; border-radius: 18px; padding: 22px; margin: 0 0 22px; max-width: 760px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 8px 30px rgba(30,60,40,.08); }
.tq-receipt-head { display: flex; gap: 14px; align-items: center; } .tq-receipt-head h2 { font-size: 22px; } .tq-receipt-head p { margin: 2px 0 0; }
.tq-tick { flex: none; width: 46px; height: 46px; border-radius: 50%; background: #2E6B3A; color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 700; }
.tq-dl { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--tq-line); }
.tq-dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--tq-line); font-size: 15px; }
.tq-dl dt { color: var(--muted); } .tq-dl dd { margin: 0; text-align: right; font-weight: 600; }
.tq-dl-total dd { font-size: 18px; }
.tq-steps { margin: 0; padding-left: 20px; color: #4D524A; } .tq-steps li { margin: 2px 0; }
.tq-btn-wide { align-self: flex-start; }
.tq-foot { max-width: 1240px; margin: 34px auto 0; padding: 18px 0 0; border-top: 1px solid var(--tq-line); display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.tq-foot a { color: var(--muted); }

@media (min-width: 1000px) {
  .tq-grid { grid-template-columns: minmax(0, 1fr) 390px; gap: 32px; }
  .tq-grid.tq-solo { grid-template-columns: minmax(0, 860px); }
  .tq-side { position: sticky; top: 84px; }
  .tq-main { padding-top: 34px; }
}
.tq-grid.tq-solo { max-width: 860px; } .tq-receipt { max-width: 860px; }
.tq-receipt .btn-primary { background: var(--tq-brand); border-color: var(--tq-brand); color: #fff; }
@media (max-width: 520px) { .tq-head-meta > span:first-child { display: none; } .tq-price { font-size: 34px; } }

/* ===================== Sending a quote (owner) ===================== */
.sq { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.sq-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sq-main .panel { margin: 0; }
.sq-total { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sq-total > div { display: flex; flex-direction: column; gap: 2px; }
.sq-total strong { font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sq-total strong small { font-size: 14px; font-weight: 500; color: var(--muted); }
.sq-total .m-bad { color: var(--red); } .sq-total .m-ok { color: var(--amber); } .sq-total .m-good { color: #2E6B3A; }
.sq-prev p { margin: 0; }
.sq-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sq-checks li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: 15px; }
.sq-checks i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 13px; }
.sq-stop i { background: var(--red-soft); color: var(--red); } .sq-stop span { color: var(--red); font-weight: 600; }
.sq-warn i { background: var(--amber-soft); color: var(--amber); }
.sq-ok i { background: var(--forest-soft); color: var(--forest); }
.sq-doc-cap { margin: 0 0 8px; }
@media (min-width: 1000px) {
  .sq { grid-template-columns: minmax(380px, 560px) minmax(0, 1fr); gap: 28px; }
  .sq-doc { position: sticky; top: 76px; }
}

/* the "what the customer has" bar in the builder */
.qb-sent { grid-column: 1 / -1; background: var(--paper); border: 1px solid var(--stone); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.qb-sent.st-accepted { border-color: #BFD8C1; background: #F4FAF3; }
.qb-sent.st-declined { border-color: #E8C7C0; } .qb-sent.st-expired, .qb-sent.st-draft { border-color: #E8D3AE; }
.qb-sent-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 15px; }
.qb-sent-pill { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--forest-soft); color: var(--forest); }
.qb-sent-pill.ok { background: #2E6B3A; color: #fff; } .qb-sent-pill.bad { background: var(--red-soft); color: var(--red); } .qb-sent-pill.warn { background: var(--amber-soft); color: var(--amber); }
.qb-sent-actions, .qb-sent-next { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qb-sent-actions form { margin: 0; }
.qb-sent-changed { margin: 0; background: var(--amber-soft); color: #6B4511; border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.qb-sent-changed a { font-weight: 700; color: #6B4511; }
.top .qb-sendbtn.btn-primary { background: var(--amber-soft); color: var(--forest); border-color: transparent; font-weight: 750; }
.tq-mobile-bar { display: none; }
@media (max-width: 999px) {
  .tq-mobile-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--tq-brand); color: #fff; text-decoration: none; border-radius: 16px; padding: 14px 18px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
  .tq-mobile-bar small { display: block; font-weight: 500; opacity: .85; font-size: 13px; }
  .tq-body.has-bar .tq-main { padding-bottom: 110px; }
}
.qb-sent { margin: 0 0 10px; }
@media (min-width: 1000px) {
  .qb.has-sent { grid-template-rows: auto minmax(0, 1fr); }
  .qb-sent { margin: 12px 22px 0; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .qb-sent-changed, .qb-sent-next { flex-basis: 100%; }
}
.mono-ish { font-size: 14px; line-height: 1.5; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.lq-seen { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; } .lq-seen b { color: var(--forest); }
@media (min-width: 1000px) { body.public { padding-left: 0; } }
.tq-zoom { display: none; }
@media (max-width: 700px) { .tq-zoom { display: block; text-align: center; margin: 10px 0 0; font-weight: 600; font-size: 15px; color: var(--tq-ink); } }
.sq-total strong { white-space: nowrap; font-size: 22px; }
.warn-box { background: var(--amber-soft); color: #6B4511; border-radius: 12px; padding: 10px 14px; font-size: 15px; margin: 0 0 12px; }
.qb-sent.st-change { border-color: #C9D7E8; background: #F5F8FC; }
.qb-sent-change { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; background: #EAF1FA; color: #1E3A5C; border-radius: 10px; padding: 8px 12px; }
.qb-sent-change form { margin: 0 0 0 auto; }
.tq-terms-check { background: #F6F8EE; border: 1.5px solid #DCE3C4; border-radius: 12px; padding: 12px; }
.tq-terms-check.has-error, .tq-check.has-error { border-color: var(--red); background: var(--red-soft); }
.tq-code input { font-size: 30px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; padding: 12px; }
.tq-code-more { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.tq-code-more form { margin: 0; }
.tq-signed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tq-signed li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 15px; padding: 8px 0; border-bottom: 1px solid var(--tq-line); }
.tq-signed a { font-weight: 650; color: var(--tq-ink); }

/* history and proof */
.hp-head { display: flex; flex-direction: column; gap: 10px; }
.hp-seal { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; }
.hp-seal i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 20px; }
.hp-seal.ok i { background: #2E6B3A; color: #fff; } .hp-seal.bad i { background: var(--red); color: #fff; }
.hp-seal strong { display: block; font-size: 17px; }
.hp-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hp-v { border-left: 4px solid var(--stone); } .hp-v.signed { border-left-color: #2E6B3A; } .hp-v.declined { border-left-color: var(--red); }
.hp-v-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.hp-v-head h2 { font-size: 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hp-v-head p { margin: 4px 0 0; }
.hp-v-money { text-align: right; } .hp-v-money b { display: block; font-size: 20px; } 
.hp-dl { margin: 12px 0; display: grid; gap: 0; border-top: 1px solid var(--stone-2); }
.hp-dl > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--stone-2); font-size: 14.5px; }
.hp-dl dt { color: var(--muted); } .hp-dl dd { margin: 0; }
.hp-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.hp-doc-ok { font-size: 13.5px; margin: 8px 0; } .hp-doc-ok.ok { color: #2E6B3A; } .hp-doc-ok.bad { color: var(--red); font-weight: 700; }
.hp-seals { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 6px 0 10px; }
.hp-seals th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--stone); }
.hp-seals td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--stone-2); vertical-align: top; }
.hp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hp-lock { margin: 0 0 6px; font-weight: 600; }
@media (max-width: 700px) { .hp-dl > div { grid-template-columns: 1fr; gap: 2px; } .hp-seals th:nth-child(3), .hp-seals td:nth-child(3) { display: none; } }
.sq-changes { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.sq-changes li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: var(--paper); border: 1px solid var(--stone-2); }
.sq-changes .ch-added b { color: #2E6B3A; } .sq-changes .ch-removed b { color: var(--red); }
.sq-ch-diff { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 999px) { .tq-code-first .tq-side { order: -1; } }


/* ===================================================================================================
   Phone (under 1000 px). The laptop is untouched: every rule below is inside this query.
   Principles: thumbs at the bottom (tabs, the one main button), the reason for the screen at the top,
   one clear primary action per screen, nothing important behind a sideways scroll, 44 px tap targets.
   =================================================================================================== */
.narrow-only-flex { display: flex; }
.fab { display: none; }
@media (min-width: 1000px) { .narrow-only-flex { display: none !important; } }
@media (max-width: 999px) {
  :root { --tabbar: 60px; }
  body { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px); }

  /* top bar: light, quiet, title first */
  .top { background: rgba(251,250,246,.94); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
         color: var(--ink); border-bottom: 1px solid var(--stone-2); min-height: 54px; gap: 8px;
         padding: calc(6px + env(safe-area-inset-top)) 8px 6px 16px; }
  .top .brand { display: none; }
  .top-title { font-size: 19px; font-weight: 700; color: var(--ink); min-width: 0; }
  .top .back { color: var(--ink); font-size: 32px; padding: 0 8px 4px 0; margin-left: -4px; }
  .top-search { color: var(--ink); }
  .top .btn-ghost { color: var(--forest); border-color: var(--stone); background: #fff; }
  .top .btn-primary { background: var(--forest); color: var(--ivory); }
  .btn-top { min-height: 38px; padding: 6px 14px; font-size: 15px; border-radius: 10px; }

  /* tab bar: five equal targets, the active one marked twice (colour + bar) */
  .tabbar { background: rgba(251,250,246,.97); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
            border-top: 1px solid var(--stone-2); }
  .tab { font-size: 11.5px; font-weight: 650; gap: 2px; color: #7A7F78; }
  .tab svg { width: 24px; height: 24px; stroke-width: 1.9; }
  .tab.on { color: var(--forest); }
  .tab.on svg { stroke-width: 2.4; }
  .tab.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--forest); }
  .tab .badge { top: 5px; }

  /* the one way to add a lead, always in reach of the thumb */
  .fab { display: inline-flex; position: fixed; right: 14px; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 14px); z-index: 25;
         align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px; border-radius: 16px; background: var(--forest); color: var(--ivory);
         text-decoration: none; font-weight: 700; font-size: 16px; box-shadow: 0 8px 22px rgba(31,58,46,.30), 0 2px 6px rgba(0,0,0,.12);
         -webkit-tap-highlight-color: transparent; transition: transform .08s; }
  .fab svg { width: 22px; height: 22px; stroke-width: 2.6; }
  .fab:active { transform: scale(.96); }
  body:has(.fab) .main { padding-bottom: 84px; }
  .toasts { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 76px); }

  .main { padding: 12px 12px 24px; }

  /* lead cards: the name always readable, labels move under it when needed */
  .card-row1 { flex-wrap: wrap; row-gap: 2px; }
  .card-name { white-space: normal; overflow-wrap: anywhere; font-size: 17px; }
  .card-row2 { font-size: 14.5px; }
  .card-actions { padding: 8px 8px 8px 0; gap: 6px; }
  .card-actions .btn-next { min-height: 40px; padding: 8px 10px; font-size: 14px; border-radius: 10px; }
  .card-actions .btn-icon { width: 44px; height: 44px; align-self: flex-end; }

  /* lead page: contact row, then the one next step, then the rest */
  .lead-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "call text map" "next next next" "visit visit lost"; gap: 8px; margin: 4px 0 12px; }
  .lead-actions .act-call { grid-area: call; } .lead-actions .act-text { grid-area: text; } .lead-actions .act-map { grid-area: map; }
  .lead-actions .act-next { grid-area: next; } .lead-actions .act-visit { grid-area: visit; } .lead-actions .act-lost { grid-area: lost; }
  .lead-actions .act-call, .lead-actions .act-text, .lead-actions .act-map { flex-direction: column; gap: 2px; min-height: 62px; padding: 8px 4px; font-size: 14px; background: #fff; }
  .lead-actions .act-call svg, .lead-actions .act-text svg, .lead-actions .act-map svg { width: 22px; height: 22px; }
  .lead-actions .act-next .btn { min-height: 54px; font-size: 18px; }
  .lead-actions .act-visit, .lead-actions .act-lost { min-height: 46px; font-size: 15px; }
  .actions:not(.lead-actions) { grid-template-columns: 1fr 1fr; }
  .chip-row.quick-texts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; }
  .chip-row.quick-texts::-webkit-scrollbar { display: none; }
  .chip-row.quick-texts .chip { flex: none; }
  .lead-head h2 { font-size: 25px; }
  .lead-head .muted { font-size: 15px; }
  .next-banner { margin: 2px 0 10px; }

  /* calendar: colour bars without names (the day list below has them), bigger day numbers */
  .cal { --wk: 0px; --num: 30px; --lane: 7px; }
  .cal .wk, .cal-wd .wk { visibility: hidden; border: 0; padding: 0; }
  .cal-week { grid-template-rows: var(--num) repeat(3, var(--lane)) 14px; }
  .cal-day { align-items: center; padding: 3px 0 2px; }
  .cal-day .num { font-size: 15px; width: 28px; height: 28px; }
  .bar { font-size: 0; height: 5px; line-height: 5px; padding: 0; align-self: center; }
  .bar.first { margin-left: 4px; } .bar.last { margin-right: 4px; }
  .marks { justify-content: center; }
  .cal-legend { font-size: 11.5px; }

  /* quotes list: numbers in a compact strip, filters in one swipeable row */
  .ql-kpis { display: flex; overflow-x: auto; gap: 8px; margin: 0 -12px 12px; padding: 0 12px 2px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ql-kpis::-webkit-scrollbar { display: none; }
  .ql-kpis > div { flex: 0 0 auto; min-width: 150px; padding: 10px 12px; scroll-snap-align: start; }
  .ql-kpis b { font-size: 19px; }
  .ql-kpis .ql-new { display: none; }
  .ql-tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .ql-tabs::-webkit-scrollbar { display: none; }
  .ql-tabs a { flex: none; }

  /* the quote builder fits a phone for checking and sending; building is best on the laptop */
  .qb-page .top .qb-pdf { display: none; }
  .qb-sent { padding: 10px 12px; }
  .qb-sent-actions { gap: 6px; }
  .qb-sent-actions .btn-sm { min-height: 38px; padding: 6px 10px; font-size: 13.5px; }

  /* long links in history never push the page sideways */
  .timeline, .thread, .bubble-text, .details dd { overflow-wrap: anywhere; }

  /* forms: the save button stays in reach */
  form.lead-form > .btn-primary:last-child, form.lead-form .form-end { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 10px); z-index: 5; }
  form.lead-form .form-end { background: linear-gradient(transparent, var(--ivory) 30%); padding-top: 14px; }

  /* More */
  .more-me { display: flex; align-items: center; gap: 14px; padding: 6px 4px 14px; }
  .more-me strong { display: block; font-size: 19px; }
  .more-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--forest); color: var(--ivory); display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
  .more-h { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 14px 6px 8px; }
  .more-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--stone-2); border-radius: 16px; overflow: hidden; }
  .more-list a { display: grid; grid-template-columns: 40px 1fr 16px; gap: 14px; align-items: center; padding: 12px 14px; min-height: 64px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--stone-2); }
  .more-list a:first-child { border-top: 0; }
  .more-list a:active { background: var(--paper); }
  .more-list b { display: block; font-size: 17px; font-weight: 650; }
  .more-list small { display: block; color: var(--muted); font-size: 14px; margin-top: 1px; }
  .more-list em { font-style: normal; color: #A9ADA6; font-size: 24px; line-height: 1; }
  .mi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--stone-2); color: var(--forest); }
  .mi svg { width: 22px; height: 22px; }
  .mi-q { background: #E7F0FF; color: #1E4FA8; } .mi-c { background: var(--forest-soft); } .mi-p { background: #F6EBDD; color: #8A5A1E; }
  .more-out { margin: 22px 0 8px; display: flex; justify-content: center; }
  .more-out .btn { min-width: 180px; color: var(--red); }
}
@media (max-width: 999px) {
  .qb-head small { color: var(--muted); }
  .qb-page .top .qb-save { color: var(--muted); } .qb-page .top .qb-save.busy { color: #A86B1D; } .qb-page .top .qb-save.err { color: var(--red); }
  .qb-page .top .qb-icon { color: var(--ink); }
}
@media (max-width: 999px) { .settings-nav { display: none; } }
.sq > * { min-width: 0; }
.sq-doc { min-width: 0; overflow: hidden; }
@media (max-width: 999px) {
  .sq-total { grid-template-columns: 1fr 1fr; }
  .sq-total > div:last-child { grid-column: 1 / -1; }
  .sq-total strong { font-size: 20px; }
}

/* --- invoices ------------------------------------------------------------------------------------ */
.iv-banner { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; font-size: 15px; background: var(--stone-2); }
.iv-banner.iv-practice { background: #EEF3FF; color: #1E3F7A; }
.iv-banner.iv-warn { background: var(--amber-soft); color: #6B430D; }
.iv-banner.iv-bad { background: var(--red-soft); color: var(--red); }
.iv-grid { display: grid; gap: 16px; }
.iv-grid > * { min-width: 0; }
.iv-paper { background: #fff; border: 1px solid var(--stone); border-radius: 18px; padding: 18px 16px; box-shadow: 0 1px 2px rgba(30,30,20,.04); }
.iv-paper-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.iv-paper-head h2 { font-size: 22px; margin: 2px 0 2px; }
.iv-kind { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.iv-pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 11px; border-radius: 99px; background: var(--stone-2); color: var(--muted); white-space: nowrap; }
.iv-pill.ok { background: var(--forest-soft); color: var(--forest); }
.iv-pill.warn { background: #E7F0FF; color: #1E4FA8; }
.iv-pill.bad { background: var(--red-soft); color: var(--red); }
.iv-source { margin: 10px 0 14px; color: var(--muted); }
.iv-lines { width: 100%; border-collapse: collapse; font-size: 15px; }
.iv-lines th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 0 6px 8px; border-bottom: 1px solid var(--stone); }
.iv-lines td { padding: 9px 6px; border-bottom: 1px solid var(--stone-2); vertical-align: top; }
.iv-lines .num { text-align: right; white-space: nowrap; }
.iv-lines tr.iv-h td { font-weight: 700; color: var(--muted); font-size: 13px; padding-top: 12px; }
.iv-lines tr.iv-minus td { color: var(--muted); }
.iv-lines tr.iv-extra td { background: #FFFBF1; }
.iv-tag { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; color: #8A5A12; }
.iv-lines tfoot td { border-bottom: 0; padding: 5px 6px; color: var(--muted); }
.iv-lines tfoot td:first-child { text-align: right; }
.iv-lines tfoot tr.iv-grand td { color: var(--ink); font-weight: 800; font-size: 18px; padding-top: 10px; border-top: 2px solid var(--ink); }
.iv-comment { margin-top: 14px; background: var(--paper); border-radius: 12px; padding: 10px 14px; }
.iv-comment p { margin: 4px 0 0; font-size: 14px; }
.iv-add { margin-top: 16px; border-top: 1px dashed var(--stone); padding-top: 12px; }
.iv-add summary { cursor: pointer; font-weight: 700; color: var(--forest); min-height: 40px; display: flex; align-items: center; }
.iv-add-form { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; align-items: end; }
.iv-add-form .iv-f-text { grid-column: 1 / -1; }
.iv-add-form .btn { grid-column: 1 / -1; }
.iv-rm { display: inline; margin-left: 8px; }
.iv-rm .linkish { background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 12px; font-weight: 700; color: var(--red); text-decoration: underline; cursor: pointer; }
.iv-bar { display: none; }
.iv-extras { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.iv-extras li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.iv-side .side-box h3 { margin: 0 0 10px; font-size: 17px; }
.iv-send { display: flex; flex-direction: column; gap: 12px; }
.iv-send .field { margin: 0; }
.iv-due { margin: -6px 0 0; }
.iv-problems { margin: 0; padding: 10px 14px 10px 30px; background: var(--amber-soft); border-radius: 10px; font-size: 14px; color: #6B430D; }
.iv-total { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--stone-2); border-radius: 12px; padding: 10px 14px; }
.iv-total span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.iv-total b { font-size: 26px; letter-spacing: -.02em; }
.iv-delete { margin: 6px 0 0; text-align: center; }
.iv-facts { margin: 0 0 12px; display: grid; gap: 6px; font-size: 15px; }
.iv-facts div { display: flex; justify-content: space-between; gap: 10px; }
.iv-facts dt { color: var(--muted); } .iv-facts dd { margin: 0; text-align: right; }
.iv-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.iv-actions form, .iv-actions .btn { width: 100%; } .iv-actions form .btn { width: 100%; }
.iv-credit { margin-top: 10px; font-size: 14px; } .iv-credit summary { cursor: pointer; color: var(--muted); min-height: 36px; display: flex; align-items: center; }
.iv-mini { margin: 0; padding-left: 18px; font-size: 14px; }
.iv-howto { margin-top: 12px; } .iv-howto ol { padding-left: 20px; } .iv-howto li { margin-bottom: 6px; } .iv-howto summary { cursor: pointer; font-weight: 700; min-height: 40px; display: flex; align-items: center; }
.iv-kpis .iv-k-bad b { color: var(--red); }
.iv-todo .iv-go { grid-area: margin; justify-self: end; }
.ql-status.st-credited { background: var(--stone-2); color: var(--muted); }
.lq-invoice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; padding: 10px 12px; background: var(--forest-soft); border-radius: 12px; }
.lq-aconto { font-size: 14px; } .lq-aconto summary { cursor: pointer; color: var(--forest); min-height: 36px; display: flex; align-items: center; }
.lq-aconto-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 6px; }
.lq-aconto-form .field { margin: 0; } .lq-aconto-form input { max-width: 110px; }
.lq-invs { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.lq-sub { margin: 0 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.qb-sent-next form { display: inline; }
.fa-card { gap: 12px; }
.fa-amount { display: flex; flex-direction: column; }
.fa-amount span { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fa-amount b { font-size: clamp(34px, 7vw, 46px); letter-spacing: -.03em; color: var(--tq-ink, var(--ink)); }
.fa-pay { margin: 0; display: grid; gap: 8px; background: #F7F5EF; border-radius: 12px; padding: 12px 14px; }
.fa-pay div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fa-pay dt { color: var(--muted); } .fa-pay dd { margin: 0; font-weight: 600; text-align: right; }
.fa-card .btn-primary { background: var(--tq-brand, var(--forest)); border-color: var(--tq-brand, var(--forest)); color: #fff; }
@media (min-width: 1000px) {
  .iv-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 24px; }
  .iv-paper { padding: 26px 28px; }
  .iv-add-form { grid-template-columns: minmax(0, 2.2fr) 90px 110px 150px auto; }
  .iv-add-form .iv-f-text, .iv-add-form .btn { grid-column: auto; }
  .iv-side { position: sticky; top: 16px; }
  .iv-kpis { grid-template-columns: repeat(4, 1fr); }
  .ql-row.iv-todo { grid-template-columns: minmax(0, 2.4fr) 120px 170px 190px; grid-template-areas: "main status money margin"; }
}
.iv-go .btn { white-space: nowrap; }
@media (max-width: 999px) {
  .iv-lines, .iv-lines tbody, .iv-lines tfoot { display: block; width: 100%; }
  .iv-lines thead { display: none; }
  .iv-lines tbody tr:not(.iv-h) { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--stone-2); }
  .iv-lines tbody tr.iv-extra { padding: 10px 8px; margin: 0 -8px; border-radius: 8px; }
  .iv-lines tbody td { display: block; border: 0; padding: 0; background: none !important; }
  .iv-lines tbody td:first-child { grid-column: 1 / -1; }
  .iv-lines tbody td:nth-child(2) { color: var(--muted); font-size: 14px; text-align: left; }
  .iv-lines tbody td:nth-child(3) { display: none; }
  .iv-lines tbody td:nth-child(4) { font-weight: 700; }
  .iv-lines tr.iv-h { display: block; } .iv-lines tr.iv-h td { display: block; padding: 10px 0 0; }
  .iv-lines tfoot tr { display: flex; justify-content: space-between; gap: 10px; }
  .iv-lines tfoot td:first-child { text-align: left; }
  .iv-lines tfoot tr.iv-grand { border-top: 2px solid var(--ink); margin-top: 6px; }
  .iv-lines tfoot tr.iv-grand td { border-top: 0; }
  .iv-paper-head { flex-direction: column-reverse; gap: 6px; }
}
@media (max-width: 999px) {
  .iv-lines tfoot td { padding: 5px 0; }
  .iv-side .side-box { background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius); padding: 14px 16px 16px; margin-bottom: 12px; }
  .iv-bar { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 10px); z-index: 24;
    align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--stone); border-radius: 16px;
    padding: 10px 10px 10px 16px; box-shadow: 0 8px 28px rgba(20,30,20,.16); transition: opacity .2s, transform .2s; }
  .iv-bar span { display: flex; flex-direction: column; line-height: 1.15; } .iv-bar b { font-size: 19px; } .iv-bar small { color: var(--muted); font-size: 12px; }
  .iv-bar.is-hidden { opacity: 0; transform: translateY(12px); pointer-events: none; }
  .main:has(.iv-bar) { padding-bottom: 96px; }
}
@media (max-width: 520px) {
  .fa-pay div { flex-direction: column; gap: 0; } .fa-pay dd { text-align: left; }
}

/* --- repeat business ------------------------------------------------------------------------------ */
.mi-i { background: #EEF0E6; color: #4B5A1A; } .mi-w { background: #EFE9F7; color: #5B3F8C; }
.rv-card { gap: 10px; }
.rv-card .btn-primary { background: var(--tq-brand, var(--forest)); border-color: var(--tq-brand, var(--forest)); color: #fff; }
.rv-share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rv-link { flex: 1 1 220px; min-width: 0; font-size: 14px; padding: 10px 12px; border: 1px solid var(--stone); border-radius: 10px; background: #fff; color: var(--muted); }
.rp-why { margin-top: 4px; }
.rp-panel > .field { margin-bottom: 16px; } .rp-panel > .field small { display: block; margin-top: 4px; }
.rv-card p { margin: 0; } .rv-card h2 { margin: 0; }
.rp-months { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.rp-months .field { margin: 0; }
.wk-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.wk-nav > span { display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.wk-nav b { font-size: 18px; } .wk-spacer { width: 44px; }
.wk-grid { display: grid; gap: 16px; margin-top: 16px; }
.wk-grid > * { min-width: 0; }
.wk-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.wk-table th, .wk-table td { padding: 9px 4px; border-bottom: 1px solid var(--stone-2); text-align: left; font-weight: 500; }
.wk-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.wk-table .num { text-align: right; white-space: nowrap; }
.wk-up { color: var(--forest); font-size: 11px; } .wk-down { color: var(--red); font-size: 11px; }
.wk-side .side-box h3 { margin: 0 0 8px; font-size: 16px; }
.wk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wk-list li { display: flex; flex-direction: column; font-size: 15px; }
.wk-fb q { font-size: 14px; color: var(--ink); margin: 2px 0; }
.fu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fu-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; padding-bottom: 10px; border-bottom: 1px solid var(--stone-2); }
.fu-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.fu-main { display: flex; flex-direction: column; min-width: 0; }
.fu-fb { display: block; margin-top: 4px; font-size: 14px; background: var(--paper); padding: 8px 10px; border-radius: 10px; }
.fu-edit summary { cursor: pointer; color: var(--forest); font-weight: 600; font-size: 14px; min-height: 36px; display: flex; align-items: center; }
.fu-edit form { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.fu-edit .field { margin: 0; }
.fu-share { margin: 12px 0 0; display: flex; flex-direction: column; gap: 4px; }
.fu-share .rv-link { flex: none; width: 100%; }
.tq-remind .muted { display: block; font-size: 13px; }
@media (min-width: 1000px) {
  .wk-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 24px; }
  .wk-kpis { grid-template-columns: repeat(4, 1fr); }
  .wk-side .side-box { background: var(--paper); }
}
@media (max-width: 999px) {
  .wk-side .side-box { background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius); padding: 14px 16px 16px; margin-bottom: 12px; }
}

/* --- connections ---------------------------------------------------------------------------------- */
.dn-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dn-form { display: grid; gap: 10px; margin: 8px 0; }
.dn-form .field { margin: 0; }
@media (min-width: 1000px) { .dn-form { grid-template-columns: 1fr 1fr; } .dn-form .btn { grid-column: 1 / -1; justify-self: start; } }
.sm-meter { margin: 10px 0 12px; display: flex; flex-direction: column; gap: 6px; }
.sm-meter-top { display: flex; justify-content: space-between; font-size: 14px; }
.sm-bar { height: 8px; background: var(--stone-2); border-radius: 99px; overflow: hidden; }
.sm-bar i { display: block; height: 100%; width: 0; background: var(--forest); border-radius: 99px; }
.sm-bar i.warn { background: var(--amber, #C98A1B); }

/* --- product: plan banner, set-up guide, subscription, console, legal, sign-up ------------------------- */
.plan-banner { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: #EEF3FF; color: #1E3F7A; font-size: 15px; }
.plan-banner.bad { background: var(--red-soft); color: var(--red); }
.plan-banner a { color: inherit; font-weight: 700; }
.su-progress { display: flex; flex-direction: column; gap: 8px; }
.su-steps { list-style: none; margin: 14px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.su-steps a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius); color: var(--ink); text-decoration: none; min-height: 64px; }
.su-steps a:hover { border-color: var(--forest); }
.su-tick { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--stone-2); color: var(--muted); }
.su-steps .is-done .su-tick { background: var(--forest); color: #fff; }
.su-steps .is-done b { color: var(--muted); }
.su-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.su-steps em { font-style: normal; color: var(--muted); font-size: 20px; }
.su-close { text-align: center; }
.bl-plan { display: flex; flex-direction: column; margin: 14px 0 10px; padding: 12px 14px; background: #fff; border: 1px solid var(--stone-2); border-radius: 12px; }
.bl-plan b { font-size: 22px; }
.bl-actions { margin-bottom: 8px; }
.cn-note { margin: 0 0 12px; }
.cn-table-wrap { overflow-x: auto; margin-top: 16px; background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius); }
.cn-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; }
.cn-table th, .cn-table td { padding: 10px 12px; border-bottom: 1px solid var(--stone-2); text-align: left; vertical-align: top; font-weight: 500; }
.cn-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.cn-table .num { text-align: right; }
.cn-sub { display: block; }
.cn-act summary { cursor: pointer; color: var(--forest); font-weight: 600; }
.cn-act form { display: flex; flex-wrap: wrap; gap: 6px; align-items: end; margin-top: 8px; }
.cn-act .field { margin: 0; }
.cn-kpis { margin-top: 4px; }
.legal-main { max-width: 820px; }
.legal-doc { background: #fff; border: 1px solid var(--stone); border-radius: 18px; padding: 22px 20px; line-height: 1.6; }
.legal-doc h1 { font-size: 26px; margin: 0 0 4px; } .legal-doc h2 { font-size: 17px; margin: 22px 0 6px; }
.legal-meta { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; } .legal-table th, .legal-table td { border-bottom: 1px solid var(--stone-2); padding: 6px 8px; text-align: left; vertical-align: top; }
.su-main { max-width: 620px; }
.su-card .stack { gap: 14px; }
@media (min-width: 1000px) {
  .su-steps a { padding: 16px 20px; }
  .cn-kpis { grid-template-columns: repeat(4, 1fr); }
  .legal-doc { padding: 34px 40px; }
}
.setup-card { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "txt arrow" "bar bar"; gap: 8px 12px; align-items: center; margin: 0 0 14px; padding: 14px 16px; background: var(--forest); color: #fff; border-radius: var(--radius); text-decoration: none; }
.setup-card span { grid-area: txt; display: flex; flex-direction: column; } .setup-card small { opacity: .85; }
.setup-card > .sm-bar { grid-area: bar; background: rgba(255,255,255,.25); display: block; } .setup-card > .sm-bar i { background: #fff; }
.setup-card em { grid-area: arrow; font-style: normal; font-size: 22px; }
.cn-table .ql-status { white-space: nowrap; }
