:root {
  --ink: #17231c;
  --muted: #68766d;
  --faint: #9aa69e;
  --canvas: #f5f3ed;
  --paper: #fffefa;
  --line: #dedfd9;
  --line-soft: #e9e8e2;
  --green: #1e6049;
  --green-dark: #154b39;
  --green-pale: #dcebe1;
  --lime: #d7ef8f;
  --orange: #ec8f50;
  --red: #b94b42;
  --shadow: 0 18px 54px rgba(31, 49, 39, .09);
  --sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--sans); font-size: 14px; }
body.menu-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

#app { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; background: #ece9e0; border-right: 1px solid #dcd9d0; display: flex; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 0 8px; font-family: var(--serif); font-size: 25px; font-weight: 600; letter-spacing: -.5px; }
.brand-mark { display: inline-flex; align-items: end; gap: 2px; height: 24px; transform: rotate(-5deg); }
.brand-mark i { width: 5px; border-radius: 4px; background: var(--green); display: block; }
.brand-mark i:nth-child(1) { height: 13px; }
.brand-mark i:nth-child(2) { height: 21px; }
.brand-mark i:nth-child(3) { height: 16px; }
.workspace-picker { width: 100%; margin: 30px 0 20px; padding: 10px; border: 1px solid #d4d3cc; border-radius: 12px; background: rgba(255,255,255,.48); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.workspace-avatar, .profile-avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--green); color: white; font-size: 11px; font-weight: 700; }
.workspace-picker span:nth-child(2), .profile span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.workspace-picker small, .profile small { color: var(--muted); font-size: 11px; }
.workspace-picker strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chevron, .more { color: var(--muted); }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: #526058; font-weight: 500; transition: .18s ease; }
.nav a:hover { background: rgba(255,255,255,.55); color: var(--ink); }
.nav a.active { background: var(--paper); color: var(--green-dark); box-shadow: 0 2px 6px rgba(44,50,45,.05); }
.nav svg { width: 18px; height: 18px; stroke-width: 1.8; }
.sidebar-bottom { margin-top: auto; }
.nav.compact { margin-bottom: 18px; }
.usage-mini { padding: 14px 12px; margin-bottom: 10px; border-top: 1px solid #d8d6ce; border-bottom: 1px solid #d8d6ce; }
.usage-mini > div:first-child { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 11px; color: var(--muted); }
.usage-mini strong { color: var(--ink); font-weight: 600; }
.progress { height: 5px; overflow: hidden; background: #d7d8d0; border-radius: 10px; }
.progress i { display: block; height: 100%; width: 0; background: var(--green); border-radius: inherit; transition: width .5s ease; }
.profile { width: 100%; border: 0; background: transparent; padding: 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; cursor: pointer; }
.profile-avatar { border-radius: 50%; background: #c6d3c9; color: var(--green-dark); }
.profile strong { font-size: 13px; }
.main { min-width: 0; }
.page { max-width: 1400px; margin: 0 auto; padding: 42px 54px 80px; }
.mobile-header { display: none; }
.loading-state { min-height: 70vh; display: grid; place-items: center; align-content: center; color: var(--muted); }
.spinner { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-family: var(--serif); font-size: clamp(35px, 4vw, 48px); line-height: 1.02; letter-spacing: -1.5px; font-weight: 600; }
h2 { font-family: var(--serif); font-size: 28px; letter-spacing: -.5px; }
h3 { font-size: 16px; }
.page-subtitle { margin: 0; color: var(--muted); font-size: 15px; }
.head-actions, .button-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button { min-height: 42px; padding: 0 17px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; cursor: pointer; transition: .18s ease; }
.button:hover { border-color: #bfc5c0; transform: translateY(-1px); }
.button.primary { background: var(--green); border-color: var(--green); color: white; box-shadow: 0 7px 16px rgba(30,96,73,.16); }
.button.primary:hover { background: var(--green-dark); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.ai-button { border-color: #cfc7f2; color: #5545b8; background: #f5f2ff; }
.button.ghost { background: transparent; }
.button.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.button.danger { color: var(--red); }
.button svg { width: 16px; height: 16px; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 20px; }
.card { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 17px; box-shadow: 0 3px 12px rgba(37,45,40,.025); }
.feature-card { min-height: 277px; padding: 33px 34px; position: relative; overflow: hidden; background: var(--green); color: white; display: flex; flex-direction: column; align-items: flex-start; }
.feature-card::before { content: ""; position: absolute; width: 350px; height: 350px; right: -120px; top: -130px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.035), 0 0 0 76px rgba(255,255,255,.025); }
.feature-card > * { position: relative; z-index: 1; }
.feature-card .kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 45px; font-size: 12px; color: #d5e6dd; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.feature-card h2 { max-width: 560px; margin-bottom: 11px; font-size: 35px; line-height: 1.08; }
.feature-card p { max-width: 540px; color: #d5e3dc; line-height: 1.55; }
.feature-card .button { margin-top: auto; background: var(--lime); color: var(--green-dark); border: 0; }
.readiness-card { padding: 28px; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.readiness-card h3 { margin-bottom: 4px; }
.readiness-card > p { color: var(--muted); font-size: 13px; }
.readiness-list { display: grid; gap: 9px; margin-top: 22px; }
.readiness-item { padding: 11px 0; border-top: 1px solid var(--line-soft); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; }
.status-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--green-pale); color: var(--green); font-size: 12px; font-weight: 700; }
.status-dot.pending { background: #f2e9d1; color: #9a6c27; }
.readiness-item small { color: var(--muted); }
.readiness-item strong { display: block; font-size: 13px; margin-bottom: 2px; }
.text-link { border: 0; background: none; color: var(--green); padding: 0; font-weight: 600; cursor: pointer; }

.section { margin-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 25px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric { padding: 22px; }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #edf0eb; color: var(--green); }
.metric-icon svg { width: 15px; }
.metric-value { margin: 20px 0 4px; font-family: var(--serif); font-size: 31px; }
.metric-note { color: var(--muted); font-size: 12px; }
.positive { color: var(--green); }
.report-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.report-head h1 { margin-bottom: 7px; }
.report-period { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.65); }
.report-period button, .report-tabs button { border: 0; background: transparent; cursor: pointer; font-weight: 700; }
.report-period button { min-height: 34px; padding: 0 12px; border-radius: 8px; color: var(--muted); font-size: 11px; }
.report-period button.active { background: var(--ink); color: white; box-shadow: 0 3px 10px rgba(23,35,28,.14); }
.report-tabs { display: flex; gap: 28px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.report-tabs button { padding: 0 2px 13px; color: var(--muted); position: relative; }
.report-tabs button.active { color: var(--ink); }
.report-tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: #7165ff; }
.revenue-hero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; border: 1px solid #dedce9; border-radius: 18px; background: #dedce9; box-shadow: 0 14px 40px rgba(66,55,128,.08); }
.report-metric { min-width: 0; padding: 23px; background: white; position: relative; overflow: hidden; }
.report-metric::after { content: ""; position: absolute; width: 100px; height: 100px; right: -42px; bottom: -55px; border-radius: 50%; background: currentColor; opacity: .06; }
.report-metric.revenue { color: #6659ee; }
.report-metric.average { color: #ef5da8; }
.report-metric.orders { color: #17a96a; }
.report-metric.rate { color: #df812d; }
.report-metric-top { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.report-metric-icon { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, currentColor 12%, white); color: inherit; font-weight: 800; }
.report-metric > strong { display: block; margin: 18px 0 12px; color: var(--ink); font-family: var(--serif); font-size: clamp(29px, 3vw, 39px); line-height: 1; letter-spacing: -.8px; }
.report-metric > div:last-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.report-metric small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.change { flex: 0 0 auto; padding: 5px 8px; border-radius: 20px; font-size: 10px; font-weight: 800; }
.change.up { background: #dcf7e9; color: #148656; }
.change.down { background: #ffebe5; color: #c4523d; }
.report-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; margin-top: 18px; }
.report-panel { padding: 25px; border: 1px solid #e4e2eb; border-radius: 17px; background: white; box-shadow: 0 5px 18px rgba(42,35,75,.035); }
.report-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.report-panel-head h2 { margin: 0 0 5px; font-family: var(--sans); font-size: 16px; letter-spacing: 0; }
.report-panel-head p { margin: 0; color: var(--muted); font-size: 11px; }
.report-total { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--serif); font-size: 22px; font-weight: 700; white-space: nowrap; }
.report-total small { margin-top: 2px; color: var(--muted); font-family: var(--sans); font-size: 9px; font-weight: 500; }
.conversion-funnel { display: grid; gap: 14px; }
.funnel-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 11px; }
.funnel-label strong { font-size: 12px; }
.funnel-track { height: 12px; overflow: hidden; border-radius: 20px; background: #f0eef5; }
.funnel-track i { display: block; height: 100%; border-radius: inherit; box-shadow: 0 2px 7px rgba(55,45,110,.18); transition: width .35s ease; }
.funnel-step small { display: block; margin-top: 5px; color: var(--faint); font-size: 9px; text-align: right; }
.trend-panel select { height: 35px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 11px; font-weight: 700; }
.chart-summary { display: flex; align-items: baseline; gap: 9px; }
.chart-summary strong { font-family: var(--serif); font-size: 31px; }
.chart-summary span { color: var(--muted); font-size: 10px; }
.line-chart { height: 205px; margin-top: 8px; }
.line-chart svg { width: 100%; height: 175px; overflow: visible; }
.chart-grid-line { stroke: #e7e5ef; stroke-width: .5; }
.chart-line { fill: none; stroke: #7165ff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-dot { fill: white; stroke: #7165ff; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.chart-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 9px; }
.report-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 18px; }
.report-campaign-row, .order-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 64px; border-top: 1px solid var(--line-soft); }
.campaign-rank { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: white; font-size: 11px; font-weight: 800; }
.report-campaign-row > span:nth-child(2), .order-row > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.report-campaign-row strong, .order-row strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.report-campaign-row small, .order-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.report-campaign-row b, .order-row b { font-family: var(--serif); font-size: 17px; }
.order-mark { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; background: #ddf7e9; color: #148656; font-size: 11px; font-weight: 800; }
.live-indicator { display: inline-flex; align-items: center; gap: 6px; color: #148656; font-size: 10px; font-weight: 700; }
.live-indicator::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c77a; box-shadow: 0 0 0 4px #e0f8eb; }
.comparison-panel { padding: 0; overflow: hidden; }
.comparison-panel > .report-panel-head { padding: 25px 25px 0; }
.report-table td:first-child strong, .report-table td:first-child small { display: block; }
.report-table td:first-child small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.report-table td:nth-last-child(-n+2) { color: #148656; }
.lower-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 20px; }
.campaign-list { overflow: hidden; }
.campaign-row { display: grid; grid-template-columns: 1fr 95px 95px 40px; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.campaign-row:last-child { border-bottom: 0; }
.campaign-name { display: flex; align-items: center; gap: 13px; min-width: 0; }
.campaign-thumb { width: 43px; height: 43px; border-radius: 9px; background: #e7e4db; display: grid; place-items: center; color: var(--green); flex: 0 0 auto; }
.campaign-name strong, .campaign-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-name small { color: var(--muted); margin-top: 3px; }
.campaign-stat { text-align: right; }
.campaign-stat strong, .campaign-stat small { display: block; }
.campaign-stat small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 9px; border-radius: 20px; background: var(--green-pale); color: var(--green-dark); font-size: 11px; font-weight: 700; text-transform: capitalize; }
.status-badge.draft { background: #ebeae5; color: #656b67; }
.status-badge.simulated { background: #f4ead5; color: #8b642a; }
.activity-card { padding: 22px; }
.activity-list { display: grid; margin-top: 8px; }
.activity-item { display: grid; grid-template-columns: auto 1fr; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { width: 31px; height: 31px; border-radius: 50%; background: #edf0eb; display: grid; place-items: center; color: var(--green); }
.activity-item p { margin: 0; font-size: 12px; line-height: 1.5; }
.activity-item small { color: var(--muted); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.search { position: relative; width: min(360px, 100%); }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--muted); }
.search input { width: 100%; height: 42px; padding: 0 14px 0 39px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); outline: none; }
.search input:focus, input:focus, textarea:focus, select:focus { border-color: #83a395; box-shadow: 0 0 0 3px rgba(30,96,73,.09); outline: none; }
.table-card { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 43px; padding: 0 20px; background: #f8f7f2; color: var(--muted); font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .05em; }
.data-table td { padding: 16px 20px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tr:hover td { background: #fdfcf8; }
.contact-cell { display: flex; align-items: center; gap: 11px; }
.contact-avatar { width: 34px; height: 34px; border-radius: 50%; background: #e2e9e3; color: var(--green); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.contact-cell strong, .contact-cell small { display: block; }
.contact-cell small { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; padding: 4px 8px; border-radius: 12px; background: #eef0eb; color: #58635c; font-size: 11px; }
.table-empty { padding: 50px; text-align: center; color: var(--muted); }

.composer-layout { display: grid; grid-template-columns: minmax(340px, .78fr) minmax(440px, 1.22fr); gap: 22px; align-items: start; }
.composer-panel { padding: 25px; }
.form-section { padding-bottom: 25px; margin-bottom: 25px; border-bottom: 1px solid var(--line-soft); }
.form-section:last-child { margin: 0; padding: 0; border: 0; }
.form-section h3 { margin-bottom: 15px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { display: grid; gap: 7px; margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 12px; font-weight: 600; }
.field .hint { color: var(--muted); font-size: 11px; font-weight: 400; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); }
.field input, .field select { height: 41px; padding: 0 12px; }
.field textarea { min-height: 96px; padding: 11px 12px; resize: vertical; }
.editor-tools { display: flex; gap: 4px; padding: 8px; border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; background: #f8f7f3; }
.editor-tools button { min-width: 31px; height: 30px; border: 0; border-radius: 6px; background: transparent; font-weight: 700; cursor: pointer; }
.editor-tools button:hover { background: #e9e9e3; }
.content-editor { min-height: 250px !important; border-radius: 0 0 9px 9px !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.55; }
.preview-wrap { position: sticky; top: 28px; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.device-toggle { display: flex; padding: 3px; background: #e9e7e0; border-radius: 8px; }
.device-toggle button { border: 0; background: transparent; min-width: 34px; height: 29px; border-radius: 6px; cursor: pointer; }
.device-toggle button.active { background: white; box-shadow: 0 1px 5px rgba(0,0,0,.08); }
.email-shell { min-height: 660px; padding: 38px; background: #dfddd6; border-radius: 17px; display: grid; place-items: start center; transition: .2s ease; }
.email-shell.mobile .email-preview { max-width: 360px; }
.email-preview { width: 100%; max-width: 680px; min-height: 560px; background: white; box-shadow: 0 10px 38px rgba(36,42,38,.13); transition: max-width .2s ease; }
.email-meta { padding: 17px 22px; background: #f8f8f6; border-bottom: 1px solid #ecece8; font-size: 11px; color: #6c746e; }
.email-meta strong { color: var(--ink); }
.email-content { padding: 50px 52px; font-family: Arial, sans-serif; color: #222; line-height: 1.55; }
.email-content h1 { font-family: Georgia, serif; font-size: 37px; letter-spacing: -1px; }
.email-content img { max-width: 100%; }
.email-content a { color: #1e6049; text-decoration: underline; }
.recipient-count { padding: 12px 14px; border-radius: 9px; background: #edf4ef; color: var(--green-dark); font-size: 12px; }

.builder-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.builder-title, .builder-head-actions { display: flex; align-items: center; gap: 10px; }
.builder-title > span { display: flex; flex-direction: column; min-width: 0; }
.builder-title small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.builder-title strong { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 20px; }
.builder-head .icon-button:disabled { opacity: .38; cursor: default; }
.visual-builder { height: calc(100vh - 150px); min-height: 690px; display: grid; grid-template-columns: 220px minmax(440px, 1fr) 280px; border: 1px solid #d9dad4; border-radius: 16px; overflow: hidden; background: white; box-shadow: var(--shadow); }
.builder-palette, .builder-inspector { min-width: 0; background: #faf9f5; }
.builder-palette { border-right: 1px solid var(--line); overflow-y: auto; }
.builder-inspector { border-left: 1px solid var(--line); overflow-y: auto; }
.builder-panel-head { min-height: 67px; padding: 15px 16px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(255,255,255,.65); }
.builder-panel-head > span { display: flex; flex-direction: column; }
.builder-panel-head strong { font-size: 13px; }
.builder-panel-head small, .builder-panel-head > span:not(:has(strong)) { color: var(--muted); font-size: 10px; margin-top: 2px; }
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px; }
.module-tile { min-height: 78px; padding: 11px 7px; border: 1px solid #dedfd9; border-radius: 10px; background: white; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: grab; transition: .16s ease; }
.module-tile:hover { border-color: #94aa9e; box-shadow: 0 5px 15px rgba(31,64,47,.08); transform: translateY(-1px); }
.module-tile:active { cursor: grabbing; }
.module-tile span { width: 29px; height: 29px; border-radius: 8px; background: #edf1ec; color: var(--green); display: grid; place-items: center; font-family: Georgia, serif; font-size: 17px; }
.module-tile strong { font-size: 11px; }
.builder-panel-section { padding: 14px; border-top: 1px solid var(--line-soft); }
.builder-global-button { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: white; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-align: left; cursor: pointer; }
.builder-global-button + .builder-global-button { margin-top: 8px; }
.builder-global-button.active { border-color: var(--green); box-shadow: 0 0 0 2px rgba(30,96,73,.08); }
.builder-global-button > span:first-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #edf1ec; color: var(--green); }
.builder-global-button > span:nth-child(2) { display: flex; flex-direction: column; }
.builder-global-button strong { font-size: 11px; }
.builder-global-button small { color: var(--muted); font-size: 9px; }
.builder-tip { margin: 0 14px 14px; padding: 12px; border-radius: 9px; background: #f0eee7; color: var(--muted); font-size: 10px; line-height: 1.45; }
.builder-tip strong { display: block; color: var(--ink); margin-bottom: 4px; }
.builder-tip p { margin: 0; }
.builder-tip code { color: var(--green-dark); }
.builder-workspace { min-width: 0; display: flex; flex-direction: column; background: #e7e7e2; overflow: hidden; }
.builder-toolbar { min-height: 67px; padding: 10px 18px; border-bottom: 1px solid #d2d3ce; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #f6f5f1; }
.builder-toolbar > span { min-width: 0; display: flex; flex-direction: column; }
.builder-toolbar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.builder-toolbar small { color: var(--muted); font-size: 10px; }
.builder-preview-controls { display: flex; align-items: center; gap: 9px; }
.builder-preview-controls select { height: 35px; max-width: 180px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 10px; }
.builder-canvas-wrap { flex: 1; overflow: auto; padding: 36px 34px 80px; }
.builder-canvas { min-height: 100%; display: flex; justify-content: center; align-items: flex-start; transition: .2s ease; }
.builder-email { max-width: 100%; min-height: 420px; box-shadow: 0 10px 35px rgba(35,45,39,.14); transition: width .2s ease, border-radius .2s ease; }
.builder-canvas.mobile .builder-email { width: 360px !important; }
.builder-block { position: relative; cursor: pointer; outline: 0 solid transparent; transition: outline .1s ease; }
.builder-block:hover { outline: 1px solid #77a08d; z-index: 2; }
.builder-block.selected { outline: 2px solid var(--green); z-index: 3; }
.builder-block-preview { pointer-events: none; overflow: hidden; }
.builder-block-actions { position: absolute; z-index: 4; right: 5px; top: 5px; display: none; padding: 3px; border-radius: 7px; background: var(--green); box-shadow: 0 3px 10px rgba(0,0,0,.16); }
.builder-block:hover .builder-block-actions, .builder-block.selected .builder-block-actions { display: flex; }
.builder-block-actions button { width: 26px; height: 26px; border: 0; border-radius: 5px; background: transparent; color: white; cursor: pointer; }
.builder-block-actions button:hover { background: rgba(255,255,255,.17); }
.builder-drop-zone { height: 8px; position: relative; z-index: 5; margin: -4px 0; transition: height .14s ease; }
.builder-drop-zone span { display: none; }
.builder-drop-zone.active { height: 35px; margin: 0; border: 2px dashed #4d8c70; background: #dff0e5; }
.builder-drop-zone.active span { height: 100%; display: grid; place-items: center; color: var(--green); font-size: 10px; font-weight: 700; }
.builder-empty-drop { min-height: 380px; display: grid; place-items: center; align-content: center; gap: 5px; border: 2px dashed #c8cec9; color: var(--muted); text-align: center; }
.builder-empty-drop strong { color: var(--ink); }
.builder-empty-drop span { max-width: 300px; padding: 0 18px; line-height: 1.5; }
.dynamic-hidden { min-height: 75px; padding: 18px; border: 2px dashed #d1b989; background: #fff9e9; display: grid; place-items: center; align-content: center; text-align: center; color: #80662f; }
.dynamic-hidden strong { font-size: 11px; }
.dynamic-hidden span { margin-top: 4px; font-size: 9px; }
.inspector-scroll { padding: 16px; }
.inspector-empty { height: 100%; padding: 35px 24px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.inspector-empty > span { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #e8ece7; color: var(--green); font-size: 23px; }
.inspector-empty h3 { margin: 13px 0 5px; color: var(--ink); }
.inspector-empty p { line-height: 1.5; font-size: 11px; }
.inspector-field { display: grid; gap: 6px; margin-bottom: 14px; }
.inspector-field > span:first-child { display: flex; align-items: center; justify-content: space-between; font-size: 10px; font-weight: 700; color: #59655e; }
.inspector-field output { color: var(--muted); font-weight: 500; }
.inspector-field input:not([type="color"]):not([type="range"]), .inspector-field textarea, .inspector-field select { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
.inspector-field input:not([type="color"]):not([type="range"]), .inspector-field select { height: 38px; padding: 0 10px; }
.inspector-field textarea { min-height: 92px; padding: 9px 10px; resize: vertical; line-height: 1.45; }
.inspector-field textarea.inspector-code { min-height: 250px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.inspector-field small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.color-field > span:last-child { display: grid; grid-template-columns: 38px 1fr; gap: 7px; }
.color-field input[type="color"] { width: 38px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.number-input { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.number-input input { border-radius: 8px 0 0 8px !important; }
.number-input b { height: 38px; min-width: 33px; padding: 0 8px; border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; display: grid; place-items: center; background: #f0f0eb; color: var(--muted); font-size: 9px; }
.inspector-field input[type="range"] { width: 100%; accent-color: var(--green); }
.alignment-control { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; background: #e9e9e3; border-radius: 8px; }
.alignment-control button { height: 31px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; }
.alignment-control button.active { background: white; color: var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.inspector-details { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.inspector-details summary { margin-bottom: 14px; font-size: 11px; font-weight: 700; cursor: pointer; }
.spacing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 9px; }
.inspector-transparent { font-size: 10px; }
.inspector-help { margin: -4px 0 13px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.template-card { overflow: hidden; }
.template-preview { height: 310px; padding: 20px; overflow: hidden; display: grid; place-items: start center; }
.template-preview iframe { width: 760px; height: 760px; border: 0; background: transparent; transform: scale(.35); transform-origin: top center; pointer-events: none; }
.template-info { padding: 20px; }
.template-info h3 { margin-bottom: 6px; font-family: var(--serif); font-size: 23px; }
.template-info .button { margin-top: 15px; }
.audience-tabs { display: flex; gap: 5px; margin: -12px 0 24px; padding: 4px; width: fit-content; background: #e9e7e0; border-radius: 10px; }
.audience-tabs button { min-height: 35px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-weight: 600; color: var(--muted); }
.audience-tabs button.active { background: white; color: var(--green); box-shadow: 0 1px 5px rgba(0,0,0,.08); }
.audience-tabs span { margin-left: 5px; color: var(--faint); font-size: 10px; }
.segment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.segment-grid .empty-card { grid-column: 1 / -1; }
.segment-card { padding: 21px; }
.segment-card > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.segment-icon { width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center; background: #e6eee8; color: var(--green); }
.segment-icon svg { width: 18px; }
.segment-card h3 { margin: 17px 0 5px; font-family: var(--serif); font-size: 22px; }
.segment-card > p { color: var(--muted); font-size: 11px; }
.segment-rule-summary { min-height: 67px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 5px; margin: 15px 0; }
.segment-rule-summary span { padding: 5px 7px; border-radius: 6px; background: #f0f0eb; color: #5e6962; font-size: 9px; }
.segment-match-row { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; color: var(--muted); font-size: 12px; }
.segment-match-row select { height: 35px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 0 9px; }
.segment-rule { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 7px; margin-bottom: 8px; }
.segment-rule input, .segment-rule select { min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 0 9px; }
.segment-preview-count { margin-top: 17px; padding: 12px; border-radius: 9px; background: #edf4ef; color: var(--green-dark); font-size: 12px; font-weight: 600; }
.custom-fields-editor { margin: 15px 0; padding: 13px; border: 1px solid var(--line); border-radius: 10px; }
.custom-fields-editor summary { cursor: pointer; font-weight: 600; font-size: 12px; margin-bottom: 12px; }
.custom-field-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; margin-bottom: 7px; }
.custom-field-row input { min-width: 0; height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; }
.import-option { display: flex; align-items: center; gap: 9px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.personalization-example { padding: 16px; margin-bottom: 17px; border-radius: 10px; background: #eef3ee; }
.personalization-example strong, .personalization-example code, .personalization-example p { display: block; }
.personalization-example code { margin: 9px 0; color: var(--green-dark); font-size: 15px; }
.personalization-example p { margin: 0; color: var(--muted); font-size: 11px; }
.merge-tag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 17px; }
.merge-tag { padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: white; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; text-align: left; }
.merge-tag:hover { border-color: #92aa9e; }
.merge-tag span { font-weight: 600; font-size: 11px; text-transform: capitalize; }
.merge-tag code { color: var(--green); font-size: 9px; }
.automation-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.automation-list { overflow: hidden; }
.automation-list-row { min-height: 78px; padding: 15px 20px; display: grid; grid-template-columns: auto 1fr 110px 90px auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line-soft); }
.automation-list-row:last-child { border-bottom: 0; }
.automation-list-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: #e3eee7; color: var(--green); }
.automation-list-icon svg { width: 21px; }
.automation-list-row > span:nth-child(2), .automation-list-stat { display: flex; flex-direction: column; }
.automation-list-row small { color: var(--muted); margin-top: 3px; font-size: 11px; }
.automation-list-stat { text-align: right; }
.automation-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.automation-builder { height: calc(100vh - 150px); min-height: 700px; display: grid; grid-template-columns: minmax(600px, 1fr) 280px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #f1f2ef; box-shadow: var(--shadow); }
.automation-canvas { min-width: 0; overflow: auto; padding: 42px 50px 100px; background-color: #eff0ed; background-image: radial-gradient(#cfd4cf 1px, transparent 1px); background-size: 20px 20px; }
.automation-palette { border-left: 1px solid var(--line); background: #fbfaf6; overflow-y: auto; }
.automation-flow { min-width: 620px; width: fit-content; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.flow-trigger, .flow-node { width: 300px; min-height: 66px; padding: 12px 15px; border: 1px solid #d8dcd8; border-radius: 11px; background: white; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; text-align: left; box-shadow: 0 4px 14px rgba(30,44,36,.07); cursor: pointer; position: relative; z-index: 2; }
.flow-trigger { border-top: 3px solid #60a979; }
.flow-trigger > span:first-child, .flow-node-icon { width: 35px; height: 35px; border-radius: 9px; display: grid; place-items: center; background: #e5f2e9; color: var(--green); font-size: 18px; }
.flow-trigger > span:nth-child(2), .flow-node > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.flow-trigger small, .flow-node small { color: var(--muted); font-size: 10px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-trigger strong, .flow-node strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-trigger b, .flow-node b { color: var(--faint); }
.flow-node:hover, .flow-node.selected { border-color: var(--green); box-shadow: 0 0 0 2px rgba(30,96,73,.08), 0 5px 17px rgba(30,44,36,.08); }
.flow-line { width: 2px; height: 34px; background: #9ba59e; }
.flow-add { width: 29px; height: 29px; flex: 0 0 auto; border: 2px solid #82a491; border-radius: 50%; background: white; color: var(--green); font-size: 19px; line-height: 1; cursor: pointer; position: relative; z-index: 3; transition: .15s ease; }
.flow-add:hover, .flow-add.dragging { transform: scale(1.12); background: var(--green); color: white; }
.flow-branch-wrap { display: flex; flex-direction: column; align-items: center; }
.flow-branch-labels { width: 482px; height: 35px; display: flex; justify-content: space-between; align-items: end; position: relative; }
.flow-branch-labels::before { content: ""; position: absolute; left: 70px; right: 70px; bottom: 9px; height: 25px; border-left: 2px solid #9ba59e; border-right: 2px solid #9ba59e; border-top: 2px solid #9ba59e; border-radius: 45% 45% 0 0; }
.flow-branch-labels span { z-index: 1; min-width: 56px; padding: 3px 7px; border-radius: 12px; background: #dcebdc; color: #3d6f4d; font-size: 9px; font-weight: 700; text-align: center; }
.flow-branch-labels span:last-child { background: #f4ddd3; color: #8b5541; }
.flow-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; align-items: start; }
.flow-branch { min-width: 300px; display: flex; flex-direction: column; align-items: center; }
.automation-palette-section { padding: 15px; border-bottom: 1px solid var(--line-soft); }
.automation-palette-section h3 { margin: 0 0 9px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.automation-palette-item { width: 100%; min-height: 58px; margin-bottom: 7px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; text-align: left; cursor: grab; }
.automation-palette-item:hover { border-color: #8ca598; box-shadow: 0 3px 11px rgba(30,60,44,.07); }
.automation-palette-item > span:first-child { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; background: #edf1ed; color: var(--green); }
.automation-palette-item > span:last-child { display: flex; flex-direction: column; }
.automation-palette-item strong { font-size: 11px; }
.automation-palette-item small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.automation-help { margin: 15px; padding: 13px; border-radius: 9px; background: #efeee8; font-size: 10px; color: var(--muted); }
.automation-help strong, .automation-help code { display: block; }
.automation-help code { margin: 6px 0; color: var(--green-dark); }
.automation-help p { margin: 0; line-height: 1.45; }
.automation-chooser { display: grid; gap: 8px; }
.automation-chooser button { width: 100%; min-height: 60px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; text-align: left; cursor: pointer; }
.automation-chooser button:hover { border-color: var(--green); }
.automation-chooser button > span:first-child { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #e8efe9; color: var(--green); }
.automation-chooser button > span:nth-child(2) { display: flex; flex-direction: column; }
.automation-chooser small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.modal-note { color: var(--muted); font-size: 11px; line-height: 1.5; }
.automation-run-log { display: grid; }
.automation-run-log > div { min-height: 58px; padding: 10px 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 11px; border-bottom: 1px solid var(--line-soft); }
.automation-run-log > div > span:first-child { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #e7eee8; color: var(--green); }
.automation-run-log > div > span:last-child { display: flex; flex-direction: column; }
.automation-run-log small { color: var(--muted); margin-top: 3px; font-size: 10px; }

.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.plan-card { padding: 25px; position: relative; }
.plan-card.featured { border: 2px solid var(--green); }
.plan-card .popular { position: absolute; top: 0; right: 22px; transform: translateY(-50%); padding: 5px 9px; background: var(--green); color: white; border-radius: 20px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.plan-card h3 { font-family: var(--serif); font-size: 25px; }
.plan-price { margin: 20px 0; font-family: var(--serif); font-size: 37px; }
.plan-price small { font-family: var(--sans); color: var(--muted); font-size: 12px; }
.plan-card ul { padding: 0; margin: 22px 0; list-style: none; display: grid; gap: 10px; color: var(--muted); font-size: 12px; }
.plan-card li::before { content: "✓"; color: var(--green); font-weight: 700; margin-right: 8px; }
.usage-card { padding: 27px; margin-bottom: 30px; display: grid; grid-template-columns: 1fr auto; gap: 26px; align-items: center; }
.usage-card .progress { height: 8px; margin-top: 14px; }
.usage-number { font-family: var(--serif); font-size: 30px; text-align: right; }
.usage-number small { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(16,28,21,.48); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 24px; animation: fade .15s ease; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 28px; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); animation: rise .2s ease; }
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.modal-head h2 { margin: 0 0 4px; }
.modal-head p { color: var(--muted); margin: 0; }
.close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #efeee8; cursor: pointer; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.dropzone { min-height: 190px; border: 1.5px dashed #b8c1ba; border-radius: 12px; background: #f9f8f4; display: grid; place-items: center; text-align: center; padding: 30px; cursor: pointer; }
.dropzone.dragging { background: #edf5ef; border-color: var(--green); }
.dropzone input { display: none; }
.dropzone strong { display: block; margin: 10px 0 4px; }
.dropzone p { color: var(--muted); margin: 0; font-size: 12px; }
.send-confirm { padding: 15px; background: #f1f3ed; border-radius: 10px; margin-bottom: 18px; }
.send-confirm strong { display: block; margin-bottom: 4px; }
.send-confirm p { margin: 0; color: var(--muted); font-size: 12px; }
.toast-root { position: fixed; z-index: 200; right: 24px; bottom: 24px; display: grid; gap: 9px; }
.toast { min-width: 280px; max-width: 390px; padding: 14px 17px; border-radius: 11px; background: var(--ink); color: white; box-shadow: var(--shadow); animation: rise .2s ease; }
.toast.error { background: #873e38; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.empty-card { padding: 65px 30px; text-align: center; }
.empty-icon { width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 16px; display: grid; place-items: center; background: #e7eee8; color: var(--green); }
.empty-icon svg { width: 28px; }
.empty-card p { max-width: 430px; margin: 0 auto 20px; color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 25px; }
.settings-nav { padding: 12px; align-self: start; }
.settings-nav button { width: 100%; padding: 11px 12px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.settings-nav button.active { background: #eef0eb; color: var(--green); font-weight: 600; }
.settings-panel { padding: 28px; }
.integration-status { display: flex; align-items: center; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 12px; }
.integration-logo { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--green); color: white; font-weight: 700; }
.integration-status span:nth-child(2) { flex: 1; }
.integration-status strong, .integration-status small { display: block; }
.integration-status small { color: var(--muted); margin-top: 3px; }
.integration-connected-count { padding: 8px 12px; border-radius: 20px; background: #e5efe8; color: var(--green-dark); font-size: 11px; font-weight: 700; }
.integration-security-note { margin: -10px 0 22px; padding: 12px 15px; border: 1px solid #ead7a9; border-radius: 11px; background: #fff8e7; display: flex; align-items: center; gap: 12px; color: #715a24; }
.integration-security-note span { flex: 0 0 auto; padding: 4px 7px; border-radius: 6px; background: #f4dfaa; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.integration-security-note p { margin: 0; font-size: 11px; }
.integration-security-note code { color: #5c4514; font-weight: 700; }
.integration-spotlight { min-height: 175px; padding: 31px 34px; border-radius: 18px; background: linear-gradient(125deg, #17231c 0%, #1c4938 62%, #315b49 100%); color: white; display: flex; align-items: center; justify-content: space-between; gap: 30px; overflow: hidden; position: relative; }
.integration-spotlight::after { content: ""; position: absolute; width: 290px; height: 290px; right: -80px; top: -130px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.035), 0 0 0 76px rgba(255,255,255,.025); }
.integration-spotlight > * { position: relative; z-index: 1; }
.integration-spotlight h2 { max-width: 550px; margin-bottom: 8px; font-size: 30px; }
.integration-spotlight p { max-width: 620px; margin: 0; color: #d6e4dc; line-height: 1.55; }
.integration-flow { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; }
.integration-flow span { min-width: 82px; padding: 12px 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: rgba(255,255,255,.09); text-align: center; font-size: 11px; font-weight: 700; backdrop-filter: blur(4px); }
.integration-flow b { color: #bfe681; }
.mcp-access { margin-top: 18px; border: 1px solid #d9d6e9; border-radius: 17px; background: linear-gradient(135deg, #fff 0%, #f7f5ff 100%); overflow: hidden; box-shadow: 0 5px 18px rgba(74,62,140,.04); }
.mcp-access-head { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.mcp-access-head > div { display: flex; align-items: center; gap: 12px; }
.mcp-access-head > div > span:last-child { display: flex; flex-direction: column; }
.mcp-access-head h2 { margin: 0 0 3px; font-family: var(--sans); font-size: 15px; letter-spacing: 0; }
.mcp-access-head p { margin: 0; color: var(--muted); font-size: 10px; }
.mcp-mark { width: 43px; height: 43px; border-radius: 12px; display: grid; place-items: center; background: #7165ff; color: white; box-shadow: 0 7px 16px rgba(113,101,255,.2); font-size: 10px; font-weight: 800; }
.mcp-endpoint { min-height: 58px; padding: 10px 22px; border-top: 1px solid #e7e4f0; border-bottom: 1px solid #e7e4f0; background: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mcp-endpoint > span { min-width: 0; display: flex; flex-direction: column; }
.mcp-endpoint small { color: var(--muted); font-size: 9px; }
.mcp-endpoint code { margin-top: 3px; overflow: hidden; color: #4e438c; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.mcp-key-list { padding: 0 22px; }
.mcp-key-row { min-height: 65px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; border-bottom: 1px solid #ebe8f2; }
.mcp-key-row:last-child { border-bottom: 0; }
.mcp-key-icon { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: #ece9ff; color: #6254dc; }
.mcp-key-icon svg { width: 15px; }
.mcp-key-row > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.mcp-key-row strong { font-size: 11px; }
.mcp-key-row small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mcp-empty { padding: 22px 0; text-align: center; }
.mcp-empty strong { font-size: 11px; }
.mcp-empty p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.mcp-warning { margin-top: 15px; padding: 13px; border: 1px solid #ead7a9; border-radius: 10px; background: #fff8e7; color: #715a24; }
.mcp-warning strong { display: block; font-size: 11px; }
.mcp-warning p { margin: 4px 0 0; font-size: 10px; line-height: 1.45; }
.mcp-token { padding: 16px; border-radius: 11px; background: #1b211d; color: white; display: grid; gap: 9px; }
.mcp-token small { color: #b9c4bc; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.mcp-token code { overflow-wrap: anywhere; color: #d9ef9c; font-size: 12px; line-height: 1.5; }
.mcp-token .button { justify-self: start; }
.mcp-client-config { margin-top: 14px; padding: 14px; border-radius: 10px; background: #f0eef9; }
.mcp-client-config strong { display: block; margin-bottom: 6px; font-size: 11px; }
.mcp-client-config p { margin: 4px 0; color: #5d557e; font-size: 10px; overflow-wrap: anywhere; }
.mcp-client-config code { color: #453b75; }
.integration-filters { display: flex; gap: 7px; margin: 25px 0 16px; overflow-x: auto; }
.integration-filters button { min-height: 35px; padding: 0 13px; border: 1px solid var(--line); border-radius: 20px; background: white; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; white-space: nowrap; }
.integration-filters button.active { border-color: var(--ink); background: var(--ink); color: white; }
.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.integration-card { min-height: 345px; padding: 21px; border: 1px solid var(--line-soft); border-radius: 16px; background: white; display: flex; flex-direction: column; box-shadow: 0 4px 15px rgba(30,42,34,.03); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.integration-card:hover { transform: translateY(-2px); border-color: #c9cec9; box-shadow: 0 12px 26px rgba(30,42,34,.07); }
.integration-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.integration-brand { width: 45px; height: 45px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; background: var(--provider-color); color: white; box-shadow: 0 7px 16px color-mix(in srgb, var(--provider-color) 25%, transparent); font-size: 12px; font-weight: 800; letter-spacing: -.03em; }
.integration-state { padding: 5px 8px; border-radius: 20px; background: #eeefeb; color: var(--muted); font-size: 9px; font-weight: 700; }
.integration-state.connected { background: #ddf4e7; color: #16734c; }
.integration-category { color: var(--faint); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.integration-card h3 { margin: 5px 0 6px; font-family: var(--serif); font-size: 24px; }
.integration-card p { min-height: 53px; margin-bottom: 14px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.integration-capabilities { display: grid; gap: 6px; margin-bottom: 17px; color: #526058; font-size: 10px; }
.integration-capabilities span::first-letter { color: var(--green); }
.integration-account { margin: 0 0 14px; padding: 10px; border-radius: 9px; background: #f1f5f1; display: flex; flex-direction: column; }
.integration-account strong { font-size: 10px; }
.integration-account small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.integration-card > .button { width: 100%; margin-top: auto; }
.integration-modal-title { display: flex; align-items: center; gap: 13px; }
.integration-modal-title > span:last-child { display: flex; flex-direction: column; }
.integration-modal-title h2 { margin: 0 0 4px; }
.integration-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 13px; }
.oauth-explainer { margin-bottom: 18px; padding: 14px; border-radius: 10px; background: #f0edfb; color: #544987; }
.oauth-explainer strong { display: block; margin-bottom: 4px; }
.oauth-explainer p { margin: 0; font-size: 10px; line-height: 1.5; }
.oauth-explainer code { word-break: break-all; }
.capability-picker { margin: 8px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 11px; }
.capability-picker legend { padding: 0 6px; font-size: 11px; font-weight: 700; }
.capability-picker label { min-height: 48px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; border-top: 1px solid var(--line-soft); cursor: pointer; }
.capability-picker label:first-of-type { border-top: 0; }
.capability-picker input { width: 16px; height: 16px; accent-color: var(--green); }
.capability-picker label span { display: flex; flex-direction: column; }
.capability-picker strong { font-size: 11px; }
.capability-picker small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.integration-actions .danger { margin-right: auto; }

body.auth-mode { background: #eef3ee; }
.legal-page { min-height: 100vh; padding: 60px 24px; background: #f4f2eb; }
.legal-page main { max-width: 760px; margin: 0 auto; padding: 46px; border-radius: 22px; background: white; box-shadow: var(--shadow); }
.legal-page h1 { margin: 45px 0 18px; font-family: var(--serif); font-size: 48px; }
.legal-page p { color: #4f6257; font-size: 16px; line-height: 1.75; }
.legal-page a { color: var(--green); }
body.auth-mode #app { display: block; min-height: 100vh; }
body.auth-mode .sidebar,
body.auth-mode .mobile-header { display: none; }
body.auth-mode .main { min-height: 100vh; }
body.auth-mode .page { max-width: none; padding: 0; }
.auth-shell { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(500px, 1.1fr); min-height: 100vh; }
.auth-story { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 54px 64px; color: #f7fbf7; background: linear-gradient(145deg, #102e24 0%, #185c44 58%, #50a66f 145%); }
.auth-story::after { content: ""; position: absolute; width: 460px; height: 460px; right: -180px; bottom: -220px; border: 80px solid rgba(255,255,255,.08); border-radius: 50%; }
.auth-story .brand { color: white; position: relative; z-index: 1; }
.auth-story > div { position: relative; z-index: 1; max-width: 580px; }
.auth-story h1 { margin: 0 0 18px; font-family: var(--serif); font-size: clamp(44px, 5vw, 72px); line-height: .98; letter-spacing: -.035em; }
.auth-story p { max-width: 500px; margin: 0; color: rgba(255,255,255,.78); font-size: 18px; line-height: 1.65; }
.auth-story blockquote { position: relative; z-index: 1; max-width: 480px; margin: 0; padding: 18px 22px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; color: rgba(255,255,255,.8); background: rgba(255,255,255,.07); backdrop-filter: blur(10px); line-height: 1.5; }
.auth-panel { display: grid; place-items: center; padding: 48px; }
.auth-card { width: min(100%, 470px); padding: 42px; border: 1px solid rgba(31,67,49,.1); border-radius: 24px; background: white; box-shadow: 0 28px 80px rgba(25,58,42,.13); }
.auth-card h2 { margin: 18px 0 8px; font-family: var(--serif); font-size: 36px; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); line-height: 1.55; }
.auth-lock { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: white; background: var(--green); font-size: 21px; }
.auth-submit { width: 100%; justify-content: center; margin-top: 8px; }
.auth-assurance { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.auth-new-account { margin-bottom: 8px; }
.auth-new-account summary { margin-bottom: 16px; color: var(--green); cursor: pointer; font-size: 13px; font-weight: 700; }
.otp-field { display: block; margin-bottom: 18px; }
.otp-field span { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.otp-field input { width: 100%; padding: 15px; border: 1px solid var(--line); border-radius: 10px; font-size: 28px; font-weight: 700; letter-spacing: .45em; text-align: center; }
.development-code { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; margin-top: 22px; padding: 16px; border-radius: 12px; color: #315244; background: #eef8f1; font-size: 12px; }
.development-code code { font-size: 18px; font-weight: 700; letter-spacing: .16em; }
.development-code a { grid-column: 1 / -1; color: var(--green); font-weight: 700; }
.auth-back { margin-top: 22px; }
.auth-legal { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; font-size: 12px; }
.auth-legal a { color: var(--muted); }

.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.account-card { padding: 26px; }
.account-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.account-card-head h2 { margin: 0 0 3px; }
.account-card-head p { margin: 0; color: var(--muted); font-size: 13px; }
.account-icon { display: grid; place-items: center; flex: 0 0 auto; width: 50px; height: 50px; border-radius: 15px; color: white; background: var(--green); font-weight: 800; }
.account-icon.workspace { color: #764c08; background: #f7d995; }
.member-list, .session-list { display: grid; }
.member-row, .session-row, .integration-status { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 13px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.member-row small, .session-row small, .integration-status small, .pending-invites small { display: block; margin-top: 3px; color: var(--muted); }
.session-device, .integration-logo { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--green); background: #edf5ef; font-weight: 800; }
.session-device svg { width: 20px; }
.pending-invites { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.pending-invites h3 { margin: 0 0 8px; }
.pending-invites > div { padding: 10px 0; }
.integration-status { grid-template-columns: auto minmax(0, 1fr) auto; border-top: 0; padding-bottom: 0; }
.tracking-domain-empty { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px; border: 1px dashed #b9c9be; border-radius: 14px; background: #f7faf7; }
.tracking-domain-empty p { margin: 5px 0 0; color: var(--muted); }
.tracking-domain-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 13px; align-items: center; }
.tracking-domain-head small { display: block; margin-top: 3px; color: var(--muted); }
.dns-record { display: grid; grid-template-columns: 100px minmax(140px, .6fr) minmax(220px, 1fr); gap: 12px; margin-top: 18px; padding: 16px; border-radius: 12px; background: #f3f6f3; }
.dns-record span { min-width: 0; }
.dns-record small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.dns-record strong, .dns-record code { overflow-wrap: anywhere; }
.tracking-actions { display: flex; gap: 10px; margin-top: 16px; }
.billing-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 20px; padding: 0; overflow: hidden; background: var(--line); }
.billing-status span { padding: 20px 22px; background: white; }
.billing-status small { display: block; margin-bottom: 5px; color: var(--muted); }

@media (max-width: 1100px) {
  #app { grid-template-columns: 220px minmax(0,1fr); }
  .page { padding: 36px 32px 70px; }
  .metric-grid, .plans { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .lower-grid { grid-template-columns: 1fr; }
  .readiness-card { min-height: auto; }
  .visual-builder { grid-template-columns: 190px minmax(420px, 1fr) 250px; }
  .module-grid { grid-template-columns: 1fr; }
  .segment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .automation-builder { grid-template-columns: minmax(520px, 1fr) 240px; }
  .revenue-hero { grid-template-columns: repeat(2, 1fr); }
  .report-grid, .report-split { grid-template-columns: 1fr; }
  .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .integration-spotlight { align-items: flex-start; flex-direction: column; }
  .auth-story { padding: 44px; }
}

@media (max-width: 900px) {
  .auth-shell { display: block; }
  .auth-story { min-height: 310px; padding: 30px 24px; }
  .auth-story h1 { margin-top: 60px; font-size: 42px; }
  .auth-story blockquote { display: none; }
  .auth-panel { padding: 24px 16px 48px; }
  .auth-card { margin: -34px auto 0; padding: 28px 22px; }
}

@media (max-width: 760px) {
  #app { display: block; }
  .sidebar { position: fixed; z-index: 90; left: 0; top: 0; width: 260px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.menu-open::after { content: ""; position: fixed; z-index: 80; inset: 0; background: rgba(23,35,28,.38); backdrop-filter: blur(2px); }
  body.menu-open .sidebar { transform: translateX(0); }
  .mobile-header { height: 66px; padding: 0 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: var(--canvas); position: sticky; top: 0; z-index: 50; }
  .mobile-header .brand { font-size: 22px; }
  .page { padding: 25px 16px 56px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .report-head { align-items: flex-start; flex-direction: column; }
  .report-period { width: 100%; }
  .report-period button { flex: 1; }
  .page-head .head-actions { width: 100%; }
  .page-head .button { flex: 1; }
  .hero-grid, .lower-grid, .composer-layout, .settings-grid { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
  .email-shell { min-height: 500px; padding: 15px; }
  .email-content { padding: 32px 25px; }
  .metric-grid, .plans { grid-template-columns: 1fr; }
  .revenue-hero { grid-template-columns: 1fr; }
  .report-tabs { gap: 19px; overflow-x: auto; }
  .report-panel { padding: 20px; }
  .report-panel-head { margin-bottom: 19px; }
  .report-panel-head .report-total { display: none; }
  .report-metric { padding: 20px; }
  .report-table { min-width: 850px; }
  .integration-grid, .integration-fields { grid-template-columns: 1fr; }
  .integration-spotlight { padding: 25px; }
  .integration-spotlight h2 { font-size: 27px; }
  .integration-flow { width: 100%; gap: 5px; }
  .integration-flow span { min-width: 0; flex: 1; padding: 10px 7px; }
  .integration-security-note { align-items: flex-start; flex-direction: column; }
  .integration-actions { align-items: stretch; flex-direction: column-reverse; }
  .integration-actions .danger { margin: 0; }
  .mcp-access-head { align-items: stretch; flex-direction: column; }
  .mcp-access-head .button { width: 100%; }
  .mcp-endpoint { align-items: stretch; flex-direction: column; }
  .mcp-endpoint .button { align-self: flex-start; }
  .campaign-row { grid-template-columns: 1fr auto; }
  .campaign-row { padding: 15px 14px; }
  .campaign-stat { display: none; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .table-card { overflow-x: auto; }
  .data-table { min-width: 720px; }
  .feature-card { padding: 26px; }
  .feature-card .kicker { margin-bottom: 30px; }
  .feature-card h2 { font-size: 31px; }
  .field-grid { grid-template-columns: 1fr; }
  .usage-card { grid-template-columns: 1fr; }
  .usage-number { text-align: left; }
  .builder-head { align-items: flex-start; flex-direction: column; }
  .builder-title { width: 100%; }
  .builder-title > span { flex: 1; }
  .builder-title strong { max-width: min(250px, 55vw); }
  .builder-head-actions { width: 100%; flex-wrap: wrap; }
  .builder-head-actions .button { flex: 1 1 135px; }
  .builder-head-actions .icon-button { flex: 0 0 38px; }
  .visual-builder { height: auto; min-height: 0; display: flex; flex-direction: column; overflow: visible; }
  .builder-palette, .builder-inspector { border: 0; overflow: visible; }
  .builder-palette { order: 1; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .builder-workspace { order: 2; min-height: 540px; margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; }
  .builder-inspector { order: 3; }
  .builder-inspector { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .module-grid { grid-template-columns: repeat(4, minmax(72px, 1fr)); overflow-x: auto; }
  .module-tile { min-height: 68px; }
  .builder-tip { display: none; }
  .builder-canvas-wrap { padding: 24px 10px 55px; }
  .builder-toolbar { align-items: stretch; flex-direction: column; }
  .builder-preview-controls { align-items: center; justify-content: space-between; }
  .builder-preview-controls select { min-width: 0; max-width: none; flex: 1; }
  .builder-email { width: 100% !important; }
  .template-grid { grid-template-columns: 1fr; }
  .segment-grid, .merge-tag-grid { grid-template-columns: 1fr; }
  .segment-rule { grid-template-columns: 1fr; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
  .automation-summary { grid-template-columns: 1fr; }
  .automation-list-row { grid-template-columns: auto 1fr auto; }
  .automation-list-stat { display: none; }
  .automation-list-row .status-badge { display: none; }
  .automation-head { align-items: flex-start; flex-direction: column; }
  .automation-head .head-actions { width: 100%; }
  .automation-head .button { flex: 1; }
  .automation-builder { height: auto; min-height: 760px; display: flex; flex-direction: column; overflow: visible; }
  .automation-palette { order: 1; border: 0; }
  .automation-canvas { order: 2; min-height: 650px; padding: 30px 20px 80px; }
  .automation-palette-section { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .automation-palette-section h3 { grid-column: 1 / -1; }
  .automation-palette-item { margin: 0; }
  .auth-assurance { align-items: flex-start; flex-direction: column; gap: 8px; }
  .account-grid { grid-template-columns: 1fr; }
  .dns-record, .billing-status { grid-template-columns: 1fr; }
  .tracking-domain-empty { align-items: flex-start; flex-direction: column; }
  .member-row, .session-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .member-row .button, .session-row .button { grid-column: 2 / -1; justify-self: start; }
}

@media (max-width: 480px) {
  h1 { font-size: 36px; }
  .mobile-header { height: 60px; padding: 0 13px; }
  .page { padding: 21px 12px 48px; }
  .page-head { gap: 17px; margin-bottom: 24px; }
  .page-head .head-actions { align-items: stretch; flex-direction: column; }
  .page-head .button { width: 100%; }
  .feature-card { min-height: 250px; padding: 23px 21px; }
  .feature-card h2 { font-size: 28px; }
  .readiness-card, .metric, .report-panel, .composer-panel { padding: 19px; }
  .module-grid { grid-template-columns: repeat(3, minmax(78px, 1fr)); padding: 10px; }
  .builder-panel-section { padding: 10px; }
  .builder-canvas-wrap { padding: 18px 6px 45px; }
  .builder-email { min-height: 350px; }
  .builder-empty-drop { min-height: 310px; }
  .builder-preview-controls { align-items: stretch; flex-direction: column; }
  .device-toggle { align-self: flex-end; }
  .modal { width: calc(100% - 18px); max-height: calc(100vh - 18px); padding: 20px 17px; }
  .toast-root { left: 10px; right: 10px; bottom: 10px; }
  .toast { min-width: 0; width: 100%; }
}
