:root {
  color-scheme: light;
  --bg: #e9edf1; --surface: #ffffff; --surface-subtle: #f7f8fa;
  --text: #171e2d; --muted: #566173; --accent: #245be2; --accent-hover: #1949be;
  --accent-soft: #edf2ff; --danger: #a62636; --danger-soft: #fff0f2;
  --success: #17633d; --success-soft: #eaf6ee; --warning: #855319; --warning-soft: #fff6e6;
  --info: #34527e; --info-soft: #edf2fa; --handoff: #65458c; --handoff-soft: #f2edf9;
  --border: #dce1e9; --focus: #245be2;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --type-xs: 12px; --type-sm: 14px; --type-base: 16px; --type-lg: 24px; --type-display: clamp(28px, 3vw, 38px);
  --weight-normal: 400; --weight-strong: 600;
  --radius-sm: 12px; --radius-lg: 20px; --elevation: 0 8px 32px rgb(23 30 45 / 4%);
  --duration: 180ms; --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-nav-height: calc(var(--space-7) * 2 + var(--space-1) + var(--space-4) + 1px);
  --telegram-bg: var(--bg); --sidebar-width: 208px;
  --honeycomb-size: 192px 110.852px; --lead-action-height: 64px;
  font: var(--weight-normal) var(--type-base)/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg) url('/static/honeycomb.svg') top center / var(--honeycomb-size); }
