/* ==========================================================================
   Baatcheet — design system
   Palette: Siltstone (#CBBD93 · #FFF5B8 · #FFB16E · #CCA25A)
   Shared by the marketing site and the dashboard. Change tokens here only.
   ========================================================================== */

:root {
    /* Siltstone palette */
    --sand: #CBBD93;
    --cream: #FFF5B8;
    --apricot: #FFB16E;
    --ochre: #CCA25A;

    /* Tints & shades derived from the palette */
    --sand-50: #FAF7EE;
    --sand-100: #F3EEDF;
    --sand-200: #E7DFC8;
    --sand-300: #D9CEAE;
    --cream-50: #FFFBE3;
    --apricot-100: #FFE7D1;
    --apricot-700: #A8551C;
    --ochre-100: #F2E6CC;
    --ochre-700: #7D5A1E;

    /* Neutrals (warm, pulled from the palette) */
    --ink: #221D13;
    --ink-2: #4E4535;
    --ink-3: #7F7461;
    --ink-4: #A79C86;
    --paper: #FCFAF4;
    --surface: #FFFFFF;
    --line: #EAE3D0;
    --line-strong: #DCD2B8;

    /* Status */
    --success: #4F7A3A;
    --success-bg: #E8F0DC;
    --danger: #A8402A;
    --danger-bg: #F8E1D8;

    /* Type */
    --font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-serif: "Instrument Serif", ui-serif, Georgia, serif;

    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 15px;
    --text-md: 17px;
    --text-lg: 20px;
    --text-xl: 26px;
    --text-2xl: 34px;
    --text-3xl: 48px;
    --text-4xl: 68px;

    /* Shape */
    --radius-sm: 8px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --radius-pill: 999px;

    /* Depth */
    --shadow-xs: 0 1px 0 rgba(34, 29, 19, .04);
    --shadow-sm: 0 1px 2px rgba(34, 29, 19, .06), 0 1px 0 rgba(34, 29, 19, .03);
    --shadow-md: 0 1px 2px rgba(34, 29, 19, .05), 0 10px 28px -14px rgba(34, 29, 19, .22);
    --shadow-lg: 0 2px 4px rgba(34, 29, 19, .04), 0 24px 56px -24px rgba(34, 29, 19, .30);
    --ring: 0 0 0 3px rgba(255, 177, 110, .38);

    --ease: cubic-bezier(.2, .7, .2, 1);
    --container: 1180px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--cream); color: var(--ink); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
.serif em, em.serif { font-style: italic; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }

/* --------------------------------------------------------------------------
   Brand
   -------------------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: var(--text-md); letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px;
    border: 1px solid transparent; border-radius: var(--radius);
    font-size: var(--text-base); font-weight: 500; line-height: 1; white-space: nowrap;
    cursor: pointer; transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-sm { height: 32px; padding: 0 12px; font-size: var(--text-sm); border-radius: var(--radius-sm); gap: 6px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: var(--text-md); }

.btn-primary { background: var(--ink); color: var(--cream-50); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #3A3223; }

.btn-accent { background: var(--apricot); color: var(--ink); border-color: #F29C52; box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-accent:hover { background: #FFA35A; }

.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--sand-50); border-color: var(--sand); }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sand-100); color: var(--ink); }

.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

/* --------------------------------------------------------------------------
   Form fields
   -------------------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.label { font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); }

.input, .select {
    width: 100%; height: 40px; padding: 0 12px;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
    font-size: var(--text-base); color: var(--ink); box-shadow: var(--shadow-xs);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input::placeholder { color: var(--ink-4); }
.input:hover, .select:hover { border-color: var(--sand); }
.input:focus, .select:focus { outline: none; border-color: var(--apricot); box-shadow: var(--ring); }
.input-lg { height: 48px; font-size: var(--text-md); padding: 0 16px; }

.select {
    appearance: none; padding-right: 34px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237F7461' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group > .icon { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.input-group > .input { padding-left: 38px; }
.input-group > .kbd { position: absolute; right: 10px; }

.kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--sand-50); font-size: 11px; color: var(--ink-3); }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.card-title { font-size: var(--text-md); font-weight: 600; letter-spacing: -0.01em; }
.card-sub { font-size: var(--text-sm); color: var(--ink-3); margin-top: 2px; }
.card-body { padding: 20px 24px; }
.card-foot { padding: 14px 24px; border-top: 1px solid var(--line); background: var(--sand-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* Icon tile used inside cards — one size, one radius everywhere */
.tile { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius); background: var(--sand-100); color: var(--ink-2); border: 1px solid var(--line); }
.tile-cream { background: var(--cream); border-color: #F1E39A; color: var(--ochre-700); }
.tile-apricot { background: var(--apricot-100); border-color: #F8D3B1; color: var(--apricot-700); }
.tile-ochre { background: var(--ochre-100); border-color: #E5D3AC; color: var(--ochre-700); }

/* --------------------------------------------------------------------------
   Badges, avatars, misc
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
    border-radius: var(--radius-pill); border: 1px solid var(--line);
    background: var(--sand-50); color: var(--ink-2);
    font-size: var(--text-xs); font-weight: 500; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-cream { background: var(--cream); border-color: #F1E39A; color: var(--ochre-700); }
.badge-apricot { background: var(--apricot-100); border-color: #F8D3B1; color: var(--apricot-700); }
.badge-ochre { background: var(--ochre-100); border-color: #E5D3AC; color: var(--ochre-700); }
.badge-success { background: var(--success-bg); border-color: #D2E1BF; color: var(--success); }
.badge-danger { background: var(--danger-bg); border-color: #EFC8BA; color: var(--danger); }

.avatar {
    display: inline-grid; place-items: center; flex: none;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--sand-200); color: var(--ink-2);
    font-size: var(--text-sm); font-weight: 600; letter-spacing: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.a1 { background: var(--cream); color: var(--ochre-700); }
.avatar.a2 { background: var(--apricot-100); color: var(--apricot-700); }
.avatar.a3 { background: var(--ochre-100); color: var(--ochre-700); }
.avatar.a4 { background: var(--sand-200); color: var(--ink-2); }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 6px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: var(--surface);
    font-size: var(--text-sm); color: var(--ink-2); box-shadow: var(--shadow-xs);
}
.eyebrow .badge { height: 20px; padding: 0 7px; }

.section-label { font-size: var(--text-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ochre-700); }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-sm); font-weight: 500; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }

.progress { height: 8px; border-radius: var(--radius-pill); background: var(--sand-100); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; }

/* ==========================================================================
   Marketing site
   ========================================================================== */
.site-nav { position: sticky; top: 0; z-index: 30; background: rgba(252, 250, 244, .82); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-nav.is-scrolled { border-bottom-color: var(--line); }
.site-nav .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.site-links { display: flex; gap: 4px; }
.site-links a { padding: 8px 12px; border-radius: var(--radius-sm); font-size: var(--text-base); color: var(--ink-2); transition: background .18s, color .18s; }
.site-links a:hover { background: var(--sand-100); color: var(--ink); }
.site-actions { display: flex; align-items: center; gap: 8px; }
.site-menu-btn { display: none; }

/* Hero */
.hero { position: relative; padding: 72px 0 96px; overflow: hidden; }
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 56px 56px; opacity: .45;
    mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 20%, transparent 75%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center; }
.hero h1 { margin-top: 22px; font-size: var(--text-4xl); line-height: 1.02; letter-spacing: -0.035em; }
.hero h1 .serif { font-size: 1.08em; letter-spacing: -0.02em; color: var(--ochre-700); }
.hero-lede { margin-top: 22px; max-width: 520px; font-size: var(--text-md); color: var(--ink-2); line-height: 1.6; }
.hero-form { display: flex; gap: 8px; margin-top: 32px; max-width: 500px; }
.hero-form .input-group { flex: 1; }
.hero-note { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; font-size: var(--text-sm); color: var(--ink-3); }
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note .icon { color: var(--ochre); }

/* Phone / chat mock */
.stage { position: relative; display: flex; justify-content: flex-end; padding: 20px 24px 20px 0; }
.stage-bg { position: absolute; inset: 6% 4% 0 14%; border-radius: 36px; background: var(--cream); border: 1px solid #F1E39A; }
.stage-bg::after { content: ""; position: absolute; right: -18px; bottom: 40px; width: 120px; height: 120px; border-radius: 28px; background: var(--apricot); opacity: .9; transform: rotate(10deg); z-index: -1; }

.phone { position: relative; width: 330px; border-radius: 34px; background: var(--ink); padding: 10px; box-shadow: var(--shadow-lg); }
.phone-screen { border-radius: 26px; overflow: hidden; background: #F4EEDD; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-head .avatar { width: 34px; height: 34px; }
.chat-head strong { display: block; font-size: var(--text-sm); }
.chat-head small { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--success); }
.chat-head small::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chat-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 12px 18px; min-height: 410px; }
.chat-day { align-self: center; padding: 3px 10px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, .7); font-size: 11px; color: var(--ink-3); }
.bubble { max-width: 82%; padding: 8px 11px 6px; border-radius: 14px; font-size: var(--text-sm); line-height: 1.45; box-shadow: 0 1px 0 rgba(34, 29, 19, .06); }
.bubble time { display: block; margin-top: 2px; text-align: right; font-size: 10px; color: var(--ink-3); }
.bubble.in { align-self: flex-start; background: var(--surface); border-top-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--cream); border-top-right-radius: 4px; }
.bubble-options { display: grid; gap: 4px; margin-top: 8px; }
.bubble-options span { padding: 6px 8px; border-radius: 8px; background: var(--sand-50); border: 1px solid var(--line); font-size: 12px; text-align: center; color: var(--ochre-700); font-weight: 500; }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 11px 13px; background: var(--surface); border-radius: 14px; border-top-left-radius: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); animation: typing 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.float-card { position: absolute; z-index: 2; width: 216px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.float-card.lead { left: 0; bottom: 36px; }
.float-card.stat { left: 24px; top: 96px; width: 172px; }
.float-card .row { display: flex; justify-content: space-between; gap: 12px; font-size: var(--text-sm); padding: 5px 0; }
.float-card .row span:first-child { color: var(--ink-3); }
.float-card .row span:last-child { font-weight: 500; }
.float-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: var(--text-sm); font-weight: 600; }

