:root {
  --ink: #17221d;
  --ink-soft: #5d6963;
  --paper: #f5f6f1;
  --surface: #ffffff;
  --line: #e3e7df;
  --line-strong: #d3d9d0;
  --forest: #173d2f;
  --forest-deep: #0d2a20;
  --mint: #bff25c;
  --mint-soft: #eefbd7;
  --amber: #f2b84b;
  --red: #d9544d;
  --blue: #4b72e6;
  --shadow: 0 18px 50px rgba(24, 42, 33, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 11px;
  color: var(--forest-deep);
  background: var(--mint);
  font-size: 17px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}

.brand-on-dark { color: #fff; }
.eyebrow {
  margin: 0 0 9px;
  color: #76817b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow-light { color: rgba(255,255,255,.55); }
.muted { color: var(--ink-soft); }

/* Login */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(430px, 1.05fr) minmax(480px, .95fr);
  background: var(--surface);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 48px clamp(46px, 6vw, 92px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 82% 16%, rgba(191,242,92,.2), transparent 30%),
    radial-gradient(circle at -8% 96%, rgba(60,123,93,.55), transparent 36%),
    linear-gradient(145deg, #0a251b, #164330 68%, #1d4c38);
}

.login-story::before,
.login-story::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
}
.login-story::before { width: 520px; height: 520px; right: -280px; top: 12%; }
.login-story::after { width: 360px; height: 360px; right: -195px; top: 23%; }

.story-copy { position: relative; z-index: 1; margin: auto 0 52px; max-width: 620px; }
.story-copy h1 {
  margin: 0;
  font-size: clamp(48px, 6vw, 82px);
  line-height: .98;
  letter-spacing: -.065em;
  font-weight: 650;
}
.story-lead {
  max-width: 540px;
  margin: 30px 0 0;
  color: rgba(255,255,255,.68);
  font-size: 17px;
  line-height: 1.65;
}

.story-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255,255,255,.14);
}
.story-metrics div { padding: 25px 22px 0 0; }
.story-metrics strong { display: block; margin-bottom: 10px; color: var(--mint); font-size: 12px; letter-spacing: .12em; }
.story-metrics span { color: rgba(255,255,255,.6); font-size: 12px; line-height: 1.5; }
.story-note { margin: 38px 0 0; color: rgba(255,255,255,.3); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; }

