
:root{color-scheme:dark;--background:#09090B;--foreground:#EDEDEF;--card:#111113;--card-foreground:#EDEDEF;--popover:#18181B;--popover-foreground:#EDEDEF;--primary:#EDEDEF;--primary-foreground:#09090B;--secondary:#18181B;--secondary-foreground:#EDEDEF;--muted:#18181B;--muted-foreground:#A1A1AA;--subtle-foreground:#8B8B94;--accent:#222226;--accent-foreground:#EDEDEF;--destructive:#DC2626;--destructive-foreground:#FFFFFF;--destructive-text:#FCA5A5;--warning:#FBBF24;--warning-text:#FCD34D;--border:#232327;--border-strong:#303036;--input:#3F3F46;--input-hover:#52525B;--placeholder:#71717A;--ring:#A1A1AA;--brand:#2DD4BF;--brand-text:#5EEAD4;--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-8:32px;--space-10:40px;--space-12:48px;--space-16:64px;--text-xs:12px;--text-sm:13px;--text-base:14px;--text-md:15px;--text-lg:16px;--text-xl:20px;--text-2xl:24px;--text-3xl:32px;--text-4xl:44px;--radius-xs:6px;--radius-sm:8px;--radius-md:10px;--radius-lg:12px;--radius-xl:20px;--radius-full:999px;--shadow-sm:0 1px 2px rgba(0,0,0,0.4);--shadow-lg:0 12px 32px rgba(0,0,0,0.5);--font-sans:'Geist',ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif;--font-mono:'Geist Mono',ui-monospace,SFMono-Regular,Menlo,monospace}
*,*::before,*::after{box-sizing:border-box}
html{scroll-padding-top:88px;scroll-padding-bottom:96px;-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;display:flex;flex-direction:column;background:var(--background);color:var(--foreground);
font-family:var(--font-sans);font-size:var(--text-base);line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
h1:focus{outline:none}
::selection{background:rgba(45,212,191,0.28)}
.vh{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.skip{position:absolute;left:var(--space-4);top:-80px;z-index:30;padding:var(--space-2) 14px;border-radius:var(--radius-sm);background:var(--primary);color:var(--primary-foreground);font-weight:500;text-decoration:none}
.skip:focus{top:var(--space-3)}

/* Type */
h1{margin:0;font-size:var(--text-2xl);font-weight:600;letter-spacing:-0.02em;line-height:1.2;text-wrap:balance}
h2{margin:0;font-size:var(--text-md);font-weight:600;letter-spacing:-0.005em}
h3{margin:0;font-size:var(--text-base);font-weight:600}
p{margin:0}
a{color:var(--foreground);text-decoration:underline;text-decoration-color:rgba(237,237,239,0.35);text-underline-offset:3px}
a:hover{text-decoration-color:currentColor}
strong{font-weight:600}
code,.mono{font-family:var(--font-mono);font-size:var(--text-sm)}
.mono{word-break:break-all}
.lead{margin-top:6px;color:var(--muted-foreground);max-width:62ch}
.hint{font-size:var(--text-sm);color:var(--muted-foreground);overflow-wrap:anywhere}
.muted{color:var(--muted-foreground)}
.section-label{margin:0;font-size:var(--text-xs);font-weight:500;letter-spacing:0.04em;text-transform:uppercase;color:var(--subtle-foreground)}
.section-note{font-size:var(--text-sm);color:var(--subtle-foreground)}
.list-head{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-3);padding:0 2px}
@media (max-width:640px){h1{font-size:22px}}

/* Header: brand, tabs, account */
.top{position:sticky;top:0;z-index:10;background:rgba(9,9,11,0.82);border-bottom:1px solid var(--border);
backdrop-filter:saturate(160%) blur(12px);-webkit-backdrop-filter:saturate(160%) blur(12px)}
.top-inner{max-width:1120px;margin:0 auto;padding:0 clamp(16px,4vw,32px);min-height:56px;display:flex;align-items:center;gap:28px}
.brand{display:inline-flex;align-items:center;gap:var(--space-2);font-size:var(--text-md);font-weight:600;letter-spacing:-0.01em;color:var(--foreground);text-decoration:none}
.who{margin-left:auto;display:flex;align-items:center;gap:6px}
.handle{display:inline-flex;align-items:center;gap:var(--space-2);font-size:var(--text-sm);color:var(--muted-foreground)}
@media (max-width:640px){
.top-inner{flex-wrap:wrap;gap:0 var(--space-4)}
.brand,.who{min-height:52px}
.top .tabs{order:3;width:calc(100% + 20px);margin:0 -10px;min-height:44px}
.handle-name{display:none}
}

/* Tabs: links, the current one underlined */
.tabs{display:flex;gap:2px;align-self:stretch;overflow-x:auto;scrollbar-width:none}
.tab{position:relative;display:inline-flex;align-items:center;min-height:40px;padding:0 10px;color:var(--muted-foreground);font-weight:500;text-decoration:none;white-space:nowrap}
.tab:hover{color:var(--foreground)}
.tab[aria-current="page"]{color:var(--foreground)}
.tab[aria-current="page"]::after{content:"";position:absolute;left:10px;right:10px;bottom:-1px;height:2px;border-radius:2px;background:var(--foreground)}

/* Page frame */
.wrap{flex:1;width:100%;max-width:1120px;margin:0 auto;padding:var(--space-8) clamp(16px,4vw,32px) var(--space-16)}
main{display:flex;flex-direction:column;gap:var(--space-6);margin:0 auto}
.main-narrow{max-width:720px}
.main-auth{max-width:440px;padding-top:min(6vh,48px)}
.page-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:var(--space-4)}
.back{display:inline-flex;align-items:center;min-height:32px;margin-bottom:var(--space-1);font-size:var(--text-sm);color:var(--muted-foreground);text-decoration:none}
.back:hover{color:var(--foreground)}
.stack{display:flex;flex-direction:column;gap:var(--space-4)}
.stack-sm{display:flex;flex-direction:column;gap:10px}
.foot{border-top:1px solid var(--border)}
.foot-inner{max-width:1120px;margin:0 auto;padding:var(--space-4) clamp(16px,4vw,32px);display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--space-1) var(--space-6);font-size:var(--text-sm);color:var(--subtle-foreground)}
.foot nav{display:flex;flex-wrap:wrap;gap:0 18px}
.foot a{display:inline-flex;align-items:center;min-height:36px;color:var(--subtle-foreground);text-decoration:none}
.foot a:hover{color:var(--foreground)}