/* Proof strip */
.proof { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.proof .container { display: grid; grid-template-columns: repeat(4, 1fr); }
.proof-item { padding: 28px 24px; border-left: 1px solid var(--line); }
.proof-item:first-child { border-left: 0; padding-left: 0; }
.proof-item strong { display: block; font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.03em; }
.proof-item span { font-size: var(--text-sm); color: var(--ink-3); }

/* Sections */
.section { padding: 112px 0; }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { margin-top: 14px; font-size: var(--text-3xl); letter-spacing: -0.03em; }
.section-head h2 .serif { color: var(--ochre-700); }
.section-head p { margin-top: 16px; font-size: var(--text-md); color: var(--ink-2); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { padding: 28px; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.feature h3 { margin-top: 20px; font-size: var(--text-md); letter-spacing: -0.01em; }
.feature p { margin-top: 8px; color: var(--ink-3); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; padding: 24px; }
.step-num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--cream); font-size: var(--text-sm); font-weight: 600; }
.step h3 { margin-top: 18px; font-size: var(--text-md); }
.step p { margin-top: 8px; color: var(--ink-3); font-size: var(--text-base); }
.step code { font-size: var(--text-xs); padding: 2px 6px; border-radius: 5px; background: var(--sand-100); color: var(--ink-2); }

/* Split showcase */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.check-list { display: grid; gap: 14px; margin: 28px 0 0; padding: 0; list-style: none; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); }
.check-list .icon { margin-top: 2px; padding: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--cream); color: var(--ochre-700); stroke-width: 2.2; }