.login-panel { display: grid; place-items: center; padding: 48px clamp(38px, 7vw, 110px); }
.login-card { width: 100%; max-width: 430px; }
.mobile-brand { display: none; margin-bottom: 64px; }
.login-heading { display: flex; align-items: center; gap: 9px; color: var(--forest); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }
.login-heading p { margin: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #70b434; box-shadow: 0 0 0 4px rgba(112,180,52,.12); }
.login-card h2 { margin: 26px 0 10px; font-size: 40px; letter-spacing: -.045em; }
.login-card > .muted { margin: 0 0 36px; line-height: 1.6; }

.form-stack { display: grid; gap: 22px; }
label { display: grid; gap: 9px; color: #344139; font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  background: #fbfcf9;
  color: var(--ink);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input, select { height: 52px; }
textarea { min-height: 104px; padding-top: 14px; padding-bottom: 14px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #718078 50%), linear-gradient(135deg, #718078 50%, transparent 50%); background-position: calc(100% - 18px) 22px, calc(100% - 13px) 22px; background-size: 5px 5px; background-repeat: no-repeat; }
input::placeholder { color: #a2aaa5; }
input:focus, select:focus, textarea:focus { border-color: #4d765f; background-color: #fff; box-shadow: 0 0 0 4px rgba(42,94,68,.1); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 82px; }
.password-toggle { position: absolute; right: 8px; top: 8px; height: 36px; padding: 0 8px; color: #6f7973; font-size: 11px; }
.icon-button { border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.icon-button:hover { background: #edf1eb; }
.form-error { margin: -8px 0 0; padding: 11px 13px; border-radius: 9px; color: #9d302c; background: #fff0ef; font-size: 12px; line-height: 1.45; }

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 17px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .16s, background .16s, border-color .16s, opacity .16s;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { color: #fff; background: var(--forest); box-shadow: 0 8px 20px rgba(23,61,47,.15); }
.button-primary:hover { background: #0e3023; }
.button-secondary { border-color: var(--line-strong); background: #fff; }
.button-secondary:hover { background: #f6f8f3; }
.button-ghost { background: transparent; }
.button-wide { width: 100%; min-height: 53px; justify-content: space-between; padding: 0 20px; margin-top: 4px; }
.support-note { margin: 28px 0 0; color: #8b948f; font-size: 11px; line-height: 1.55; text-align: center; }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 260px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fbfcf8;
}
.sidebar-head { display: flex; height: 76px; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); }
.beta-label { padding: 4px 6px; border-radius: 5px; color: #71806f; background: #edf1e9; font-size: 8px; font-weight: 850; letter-spacing: .1em; }
.main-nav { flex: 1; padding: 24px 14px; overflow: auto; }
.nav-label { margin: 0 11px 10px; color: #9aa29e; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-label-secondary { margin-top: 29px; }
.nav-item {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #6d7771;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover { color: var(--ink); background: #f0f3ed; }
.nav-item.is-active { color: var(--forest); background: #eaf1e9; }
.nav-icon { display: grid; width: 22px; height: 22px; place-items: center; font-size: 17px; }
.nav-badge { margin-left: auto; color: #9ba39e; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--line); }
.service-state { display: flex; align-items: center; gap: 9px; padding: 0 10px 15px; color: #7c8781; font-size: 10px; }
.service-state .status-dot { width: 6px; height: 6px; box-shadow: none; }
.user-card { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; text-align: left; }
.user-card:hover { background: #eef1eb; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; color: #fff; background: var(--forest); font-size: 12px; font-weight: 800; }
.user-card-copy { display: grid; flex: 1; min-width: 0; }
.user-card-copy strong, .user-card-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-copy strong { font-size: 11px; }
.user-card-copy small { margin-top: 3px; color: #8a938e; font-size: 9px; }

.workspace { min-height: 100vh; margin-left: 260px; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; height: 76px; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(245,246,241,.9); backdrop-filter: blur(16px); }
.breadcrumbs { display: flex; align-items: center; gap: 9px; color: #9ba39e; font-size: 11px; }
.breadcrumbs strong { color: #56625b; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.tenant-chip { display: flex; height: 40px; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 11px; font-weight: 700; }
.tenant-symbol { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 6px; color: var(--forest); background: var(--mint-soft); font-size: 9px; }
.notification-button { position: relative; display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.notification-button span { position: absolute; top: 9px; right: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); }
.menu-button { display: none; border: 0; background: transparent; font-size: 20px; cursor: pointer; }
.workspace-content { max-width: 1480px; margin: 0 auto; padding: 42px clamp(24px, 4vw, 58px) 70px; }

.view { display: none; animation: view-in .22s ease-out; }
.view.is-visible { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.page-heading.compact { align-items: center; }
.page-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.page-heading h1 { margin: 0 0 7px; font-size: clamp(28px, 3vw, 38px); font-weight: 680; letter-spacing: -.045em; }
.page-heading .muted { margin: 0; font-size: 13px; }
.live-indicator { display: flex; align-items: center; gap: 9px; color: #78837d; font-size: 10px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #78b63a; box-shadow: 0 0 0 5px rgba(120,182,58,.11); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 14px; }
.stat-card { position: relative; min-height: 145px; padding: 21px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.stat-card::after { content: ""; position: absolute; width: 86px; height: 86px; right: -44px; top: -44px; border-radius: 50%; background: var(--stat-tint, #eff4ec); }
.stat-label { display: flex; align-items: center; gap: 9px; color: #717c76; font-size: 11px; font-weight: 680; }
.stat-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--stat-tint, #eff4ec); color: var(--stat-color, var(--forest)); font-size: 13px; }
.stat-value { margin: 18px 0 3px; font-size: 34px; font-weight: 700; letter-spacing: -.045em; }
.stat-foot { color: #929a96; font-size: 9px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 1px 0 rgba(23,34,29,.01); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 14px; margin-bottom: 14px; }
.getting-started, .account-health { min-height: 315px; padding: 25px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-head h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.progress-label, .soft-chip { padding: 6px 8px; border-radius: 7px; color: #4d6a58; background: var(--mint-soft); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.progress-track { height: 4px; margin: 22px 0 10px; border-radius: 10px; background: #edf0eb; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--forest); transition: width .4s ease; }
.setup-steps { display: grid; }
.setup-step { display: flex; width: 100%; align-items: center; gap: 14px; padding: 15px 0; border: 0; border-bottom: 1px solid #edf0eb; background: transparent; text-align: left; cursor: pointer; }
.setup-step:last-child { border-bottom: 0; }
.step-number { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 10px; color: #738078; background: #f1f4ee; font-size: 11px; font-weight: 800; }
.setup-step.is-done .step-number { color: var(--forest); background: var(--mint); }
.setup-copy { display: grid; gap: 3px; flex: 1; }
.setup-copy strong { font-size: 12px; }
.setup-copy span { color: #8a948e; font-size: 10px; }
.step-state { color: #89938d; font-size: 10px; font-weight: 700; }
.setup-step.is-done .step-state { color: #4f7a60; }

.health-list { display: grid; gap: 4px; margin-top: 22px; }
.health-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid #edf0eb; }
.health-row:last-child { border: 0; }
.health-row > span:first-child { color: #68736d; font-size: 11px; }
.health-value { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 750; }
.health-dot { width: 6px; height: 6px; border-radius: 50%; background: #77b63d; }
.health-dot.warning { background: var(--amber); }
.health-dot.danger { background: var(--red); }

.events-panel { padding: 25px; }
.text-button { border: 0; color: #6b7770; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.text-button:hover { color: var(--forest); }
.table-wrap { margin-top: 20px; overflow-x: auto; }
.events-table { width: 100%; border-collapse: collapse; }
.events-table th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: #9aa29e; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
.events-table td { padding: 15px 12px; border-bottom: 1px solid #edf0eb; color: #5e6a63; font-size: 11px; }
.events-table tr:last-child td { border-bottom: 0; }
.event-provider { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; }
.provider-mark { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; color: #fff; background: #2f8b63; font-size: 9px; }
.provider-mark.provider-broadcast { background: #496ed1; }
.provider-mark.provider-integration { background: #7b62c8; }
.provider-mark.provider-admin { background: #5b6761; }
.provider-mark.provider-system { background: #c25a4f; }
.event-detail { max-width: 360px; overflow: hidden; color: #7c8781 !important; text-overflow: ellipsis; white-space: nowrap; }
.state-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px; border-radius: 6px; color: #4e765c; background: #edf8e9; font-size: 9px; font-weight: 750; }
.state-pill.failed { color: #a4433d; background: #fff0ee; }
.state-pill.pending { color: #8a6725; background: #fff5dd; }
.state-pill.cancelled, .state-pill.undelivered, .state-pill.error { color: #a4433d; background: #fff0ee; }
.state-pill.queued, .state-pill.processing, .state-pill.retrying { color: #8a6725; background: #fff5dd; }
.empty-row { padding: 46px 20px !important; color: #909994 !important; text-align: center; }

.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.integration-card { position: relative; min-height: 250px; padding: 26px; overflow: hidden; }
.integration-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -85px; bottom: -90px; border-radius: 50%; background: var(--integration-tint); opacity: .7; }
.integration-logo { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; color: #fff; background: var(--integration-color); font-size: 16px; font-weight: 900; }
.integration-card h2 { margin: 21px 0 8px; font-size: 20px; }
.integration-card p { max-width: 440px; margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.integration-meta { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-top: 30px; }
.connection-state { display: inline-flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 750; }
.connection-state span { width: 7px; height: 7px; border-radius: 50%; background: #adb5b0; }
.connection-state.connected span { background: #74b63d; }
.integration-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 21px; }
.integration-details { position: relative; z-index: 1; display: grid; gap: 9px; margin-top: 18px; }
.integration-detail-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 9px; border-top: 1px solid var(--line); color: #7b8580; font-size: 10px; }
.integration-detail-row strong { color: #4e5b54; font-weight: 750; text-align: right; }
.channel-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.channel-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px; color: #526159; background: #f0f3ee; font-size: 9px; font-weight: 700; }
.channel-pill i { width: 6px; height: 6px; border-radius: 50%; background: #aab2ad; }
.channel-pill.is-active i { background: #76b63c; }
.provider-error { margin-top: 12px !important; color: #a4433d !important; }

.funnel-workspace { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.funnel-sidebar { position: sticky; top: 92px; padding: 20px; }
.panel-heading, .funnel-editor-header, .steps-heading, .funnel-save-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading h2, .funnel-editor-header h2 { margin: 0; font-size: 18px; }
.small-badge { display: grid; min-width: 25px; height: 25px; place-items: center; border-radius: 8px; color: #5e6c64; background: #eef1ec; font-size: 10px; font-weight: 800; }
.funnel-list { display: grid; gap: 7px; margin-top: 18px; }
.funnel-list-item { display: grid; gap: 6px; width: 100%; padding: 13px; border: 1px solid transparent; border-radius: 11px; text-align: left; background: transparent; cursor: pointer; }
.funnel-list-item:hover { background: #f6f8f3; }
.funnel-list-item.is-active { border-color: #cbd9c3; background: #f0f8e9; }
.funnel-list-item strong { font-size: 11px; }
.funnel-list-item span { color: #8a948e; font-size: 9px; }
.funnel-editor { padding: 26px; }
.funnel-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.funnel-fields { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; margin-top: 24px; }
.funnel-description-field { grid-column: 1 / -1; }
.funnel-editor-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 20px 0 27px; padding: 13px 14px; border-radius: 11px; background: #f4f6f1; }
.funnel-editor-meta > .muted { max-width: 520px; font-size: 9px; line-height: 1.45; text-align: right; }
.steps-heading h3 { margin: 0; font-size: 17px; }
.funnel-steps { display: grid; gap: 14px; margin-top: 16px; }
.funnel-step-card { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcf9; }
.funnel-step-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.funnel-step-index { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; }
.funnel-step-index i { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; color: var(--forest); background: var(--mint-soft); font-style: normal; font-size: 9px; }
.funnel-step-fields { display: grid; grid-template-columns: .7fr 1.3fr; gap: 12px; }
.funnel-step-message { grid-column: 1 / -1; }
.funnel-step-fields label, .funnel-button-row label { font-size: 10px; }
.funnel-step-fields input, .funnel-step-fields select, .funnel-button-row input, .funnel-button-row select { height: 42px; padding: 0 12px; font-size: 11px; }
.funnel-step-fields textarea { min-height: 82px; font-size: 11px; }
.terminal-check { display: flex; align-items: center; gap: 9px; align-self: end; height: 42px; }
.terminal-check input { width: 16px; height: 16px; padding: 0; accent-color: var(--forest); }
.terminal-check span { font-size: 10px; }
.funnel-buttons { display: grid; gap: 9px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.funnel-buttons-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.funnel-buttons-head strong { font-size: 10px; }
.funnel-button-row { display: grid; grid-template-columns: .75fr 1fr 1fr auto; gap: 8px; align-items: end; }
.button-counter { color: #88928d; font-size: 8px; font-weight: 700; text-align: right; }
.remove-control { min-width: 42px; padding: 0 10px; color: #a4433d; }
.funnel-save-bar { position: sticky; z-index: 3; bottom: 12px; margin: 24px -10px -10px; padding: 13px 14px; border: 1px solid #dce4d7; border-radius: 13px; background: rgba(255,255,255,.96); box-shadow: 0 12px 30px rgba(27,48,37,.1); backdrop-filter: blur(8px); }
.funnel-save-bar .muted { font-size: 9px; }

.broadcast-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.broadcast-card { padding: 24px; }
.broadcast-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.broadcast-card h2 { margin: 4px 0 7px; font-size: 19px; }
.broadcast-card .muted { margin: 0; font-size: 10px; }
.broadcast-status { padding: 6px 8px; border-radius: 8px; color: #66726b; background: #eef1ec; font-size: 9px; font-weight: 800; white-space: nowrap; }
.broadcast-status.running { color: #426f50; background: #e9f6e5; }
.broadcast-status.completed { color: #42668a; background: #eaf3fb; }
.broadcast-status.failed, .broadcast-status.cancelled { color: #9c4b45; background: #fff0ee; }
.broadcast-variant-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.broadcast-variant-chips span { padding: 5px 7px; border-radius: 7px; color: #58655e; background: #f1f4ef; font-size: 9px; font-weight: 750; }
.broadcast-progress { height: 7px; margin-top: 21px; overflow: hidden; border-radius: 99px; background: #eef1ec; }
.broadcast-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), #86ba54); }
.broadcast-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 17px; }
.broadcast-metrics div { padding: 10px; border-radius: 9px; background: #f7f8f5; }
.broadcast-metrics strong, .broadcast-metrics span { display: block; }
.broadcast-metrics strong { font-size: 15px; }
.broadcast-metrics span { margin-top: 4px; color: #8a948e; font-size: 8px; }
.broadcast-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.broadcast-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 13px; }
.broadcast-form-grid .full-field { grid-column: 1 / -1; }
.broadcast-variant-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 23px; }
.broadcast-variant-heading strong { font-size: 11px; }
.broadcast-variants { display: grid; gap: 10px; margin-top: 10px; }
.broadcast-variant-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; }
.broadcast-variant-card > strong { display: block; margin-bottom: 9px; font-size: 10px; }
.broadcast-variant-card label { margin-top: 9px; }
.broadcast-template-preview { margin: 8px 0 0; color: #7a857f; font-size: 9px; line-height: 1.5; }
.field-help { display: block; margin-top: 6px; color: #89938d; font-size: 9px; line-height: 1.45; }

.empty-product { display: grid; min-height: 420px; place-items: center; align-content: center; padding: 60px; text-align: center; }
.empty-symbol { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 18px; color: var(--forest); background: var(--mint-soft); font-size: 27px; }
.empty-product h2 { margin: 23px 0 9px; font-size: 22px; }
.empty-product p { max-width: 560px; margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.roadmap-chip { margin-top: 22px; padding: 7px 10px; border-radius: 8px; color: #64716a; background: #eef1ec; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-card { padding: 28px; }
.settings-card h2 { margin: 0 0 12px; font-size: 20px; }
.settings-card > .muted { max-width: 470px; margin: 0 0 24px; font-size: 12px; line-height: 1.6; }
.settings-card dl { margin: 25px 0 0; }
.settings-card dl div { display: flex; justify-content: space-between; padding: 13px 0; border-top: 1px solid var(--line); font-size: 11px; }
.settings-card dt { color: #89928d; }
.settings-card dd { margin: 0; font-weight: 700; }

.account-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.account-card { padding: 25px; }
.account-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.account-card-head h2 { margin: 0 0 7px; font-size: 20px; }
.account-card-head .muted { margin: 0; font-size: 10px; }
.account-status { padding: 6px 8px; border-radius: 7px; color: #32704e; background: #edf8e9; font-size: 9px; font-weight: 800; white-space: nowrap; }
.account-status.suspended { color: #9d514a; background: #fff0ee; }
.account-owner { display: flex; align-items: center; gap: 11px; margin-top: 22px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; }
.account-owner > span:nth-child(2) { display: grid; min-width: 0; }
.account-owner strong, .account-owner small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-owner strong { font-size: 11px; }
.account-owner small { margin-top: 4px; color: #7d8881; font-size: 9px; }
.account-owner i { margin-left: auto; color: #8a6725; font-size: 8px; font-style: normal; font-weight: 800; }
.account-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 13px; }
.account-metrics span { padding: 10px; border-radius: 9px; color: #7c8781; background: #f3f5f1; font-size: 9px; text-align: center; }
.account-metrics strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 14px; }
.account-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.credential-password { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }

.skeleton { border-radius: 6px; background: linear-gradient(90deg, #edf0eb 25%, #f7f8f5 50%, #edf0eb 75%); background-size: 200% 100%; animation: skeleton 1.4s infinite; }
.skeleton-title { width: 58%; height: 13px; }
.skeleton-number { width: 35%; height: 33px; margin-top: 24px; }
@keyframes skeleton { to { background-position: -200% 0; } }

.modal { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow-y: auto; border: 0; border-radius: 22px; box-shadow: 0 30px 90px rgba(12,31,22,.24); }
.modal-wide { width: min(760px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(10,25,18,.58); backdrop-filter: blur(4px); }
.modal-card { padding: 32px; }
.modal-card h2 { margin: 0 0 9px; font-size: 25px; letter-spacing: -.035em; }
.modal-card > .muted { margin: 0 0 25px; font-size: 12px; line-height: 1.55; }
.modal-card label { margin-top: 15px; }
.modal-icon { display: grid; width: 40px; height: 40px; place-items: center; margin-bottom: 20px; border-radius: 12px; color: var(--forest); background: var(--mint); font-weight: 900; }
.warning-icon { color: #8c5a12; background: #fff0ca; }
.modal-provider-logo { margin-bottom: 20px; --integration-color: #258b60; }
.amo-provider-logo { --integration-color: #5373e4; }
.readonly-input { color: #68756e !important; background: #f3f5f1 !important; cursor: text; }
.setup-guide { margin: 0 0 20px; padding: 13px 15px; border: 1px solid #dce4d7; border-radius: 12px; color: #536159; background: #f8faf6; }
.setup-guide summary { color: #33473c; font-size: 11px; font-weight: 800; cursor: pointer; }
.setup-guide ol { margin: 12px 0 10px; padding-left: 20px; }
.setup-guide li { margin: 7px 0; color: #68756e; font-size: 10px; line-height: 1.5; }
.setup-guide a { color: var(--forest); font-size: 10px; font-weight: 800; text-decoration: none; }
.setup-guide a:hover { text-decoration: underline; }
.security-callout { display: grid; gap: 5px; margin-top: 18px; padding: 13px 14px; border: 1px solid #dce8d6; border-radius: 11px; color: #52645a; background: #f3f9ee; }
.security-callout strong { font-size: 10px; }
.security-callout span { color: #78847d; font-size: 10px; line-height: 1.45; }
.confirm-check { display: flex; align-items: flex-start; grid-template-columns: none; gap: 11px; margin-top: 22px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf8; cursor: pointer; }
.confirm-check input { width: 17px; height: 17px; flex: 0 0 17px; margin: 1px 0 0; accent-color: var(--forest); }
.confirm-check span { color: #5f6b64; font-size: 11px; line-height: 1.45; }
.password-hint { color: #8c9590; font-size: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 17px; border-radius: 12px; color: #fff; background: var(--forest); box-shadow: var(--shadow); font-size: 12px; }
.mobile-overlay { position: fixed; z-index: 25; inset: 0; background: rgba(15,28,21,.45); }

@media (max-width: 1080px) {
  .login-shell { grid-template-columns: minmax(360px, .85fr) minmax(430px, 1fr); }
  .story-metrics { grid-template-columns: 1fr; gap: 8px; }
  .story-metrics div { display: flex; gap: 15px; padding-top: 15px; }
  .story-metrics strong { margin: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .funnel-workspace { grid-template-columns: 220px minmax(0, 1fr); }
  .funnel-button-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .login-shell { display: block; min-height: 100vh; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 40px 24px; }
  .mobile-brand { display: inline-flex; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(20,39,29,.12); }
  .sidebar.is-open { transform: none; }
  .workspace { margin-left: 0; }
  .menu-button { display: block; }
  .topbar { height: 66px; padding: 0 18px; }
  .breadcrumbs { display: none; }
  .workspace-content { padding: 28px 18px 52px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .integration-grid, .settings-grid, .account-list { grid-template-columns: 1fr; }
  .broadcast-list { grid-template-columns: 1fr; }
  .funnel-workspace { grid-template-columns: 1fr; }
  .funnel-sidebar { position: static; }
  .funnel-fields, .funnel-step-fields { grid-template-columns: 1fr; }
  .funnel-description-field, .funnel-step-message { grid-column: auto; }
}

@media (max-width: 540px) {
  .login-card h2 { font-size: 34px; }
  .mobile-brand { margin-bottom: 48px; }
  .stats-grid { grid-template-columns: 1fr; gap: 9px; }
  .stat-card { min-height: 112px; padding: 16px; }
  .stat-value { margin-top: 15px; font-size: 28px; }
  .stat-label { gap: 9px; }
  .getting-started, .account-health, .events-panel { padding: 19px; border-radius: 18px; }
  .tenant-chip span:nth-child(2) { display: none; }
  .live-indicator { display: none; }
  .empty-product { padding: 40px 24px; }
  .modal-card { padding: 24px; }
  .funnel-editor { padding: 18px; }
  .funnel-editor-header, .funnel-editor-meta, .steps-heading { align-items: flex-start; flex-direction: column; }
  .funnel-editor-meta > .muted { text-align: left; }
  .funnel-button-row { grid-template-columns: 1fr; }
  .broadcast-form-grid { grid-template-columns: 1fr; }
  .broadcast-form-grid .full-field { grid-column: auto; }
  .broadcast-metrics { grid-template-columns: repeat(2, 1fr); }
}
