:root {
  color-scheme: light;
  --canvas: #eaf0fb;
  --bg: #f7f9fe;
  --surface: #ffffff;
  --surface-2: #eef3fc;
  --ink: #101828;
  --muted: #667085;
  --line: #dfe7f5;
  --line-strong: #c8d5eb;
  --green: #2563eb;
  --green-hover: #1d4ed8;
  --green-soft: #e8f0ff;
  --coral: #e8674d;
  --coral-soft: #fae9e4;
  --amber: #9c6519;
  --amber-soft: #f7ecd7;
  --red: #b33d3d;
  --shadow: 0 14px 38px rgba(37, 99, 235, .08);
  --shadow-lg: 0 24px 70px rgba(40, 65, 130, .16);
  --radius: 14px;
  --ease: cubic-bezier(.32,.72,0,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #090e1a;
  --bg: #0d1424;
  --surface: #121c30;
  --surface-2: #192641;
  --ink: #f4f7ff;
  --muted: #a8b3c7;
  --line: #243653;
  --line-strong: #365079;
  --green: #79a7ff;
  --green-hover: #9bbcff;
  --green-soft: #172e58;
  --coral: #f17a62;
  --coral-soft: #422a25;
  --amber: #e0ad5f;
  --amber-soft: #3a3020;
  --red: #f07c77;
  --shadow: 0 12px 38px rgba(0, 0, 0, .2);
}

* { box-sizing: border-box; }
*:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 55%, transparent); outline-offset: 3px; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button { touch-action: manipulation; transition: transform 120ms var(--ease), background-color 200ms var(--ease), border-color 200ms var(--ease), color 200ms var(--ease), opacity 200ms var(--ease); }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { cursor: not-allowed; opacity: .55; }
.app-shell { width: min(100%, 1060px); min-height: 100vh; margin: 0 auto; background: var(--bg); border-inline: 1px solid var(--line); }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 8; }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 48px; height: 48px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 8px 14px rgba(37,99,235,.2)); }
.brand { font-size: 20px; line-height: 1.1; font-weight: 780; }
.muted { color: var(--muted); font-size: 13px; }
.ui-icon { display: block; width: 24px; height: 24px; flex: 0 0 auto; color: currentColor; overflow: visible; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.icon-button { border: 1px solid var(--line); background: var(--surface); width: 38px; height: 38px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--ink); display: inline-grid; place-items: center; }
.icon-button .ui-icon { width: 22px; height: 22px; }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-2); }
.admin-button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); border-radius: 7px; min-height: 36px; padding: 0 12px; font-weight: 700; }
.admin-button .ui-icon { width: 21px; height: 21px; }
main { padding: 24px 20px 108px; }
.view { display: none; }
.view.active { display: block; animation: reveal 300ms var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translate3d(0,8px,0); } }
h1, h2, p { margin: 0; }
h1 { font-size: 27px; line-height: 1.15; }
h2 { font-size: 17px; line-height: 1.3; }
.eyebrow { display: block; color: var(--green); font-size: 11px; line-height: 1.3; font-weight: 800; text-transform: uppercase; margin-bottom: 4px; }
.page-intro, .admin-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.setup-guide { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow); }
.setup-guide > div { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.setup-guide > div:nth-child(2n) { border-right: 0; }
.setup-guide > div:nth-last-child(-n+2) { border-bottom: 0; }
.setup-guide strong, .setup-guide span { display: block; }
.setup-guide strong { font-size: 13px; }
.setup-guide div div span { color: var(--muted); font-size: 11px; line-height: 1.4; margin-top: 3px; }
.setup-guide > div > .guide-number { width: 24px; height: 24px; flex: 0 0 24px; display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1; text-align: center; border: 1px solid var(--green); color: var(--green); border-radius: 50%; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.metric { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.metric span, .metric small { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-size: 30px; line-height: 1; margin: 9px 0 5px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 28px 0 10px; }
.section-head p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.text-button { color: var(--green); font-weight: 700; background: none; border: 0; padding: 7px; white-space: nowrap; }
.primary-button { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; gap: 8px; align-items: center; justify-content: center; background: linear-gradient(135deg,#2563eb,#4f46e5); color: #fff; border: 1px solid transparent; border-radius: 12px; min-height: 48px; padding: 0 19px; font-weight: 750; box-shadow: 0 10px 22px rgba(37,99,235,.2); }
.primary-button:hover { background: var(--green-hover); border-color: var(--green-hover); }
.primary-button.compact { min-height: 38px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); font-weight: 720; }
.secondary-button:hover { background: var(--surface-2); border-color: var(--green); }
.full { width: 100%; }
.stack { display: grid; gap: 8px; }
.empty-state:empty, .empty-state:not(:has(> *)) { color: var(--muted); border: 1px dashed var(--line-strong); padding: 28px 14px; text-align: center; border-radius: var(--radius); }
.notice { display: flex; align-items: flex-start; gap: 10px; background: var(--green-soft); border-left: 3px solid var(--green); border-radius: 4px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; }
.notice strong { flex: 0 0 auto; }
.notice span { color: var(--muted); line-height: 1.45; }
.notice.warm { background: var(--amber-soft); border-color: var(--amber); }
.account-item, .campaign-item, .contact-item, .message-item, .paste-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.account-item:hover, .campaign-item:hover, .contact-item:hover, .message-item:hover { border-color: var(--line-strong); }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.item-title { font-weight: 730; overflow-wrap: anywhere; }
.item-meta { color: var(--muted); font-size: 13px; margin-top: 3px; }
.item-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.mini-button { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 6px; min-height: 33px; padding: 0 10px; }
.mini-button.icon-only { width: 36px; min-width: 36px; padding: 0; display: inline-grid; place-items: center; }
.mini-button.icon-only .ui-icon { width: 22px; height: 22px; }
.mini-button:hover { background: var(--surface-2); }
.danger { color: var(--red); }
.badge { display: inline-flex; align-items: center; border-radius: 20px; padding: 4px 8px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.badge.running, .badge.sent, .badge.completed { background: var(--green-soft); color: var(--green); }
.badge.paused, .badge.scheduled { background: var(--amber-soft); color: var(--amber); }
.progress { height: 5px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 11px; }
.progress > i { display: block; height: 100%; background: var(--green); }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: center; margin-bottom: 12px; }
.count { background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
.contact-list, .message-list { display: grid; gap: 7px; }
.contact-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.contact-avatar { width: 36px; height: 36px; background: var(--green-soft); color: var(--green); border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.contact-info { display: flex; gap: 10px; min-width: 0; }
.file-button input { display: none; }
.form-layout, .dialog-form { display: grid; gap: 15px; }
.compose-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.compose-actions { display: grid; grid-template-columns: minmax(150px, .65fr) minmax(180px, 1fr); gap: 9px; }
label { display: grid; gap: 6px; color: var(--ink); font-size: 13px; font-weight: 680; }
label > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
label small { color: var(--muted); font-size: 11px; font-weight: 450; line-height: 1.4; }
.optional { font-size: 9px; line-height: 1; text-transform: uppercase; font-weight: 800; font-style: normal; }
.optional { color: var(--muted); }
input, select, textarea { width: 100%; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--ink); padding: 11px 12px; outline: none; font-size: 16px; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 74%, transparent); }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent); }
textarea { resize: vertical; line-height: 1.55; }
.template-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.template-row > span { font-size: 13px; color: var(--muted); }
.chips { display: flex; gap: 6px; overflow-x: auto; flex: 1; }
.chips button, .variables button, .preset-row button { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); padding: 7px 11px; font-size: 12px; }
.chips button:hover, .variables button:hover, .preset-row button:hover { border-color: var(--green); color: var(--green); }
.variables, .preset-row { display: flex; gap: 6px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(96px, .38fr); gap: 10px; }
.two-col.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-note { color: var(--muted); font-size: 11px; margin-top: -10px; }
.compact-select { width: auto; max-width: 55%; padding: 9px 10px; }
.message-item { cursor: pointer; position: relative; display: grid; gap: 6px; }
.message-item.is-unseen { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); background: color-mix(in srgb, var(--green-soft, #e8f5e9) 55%, var(--surface)); }
.message-item.is-unseen .item-title { font-weight: 800; }
.message-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.message-subject { font-weight: 700; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.message-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  white-space: normal;
}
.unread-dot {
  flex: 0 0 auto;
  min-width: 42px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
  letter-spacing: .02em;
}
.message-tap-hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.message-dialog { width: min(96vw, 640px); }
.message-dialog-layout { display: flex; flex-direction: column; gap: 12px; max-height: min(92vh, 820px); }
.message-head-block { min-width: 0; display: grid; gap: 4px; }
.message-head-block h2 { margin: 0; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.message-meta-row { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; }
.reply-form { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.soft-note { margin: 0; }
.how-to-box { margin-top: 12px; }
.how-to-box code, .var-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface-2, #eee) 80%, var(--line));
}
.var-hint { margin-top: 4px; }
.compose-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.compose-actions .primary-button,
.compose-actions .secondary-button { flex: 1 1 140px; }
.accent-start {
  background: linear-gradient(135deg, #1f7a4c, #16a34a) !important;
  box-shadow: 0 8px 18px rgba(22, 163, 74, .28);
}
.campaign-item .item-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.campaign-item .start-send-btn {
  background: linear-gradient(135deg, #1f7a4c, #16a34a);
  color: #fff;
  border: 0;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 10px;
}
.paste-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 9px; }
.paste-subject { font-weight: 750; margin: 9px 0 5px; overflow-wrap: anywhere; }
.paste-preview { color: var(--muted); font-size: 13px; line-height: 1.45; height: 58px; overflow: hidden; white-space: pre-wrap; }
.paste-item .item-actions { flex-wrap: wrap; }
#composePasteChips { max-width: 100%; }
.bottom-nav { position: fixed; z-index: 10; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 1060px); height: calc(76px + env(safe-area-inset-bottom)); padding: 7px 7px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb,var(--surface) 92%,transparent); backdrop-filter: blur(18px) saturate(150%); border-top: 1px solid var(--line); }
.bottom-nav button { border: 0; background: none; color: var(--muted); font-size: 9px; display: grid; place-items: center; align-content: center; gap: 4px; min-width: 0; }
.bottom-nav .ui-icon { width: 25px; height: 25px; }
.bottom-nav button.active { color: var(--green); font-weight: 800; }
.bottom-nav .compose-nav .ui-icon { width: 29px; height: 29px; }
dialog { width: min(94vw, 590px); max-height: 92vh; border: 1px solid var(--line); border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(12, 18, 14, .62); }
.dialog-form { padding: 21px; overflow-y: auto; max-height: 92vh; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.dialog-notice { color: var(--muted); font-size: 12px; line-height: 1.5; border-left: 3px solid var(--coral); padding: 9px 11px; background: var(--coral-soft); border-radius: 4px; }
.form-error {
  display: none;
  color: #fff;
  background: #b42318;
  border: 1px solid color-mix(in srgb, #b42318 70%, #000);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 8px 24px rgba(180, 35, 24, .25);
}
.form-error:not([hidden]) { display: block; }
.form-error strong { display: block; margin-bottom: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .9; }
.message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  flex: 1 1 auto;
  min-height: 180px;
  max-height: min(52vh, 480px);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
  -webkit-overflow-scrolling: touch;
}
.preview-dialog { width: min(94vw, 720px); }
.preview-layout { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 13px; padding: 21px; max-height: 92vh; }
.preview-head { flex: 0 0 auto; }
.preview-recipient-note { background: var(--green-soft); border-left: 3px solid var(--green); border-radius: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; padding: 10px 12px; }
.mail-preview { min-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 20px; }
.mail-preview-top { display: flex; align-items: flex-start; gap: 11px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.mail-avatar { width: 39px; height: 39px; flex: 0 0 39px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; }
.mail-addresses { display: grid; min-width: 0; gap: 2px; }
.mail-addresses strong, .mail-addresses span { overflow-wrap: anywhere; }
.mail-addresses span { color: var(--muted); font-size: 12px; }
.mail-addresses b { color: var(--ink); font-weight: 550; }
.mail-preview h3 { margin: 18px 0 16px; font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
.mail-preview pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.65 inherit; color: var(--ink); }
.preview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
/* Native <dialog> uses the top layer — toast must sit above it or live inside the dialog. */
.toast {
  position: fixed;
  z-index: 2147483000;
  left: 50%;
  top: max(16px, env(safe-area-inset-top));
  bottom: auto;
  transform: translate(-50%, -12px);
  max-width: min(92%, 520px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  white-space: pre-wrap;
  word-break: break-word;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast.is-error { background: #b42318; color: #fff; }
.admin-metrics { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); gap: 8px; }
.admin-metric { border-top: 3px solid var(--green); background: var(--surface); border-radius: 4px; padding: 13px; border-inline: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.admin-metric span { color: var(--muted); font-size: 11px; }
.admin-metric strong { display: block; margin-top: 6px; font-size: 23px; }
.admin-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 12px; margin-top: 13px; }
.admin-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px 14px; min-width: 0; }
.admin-search { width: min(250px, 54%); padding: 8px 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; text-align: left; font-weight: 800; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td:last-child, th:last-child { text-align: right; }
.user-cell strong, .user-cell span { display: block; }
.admin-logs { display: grid; gap: 1px; max-height: 590px; overflow-y: auto; }
.log-item { padding: 10px 3px; border-bottom: 1px solid var(--line); }
.log-event { font-weight: 750; font-size: 13px; }
.log-detail { color: var(--muted); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }

.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-160%); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { transform: none; }
.hero-panel { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; padding: 30px; margin-bottom: 18px; border: 1px solid color-mix(in srgb,var(--green) 25%,var(--line)); border-radius: 22px; background: radial-gradient(circle at 85% 20%,rgba(34,211,238,.16),transparent 30%),linear-gradient(135deg,color-mix(in srgb,var(--surface) 92%,#dbeafe),var(--surface)); box-shadow: var(--shadow-lg); }
.hero-panel::after { content:""; position:absolute; width:260px; height:260px; right:-120px; top:-150px; border-radius:50%; background:linear-gradient(135deg,rgba(37,99,235,.25),rgba(79,70,229,.12)); filter:blur(2px); pointer-events:none; }
.hero-panel h1 { max-width: 720px; font-size: clamp(30px,5vw,52px); letter-spacing: -.045em; line-height: 1.04; }
.hero-panel p { max-width: 650px; color: var(--muted); margin-top: 14px; line-height: 1.65; font-size: 15px; }
.hero-cta { z-index:1; min-width: 180px; }
.button-shine { position:absolute; inset:0; z-index:-1; background:linear-gradient(110deg,transparent 20%,rgba(255,255,255,.25) 48%,transparent 76%); transform:translate3d(-120%,0,0); transition:transform 550ms var(--ease); }
.primary-button:hover .button-shine { transform:translate3d(120%,0,0); }
.delivery-planner { display:grid; gap:14px; padding:18px; border:1px solid color-mix(in srgb,var(--green) 28%,var(--line)); border-radius:16px; background:linear-gradient(145deg,var(--green-soft),color-mix(in srgb,var(--surface) 92%,transparent)); }
.planner-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.safety-badge { display:inline-flex; align-items:center; min-height:30px; padding:0 10px; border-radius:99px; background:var(--surface); color:var(--green); border:1px solid color-mix(in srgb,var(--green) 35%,var(--line)); font-size:11px; font-weight:800; }
.plan-summary { display:grid; gap:4px; padding:13px 14px; border-radius:12px; background:var(--surface); border:1px solid var(--line); }
.plan-summary strong { font-size:13px; }
.plan-summary span { color:var(--muted); font-size:12px; line-height:1.5; }
.plan-summary.is-warning { border-color:var(--amber); background:var(--amber-soft); }
.consent-check { grid-template-columns:22px 1fr; align-items:start; padding:14px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); cursor:pointer; }
.consent-check input { width:20px; min-height:20px; height:20px; margin:2px 0 0; accent-color:var(--green); }
.consent-check > span { display:grid; justify-content:initial; gap:3px; }
.consent-check small { display:block; }
.pace-meta { color:var(--green); font-size:11px; font-weight:700; margin-top:6px; }
.button-spinner { width:17px; height:17px; border:2px solid rgba(255,255,255,.38); border-top-color:#fff; border-radius:50%; animation:spin 700ms linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.metric,.account-item,.campaign-item,.contact-item,.message-item,.paste-item,.compose-panel { transition:transform 200ms var(--ease),border-color 200ms var(--ease),box-shadow 200ms var(--ease); }
@media (hover:hover) { .metric:hover,.account-item:hover,.campaign-item:hover,.paste-item:hover { transform:translate3d(0,-2px,0); box-shadow:var(--shadow); } }

@media (max-width: 700px) {
  .hero-panel { grid-template-columns:1fr; padding:22px 18px; border-radius:18px; }
  .hero-panel h1 { font-size:32px; }
  .hero-cta { width:100%; }
  .setup-guide { grid-template-columns: 1fr; }
  .setup-guide > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .setup-guide > div:last-child { border-bottom: 0; }
  .notice { display: grid; gap: 4px; }
  .page-intro { align-items: center; }
  .page-intro h1 { font-size: 24px; }
  .admin-button { padding: 0 9px; font-size: 12px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand { font-size: 18px; }
  .two-col { grid-template-columns: minmax(0, 1fr) 92px; }
  .two-col.equal { grid-template-columns: 1fr; }
  .admin-metrics { grid-template-columns: repeat(2, 1fr); }
  .admin-columns { grid-template-columns: 1fr; }
  .compose-actions { grid-template-columns: 1fr; }
  .preview-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .preview-layout { height: 100dvh; max-height: 100dvh; padding: max(16px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
  .mail-preview { min-height: 0; padding: 16px; }
  .preview-actions { grid-template-columns: 1fr; }
  .preview-actions .primary-button { order: -1; }
  .section-head { align-items: center; }
  .section-head p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
  .view.active { animation:none; }
}

@media (min-width: 980px) {
  .app-shell { width: min(1280px, 100%); padding-left: 188px; position: relative; }
  .topbar { padding-inline: 30px; }
  main { padding: 30px 32px 48px; }
  .bottom-nav { top: 0; bottom: 0; left: max(0px, calc(50% - 640px)); transform: none; width: 188px; height: 100vh; padding: 112px 12px 18px; display: flex; flex-direction: column; gap: 5px; border-top: 0; border-right: 1px solid var(--line); }
  .bottom-nav::before { content: "РАБОЧЕЕ МЕНЮ"; position: absolute; top: 82px; left: 20px; color: var(--muted); font-size: 9px; font-weight: 800; }
  .bottom-nav button { min-height: 45px; display: grid; grid-template-columns: 30px 1fr; justify-items: start; align-items: center; align-content: center; gap: 8px; border-radius: 7px; padding: 0 10px; font-size: 12px; }
  .bottom-nav button:hover { background: var(--surface-2); color: var(--ink); }
  .bottom-nav button.active { background: var(--green-soft); }
  .bottom-nav .compose-nav { order: -1; background: var(--green); color: #fff; margin-bottom: 10px; }
  .bottom-nav .compose-nav:hover { background: var(--green-hover); color: #fff; }
  .bottom-nav .compose-nav .ui-icon { width: 27px; height: 27px; }
  .toast { top: max(12px, env(safe-area-inset-top)); bottom: auto; }
}