/* Card */
.card{background:var(--card);color:var(--card-foreground);border:1px solid var(--border);border-radius:var(--radius-lg)}
.card-body{padding:var(--space-5);display:flex;flex-direction:column;gap:var(--space-4)}
.card-header{display:flex;flex-direction:column;gap:var(--space-1)}
.card-description{font-size:var(--text-sm);color:var(--muted-foreground)}

/* Button: default | secondary | outline | ghost | destructive | link; sizes sm | default | lg | icon */
.actions{display:flex;flex-wrap:wrap;gap:var(--space-2);align-items:center}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);height:36px;padding:0 14px;border-radius:var(--radius-sm);border:1px solid transparent;
font:inherit;font-size:var(--text-base);font-weight:500;line-height:1;white-space:nowrap;cursor:pointer;text-decoration:none;
transition:background-color .15s ease,border-color .15s ease,color .15s ease}
.btn:disabled,.btn[aria-disabled="true"]{opacity:0.5;pointer-events:none}
.btn-default{background:var(--primary);color:var(--primary-foreground)}
.btn-default:hover{background:#FFFFFF}
.btn-secondary{background:var(--secondary);color:var(--secondary-foreground)}
.btn-secondary:hover{background:var(--accent)}
.btn-outline{background:var(--secondary);border-color:var(--border-strong);color:var(--foreground)}
.btn-outline:hover{background:var(--accent);border-color:#45454D}
.btn-ghost{background:none;color:var(--muted-foreground);padding:0 10px}
.btn-ghost:hover{background:var(--secondary);color:var(--foreground)}
.btn-destructive{background:var(--destructive);color:var(--destructive-foreground)}
.btn-destructive:hover{background:#E53E3E}
.btn-link{height:auto;padding:0;background:none;color:var(--foreground);text-decoration:underline;text-underline-offset:3px}
.btn-sm{height:32px;padding:0 10px;font-size:var(--text-sm)}
.btn-lg{height:40px;padding:0 18px}
.btn-icon{width:36px;padding:0}
.btn-block{width:100%}
@media (pointer:coarse){.btn:not(.btn-link){height:44px}}

/* Field: label, control, hint, error. Accessibility wiring lives in ui.tsx */
.field{display:flex;flex-direction:column;gap:6px}
.field-pair{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,3fr);gap:var(--space-4)}
@media (max-width:640px){.field-pair{grid-template-columns:1fr}}
.label-row{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-3)}
label,legend{font-size:var(--text-sm);font-weight:500;color:var(--foreground)}
.label-note{margin-left:6px;font-weight:400;color:var(--subtle-foreground)}
.input{width:100%;height:38px;padding:0 var(--space-3);border-radius:var(--radius-sm);border:1px solid var(--input);background:var(--background);color:var(--foreground);
font:inherit;font-size:var(--text-base);transition:border-color .15s ease,box-shadow .15s ease}
textarea.input{height:auto;min-height:92px;padding:9px var(--space-3);line-height:1.5;resize:vertical}
.input::placeholder{color:var(--placeholder);opacity:1}
.input:hover{border-color:var(--input-hover)}
.input:focus,.input:focus-visible{outline:none;border-color:var(--ring);box-shadow:0 0 0 3px rgba(161,161,170,0.2)}
.input[aria-invalid="true"]{border-color:var(--destructive-text)}
.input[aria-invalid="true"]:focus{box-shadow:0 0 0 3px rgba(248,113,113,0.2)}
.input:disabled{opacity:0.5;cursor:not-allowed}
.input-mono{font-family:var(--font-mono);font-size:var(--text-sm)}
@media (max-width:640px){.input,.input-mono{font-size:var(--text-lg)}}
@media (pointer:coarse){.input:not(textarea){height:44px}}
.field-error{font-size:var(--text-sm);color:var(--destructive-text)}
.counter{margin:0;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--subtle-foreground);font-variant-numeric:tabular-nums;white-space:nowrap}
.counter.over{color:var(--destructive-text)}
fieldset{border:0;margin:0;padding:0;min-width:0}
legend{padding:0;margin-bottom:var(--space-2)}
.input-list{display:flex;flex-direction:column;gap:var(--space-2)}
.inline{display:flex;flex-wrap:wrap;gap:var(--space-2)}
.inline .input{flex:1 1 220px;width:auto}

