:root {
  --paper: #f8f7f5;
  --surface: #ffffff;
  --rail: #f0efeb;
  --ink: #151515;
  --muted: #64645e;
  --line: #dfded8;
  --track: #e6e5df;
  --signal: #f15a24;
  --signal-ink: #ae3510;
  --danger: #b42318;
  --good: #1f7a4d;
  --radius: 8px;
  --sidebar: 232px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161614;
    --surface: #1e1e1b;
    --rail: #121210;
    --ink: #eeede8;
    --muted: #9c9b93;
    --line: #34332f;
    --track: #2e2d29;
    --signal-ink: #ff8a5c;
    --danger: #ff8a80;
    --good: #6fcf97;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 "Manrope", system-ui, sans-serif;
  font-feature-settings: "tnum";
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.icon { width: 16px; height: 16px; flex: none; }

h1 { font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; margin: 0; }
h2 { font-size: 16px; line-height: 1.3; font-weight: 800; margin: 0; }
h3 { font-size: 13px; font-weight: 700; color: var(--muted); margin: 16px 0 6px; }

/* Wordmark */
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.wordmark .logo { height: 22px; width: auto; }
/* The logo's box includes the b/t ascenders; nudge the label down to the lowercase letters' optical centre (~16% of logo height) */
.wordmark span { color: var(--muted); font-weight: 600; font-size: 15px; padding: 2px 0 2px 10px; border-left: 1px solid var(--line); line-height: 1; margin-top: 0.4em; }
.gate .wordmark span { margin-top: 0.55em; }

/* App shell: sidebar and a centered content column */
/* the rail colour runs the full page height behind the sticky sidebar */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--rail) calc(var(--sidebar) - 1px), var(--line) 0 var(--sidebar), transparent 0); }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--rail); border-right: 1px solid var(--line); }
.sidebar__top { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 24px; }
.sidebar__toggle { display: none; }
.sidebar__panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.nav { display: grid; gap: 2px; padding: 0 12px; }
.nav__link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.nav__link:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav__link--active { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.nav__link--active .icon { color: var(--signal); }
.nav--section { margin-top: 18px; }
.nav__heading { margin: 0 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav__badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--signal); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }

.sidebar__foot { margin-top: auto; padding: 16px 20px 20px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.shed { margin: 0; font-size: 13px; color: var(--muted); }
.shed__state { font-weight: 700; }
.shed__state::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--muted); vertical-align: 1px; }
.shed__state--online { color: var(--ink); }
.shed__state--online::before { background: var(--good); }
.shed__warning { display: block; margin-top: 4px; font-weight: 700; color: var(--danger); text-decoration: none; }
.me { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.me__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.me form { flex: none; }
.me__out { font: inherit; font-weight: 600; font-size: 13px; padding: 2px 0; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.me__out:hover { color: var(--ink); }

.main { min-width: 0; }
.container { max-width: 1240px; margin: 0 auto; padding: 32px 40px 64px; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }

/* Buttons and forms */
.button, button, input[type="submit"] {
  font: inherit;
  font-weight: 700;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1.4;
  white-space: nowrap;
}
.button--quiet { background: transparent; color: var(--ink); border-color: var(--line); padding: 5px 11px; font-weight: 600; font-size: 14px; }
.button--quiet:hover { border-color: var(--ink); }
button:disabled, textarea:disabled { opacity: .5; cursor: not-allowed; }

input:not([type="checkbox"], [type="radio"]), select, textarea {
  font: inherit;
  font-size: 14px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  max-width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 30%, transparent); }
textarea { width: 100%; resize: vertical; }

.field { display: grid; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; }
.field input { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.flash { padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.flash--alert { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.flash--notice { background: var(--track); }

/* Sign in and password pages */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate__box { width: 100%; max-width: 360px; }
.gate .wordmark { margin-bottom: 40px; }
.gate .wordmark .logo { height: 28px; }
.gate h1 { font-size: 24px; margin-bottom: 24px; }
.gate .field input { padding: 10px 12px; font-size: 15px; }
.gate form .button, .gate input[type="submit"] { width: 100%; margin-top: 8px; padding: 10px 16px; }
.gate__aside { margin-top: 20px; font-size: 14px; color: var(--muted); }

.empty { padding: 48px 24px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h2 { margin: 0 0 4px; }
.empty p { margin: 0; color: var(--muted); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-head__link { font-size: 13px; font-weight: 600; color: var(--muted); }

.market { font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.initials { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--track); font-size: 11px; font-weight: 800; color: var(--ink); flex: none; }

/* Pipeline: the stage strip reads left to right like the funnel; the two stages that wait on staff glow when full */
.stages { display: flex; flex-wrap: wrap; gap: 1px; margin-bottom: 32px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stage { position: relative; flex: 1 1 112px; display: grid; align-content: start; gap: 2px; padding: 14px 14px 12px; text-decoration: none; background: var(--surface); }
.stage strong { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stage span { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.stage:hover { background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
.stage--empty strong { color: var(--muted); font-weight: 600; }
.stage--pick:not(.stage--empty), .stage--approve:not(.stage--empty) { box-shadow: inset 0 3px 0 var(--signal); }
.stage--pick:not(.stage--empty) strong, .stage--approve:not(.stage--empty) strong { color: var(--signal-ink); }
.stage--won:not(.stage--empty) strong { color: var(--good); }

.pipeline { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }

.needs__list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.need { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.need:last-child { border-bottom: 0; }
.need__kind { font-size: 12px; font-weight: 700; color: var(--muted); }
.need--follow_up .need__kind, .need--alert .need__kind { color: var(--signal-ink); }
.need--failed_job .need__kind { color: var(--danger); }
.need--variants_stalled .need__kind { color: var(--signal-ink); }
.need__body { display: grid; min-width: 0; }
.need__client { font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.need__client:hover { text-decoration: underline; }
.need__detail { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.need__when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.need__action:empty { display: none; }

.activity__list { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--track); }
.event { position: relative; display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; }
.event::before { content: ""; position: absolute; left: -19px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--paper); border: 2px solid var(--muted); }
.event--failed::before { border-color: var(--danger); }
.event--touch::before, .event--alert::before { border-color: var(--signal); }
.event--succeeded::before { background: var(--muted); }
.event--won::before { background: var(--good); border-color: var(--good); }
.event--lost::before { border-color: var(--danger); }
.event__what { min-width: 0; }
.event__what a { font-weight: 700; text-decoration: none; }
.event__what a:hover { text-decoration: underline; }
.event time { color: var(--muted); white-space: nowrap; }

/* Add prospects dialog */
.dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: rgb(0 0 0 / .4); }
.intake { display: grid; gap: 10px; padding: 20px; }
.intake label { font-size: 13px; color: var(--muted); }
.intake textarea { font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Tabs and filters */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { padding: 8px 10px; margin-bottom: -1px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--ink); }
.tab--active { color: var(--ink); border-bottom-color: var(--signal); }
.tab__count { font-size: 12px; color: var(--muted); margin-left: 2px; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.filters__search { flex: 1 1 240px; }
.filters select { max-width: 200px; }
.filters__clear { font-size: 13px; font-weight: 600; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.filter-note { margin: -4px 0 16px; font-size: 14px; color: var(--muted); }
.filter-note a { margin-left: 8px; }

/* Clients table */
.clients, .jobs-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.clients th, .jobs-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.clients td, .jobs-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.clients tr:last-child td, .jobs-table tr:last-child td { border-bottom: 0; }
.clients tbody tr:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.num { text-align: right; }
.clients th.num, .jobs-table th.num { text-align: right; }

.col-thumb { width: 84px; padding-right: 0 !important; }
.col-thumb a { text-decoration: none; }
.thumb { display: block; width: 72px; height: 46px; object-fit: cover; object-position: top; border-radius: 4px; border: 1px solid var(--line); background: var(--track); }
.thumb--none { display: grid; place-items: center; background: color-mix(in srgb, var(--track) 45%, transparent); border-color: transparent; color: var(--muted); font-size: 17px; font-weight: 800; }
.client__name { font-weight: 700; }
.client__name a { text-decoration: none; }
.client__name a:hover { text-decoration: underline; }
.client__place { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13px; color: var(--muted); }
.col-stage { min-width: 180px; }
.stage-label { display: block; font-size: 13px; font-weight: 700; }
.stage-label--rejected, .stage-label--lost { color: var(--muted); }
.stage-label--won { color: var(--good); }
.step { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.step--urgent { color: var(--signal-ink); font-weight: 600; }
.step--busy { color: var(--ink); }
.num-score { font-weight: 700; }
.num-score--low { color: var(--signal-ink); }
.psi-value { font-weight: 700; }
.psi-value--poor { color: var(--danger); }
.psi-value--average { color: var(--signal-ink); }
.col-activity, .col-follow-up { white-space: nowrap; color: var(--muted); }
.follow-up--due { color: var(--signal-ink); font-weight: 700; }
.col-owner { width: 44px; }
.col-visits { white-space: nowrap; color: var(--muted); }
.visits-count { color: var(--ink); }

.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--track); border-top-color: var(--signal); animation: spin .8s linear infinite; flex: none; display: inline-block; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; font-size: 14px; }

/* Jobs page */
.col-job strong { margin-right: 6px; }
.col-job .muted { font-size: 13px; }
.col-job .job__error { margin: 4px 0 0; }
.col-status { white-space: nowrap; }
.col-when { white-space: nowrap; color: var(--muted); }
.col-actions { text-align: right; }

/* Alerts page */
.poll-status { margin: -4px 0 16px; font-size: 13px; color: var(--muted); }
.poll-status p { margin: 0; }
.poll-status--failing p { color: var(--danger); font-weight: 600; }
.poll-status__error { margin: 6px 0 0; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.alerts { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.alert-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.alert-row:last-child { border-bottom: 0; }
.alert-row--unread { color: var(--ink); }
.alert-row--unread .alert-row__kind { color: var(--signal-ink); }
.alert-row__kind { font-size: 12px; font-weight: 700; }
.alert-row__body { display: grid; min-width: 0; }
.alert-row__client { font-weight: 700; text-decoration: none; }

/* Client page */
.crumbs { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--ink); }

.client-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.client-head__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.client-head__facts > * { overflow-wrap: anywhere; }
.client-head__side { display: flex; align-items: flex-start; gap: 12px; }
.client-head__track { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.owner { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }

.client-page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.client-page__main, .client-page__side { display: grid; gap: 16px; min-width: 0; }
.panel { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.panel > h2 { margin-bottom: 8px; }
.panel > .section-head { margin-bottom: 8px; }
.panel--later { background: transparent; border-style: dashed; }
.panel--later p { margin: 0; font-size: 14px; }

/* Pipeline track: one tick per stage on the main path */
.track { display: flex; align-items: center; gap: 12px; }
.track__ticks { display: flex; gap: 3px; }
.track__ticks i { width: 14px; height: 6px; border-radius: 2px; background: var(--track); }
.track__ticks i.on { background: var(--muted); }
.track__ticks i.now { background: var(--signal); }
.track__label { font-size: 13px; font-weight: 700; white-space: nowrap; }
.track--ended .track__ticks i.on { opacity: .45; }
.track--ended .track__label { color: var(--muted); }

.rejected { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: var(--radius); }
.rejected p { margin: 0; }
.override-note { margin: 0 0 12px; font-size: 14px; color: var(--muted); }

.verdict-badge { font-size: 12px; font-weight: 700; border-radius: 4px; padding: 1px 6px; border: 1px solid currentColor; white-space: nowrap; }
.verdict-badge--yes { color: var(--signal-ink); }
.verdict-badge--no { color: var(--muted); border-color: var(--line); }
.verdict-badge--override { color: var(--ink); }

.verdict__headline { display: flex; align-items: center; gap: 12px; }
.verdict__headline .verdict-badge { font-size: 14px; padding: 2px 8px; }
.verdict__columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; }
.score { color: var(--muted); font-size: 14px; }
.score strong { color: var(--ink); font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.notes, .findings, .contacts { margin: 0; padding-left: 18px; font-size: 14px; }
.notes li, .findings li, .contacts li { margin-bottom: 4px; }
.findings { padding: 10px 12px 10px 28px; background: var(--paper); border-radius: 6px; }
.business { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 12px 0 0; font-size: 13px; }
.business dt { color: var(--muted); }
.business dd { margin: 0; overflow-wrap: anywhere; }

.shots { display: grid; grid-template-columns: 3fr 1fr; gap: 12px; align-items: start; margin-top: 16px; }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 6px; }
.shot figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Variants: one card per design direction, screenshots cropped to the first screen, the whole shot in a lightbox */
.variants { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.variant { display: grid; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.variant--chosen { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--signal); }
.variant:has(.variant__pick input:checked) { border-color: var(--signal); }
/* columns in the ratio that gives the 1440×900 and 390×844 crops the same height */
.variant__shots, .preview__shots { display: grid; grid-template-columns: minmax(0, 3.46fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.vshot { margin: 0; min-width: 0; }
.vshot__open { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); overflow: hidden; cursor: zoom-in; }
.vshot__open:hover { border-color: var(--ink); }
.vshot__open img { display: block; width: 100%; aspect-ratio: 1440 / 900; object-fit: cover; object-position: top; }
.vshot--mobile .vshot__open img { aspect-ratio: 390 / 844; }
.vshot figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.vshot__none { display: grid; place-items: center; aspect-ratio: 1440 / 900; border: 1px dashed var(--line); border-radius: 6px; font-size: 13px; color: var(--muted); }
.vshot--mobile .vshot__none { aspect-ratio: 390 / 844; }
.variant__body { display: grid; gap: 8px; min-width: 0; }
.variant__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.variant__name { margin: 0; color: var(--ink); font-size: 16px; font-weight: 800; }
.variant__letter { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 4px; border-radius: 5px; background: var(--ink); color: var(--paper); font-size: 12px; vertical-align: 2px; }
.variant__head .score { margin-left: auto; }
.variant__head .score strong { font-size: 22px; }
.variant__summary { margin: 0; font-size: 14px; }
.variant__points { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }
.variant__points h4 { margin: 4px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.variant__choice { margin: 0; font-size: 13px; color: var(--muted); }
.variant__notes { color: var(--ink); white-space: pre-line; }
.variant__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.variant__pick { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; cursor: pointer; }
.variant__pick input { accent-color: var(--signal); width: 16px; height: 16px; margin: 0; }
.choose__form { display: grid; gap: 8px; justify-items: start; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.choose__form label { font-size: 13px; font-weight: 600; }
.choose__busy { margin: 12px 0 0; font-size: 14px; }

/* Preview: the built site's report, the changes asked for and the box that asks for the next */
.preview__status { margin: 0 0 10px; font-size: 14px; }
.preview__from { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.preview__summary { margin: 12px 0 0; white-space: pre-line; }
.preview__columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }
.preview__none { margin: 0; font-size: 14px; }
.preview__note { margin: 0 0 6px; font-size: 13px; }
.check-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.check-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; }
.check-chip::before { font-weight: 800; }
.check-chip span { color: var(--muted); }
.check-chip--passed::before { content: "✓"; color: var(--good); }
.check-chip--failed { border-color: var(--danger); }
.check-chip--failed::before { content: "✕"; color: var(--danger); }
.commands { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.commands code { display: block; padding: 6px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.revisions { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.revision { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.revision__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.revision__meta { color: var(--muted); font-size: 12px; }
.revision__message { margin: 6px 0 0; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.revision__summary { margin: 4px 0 0; color: var(--muted); white-space: pre-line; }

/* Visits section */
.visits__checked { font-size: 12px; color: var(--muted); }
.visits__checked--failing { color: var(--danger); font-weight: 600; }
.visits__facts { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.visits__facts strong { color: var(--ink); }
.visits__removed { margin: 10px 0 0; font-size: 13px; }
.visits { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.visit { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.visit__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.visit__facts { display: inline-flex; flex-wrap: wrap; gap: 0 10px; color: var(--muted); font-size: 13px; }
.visit__device { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.visit__pages { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 6px 0 0; padding: 0; }
.visit__pages code { display: inline-block; padding: 1px 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.visit__actions { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--signal-ink); }
.preview-removed { font-size: 13px; font-weight: 600; color: var(--muted); }
.ask { display: grid; gap: 8px; justify-items: start; margin-top: 14px; }
.ask label { font-size: 13px; font-weight: 600; }
.ask__blocked { margin: 0; font-size: 13px; }

.lightbox { width: min(1200px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); overflow: hidden; }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: rgb(0 0 0 / .6); }
.lightbox__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.lightbox__link { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); }
.lightbox__image { overflow: auto; background: var(--paper); }
.lightbox__image img { display: block; width: 100%; height: auto; margin: 0 auto; }
.vshot--mobile .lightbox { width: min(440px, calc(100vw - 32px)); }

.psi-scores { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.psi { display: grid; min-width: 72px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; }
.psi strong { font-size: 18px; font-weight: 800; }
.psi span { font-size: 11px; color: var(--muted); }
.psi--poor strong { color: var(--danger); }
.psi--average strong { color: var(--signal-ink); }
.analysis > p, .panel .psi-scores + p { font-size: 14px; }

/* Contact and outreach */
.contact__facts, .outreach__facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 14px; }
.contact__facts dt, .outreach__facts dt { color: var(--muted); }
.contact__facts dd, .outreach__facts dd { margin: 0; overflow-wrap: anywhere; }
.contact__facts:empty { display: none; }
.contact > p { margin: 8px 0 0; font-size: 14px; }
.edit { margin-top: 12px; }
.edit summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.edit__form { margin-top: 12px; }

.follow-up-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.follow-up-form input { padding: 3px 8px; font-size: 13px; }

.log { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.log__direction { display: flex; gap: 16px; margin: 0; padding: 0; border: 0; font-size: 14px; font-weight: 600; }
.log__direction label { display: inline-flex; align-items: center; gap: 6px; }
.log__follow-up { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.log__follow-up input { padding: 3px 8px; font-size: 13px; }
.log:has(input[value="in"]:checked) .log__follow-up { display: none; }
.log__channels { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; font-weight: 600; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); }
.chip:hover { border-color: var(--signal); color: var(--signal-ink); }

.touches { list-style: none; margin: 14px 0 0; padding: 0; font-size: 13px; }
.touch { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.touch--in .touch__what { color: var(--good); font-weight: 600; }
.touch time { color: var(--muted); }
.touch__note { flex-basis: 100%; margin: 2px 0 0; color: var(--muted); }

.notes-form { display: grid; gap: 8px; justify-items: start; }

/* Jobs on the client page */
.jobs__list { list-style: none; margin: 0 -16px -16px; padding: 0; border-top: 1px solid var(--line); }
.job { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.job:last-child { border-bottom: 0; }
.job__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.job__kind { font-weight: 700; }
.job__meta { color: var(--muted); font-size: 12px; flex-basis: 100%; }
.job__actions { margin-left: auto; }
.job__retry { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 10px; }
.job__waiting { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--signal-ink); }
.job__summary { margin: 8px 0 0; white-space: pre-line; }
.job__error { margin: 8px 0 0; color: var(--danger); font-size: 13px; overflow-wrap: anywhere; }
.job__files { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.job__log { margin-top: 8px; }
.job__log summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.job__log pre { margin: 6px 0 0; padding: 10px 12px; max-height: 320px; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }

.checks { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.checks li::before { display: inline-block; width: 1.2em; font-weight: 800; }
.check--passed::before { content: "✓"; color: var(--muted); }
.check--failed::before { content: "✕"; color: var(--danger); }

.status { font-size: 12px; font-weight: 700; border-radius: 4px; padding: 1px 6px; border: 1px solid var(--line); color: var(--muted); }
.status--running { color: var(--signal-ink); border-color: currentColor; }
.status--succeeded { color: var(--ink); border-color: var(--ink); }
.status--failed { color: var(--danger); border-color: currentColor; }
.status--queued { color: var(--signal-ink); border-color: currentColor; }
.status--sent { color: var(--ink); border-color: var(--ink); }

/* Email: the prospect emails on the client page, the Approve dialog and the outbox */
.emails { list-style: none; margin: 0 -16px; padding: 0; border-top: 1px solid var(--line); }
.email { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.email__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.email__kind { font-weight: 700; }
.email__when { color: var(--muted); font-size: 13px; }
.email__actions { display: flex; gap: 8px; margin-left: auto; }
.email__meta { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.email__body { margin-top: 8px; }
.email__body summary { cursor: pointer; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.email__ids { margin: 6px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.email__next { margin: 10px 0 0; font-size: 13px; }
.email--canceled .email__kind, .email--canceled .email__body summary { color: var(--muted); }
.email-text { margin: 6px 0 0; padding: 10px 12px; max-height: 420px; overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; font: 13px/1.55 "Manrope", system-ui, sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.approved, .dnc { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.approved p, .dnc p { margin: 0; font-size: 14px; }
.dnc { padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-left: 3px solid var(--danger); border-radius: var(--radius); }
.dnc-tag { font-size: 11px; font-weight: 700; color: var(--danger); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; }
.approve { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.approve p { margin: 0; }

.compose { width: min(1120px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.compose__form { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.compose__fields { display: grid; align-content: start; gap: 14px; padding: 20px; border-right: 1px solid var(--line); }
.compose__intro { margin: -6px 0 0; font-size: 13px; }
.compose fieldset { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.compose legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.compose legend .muted { font-weight: 400; }
.compose__choice { display: flex; align-items: baseline; gap: 8px; font-size: 14px; overflow-wrap: anywhere; }
.compose__choice input, .compose__confirm input { accent-color: var(--signal); }
.compose__choice .muted { font-size: 12px; margin-left: 4px; }
.compose__to input[type="email"] { width: 100%; }
.compose__confirm { margin-top: 6px; font-weight: 600; font-size: 13px; align-items: baseline; }
.compose__findings textarea { font-size: 14px; }
.compose__locale { margin: 0; }
.compose__locale select { justify-self: start; }
.compose__revise { margin: 0; font-size: 13px; }
.compose__preview { padding: 20px; background: var(--paper); min-width: 0; }
.draft { display: grid; gap: 10px; }
.draft__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; margin: 0; font-size: 13px; }
.draft__head dt { color: var(--muted); }
.draft__head dd { margin: 0; overflow-wrap: anywhere; }
.draft__body { display: block; width: 100%; height: 460px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.draft__more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.draft__subject { margin: 6px 0 0; font-size: 13px; font-weight: 700; }
.draft h3 { margin: 6px 0 0; }
.draft__scores { border-collapse: collapse; font-size: 13px; }
.draft__scores th, .draft__scores td { padding: 3px 16px 3px 0; border-bottom: 1px solid var(--line); text-align: left; }
.draft__scores th { font-weight: 600; color: var(--muted); }
.draft__scores .num { text-align: right; }
.draft__note { margin: 0; font-size: 13px; }
.draft__problems { margin: 0; padding: 10px 12px 10px 28px; border-radius: 6px; color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); font-size: 13px; }

.outbox-facts { display: flex; flex-wrap: wrap; gap: 1px; margin: 0 0 8px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.outbox-fact { flex: 1 1 200px; padding: 12px 14px; background: var(--surface); }
.outbox-fact dt { font-size: 13px; font-weight: 600; color: var(--muted); }
.outbox-fact dd { margin: 0; font-size: 14px; color: var(--muted); }
.outbox-fact strong { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; margin-right: 4px; }
.outbox-fact--full strong { color: var(--signal-ink); }
.outbox-note { margin: 0 0 20px; font-size: 13px; }
.col-to { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* Won, lost and launch (phase 10) */
.outcome { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; font-size: 13px; color: var(--muted); }
.outcome strong { color: var(--ink); }
.outcome--won strong { color: var(--good); }
.outcome--lost strong { color: var(--danger); }
.outcome__undo { display: inline; }
.outcome-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.live-tag { font-size: 13px; font-weight: 700; color: var(--good); }
.live-tag a { color: inherit; }
.launch__status { margin: 0 0 10px; font-size: 14px; }
.launched { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-left: 3px solid var(--good); border-radius: var(--radius); }
.launched p { margin: 0; font-size: 14px; }
.handover { margin-top: 16px; padding: 14px; border: 1px solid var(--signal); border-radius: var(--radius); background: color-mix(in srgb, var(--signal) 6%, var(--surface)); }
.handover h3 { margin-top: 0; }
.handover__note { margin: 10px 0 6px; font-size: 13px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.step-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.step-item input { width: 18px; height: 18px; margin: 0; accent-color: var(--good); }
.step-item code { display: block; padding: 6px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.step-item:has(input:checked) code { color: var(--muted); text-decoration: line-through; }
.dns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; font-size: 13px; }
.dns code { display: inline-block; }
.dns__type { min-width: 3.5em; font-weight: 800; }
.dns__note { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.copy { padding: 3px 9px; font-size: 12px; }
.launch-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; align-items: end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.launch-form .button { justify-self: start; }
.launch-form .ask__blocked { grid-column: 1 / -1; margin-top: 8px; }

/* Settings → Emails: the sender and templates per language, with a live preview */
.settings-intro { margin: -12px 0 20px; max-width: 760px; font-size: 14px; }
.tab__state { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; font-size: 11px; font-weight: 700; border: 1px solid currentColor; }
.tab__state--ready { color: var(--good); }
.tab__state--blocked { color: var(--danger); }
.settings-status { margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--good); border-radius: var(--radius); background: var(--surface); font-size: 14px; }
.settings-status--blocked { border-left-color: var(--danger); }
.settings-status--blocked strong { color: var(--danger); }
.settings-status--ready strong { color: var(--good); }
.email-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.email-settings__fields { display: grid; gap: 16px; min-width: 0; }
.email-settings__preview { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.email-settings__controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.email-settings__controls select { width: 100%; }
.email-settings__save { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 0; background: var(--paper); border-top: 1px solid var(--line); font-size: 13px; }
.email-settings .flash { margin: 0; }
.saved-by { font-size: 12px; color: var(--muted); text-align: right; }
.settings-note { margin: 0 0 12px; font-size: 13px; }
.settings-freeze { margin: 0 0 12px; padding: 8px 10px; border-left: 3px solid var(--signal); background: color-mix(in srgb, var(--signal) 6%, var(--surface)); border-radius: 4px; font-size: 13px; }
.field_with_errors { display: contents; }
.field__hint { margin: 0; font-size: 12px; color: var(--muted); }
.field__error { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--danger); overflow-wrap: anywhere; }
.field--invalid input, .field--invalid textarea { border-color: var(--danger); }
.email-template__body { font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.variables summary { cursor: pointer; font-size: 13px; font-weight: 700; }
.variables summary .muted { font-weight: 400; }
.variables__list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.variables__item { display: grid; grid-template-columns: minmax(150px, auto) minmax(0, 1fr); gap: 2px 10px; align-items: baseline; font-size: 13px; }
.variables__about { color: var(--muted); }
.variables__about strong { color: var(--ink); }
.variable { justify-self: start; padding: 2px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }
.variable:hover { border-color: var(--signal); color: var(--signal-ink); }
.draft__fix { list-style: none; margin: 4px 0 0 -16px; font-weight: 700; }

/* "Run with…": provider, model and effort for one job, next to the button that queues it */
.run-with-form { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 12px; }
.run-with-form--start { justify-content: flex-start; }
.run-with { font-size: 13px; }
.run-with summary { cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; }
.run-with summary:hover { color: var(--ink); }
.run-with[open] { flex-basis: 100%; padding: 10px 12px 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.run-with__fields { display: grid; grid-template-columns: minmax(7em, .8fr) minmax(10em, 1.6fr) minmax(7em, .8fr); gap: 0 10px; margin-top: 8px; }
.run-with__fields .field { margin-bottom: 8px; }
.run-with__fields select, .run-with__fields input { width: 100%; }
.run-with__note { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.launch-form__submit { grid-column: 1 / -1; }

/* Settings → Agents */
.agents-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.agents-table th, .agents-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; font-size: 14px; }
.agents-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.agents-table tr:last-child > * { border-bottom: 0; }
.agents-table td.num, .agents-table th.num { text-align: right; white-space: nowrap; }
.agents-table td.num { padding-top: 17px; }
.agents-table__kind { display: grid; gap: 1px; min-width: 190px; font-weight: 400; }
.agents-table__kind .muted { font-size: 12px; }
.agents-table__kind .saved-by { text-align: left; }
.agents-table select, .agents-table input { width: 100%; }
.agents-table input[type="number"] { width: 6.5em; }
.agents-table__unit { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.agents-table__row--invalid > * { background: color-mix(in srgb, var(--danger) 5%, var(--surface)); }
.agents-table [aria-invalid="true"] { border-color: var(--danger); }
.agent-settings .flash { margin: 0 0 12px; }
.agents-defaults { margin-top: 24px; }
.agents-defaults__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.agents-defaults__list strong { display: inline-block; min-width: 6em; }

/* Why queued jobs wait: usage-limit pauses and daily caps, on the Jobs page */
.holds { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.hold { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--signal); border-radius: var(--radius); background: var(--surface); font-size: 14px; }
.hold > div { display: grid; gap: 2px; min-width: 0; flex: 1 1 420px; }
.hold__detail { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* Narrower screens: one column, then the sidebar folds into a top bar */
@media (max-width: 1180px) {
  .pipeline, .client-page, .email-settings { grid-template-columns: minmax(0, 1fr); }
  .email-settings__preview { position: static; max-height: none; }
}

@media (max-width: 860px) {
  .shell { display: block; background: none; }
  .sidebar { position: sticky; z-index: 10; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar__top { padding: 12px 16px; }
  .sidebar__toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); background: transparent; color: var(--ink); }
  .sidebar__panel { display: none; padding-bottom: 8px; }
  .sidebar--open .sidebar__panel { display: flex; }
  .sidebar__foot { margin-top: 12px; padding: 12px 16px 8px; }
  .nav { padding: 0 8px; }
  .container { padding: 20px 16px 48px; }
  h1 { font-size: 22px; }

  .client-head { grid-template-columns: minmax(0, 1fr); }
  .client-head__side { flex-wrap: wrap; }
  .verdict__columns, .shots, .variant__points { grid-template-columns: minmax(0, 1fr); }

  .clients, .clients tbody, .clients tr, .clients td { display: block; }
  .clients thead { display: none; }
  .clients tr { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  .clients tr:last-child { border-bottom: 0; }
  .clients td { padding: 0; border: 0; }
  .clients td.col-thumb { grid-row: 1 / span 3; width: auto; }
  .clients td.col-client { grid-column: 2; }
  .clients td.col-owner { grid-column: 3; grid-row: 1; width: auto; }
  .clients td.col-stage { grid-column: 2 / -1; min-width: 0; }
  /* a phone shows who, where they stand and when to follow up; scores stay on the client page */
  .clients td.col-score, .clients td.col-speed, .clients td.col-activity { display: none; }
  .clients td.col-visits { grid-column: 2 / -1; font-size: 13px; }
  .clients td.col-visits:not(:has(.visits-count)) { display: none; }
  .clients td.col-visits::before { content: "Visits "; color: var(--muted); }
  .clients td.col-follow-up { grid-column: 2 / -1; font-size: 13px; }
  .clients td.col-follow-up:not(:has(.follow-up)) { display: none; }
  .clients td.col-follow-up::before { content: "Follow up "; color: var(--muted); }

  .jobs-table thead { display: none; }
  .jobs-table, .jobs-table tbody, .jobs-table tr, .jobs-table td { display: block; }
  .jobs-table tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .jobs-table td { padding: 2px 0; border: 0; text-align: left; }
  .jobs-table td.num { display: none; }

  .agents-table thead { display: none; }
  .agents-table, .agents-table tbody, .agents-table tr { display: block; }
  .agents-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; padding: 12px; border-bottom: 1px solid var(--line); }
  .agents-table tr > * { padding: 4px 0; border: 0; }
  .agents-table__kind { grid-column: 1 / -1; min-width: 0; }
  .agents-table td[data-label="Model"] { grid-column: 1 / -1; }
  .agents-table td::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); }
  .agents-table td.num { text-align: left; padding-top: 4px; }

  .need { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; }
  .need__kind { grid-column: 1 / -1; }
  .need__when { grid-row: 2; grid-column: 2; }
  .need__action { grid-column: 1 / -1; }
  .need__detail { white-space: normal; }

  .alert-row { grid-template-columns: minmax(0, 1fr) auto; }
  .alert-row__kind { grid-column: 1 / -1; }

  .compose__form { grid-template-columns: minmax(0, 1fr); }
  .compose__fields { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .compose__preview { padding: 16px; }
  .draft__body { height: 380px; }
}

@media (max-width: 520px) {
  .stage { padding: 10px 12px; flex-basis: 140px; }
  .stage strong { font-size: 22px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .preview__columns { grid-template-columns: minmax(0, 1fr); }
  .launch-form { grid-template-columns: minmax(0, 1fr); }
  .run-with__fields { grid-template-columns: minmax(0, 1fr); }
  .email-settings__controls, .variables__item { grid-template-columns: minmax(0, 1fr); }
  .filters select { flex: 1 1 140px; max-width: none; }
}