.showcase { position: relative; padding: 32px; border-radius: var(--radius-xl); background: var(--sand-100); border: 1px solid var(--line); }
.showcase .card + .card { margin-top: 12px; }
.flow { display: grid; gap: 10px; }
.flow-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--sand-50); border: 1px solid var(--line); font-size: var(--text-sm); }
.flow-row strong { font-weight: 600; }
.flow-row .badge { margin-left: auto; }

/* Industries */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line-strong); font-size: var(--text-base); color: var(--ink-2); box-shadow: var(--shadow-xs); }
.chip .icon { color: var(--ochre); }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 32px; }
.plan.featured { background: var(--cream-50); border-color: #EFDF95; box-shadow: var(--shadow-md); position: relative; }
.plan.featured .badge { position: absolute; top: 24px; right: 24px; }
.plan-name { font-size: var(--text-md); font-weight: 600; }
.plan-desc { margin-top: 6px; color: var(--ink-3); font-size: var(--text-base); min-height: 46px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-top: 24px; }
.plan-price strong { font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.03em; }
.plan-price span { color: var(--ink-3); font-size: var(--text-sm); }
.plan-setup { margin-top: 4px; font-size: var(--text-sm); color: var(--ink-3); }
.plan .btn { margin-top: 24px; }
.plan .check-list { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); gap: 12px; font-size: var(--text-base); }
.pricing-note { margin-top: 24px; text-align: center; font-size: var(--text-sm); color: var(--ink-3); }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; font-size: var(--text-md); font-weight: 500; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--ink-3); transition: transform .2s var(--ease); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details p { padding: 0 40px 22px 0; color: var(--ink-2); }

/* CTA + footer */
.cta { padding: 0 0 112px; }
.cta-box { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; padding: 56px; border-radius: var(--radius-xl); background: var(--ink); color: var(--cream-50); }
.cta-box::after { content: ""; position: absolute; right: -60px; top: -60px; width: 280px; height: 280px; border-radius: 50%; border: 56px solid var(--ochre); opacity: .25; }
.cta-box h2 { font-size: var(--text-3xl); letter-spacing: -0.03em; }
.cta-box h2 .serif { color: var(--apricot); }
.cta-box p { margin-top: 14px; color: var(--sand); font-size: var(--text-md); }
.cta-actions { position: relative; z-index: 1; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.cta-box .btn-secondary { background: transparent; color: var(--cream-50); border-color: rgba(203, 189, 147, .45); box-shadow: none; }
.cta-box .btn-secondary:hover { background: rgba(203, 189, 147, .12); }

.site-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.footer-grid p { margin-top: 14px; max-width: 300px; color: var(--ink-3); font-size: var(--text-base); }
.footer-grid h4 { font-size: var(--text-sm); font-weight: 600; color: var(--ink); letter-spacing: 0; }
.footer-grid ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.footer-grid a { color: var(--ink-3); font-size: var(--text-base); transition: color .18s; }
.footer-grid a:hover { color: var(--ink); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: var(--text-sm); color: var(--ink-3); }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px; padding: 20px 16px; background: var(--sand-50); border-right: 1px solid var(--line); overflow-y: auto; }
.sidebar .brand { padding: 4px 8px; }

.workspace { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); cursor: pointer; text-align: left; transition: border-color .18s; }
.workspace:hover { border-color: var(--sand); }
.workspace .tile { width: 32px; height: 32px; border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 600; }
.workspace strong { display: block; font-size: var(--text-sm); font-weight: 600; line-height: 1.3; }
.workspace small { display: block; font-size: var(--text-xs); color: var(--ink-3); }
.workspace .icon { margin-left: auto; color: var(--ink-3); }

.nav-group { display: grid; gap: 2px; }
.nav-title { padding: 0 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); }
.nav-link { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); font-size: var(--text-base); color: var(--ink-2); transition: background .15s, color .15s; }
.nav-link .icon { color: var(--ink-3); }
.nav-link:hover { background: var(--sand-100); color: var(--ink); }
.nav-link.active { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.nav-link.active .icon { color: var(--ochre-700); }
.nav-link .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: var(--radius-pill); background: var(--apricot); color: var(--ink); font-size: 11px; font-weight: 600; }