/* Checkbox */
.checks{display:flex;flex-direction:column;gap:2px;padding-top:14px;border-top:1px solid var(--border)}
.check{display:flex;align-items:center;gap:10px;min-height:36px;font-size:var(--text-base);font-weight:400;cursor:pointer}
.check input{width:16px;height:16px;margin:0;flex:none;accent-color:var(--brand)}

/* Segmented control: a radio group */
.segments{align-self:flex-start;display:inline-flex;gap:2px;padding:3px;border-radius:var(--radius-md);background:var(--background);border:1px solid var(--input)}
.segment{display:inline-flex;align-items:center;height:30px;padding:0 14px;border-radius:7px;color:var(--muted-foreground);font-weight:500;cursor:pointer;transition:background-color .15s ease,color .15s ease}
.segment:hover{color:var(--foreground)}
.segment:has(input:checked){background:var(--accent);color:var(--foreground);box-shadow:inset 0 0 0 1px var(--border-strong),var(--shadow-sm)}
@media (pointer:coarse){.segment{height:38px}}

/* Post picker: a radio group of tiles */
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:var(--space-2)}
.tile{position:relative;aspect-ratio:1;max-width:100%;border-radius:var(--radius-md);border:1px solid var(--border-strong);background:var(--secondary);overflow:hidden;cursor:pointer;
display:flex;flex-direction:column;justify-content:flex-end;transition:border-color .15s ease,box-shadow .15s ease}
.tile:hover{border-color:var(--input-hover)}
.tile img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.tile-text{position:relative;display:flex;flex-direction:column;padding:6px var(--space-2);background:linear-gradient(transparent,rgba(0,0,0,0.78));font-size:11px;line-height:1.35}
.tile-kind{font-weight:600}
.tile-date{color:#D4D4D8;overflow-wrap:anywhere}
.tile-all{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:100%;font-size:var(--text-xs);font-weight:500;color:var(--muted-foreground)}
.tile:has(input:checked){border-color:var(--foreground);box-shadow:0 0 0 1px var(--foreground)}
.tile:has(input:checked) .tile-all{color:var(--foreground)}
.tile:has(input:checked)::after{content:"";position:absolute;top:6px;right:6px;width:18px;height:18px;border-radius:var(--radius-full);background:var(--foreground) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2309090B' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/11px no-repeat}
.tile:has(input:focus-visible),.segment:has(input:focus-visible){outline:2px solid var(--brand);outline-offset:2px}

/* Switch: <button role="switch"> with a fixed label */
.switch{flex:none;display:inline-flex;align-items:center;justify-content:center;width:48px;height:36px;padding:0;border:0;border-radius:var(--radius-sm);background:none;cursor:pointer}
.track{display:flex;width:34px;height:20px;padding:2px;border-radius:var(--radius-full);background:var(--accent);border:1px solid var(--input);transition:background-color .15s ease,border-color .15s ease}
.thumb{width:14px;height:14px;border-radius:var(--radius-full);background:var(--muted-foreground);transition:transform .15s ease,background-color .15s ease}
.switch:hover .track{border-color:var(--input-hover)}
.switch[aria-checked="true"] .track{background:var(--brand);border-color:var(--brand)}
.switch[aria-checked="true"] .thumb{transform:translateX(14px);background:#FFFFFF}
.setting{display:flex;align-items:center;gap:var(--space-4);padding:14px var(--space-3) 14px var(--space-5)}
.setting-text{flex:1;min-width:0}

/* Badge: default | secondary | outline | live | code */
.badge{flex:none;display:inline-flex;align-items:center;gap:6px;height:22px;padding:0 var(--space-2);border-radius:var(--radius-full);border:1px solid transparent;font-size:var(--text-xs);font-weight:500;white-space:nowrap}
.badge-default{background:var(--primary);color:var(--primary-foreground)}
.badge-secondary{background:var(--secondary);color:var(--muted-foreground);border-color:var(--border-strong)}
.badge-outline{color:var(--foreground);border-color:var(--border-strong)}
.badge-live{color:var(--brand-text);background:rgba(45,212,191,0.1);border-color:rgba(45,212,191,0.25)}
.badge-warning{color:var(--warning-text);background:rgba(251,191,36,0.08);border-color:rgba(251,191,36,0.28)}
.badge-code{height:auto;padding:1px 7px;border-radius:var(--radius-xs);font-family:var(--font-mono);font-weight:400;color:var(--foreground);background:var(--secondary);border-color:var(--border-strong);white-space:normal;overflow-wrap:anywhere}
.chips{display:flex;flex-wrap:wrap;gap:6px}

/* Status: dot + word */
.status{display:inline-flex;align-items:center;gap:6px;font-weight:500}
.status-on{color:var(--foreground)}
.status-off{color:var(--muted-foreground)}
.dot{width:7px;height:7px;border-radius:var(--radius-full);background:var(--input-hover)}
.status-on .dot{background:var(--brand);box-shadow:0 0 0 3px rgba(45,212,191,0.16)}

/* Avatar */
.avatar{flex:none;width:32px;height:32px;border-radius:var(--radius-full);background:var(--accent);border:1px solid var(--border-strong);
display:inline-flex;align-items:center;justify-content:center;font-size:var(--text-xs);font-weight:600;color:var(--foreground)}
.avatar-sm{width:24px;height:24px;font-size:11px}

/* Rows (account details, invites) */
.rows{list-style:none;margin:0;padding:0;overflow:hidden}
.row{display:flex;align-items:center;gap:14px;min-height:60px;padding:14px var(--space-5);border-top:1px solid var(--border)}
.row:first-child{border-top:0}
.row-main{flex:1;min-width:0}
.row-title{font-weight:500;overflow-wrap:anywhere}
.row-note{font-size:var(--text-sm);color:var(--muted-foreground);overflow-wrap:anywhere}
.row-value{font-size:var(--text-sm);font-weight:500;text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.rows.bordered{border:1px solid var(--border);border-radius:var(--radius-md)}
.rows.bordered .row{padding:10px var(--space-2) 10px var(--space-4);min-height:52px}

/* Alert: default | success | warning | destructive */
.alert{padding:var(--space-3) var(--space-4);border-radius:var(--radius-md);display:flex;flex-direction:column;gap:var(--space-1);font-size:var(--text-base);border:1px solid var(--border-strong);background:var(--card)}
.alert h2{font-size:var(--text-base)}
.alert ul{margin:2px 0 0;padding-left:18px}
.alert a{color:inherit}
.alert li a{display:inline-flex;align-items:center;min-height:28px}
.alert-success{background:rgba(45,212,191,0.06);border-color:rgba(45,212,191,0.25)}
.alert-destructive{background:rgba(248,113,113,0.07);border-color:rgba(248,113,113,0.3);color:#FECACA}
.alert-destructive h2{color:var(--destructive-text)}
.alert-warning{background:rgba(251,191,36,0.06);border-color:rgba(251,191,36,0.28);color:#FDE68A}
.alert-warning h2{color:var(--warning-text)}

/* Stats: one strip, each step with its rate and share of comments */
.totals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;margin:0;background:var(--border);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden}
.stat{display:flex;flex-direction:column;gap:2px;padding:var(--space-4) var(--space-5) 18px;background:var(--card)}
.stat dt{font-size:var(--text-sm);color:var(--muted-foreground)}
.stat dd{margin:0}
.stat-value{font-size:var(--text-2xl);font-weight:600;letter-spacing:-0.025em;line-height:1.3;font-variant-numeric:tabular-nums}
.stat-rate{font-size:var(--text-xs);color:var(--subtle-foreground)}
.bar{display:block;width:100%;height:3px;margin-top:10px;border:0;border-radius:2px;background:var(--accent);color:var(--muted-foreground);-webkit-appearance:none;appearance:none;overflow:hidden}
.bar::-webkit-progress-bar{background:var(--accent)}
.bar::-webkit-progress-value{background:var(--muted-foreground);border-radius:2px}
.bar::-moz-progress-bar{background:var(--muted-foreground);border-radius:2px}
@media (max-width:720px){.totals{grid-template-columns:repeat(2,minmax(0,1fr))}.stat{padding:14px var(--space-4)}.stat-value{font-size:22px}}

/* Automation list: whole row opens the editor, the switch sits above the link */
.auto-list{overflow:hidden}
.auto{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:var(--space-2) 28px;padding:var(--space-4) var(--space-3) var(--space-4) var(--space-5);border-top:1px solid var(--border);transition:background-color .15s ease}
.auto:first-child{border-top:0}
.auto:hover{background:var(--secondary)}
.auto-main{display:flex;flex-direction:column;gap:6px;min-width:0}
.auto h2{font-size:var(--text-md);overflow-wrap:anywhere}
.card-link{color:inherit;text-decoration:none}
.card-link::after{content:"";position:absolute;inset:0}
.card-link:focus-visible{outline:none}
.auto:has(.card-link:focus-visible){outline:2px solid var(--brand);outline-offset:-2px}
.auto-toggle{position:relative;z-index:1}
.meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:var(--text-sm);color:var(--muted-foreground)}
.meta-sep{color:var(--border-strong)}
.funnel{display:grid;grid-template-columns:repeat(5,76px);gap:var(--space-1);margin:0}
.funnel div{display:flex;flex-direction:column-reverse;align-items:flex-end}
.funnel dt{font-size:var(--text-xs);color:var(--subtle-foreground);white-space:nowrap}
.funnel dd{margin:0;font-size:var(--text-md);font-weight:500;font-variant-numeric:tabular-nums}
.funnel-rate dd{color:var(--brand-text)}
@media (max-width:860px){
.auto{grid-template-columns:minmax(0,1fr) auto;padding:var(--space-4) var(--space-3) var(--space-4) var(--space-4)}
.auto-toggle{grid-row:1;grid-column:2;align-self:start}
.funnel{grid-column:1/-1;grid-template-columns:repeat(5,minmax(0,1fr));padding-top:var(--space-3);margin-top:var(--space-1);border-top:1px dashed var(--border)}
.funnel div{align-items:flex-start}
}

/* Get started */
.steps{list-style:none;margin:0;padding:0;counter-reset:step;display:flex;flex-direction:column;gap:14px;color:var(--muted-foreground)}
.steps li{position:relative;padding-left:36px;counter-increment:step}
.steps li::before{content:counter(step);position:absolute;left:0;top:-1px;width:24px;height:24px;border-radius:var(--radius-full);border:1px solid var(--border-strong);
display:flex;align-items:center;justify-content:center;font-family:var(--font-mono);font-size:var(--text-xs);color:var(--foreground)}
.steps li.done::before{content:"";border-color:var(--brand);background:var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2309090B' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/12px no-repeat}
.steps strong{color:var(--foreground)}

/* Editor: form on the left, live DM preview on the right */
.editor{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--space-6);align-items:start}
@media (min-width:1000px){.editor{grid-template-columns:minmax(0,1fr) 340px;gap:var(--space-8)}.preview{position:sticky;top:80px}}
.step{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;margin-right:10px;border-radius:var(--radius-xs);
border:1px solid var(--border-strong);font-family:var(--font-mono);font-size:11px;font-weight:500;color:var(--muted-foreground);vertical-align:1px}
.save-bar{position:sticky;bottom:var(--space-4);z-index:5;display:flex;justify-content:flex-end;flex-wrap:wrap;gap:var(--space-2);padding:10px;border-radius:var(--radius-lg);
background:rgba(17,17,19,0.88);border:1px solid var(--border-strong);box-shadow:var(--shadow-lg);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.preview{display:flex;flex-direction:column;gap:10px}
.phone{background:#000000;border:1px solid var(--border-strong);border-radius:var(--radius-xl);overflow:hidden}
.phone-head{display:flex;align-items:center;gap:var(--space-2);padding:var(--space-3) 14px;border-bottom:1px solid var(--border);font-size:var(--text-sm);font-weight:600}
.thread{display:flex;flex-direction:column;gap:6px;padding:14px var(--space-3) 18px;font-size:var(--text-base);line-height:1.4}
.thread-note{align-self:center;margin-bottom:6px;font-size:var(--text-xs);color:var(--subtle-foreground);text-align:center}
.tpl{align-self:flex-start;max-width:85%;border-radius:18px;background:#262629;overflow:hidden}
.tpl-text{padding:9px 13px;white-space:pre-wrap;overflow-wrap:anywhere}
.tpl-url{color:#93C5FD}
.tpl-btn{display:block;padding:9px 13px;border-top:1px solid #3A3A3F;text-align:center;font-weight:600;overflow-wrap:anywhere}
.bubble-me{align-self:flex-end;max-width:75%;margin:var(--space-1) 0;padding:var(--space-2) 13px;border-radius:18px;background:#3B5BDB;color:#FFFFFF;overflow-wrap:anywhere}
.is-empty{color:var(--subtle-foreground);font-style:italic}
.bubble-me .is-empty{color:rgba(255,255,255,0.7)}

/* Toast: the persistent role="status" region announces it */
.toast{position:fixed;left:50%;bottom:var(--space-6);transform:translateX(-50%);z-index:20;display:flex;align-items:center;gap:var(--space-2);padding:10px var(--space-4);
border-radius:var(--radius-md);background:var(--popover);color:var(--popover-foreground);border:1px solid var(--border-strong);box-shadow:var(--shadow-lg);font-weight:500;max-width:calc(100% - 32px);transition:opacity .3s ease}
.toast-hide{opacity:0;pointer-events:none}
.toast-static{position:static;transform:none;align-self:flex-start}

/* Sign-in */
.points{list-style:none;margin:0;padding:0 var(--space-1);display:flex;flex-direction:column;gap:var(--space-3);font-size:var(--text-sm);color:var(--muted-foreground)}
.points li{position:relative;padding-left:var(--space-6)}
.points li::before{content:"";position:absolute;left:0;top:3px;width:14px;height:14px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232DD4BF' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat}
.points strong{color:var(--foreground)}

/* Legal pages and lists */
.prose{gap:14px;line-height:1.65}
.prose h2{margin-top:10px;font-size:var(--text-lg)}
.prose h2:first-child{margin-top:0}
.prose p,.prose li{color:#D4D4D8}
.prose ul,.prose ol{margin:0;padding-left:22px;display:flex;flex-direction:column;gap:6px}
.list{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px}

/* Danger zone */
.danger{border-color:rgba(248,113,113,0.28)}
.danger h2{color:var(--destructive-text)}

/* Table: scrolls in its box on small screens */
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:var(--text-base);min-width:680px}
th,td{padding:10px var(--space-4);text-align:left;vertical-align:middle;border-top:1px solid var(--border)}
thead th{border-top:0;height:40px;font-size:var(--text-xs);font-weight:500;color:var(--subtle-foreground);background:var(--card)}
tbody th{font-weight:500}
tbody tr:hover>*{background:var(--secondary)}
td{font-variant-numeric:tabular-nums}

/* Style guide */
.sg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,230px),1fr));gap:var(--space-3)}
.sg-swatch{display:flex;align-items:center;gap:var(--space-3);min-width:0}
.sg-chip{flex:none;width:36px;height:36px;border-radius:var(--radius-sm);border:1px solid var(--border-strong)}
.sg-name{font-family:var(--font-mono);font-size:var(--text-xs);overflow-wrap:anywhere}
.sg-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--space-3)}
.sg-space{height:12px;border-radius:2px;background:var(--brand)}
.sg-scale{display:grid;grid-template-columns:72px minmax(0,1fr);align-items:center;gap:var(--space-2) var(--space-4)}
.sw-background{background:var(--background)}
.sw-foreground{background:var(--foreground)}
.sw-card{background:var(--card)}
.sw-card-foreground{background:var(--card-foreground)}
.sw-popover{background:var(--popover)}
.sw-popover-foreground{background:var(--popover-foreground)}
.sw-primary{background:var(--primary)}
.sw-primary-foreground{background:var(--primary-foreground)}
.sw-secondary{background:var(--secondary)}
.sw-secondary-foreground{background:var(--secondary-foreground)}
.sw-muted{background:var(--muted)}
.sw-muted-foreground{background:var(--muted-foreground)}
.sw-subtle-foreground{background:var(--subtle-foreground)}
.sw-accent{background:var(--accent)}
.sw-accent-foreground{background:var(--accent-foreground)}
.sw-destructive{background:var(--destructive)}
.sw-destructive-foreground{background:var(--destructive-foreground)}
.sw-destructive-text{background:var(--destructive-text)}
.sw-warning{background:var(--warning)}
.sw-warning-text{background:var(--warning-text)}
.sw-border{background:var(--border)}
.sw-border-strong{background:var(--border-strong)}
.sw-input{background:var(--input)}
.sw-input-hover{background:var(--input-hover)}
.sw-placeholder{background:var(--placeholder)}
.sw-ring{background:var(--ring)}
.sw-brand{background:var(--brand)}
.sw-brand-text{background:var(--brand-text)}
.sp-1{width:var(--space-1)}
.sp-2{width:var(--space-2)}
.sp-3{width:var(--space-3)}
.sp-4{width:var(--space-4)}
.sp-5{width:var(--space-5)}
.sp-6{width:var(--space-6)}
.sp-8{width:var(--space-8)}
.sp-10{width:var(--space-10)}
.sp-12{width:var(--space-12)}
.sp-16{width:var(--space-16)}
.tx-xs{font-size:var(--text-xs)}
.tx-sm{font-size:var(--text-sm)}
.tx-base{font-size:var(--text-base)}
.tx-md{font-size:var(--text-md)}
.tx-lg{font-size:var(--text-lg)}
.tx-xl{font-size:var(--text-xl)}
.tx-2xl{font-size:var(--text-2xl)}
.tx-3xl{font-size:var(--text-3xl)}
.tx-4xl{font-size:var(--text-4xl)}

/* Automation form: only the parts for the chosen trigger and flow. Pure CSS (:has), so it
   works under the CSP without script; without :has support every part shows. */
.editor:has(input[name="trigger_type"][value="comment"]:checked) [data-t]:not([data-t~="comment"]),
.editor:has(input[name="trigger_type"][value="dm_keyword"]:checked) [data-t]:not([data-t~="dm_keyword"]),
.editor:has(input[name="trigger_type"][value="story_reply"]:checked) [data-t]:not([data-t~="story_reply"]),
.editor:has(input[name="trigger_type"][value="story_mention"]:checked) [data-t]:not([data-t~="story_mention"]),
.editor:has(input[name="trigger_type"][value="default_reply"]:checked) [data-t]:not([data-t~="default_reply"]){display:none}
.editor:has(input[name="flow_type"][value="link"]:checked) [data-f="email"]{display:none}
.editor:has(input[name="trigger_type"][value="default_reply"]:checked) [data-f="email"]{display:none}
.choices{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,200px),1fr));gap:var(--space-2)}
.choice{position:relative;display:flex;flex-direction:column;gap:2px;padding:var(--space-3) 14px;border-radius:var(--radius-md);border:1px solid var(--border-strong);background:var(--secondary);cursor:pointer;transition:border-color .15s ease}
.choice:hover{border-color:var(--input-hover)}
.choice-title{font-weight:500}
.choice-note{font-size:var(--text-xs);color:var(--muted-foreground)}
.choice:has(input:checked){border-color:var(--foreground);box-shadow:0 0 0 1px var(--foreground)}
.choice:has(input:focus-visible){outline:2px solid var(--brand);outline-offset:2px}
.choice:has(input[aria-invalid="true"]){border-color:var(--destructive-text)}
select.input{padding-right:var(--space-8)}
.tpl-brand{color:var(--subtle-foreground);font-size:var(--text-xs)}

/* New automation: templates */
.templates{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:var(--space-3)}
.template{display:flex;flex-direction:column;gap:6px;height:100%;padding:var(--space-4) var(--space-5);color:inherit;text-decoration:none;transition:border-color .15s ease,background-color .15s ease}
.template:hover{background:var(--secondary);border-color:var(--border-strong)}
.template-kind{font-size:var(--text-xs);color:var(--subtle-foreground)}
.template-title{font-size:var(--text-md);font-weight:600}

/* Plan usage, leads, health */
.usage{display:flex;flex-direction:column;gap:6px}
.usage .bar{width:100%}
.warn-text{color:var(--warning-text)}
.cell-wrap{min-width:200px;white-space:normal;overflow-wrap:anywhere}
.row-actions{display:flex;justify-content:flex-end;gap:var(--space-1);white-space:nowrap}
.funnel-4{grid-template-columns:repeat(4,76px)}
@media (max-width:860px){.funnel-4{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* Home page (src/home.tsx): public, for visitors who aren't signed in */
.main-home{width:100%;max-width:1056px}
.home{display:flex;flex-direction:column;gap:var(--space-16)}
.hero{display:grid;gap:var(--space-10);align-items:center;padding-top:var(--space-6)}
@media (min-width:900px){.hero{grid-template-columns:minmax(0,1fr) 340px;gap:var(--space-12)}}
.hero-text{display:flex;flex-direction:column;gap:var(--space-4)}
.hero-text .lead{font-size:var(--text-lg);max-width:54ch}
.eyebrow{margin:0;font-size:var(--text-sm);font-weight:500;color:var(--brand-text)}
.display{font-size:var(--text-4xl);letter-spacing:-0.03em;line-height:1.08}
@media (max-width:640px){.display{font-size:var(--text-3xl)}}
.band{display:flex;flex-direction:column;gap:var(--space-6)}
.section-title{font-size:var(--text-2xl);font-weight:600;letter-spacing:-0.02em;text-align:center;text-wrap:balance}
.center{text-align:center;margin-left:auto;margin-right:auto}
.steps-row{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:var(--space-4)}
.steps-row li{display:flex;flex-direction:column;gap:var(--space-2);padding:var(--space-5);border:1px solid var(--border);border-radius:var(--radius-lg)}
.steps-row h3,.feature h3,.plan h3{margin:0;font-size:var(--text-md);font-weight:600}
.steps-row p,.feature p{margin:0;color:var(--muted-foreground)}
.step-num{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:var(--radius-full);border:1px solid var(--border-strong);font-family:var(--font-mono);font-size:var(--text-sm);color:var(--brand-text)}
.feature-grid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:var(--space-3)}
.feature{gap:var(--space-2)}
.feature-plain{display:flex;flex-direction:column;padding:var(--space-2) 0 var(--space-2) var(--space-4);border-left:2px solid var(--brand)}
@media (min-width:760px){.feature-grid-2{grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-6) var(--space-8)}}
.plans{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:var(--space-4);max-width:720px;width:100%;margin:0 auto}
.plan-main{border-color:var(--border-strong)}
.plan-price{margin:0;font-size:var(--text-3xl);font-weight:600;letter-spacing:-0.02em}
.plan-per{font-size:var(--text-base);font-weight:400;color:var(--muted-foreground);letter-spacing:0}
.checklist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-2);color:var(--muted-foreground)}
.checklist li{position:relative;padding-left:var(--space-6)}
.checklist li::before{content:"";position:absolute;left:0;top:4px;width:14px;height:14px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232DD4BF' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat}
.faq{display:flex;flex-direction:column;max-width:720px;width:100%;margin:0 auto;border-top:1px solid var(--border)}
.faq details{border-bottom:1px solid var(--border)}
.faq summary{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);min-height:52px;padding:var(--space-3) 0;font-weight:500;cursor:pointer;list-style:none}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";flex:none;font-family:var(--font-mono);color:var(--subtle-foreground)}
.faq details[open] summary::after{content:"–"}
.faq details p{margin:0 0 var(--space-4);color:var(--muted-foreground);max-width:64ch}
.final{align-items:center;text-align:center;padding:var(--space-10) var(--space-5)}
.final .actions{justify-content:center}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{transition:none !important}}