button,input,select,textarea { font: inherit; }
button,a,input,select,textarea,summary { outline-offset: var(--space-1); -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); }
a { color: var(--accent); }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button, a, input, select, textarea { transition: background-color var(--duration) ease-out, border-color var(--duration) ease-out; }
h1,h2,h3,p { margin-top: 0; }
h1 { font-size: var(--type-display); line-height: 1.15; letter-spacing: -.035em; margin-bottom: var(--space-3); font-weight: var(--weight-strong); overflow-wrap: anywhere; }
h2 { font-size: var(--type-lg); line-height: 1.25; letter-spacing: -.02em; margin-bottom: var(--space-3); font-weight: var(--weight-strong); overflow-wrap: anywhere; }
h3 { font-size: var(--type-base); margin-bottom: var(--space-2); font-weight: var(--weight-strong); overflow-wrap: anywhere; }
p { margin-bottom: var(--space-4); overflow-wrap: anywhere; }
small,.muted,.help { color: var(--muted); }
small { font-size: var(--type-xs); }
.app-shell { max-width: 1440px; margin: 0 auto; min-height: 100vh; padding: var(--safe-top) var(--space-5) calc(var(--space-5) + var(--safe-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 92px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; flex-shrink: 0; gap: var(--space-3); font-size: var(--type-lg); color: var(--accent); font-weight: var(--weight-strong); text-decoration: none; line-height: 1.1; }
.brand img { border-radius: var(--radius-sm); }
.brand small { display: block; font-size: 10px; letter-spacing: .13em; color: var(--muted); font-weight: var(--weight-normal); margin-top: var(--space-1); white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: var(--space-3); }
.owner-chip { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--type-xs); }
.owner-chip i,.status-dot { display: inline-block; width: var(--space-2); height: var(--space-2); border-radius: 50%; background: var(--success); flex-shrink: 0; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); background: var(--surface); font-size: var(--type-lg); }
.icon-button:hover { color: var(--accent); border-color: var(--accent); }
.app-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-3); margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border); color: var(--muted); font-size: var(--type-xs); }
.app-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--accent); text-decoration: underline; }
.shell-grid { display: grid; grid-template-columns: var(--sidebar-width) minmax(0,1fr); gap: var(--space-6); }
.sidebar { padding-top: var(--space-6); }
.nav { display: grid; gap: var(--space-2); position: sticky; top: var(--space-4); }
.nav a { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--muted); min-width: 0; min-height: var(--space-7); border: 1px solid transparent; border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); font-size: var(--type-sm); }
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a span { min-width: 0; overflow-wrap: anywhere; }
.nav a:hover { background: var(--surface); }
.nav a.active { background: var(--surface); color: var(--accent); border-color: var(--border); box-shadow: var(--elevation); font-weight: var(--weight-strong); }
.sidebar-foot { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-7) var(--space-4); font-size: var(--type-xs); color: var(--muted); }
.main { min-width: 0; padding-top: var(--space-6); outline: none; }
.view { display: grid; gap: var(--space-5); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-2); }
.page-heading > div { min-width: 0; }
.page-heading > .button { flex-shrink: 0; }
.eyebrow { color: var(--muted); font-size: var(--type-xs); font-weight: var(--weight-strong); letter-spacing: .12em; margin-bottom: var(--space-3); }
.lead-copy { color: var(--muted); font-size: var(--type-sm); max-width: 640px; margin-bottom: 0; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: var(--space-2); min-width: 0; max-width: 100%; min-height: 44px; padding: var(--space-3) var(--space-4); border: 1px solid transparent; border-radius: var(--radius-sm); font-size: var(--type-sm); font-weight: var(--weight-strong); text-decoration: none; text-align: center; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.primary { background: var(--accent); color: var(--surface); }
.primary:hover { background: var(--accent-hover); }
.secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.secondary:hover { border-color: var(--muted); background: var(--surface-subtle); }
.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.danger:hover { border-color: var(--danger); }
.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.quiet:hover { background: var(--surface-subtle); color: var(--text); }
.button:active { transform: translateY(1px); }
.heading-actions,.action-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.heading-actions { justify-content: flex-end; }
.panel,.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--elevation); min-width: 0; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.panel-title h2 { min-width: 0; margin-bottom: 0; }
.panel-title > div,.compact-item > div,.status-line > :first-child,.lead-row > div { min-width: 0; overflow-wrap: anywhere; }
.panel-title .eyebrow { margin-bottom: var(--space-2); }
.panel-icon { font-size: var(--type-lg); color: var(--accent); }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: var(--space-4); }
.metric { position: relative; width: 100%; min-width: 0; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); }
.metric:hover { border-color: var(--accent); background: var(--accent-soft); }
.metric-arrow { position: absolute; top: var(--space-4); right: var(--space-4); color: var(--muted); font-size: var(--type-base); }
.metric strong { font-size: 32px; font-weight: var(--weight-strong); letter-spacing: -.04em; display: block; margin-bottom: var(--space-1); }
.metric span { color: var(--muted); font-size: var(--type-sm); }
.split-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--space-5); }
.next-panel { background: var(--accent-soft); border-color: var(--border); }
.next-panel .secondary { color: var(--accent); }
.status-list { display: grid; gap: var(--space-3); font-size: var(--type-sm); }
.status-line { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.status-badge { display: inline-flex; align-items: center; gap: var(--space-1); max-width: 100%; border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); font-size: var(--type-xs); font-weight: var(--weight-strong); background: var(--surface-subtle); color: var(--muted); overflow-wrap: anywhere; }
.status-badge.ok { color: var(--success); background: var(--success-soft); }
.status-badge.warning { color: var(--warning); background: var(--warning-soft); }
.status-badge.error { color: var(--danger); background: var(--danger-soft); }
.status-badge.stage-new,.status-badge.mode-auto { color: var(--success); background: var(--success-soft); }
.status-badge.stage-needs,.status-badge.mode-paused { color: var(--warning); background: var(--warning-soft); }
.status-badge.stage-offer { color: var(--info); background: var(--info-soft); }
.status-badge.stage-application,.status-badge.mode-human { color: var(--accent); background: var(--accent-soft); }
.status-badge.stage-handoff { color: var(--handoff); background: var(--handoff-soft); }
.status-badge.stage-won { color: var(--success); background: var(--success-soft); }
.status-badge.stage-lost { color: var(--danger); background: var(--danger-soft); }
.stage-shortcuts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-2); }
.stage-shortcuts .button { flex-direction: column; gap: var(--space-1); padding-inline: var(--space-2); }
.stage-shortcuts strong { font-size: var(--type-lg); font-weight: var(--weight-strong); }
.text-link { font-size: var(--type-sm); text-decoration: none; white-space: nowrap; }
.compact-list { display: grid; }
.compact-item { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) 0; border-bottom: 1px solid var(--border); }
.compact-item:last-child { border-bottom: 0; padding-bottom: 0; }
.compact-item:first-child { padding-top: 0; }
.compact-item h3 { margin: 0 0 var(--space-1); }
.card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-5); }
.card { display: grid; align-content: start; gap: var(--space-4); }
.card p { margin-bottom: 0; color: var(--muted); font-size: var(--type-sm); }
.card .action-row { margin-top: auto; }
.card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.card-title h2 { font-size: var(--type-lg); margin: 0; }
.card-icon { color: var(--accent); font-size: var(--type-lg); }
.back-link { color: var(--muted); border: 0; background: transparent; padding: 0; margin-bottom: var(--space-4); min-height: 44px; font-size: var(--type-sm); }
.back-link:hover { color: var(--accent); }
.editor-layout { display: grid; grid-template-columns: 168px minmax(0,1fr); gap: var(--space-5); align-items: start; }
.section-tabs { display: grid; gap: var(--space-1); position: sticky; top: var(--space-4); padding: var(--space-1); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.section-tabs button { min-width: 0; min-height: 44px; padding: var(--space-3); text-align: left; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: var(--type-sm); line-height: 1.4; overflow-wrap: anywhere; }
.section-tabs button.active { color: var(--accent); background: var(--accent-soft); border-color: var(--border); font-weight: var(--weight-strong); }
.section-tabs button:hover { color: var(--accent); background: var(--surface-subtle); }
.section-tabs button.active:hover { background: var(--accent-soft); }
.editor-content { display: grid; gap: var(--space-4); min-width: 0; }
.form-section { display: grid; gap: var(--space-4); }
.section-copy { color: var(--muted); font-size: var(--type-sm); margin-bottom: var(--space-2); }
.field { min-width: 0; }
.field > label { display: block; font-size: var(--type-sm); font-weight: var(--weight-strong); margin-bottom: var(--space-2); }
input,select,textarea { width: 100%; min-height: var(--space-7); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); background: var(--surface-subtle); color: var(--text); min-width: 0; }
textarea { resize: vertical; min-height: 112px; }
input:hover,select:hover,textarea:hover { border-color: var(--muted); }
input:focus,select:focus,textarea:focus { border-color: var(--accent); }
input::placeholder,textarea::placeholder { color: var(--muted); }
input:disabled,select:disabled,textarea:disabled { opacity: .6; }
.help { font-size: var(--type-xs); margin: var(--space-2) 0 0; }
.field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-4); }
.check-label { display: flex; align-items: flex-start; gap: var(--space-3); font-size: var(--type-sm); min-height: 44px; cursor: pointer; }
.check-label input { width: 20px; height: 20px; min-height: 20px; margin: var(--space-1) 0 0; accent-color: var(--accent); flex-shrink: 0; }
.check-label span { display: block; }
.check-label small { display: block; margin-top: var(--space-1); }
.divider { height: 1px; background: var(--border); margin: var(--space-2) 0; }
.repeat-list { display: grid; gap: var(--space-4); }
.repeat-card { padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-subtle); display: grid; gap: var(--space-4); }
.repeat-card input,.repeat-card textarea,.repeat-card select { background: var(--surface); }
.repeat-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.repeat-heading h3 { min-width: 0; margin: 0; }
.repeat-heading button { width: 44px; height: 44px; flex-shrink: 0; }
.empty-state { border: 1px dashed var(--border); border-radius: var(--radius-lg); padding: var(--space-6); text-align: center; color: var(--muted); font-size: var(--type-sm); background: var(--surface); }
.empty-state p { margin-bottom: var(--space-3); }
.empty-state .empty-icon { display: block; font-size: 32px; color: var(--accent); margin-bottom: var(--space-3); }
.notice { padding: var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--accent-soft); font-size: var(--type-sm); overflow-wrap: anywhere; }
.notice p { margin-bottom: var(--space-3); }
.notice p:last-child { margin-bottom: 0; }
.notice.error { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.notice.success { color: var(--success); background: var(--success-soft); }
.notice.warning { color: var(--warning); background: var(--warning-soft); }
#global-notice { margin-bottom: var(--space-5); }
.filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-4); background: var(--surface); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.filters label { font-size: var(--type-xs); color: var(--muted); }
.filters select { margin-top: var(--space-2); background: var(--surface-subtle); font-size: var(--type-sm); }
.lead-list { display: grid; gap: var(--space-3); }
.bulk-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.bulk-controls > div { min-width: 0; }
.bulk-controls h2 { font-size: var(--type-base); margin-bottom: var(--space-1); }
.bulk-controls .help { margin: 0; }
.bulk-controls .action-row { flex-wrap: nowrap; }
.lead-title-row { display: flex; align-items: center; gap: var(--space-3); }
.lead-title-row h1 { margin-bottom: 0; min-width: 0; }
.lead-title-row .icon-button { border-radius: 50%; font-size: var(--type-base); font-weight: var(--weight-strong); }
.lead-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.lead-meta > span:first-child { flex-basis: 100%; }
.action-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.action-label { min-width: 0; }
.lead-help-list { display: grid; gap: var(--space-3); padding: 0; margin: var(--space-4) 0; list-style: none; }
.lead-help-list li { display: flex; align-items: flex-start; gap: var(--space-3); font-size: var(--type-sm); }
.lead-help-list strong { font-weight: var(--weight-strong); }
.lead-help-list p { margin: 0; }
.lead-help-list .action-icon { color: var(--muted); }
.lead-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); width: 100%; text-align: left; background: var(--surface); padding: var(--space-4) var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lead-row:hover { border-color: var(--accent); }
.lead-row strong { display: block; font-size: var(--type-base); margin-bottom: var(--space-1); font-weight: var(--weight-strong); }
.lead-row small { display: block; }
.lead-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.pager { display: flex; justify-content: center; }
.lead-layout { display: grid; grid-template-columns: minmax(240px,.85fr) minmax(0,1.3fr); gap: var(--space-5); align-items: start; }
.lead-controls { display: grid; gap: var(--space-4); }
.lead-controls-heading { display: grid; gap: var(--space-2); }
.lead-controls-heading h2 { margin: 0; font-size: var(--type-base); }
.lead-mode-hint { margin: 0; color: var(--muted); font-size: var(--type-sm); }
.lead-action-groups { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-4); }
.lead-action-groups.single-group { grid-template-columns: minmax(0,1fr); }
.lead-action-group { min-width: 0; display: grid; grid-template-rows: auto 1fr; gap: var(--space-2); }
.lead-action-group h3 { margin: 0; color: var(--muted); font-size: var(--type-xs); font-weight: var(--weight-normal); }
.lead-action-buttons { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-rows: minmax(var(--lead-action-height),auto); gap: var(--space-2); }
.lead-action-buttons > .button { width: 100%; min-height: var(--lead-action-height); padding: var(--space-2); line-height: 1.35; overflow-wrap: normal; }
.lead-action-buttons > .button:only-child { grid-column: 1 / -1; }
.lead-action-buttons > .button:disabled { cursor: default; }
body[aria-busy="true"] .lead-action-buttons > .button:disabled { cursor: wait; }
.answer-list { display: grid; gap: var(--space-4); margin: 0; font-size: var(--type-sm); }
.answer-list dt { color: var(--muted); margin-bottom: var(--space-1); }
.answer-list dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.history { display: grid; gap: var(--space-3); font-size: var(--type-sm); max-height: 720px; overflow-y: auto; margin-bottom: var(--space-4); }
.message { border-radius: var(--radius-sm); background: var(--surface-subtle); padding: var(--space-3) var(--space-4); white-space: pre-wrap; overflow-wrap: anywhere; margin-right: var(--space-5); }
.message.out { background: var(--accent-soft); margin-right: 0; margin-left: var(--space-5); }
.message small { display: block; font-size: var(--type-xs); margin-bottom: var(--space-2); }
.check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--space-5); }
.check-result { padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.check-result .result-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.check-result p { color: var(--muted); font-size: var(--type-sm); margin-bottom: var(--space-2); }
.faq-list { display: grid; gap: var(--space-3); }
details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 var(--space-5); }
summary { display: block; position: relative; min-height: var(--space-7); padding: var(--space-4) var(--space-5) var(--space-4) 0; font-size: var(--type-sm); font-weight: var(--weight-strong); list-style: none; cursor: pointer; }
summary::after { position: absolute; right: 0; content: "+"; color: var(--accent); }
details[open] summary::after { content: "−"; }
summary::-webkit-details-marker { display: none; }
details > p { color: var(--muted); font-size: var(--type-sm); padding-bottom: var(--space-4); margin: 0; }
.gate { width: min(calc(100% - var(--space-6)),480px); margin: 15vh auto; padding: var(--space-6); border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); text-align: center; }
.gate img { border-radius: var(--radius-sm); margin-bottom: var(--space-5); }
.gate p { color: var(--muted); font-size: var(--type-sm); }
.gate h1 { font-size: var(--type-lg); }
.modal { max-width: min(760px,calc(100% - var(--space-5))); width: 100%; max-height: calc(100dvh - var(--space-6)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--elevation); }
.modal::backdrop { background: rgb(23 30 45 / 45%); }
.modal-inner { position: relative; padding: var(--space-6); }
.modal-close { position: absolute; right: var(--space-4); top: var(--space-4); background: transparent; border: 0; }
.modal h2 { padding-right: var(--space-7); }
.modal .form-section { margin-top: var(--space-5); }
.modal .action-row { margin-top: var(--space-5); }
.modal .notice { margin-top: var(--space-4); }
.preview-copy { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: var(--type-sm); }
.upload-input { padding: var(--space-3); font-size: var(--type-sm); }
.code-input { letter-spacing: .2em; font-size: var(--type-lg); }
.skeleton { display: grid; gap: var(--space-4); }
.skeleton span { display: block; height: var(--space-7); border-radius: var(--radius-sm); background: var(--border); animation: pulse 1s ease-out infinite alternate; }
.skeleton span:first-child { width: 65%; height: var(--space-5); }
@keyframes pulse { to { opacity: .45; } }
[aria-busy="true"] { cursor: progress; }
@media (max-width: 1100px) {
  :root { --sidebar-width: 172px; }
  .shell-grid { gap: var(--space-5); }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page-heading { flex-wrap: wrap; }
  .editor-layout { grid-template-columns: minmax(0,1fr); }
  .section-tabs { grid-template-columns: repeat(4,minmax(0,1fr)); position: static; }
  .section-tabs button { padding-inline: var(--space-2); text-align: center; }
  .lead-layout { grid-template-columns: minmax(0,1fr); }
  .lead-action-groups { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 760px) {
  html { scroll-padding-bottom: calc(var(--bottom-nav-height) + var(--space-5) + var(--safe-bottom)); }
  .app-shell { padding-inline: var(--space-4); padding-bottom: calc(var(--bottom-nav-height) + var(--space-5) + var(--safe-bottom)); }
  .topbar { min-height: 80px; }
  .shell-grid { display: block; }
  .sidebar { padding-top: 0; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; top: auto; z-index: 4; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: var(--space-2) max(var(--space-2),env(safe-area-inset-right,0px)) calc(var(--space-2) + var(--safe-bottom)) max(var(--space-2),env(safe-area-inset-left,0px)); gap: var(--space-1); border-top: 1px solid var(--border); background: var(--surface); box-shadow: 0 -4px 24px rgb(23 30 45 / 4%); }
  .nav a { display: grid; justify-items: center; align-content: center; gap: var(--space-1); padding: var(--space-1) var(--space-2); min-height: var(--space-7); border-radius: var(--radius-sm); }
  .nav a span { font-size: var(--type-xs); line-height: 1.2; font-weight: var(--weight-normal); text-align: center; }
  .nav a.active { border-color: var(--border); background: var(--accent-soft); box-shadow: none; }
  .nav a.active span { font-weight: var(--weight-strong); }
  .sidebar-foot { display: none; }
  .main { padding-top: var(--space-5); }
  .page-heading { gap: var(--space-4); }
  .page-heading > .button { width: 100%; }
  .heading-actions { width: 100%; justify-content: flex-start; }
  .heading-actions .button { flex: 1; }
  .section-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .section-tabs button { text-align: left; padding-inline: var(--space-3); }
  .field-row { grid-template-columns: minmax(0,1fr); }
  .compact-item { flex-wrap: wrap; }
  .compact-item > div { flex: 1 1 160px; }
  .action-row .button { flex: 1 1 120px; }
  .split-grid,.card-grid,.check-grid { grid-template-columns: minmax(0,1fr); }
  .panel,.card { padding: var(--space-5); }
  .compact-heading h1 { font-size: 28px; }
  .metric { padding: var(--space-4); }
  .metric strong { font-size: 28px; }
  .filters { grid-template-columns: minmax(0,1fr); gap: var(--space-3); }
  .filters label { display: grid; grid-template-columns: 96px minmax(0,1fr); align-items: center; gap: var(--space-2); }
  .filters select { margin: 0; }
  .lead-row { padding: var(--space-4); align-items: flex-start; }
  .lead-badges { flex-direction: column; align-items: flex-end; }
  .lead-row strong { font-size: var(--type-sm); }
  .bulk-controls .action-row { width: 100%; }
  .bulk-controls .action-row .button { flex: 1 1 0; }
  .lead-action-groups { grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--space-2); }
  .lead-action-group,.lead-action-buttons { display: contents; }
  .lead-action-group > h3 { display: none; }
  .lead-action-buttons > .button { min-height: 56px; padding: var(--space-2); }
  .lead-action-buttons > .button:only-child { grid-column: auto; }
  .lead-action-buttons .action-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .lead-action-buttons .action-icon { width: 24px; height: 24px; }
  .modal-inner { padding: var(--space-5); }
  .modal { max-height: calc(100dvh - var(--space-5)); }
}
@media (max-width: 390px) {
  .app-shell { padding-inline: var(--space-3); }
  .topbar,.top-actions { gap: var(--space-2); }
  .owner-chip { max-width: 100px; }
  .owner-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .field-row { grid-template-columns: minmax(0,1fr); }
  .panel,.card { padding: var(--space-4); }
  .filters label { grid-template-columns: minmax(0,1fr); gap: var(--space-1); }
  .action-row .button { flex: 1; }
  .text-link { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