.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.usage { padding: 14px; border-radius: var(--radius); background: var(--cream); border: 1px solid #F1E39A; }
.usage strong { display: block; font-size: var(--text-sm); }
.usage p { font-size: var(--text-xs); color: var(--ochre-700); margin: 2px 0 10px; }
.usage .progress { background: rgba(255, 255, 255, .7); }
.usage .progress > span { background: var(--ochre); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); }
.me strong { display: block; font-size: var(--text-sm); line-height: 1.3; }
.me small { display: block; font-size: var(--text-xs); color: var(--ink-3); }
.me .btn { margin-left: auto; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 32px; background: rgba(252, 250, 244, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .input-group { width: 340px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bell { position: relative; }
.bell::after { content: ""; position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--apricot); border: 2px solid var(--surface); }
.sidebar-toggle { display: none; }

.page { padding: 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 1400px; }
.page > *, .grid-2 > *, .grid-2-even > *, .stats > * { min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: var(--text-xl); letter-spacing: -0.025em; }
.page-head h1 .serif { font-size: 1.15em; color: var(--ochre-700); margin-left: .1em; }
.page-head p { margin-top: 4px; color: var(--ink-3); }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 20px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: var(--text-sm); color: var(--ink-3); font-weight: 500; }
.stat-value { margin-top: 14px; font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.stat-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: var(--text-sm); color: var(--ink-3); }

.grid-2 { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; }
.grid-2-even { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--sand-100); border: 1px solid var(--line); border-radius: var(--radius); }
.segmented button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; font-size: var(--text-sm); color: var(--ink-3); cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm); }

.legend { display: flex; gap: 16px; font-size: var(--text-sm); color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

.chart { width: 100%; height: auto; }
.chart text { font-family: var(--font-sans); font-size: 12px; fill: var(--ink-3); }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .bar-ai { fill: var(--ochre); }
.chart .bar-human { fill: var(--apricot); }
.chart .bar-today { fill: var(--ink); }

.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); transition: background .15s; }
.list > .list-item:last-child, .list > li:last-child > .list-item { border-bottom: 0; }
.list-item:hover { background: var(--sand-50); }
.list-main { min-width: 0; flex: 1; }
.list-main strong { display: flex; align-items: center; gap: 8px; font-size: var(--text-base); font-weight: 500; }
.list-main p { margin-top: 2px; font-size: var(--text-sm); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { display: grid; justify-items: end; gap: 6px; font-size: var(--text-xs); color: var(--ink-3); flex: none; }

.queue-wait { font-size: var(--text-xs); font-weight: 500; color: var(--apricot-700); }

.pipeline { display: grid; gap: 18px; }
.pipeline-row { display: grid; gap: 8px; }
.pipeline-row header { display: flex; justify-content: space-between; font-size: var(--text-sm); }
.pipeline-row header span:first-child { color: var(--ink-2); font-weight: 500; }
.pipeline-row header span:last-child { color: var(--ink-3); }

.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.mini-stat { padding: 14px; border-radius: var(--radius); background: var(--sand-50); border: 1px solid var(--line); }
.mini-stat span { font-size: var(--text-xs); color: var(--ink-3); }
.mini-stat strong { display: block; margin-top: 4px; font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.02em; }

.table-wrap { position: relative; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.table th { padding: 12px 24px; text-align: left; font-size: var(--text-xs); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); background: var(--sand-50); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 24px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--ink-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--sand-50); }
.table .person { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; }
.table .person small { display: block; font-weight: 400; font-size: var(--text-xs); color: var(--ink-3); }

.scrim { display: none; }

.brand-logo { height: 32px; width: auto; }
.sidebar .brand-logo { height: 30px; }

/* ==========================================================================
   App pages: forms, feedback, navigation helpers
   ========================================================================== */
.textarea {
    width: 100%; min-height: 104px; padding: 10px 12px; resize: vertical;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
    font-size: var(--text-base); line-height: 1.5; color: var(--ink); box-shadow: var(--shadow-xs);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.textarea::placeholder { color: var(--ink-4); }
.textarea:hover { border-color: var(--sand); }
.textarea:focus { outline: none; border-color: var(--apricot); box-shadow: var(--ring); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.field-error { font-size: var(--text-sm); color: var(--danger); }
.hint { font-size: var(--text-sm); color: var(--ink-3); }
.hint code, .card code { font-size: var(--text-xs); padding: 2px 6px; border-radius: 5px; background: var(--sand-100); color: var(--ink-2); word-break: break-all; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.settings-section { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 32px; padding: 28px 0; border-top: 1px solid var(--line); }
.settings-section:first-child { border-top: 0; padding-top: 0; }
.settings-section h2 { font-size: var(--text-md); letter-spacing: -0.01em; }
.settings-section > div > p { margin-top: 6px; color: var(--ink-3); font-size: var(--text-base); }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: var(--text-base); color: var(--ink-2); }
.check input { appearance: none; flex: none; width: 18px; height: 18px; margin: 2px 0 0; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s; }
.check input:checked { background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFF5B8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: var(--ink); }
.check input:focus-visible { box-shadow: var(--ring); }
.check strong { display: block; color: var(--ink); font-weight: 500; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; flex: none; width: 40px; height: 24px; border-radius: var(--radius-pill); background: var(--sand-200); border: 1px solid var(--line-strong); transition: background .18s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .18s var(--ease); }
.switch input:checked + .track { background: var(--ochre); border-color: var(--ochre); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-size: var(--text-base); color: var(--ink-2); box-shadow: var(--shadow-xs); }
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--success-bg); border-color: #D2E1BF; color: var(--success); }
.alert-error { background: var(--danger-bg); border-color: #EFC8BA; color: var(--danger); }
.alert-info { background: var(--cream-50); border-color: #F1E39A; color: var(--ochre-700); }
.alert strong { color: inherit; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .input-group { width: 280px; }
.toolbar .spacer { flex: 1; }
.segmented a { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 7px; font-size: var(--text-sm); color: var(--ink-3); white-space: nowrap; }
.segmented a:hover { color: var(--ink); }
.segmented a.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm); }
.segmented a .count { font-size: 11px; color: var(--ink-4); }
.segmented a.on .count { color: var(--ochre-700); }

.empty { display: grid; justify-items: center; gap: 10px; padding: 56px 24px; text-align: center; }
.empty .tile { width: 48px; height: 48px; border-radius: var(--radius-lg); }
.empty h3 { font-size: var(--text-md); margin-top: 6px; }
.empty p { max-width: 380px; color: var(--ink-3); }
.empty .btn { margin-top: 8px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: var(--text-sm); color: var(--ink-3); }
.pagination nav { display: flex; gap: 4px; }
.pagination .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.dropdown-menu.right { left: auto; right: 0; width: 320px; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; font-size: var(--text-sm); color: var(--ink-2); text-align: left; cursor: pointer; }
.dropdown-item:hover { background: var(--sand-50); color: var(--ink); }
.dropdown-item .tile { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; font-weight: 600; }
.dropdown-item small { display: block; font-size: var(--text-xs); color: var(--ink-3); }
.dropdown-item.current { background: var(--sand-100); color: var(--ink); font-weight: 500; }
.dropdown-sep { height: 1px; margin: 6px 0; background: var(--line); }
.dropdown-head { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); }

.kv { display: grid; gap: 12px; margin: 0; }
.kv div { display: grid; gap: 2px; }
.kv dt { font-size: var(--text-xs); color: var(--ink-3); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.kv dd { margin: 0; font-size: var(--text-base); color: var(--ink); word-break: break-word; }

.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--text-sm); background: var(--sand-50); }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; font-size: var(--text-base); color: var(--ink-2); }
.checklist .state { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); font-size: 11px; font-weight: 600; color: var(--ink-3); }
.checklist .state.done { background: var(--success-bg); border-color: #D2E1BF; color: var(--success); }
.checklist strong { display: block; color: var(--ink); font-weight: 500; }

.link { color: var(--ochre-700); font-weight: 500; text-decoration: underline; text-decoration-color: var(--sand); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--ochre); }
.table a.row-link { color: var(--ink); font-weight: 500; }
.table a.row-link:hover { color: var(--ochre-700); }
.table .select { height: 32px; font-size: var(--text-sm); width: auto; padding-right: 30px; }
.inline-form { display: inline-flex; margin: 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stack { display: grid; gap: 16px; align-content: start; }
.row { display: flex; align-items: center; gap: 8px; }
.danger-text { color: var(--danger); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #EFC8BA; }
.btn-danger:hover { background: var(--danger-bg); }

/* --------------------------------------------------------------------------
   Auth screens
   -------------------------------------------------------------------------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-panel { display: flex; flex-direction: column; padding: 32px 48px; }
.auth-form { width: 100%; max-width: 400px; margin: auto; display: grid; gap: 18px; padding: 40px 0; }
.auth-form h1 { font-size: var(--text-xl); letter-spacing: -0.025em; }
.auth-form h1 .serif { color: var(--ochre-700); font-size: 1.15em; }
.auth-form > p { margin-top: -8px; color: var(--ink-3); }
.auth-form .btn { width: 100%; }
.auth-foot { font-size: var(--text-sm); color: var(--ink-3); text-align: center; }
.auth-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 24px; padding: 48px; background: var(--cream); border-left: 1px solid #F1E39A; }
.auth-aside::before { content: ""; position: absolute; top: -80px; right: -80px; width: 320px; height: 320px; border-radius: 50%; border: 64px solid var(--apricot); opacity: .55; }
.auth-aside blockquote { position: relative; margin: 0; font-family: var(--font-serif); font-size: var(--text-2xl); line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
.auth-aside figcaption { position: relative; font-size: var(--text-sm); color: var(--ochre-700); }
.auth-aside .card { position: relative; max-width: 360px; }

/* --------------------------------------------------------------------------
   Inbox
   -------------------------------------------------------------------------- */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr) 300px; height: calc(100vh - 68px); border-top: 0; }
.inbox.no-side { grid-template-columns: 340px minmax(0, 1fr); }
.back-mobile { display: none; }
.inbox-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.inbox-list-head { display: grid; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.inbox-list-head .segmented { display: flex; }
.inbox-list-head .segmented a { flex: 1; justify-content: center; padding: 0 6px; }
.inbox-items { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.inbox-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); transition: background .15s; }
.inbox-item:hover { background: var(--sand-50); }
.inbox-item.active { background: var(--cream-50); box-shadow: inset 3px 0 0 var(--ochre); }
.inbox-item .list-main strong { justify-content: space-between; }
.inbox-item time { font-size: var(--text-xs); color: var(--ink-3); font-weight: 400; flex: none; }
.inbox-item .meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.unread { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--apricot); color: var(--ink); font-size: 11px; font-weight: 600; }

.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #F6F1E4; }
.thread-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.thread-head > div:not(.row) { flex: 1 1 180px; min-width: 0; }
.thread-head strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head .row { flex: none; flex-wrap: wrap; }
.thread-head strong { display: block; font-size: var(--text-base); }
.thread-head small { display: block; font-size: var(--text-xs); color: var(--ink-3); }
.thread-head .row { margin-left: auto; }
.thread-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 24px clamp(16px, 4vw, 48px); }
.thread-body .chat-day { margin: 10px 0; }
.thread-body .bubble { max-width: min(560px, 78%); font-size: var(--text-base); }
.thread-body .bubble.ai { background: var(--cream); }
.thread-body .bubble.agent { background: var(--apricot-100); }
.thread-body .bubble.system { align-self: center; max-width: 90%; background: rgba(255, 255, 255, .7); color: var(--ink-3); font-size: var(--text-sm); text-align: center; box-shadow: none; }
.bubble-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; color: var(--ink-3); }
.bubble-meta .failed { color: var(--danger); font-weight: 500; }
.bubble-sender { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 600; color: var(--ochre-700); }
.thread-banner { margin: 0 20px; }
.composer { display: grid; gap: 10px; padding: 14px 20px 18px; background: var(--surface); border-top: 1px solid var(--line); }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.composer .textarea { min-height: 44px; max-height: 160px; height: 44px; }
.composer-note { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); color: var(--ink-3); }

.inbox-side { overflow-y: auto; padding: 20px; display: grid; gap: 16px; align-content: start; background: var(--sand-50); border-left: 1px solid var(--line); }
.inbox-side .card-body { padding: 16px; }
.inbox-side .card-head { padding: 14px 16px; }
.inbox-empty { display: grid; place-items: center; height: 100%; }

/* Assistant playground */
.playground { display: flex; flex-direction: column; height: 560px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: #F6F1E4; box-shadow: var(--shadow-sm); }
.playground .thread-body { padding: 16px; }
.playground .thread-body .bubble { max-width: 85%; font-size: var(--text-sm); }
.playground .composer { padding: 12px; }
.playground-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.playground-actions .badge { font-size: 11px; }

/* Analytics */
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; align-items: end; height: 140px; }
.hours span { display: block; border-radius: 4px 4px 2px 2px; background: var(--ochre); min-height: 3px; }
.hours-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: var(--text-xs); color: var(--ink-3); }

@media (max-width: 1280px) {
    .inbox { grid-template-columns: 300px minmax(0, 1fr); }
    .inbox-side { display: none; }
}
@media (max-width: 1024px) {
    .settings-section { grid-template-columns: 1fr; gap: 16px; }
    .auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .form-grid { grid-template-columns: 1fr; }
    .auth-panel { padding: 24px 16px; }
    .toolbar .input-group { width: 100%; }
    .inbox { grid-template-columns: 1fr; height: auto; min-height: calc(100vh - 68px); }
    .inbox.has-thread .inbox-list { display: none; }
    .inbox:not(.has-thread) .thread { display: none; }
    .thread { min-height: calc(100vh - 68px); }
    .thread-head .row .btn-label { display: none; }
    .back-mobile { display: inline-flex; }
    .inbox.no-side { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-2-even { grid-template-columns: 1fr; }
    .topbar .input-group { width: 260px; }
}

@media (max-width: 1024px) {
    :root { --text-4xl: 54px; --text-3xl: 40px; }
    .hero-grid, .split { grid-template-columns: 1fr; gap: 56px; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .pricing { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; }
    .cta-box { grid-template-columns: 1fr; }
    .cta-actions { justify-content: flex-start; }
    .footer-grid { grid-template-columns: 1fr 1fr; }

    .app { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
    .app.nav-open .sidebar { transform: none; }
    .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(34, 29, 19, .3); }
    .sidebar-toggle { display: inline-flex; }
}

@media (max-width: 760px) {
    :root { --text-4xl: 42px; --text-3xl: 32px; --text-2xl: 28px; }
    .container { padding: 0 16px; }
    .site-links, .site-actions .btn-ghost { display: none; }
    .site-menu-btn { display: inline-flex; }
    .site-nav.menu-open .site-links { display: grid; position: absolute; top: 68px; left: 0; right: 0; padding: 12px 16px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
    .hero { padding: 48px 0 72px; }
    .hero-form { flex-direction: column; }
    .stage { justify-content: center; padding-right: 0; }
    .phone { width: 300px; }
    .float-card.lead { left: 0; bottom: -10px; }
    .float-card.stat { display: none; }
    .proof .container { grid-template-columns: 1fr 1fr; }
    .proof-item { border-left: 0; padding: 22px 0; }
    .proof-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .section { padding: 80px 0; }
    .feature-grid, .steps { grid-template-columns: 1fr; }
    .showcase { padding: 16px; }
    .cta-box { padding: 32px 24px; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; }

    .topbar { padding: 0 16px; }
    .topbar .input-group, .hide-sm { display: none; }
    .page { padding: 20px 16px; }
    .stats { grid-template-columns: 1fr; }
    .card-head, .card-body, .list-item { padding-left: 16px; padding-right: 16px; }
    .card-head { flex-wrap: wrap; }
    .table th, .table td { padding-left: 16px; padding-right: 16px; }
}

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