/* ============================================================
   ia.gratis — grayscale design system
   ============================================================ */

:root {
    /* Surfaces — warm grayscale, light theme */
    --bg:           #FAFAF7;
    --bg-soft:      #F4F4F1;
    --surface:      #FFFFFF;
    --surface-2:    #F4F4F1;
    --elevated:     #ECECE7;
    --border:       #E2E2DC;
    --border-soft:  #ECECE7;
    --border-bright:#C6C6BD;

    /* Text */
    --text:         #18181B;
    --text-2:       #44444A;
    --text-3:       #71717A;
    --text-4:       #A1A1A6;

    /* Accent (single neutral, near-black) */
    --accent:       #18181B;
    --accent-soft:  #27272A;

    /* Status colors — muted */
    --emerald:      #15803D;
    --rose:         #B91C1C;
    --amber:        #B45309;

    /* Typography */
    --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Effects */
    --shadow-sm:    0 1px 2px rgba(15, 15, 15, 0.04);
    --shadow-card:  0 1px 3px rgba(15, 15, 15, 0.05), 0 4px 12px rgba(15, 15, 15, 0.04);
    --shadow-lift:  0 12px 32px rgba(15, 15, 15, 0.08), 0 2px 6px rgba(15, 15, 15, 0.04);

    /* Radius */
    --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;

    /* Layout */
    --container: 1200px;
    --gutter: 24px;
}

/* Reset / base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1 0 auto; }
img, video, svg { display: block; max-width: 100%; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--text); }
::selection { background: var(--accent); color: var(--bg); }

/* Layout */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section-tight { padding: clamp(32px, 4vw, 56px) 0; }
.center-text { text-align: center; }

/* Typography */
h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin: 0;
    color: var(--text);
}
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); font-weight: 600; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.0625rem; font-family: var(--font-body); font-weight: 600; }
p { margin: 0 0 1em; color: var(--text-2); }
.lead { font-size: clamp(1rem, 1.3vw, 1.125rem); color: var(--text-2); line-height: 1.55; }
.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-3);
}
.mono { font-family: var(--font-mono); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}
.btn-lg { padding: 14px 24px; font-size: 14.5px; border-radius: var(--r-md); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    color: var(--bg);
    background: #000;
    border-color: #000;
}
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-bright); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

/* Navbar */
.nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(250, 250, 247, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-soft);
}
.nav-inner { display: flex; align-items: center; height: 60px; gap: 24px; }
.brand {
    display: inline-flex;
    align-items: baseline;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--text);
    line-height: 1;
}
.brand .sep {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    margin: 0 4px 4px 4px;
    transform: translateY(0);
    flex-shrink: 0;
}
.brand .ia, .brand .tld { color: var(--text); }
.brand:hover { color: var(--text); }
.brand:hover .sep { background: var(--emerald); }
.nav-links { display: flex; gap: 2px; align-items: center; margin-left: auto; }
.nav-links a, .nav-links .nav-button {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 12px;
    font-size: 14px;
    color: var(--text-2);
    border-radius: var(--r-md);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.nav-links a:hover, .nav-links .nav-button:hover { color: var(--text); background: var(--surface-2); }
.nav-links .active { color: var(--text); }

/* Dropdown */
.menu { position: relative; }
.menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 320px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lift);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .12s ease, transform .12s ease, visibility .12s;
}
.menu.open .menu-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.menu-grid.menu-grid-1 { grid-template-columns: 1fr; }
.menu-section-label {
    grid-column: 1 / -1;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 10px 8px 4px;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 13.5px;
}
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item .menu-icon {
    width: 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-2);
    flex-shrink: 0;
}
.menu-divider { height: 1px; background: var(--border-soft); margin: 6px 0; grid-column: 1/-1; }
.menu-footer {
    grid-column: 1 / -1;
    padding: 10px;
    color: var(--text);
    font-weight: 500;
    font-size: 13.5px;
    border-radius: var(--r-sm);
}
.menu-footer:hover { background: var(--surface-2); }

.lang-trigger {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.lang-panel { min-width: 160px; }
.lang-panel .menu-item { padding: 8px 10px; font-size: 13px; }

/* Hero — tight workspace style */
.hero {
    position: relative;
    padding: 36px 0 48px;
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--border-soft);
}
.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 30% at 50% 0%, rgba(0,0,0,0.035) 0%, transparent 60%);
    z-index: -1;
}
.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 60% 40% at 50% 30%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 40% at 50% 30%, #000 0%, transparent 70%);
}
.hero h1 {
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    max-width: none;
    margin: 0 auto 6px;
    line-height: 1.15;
}
.hero .lead {
    font-size: 14.5px;
    color: var(--text-3);
    max-width: 56ch;
    margin: 0 auto 22px;
    line-height: 1.5;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    margin-bottom: 14px;
}
.hero-eyebrow .pulse {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 0 0 rgba(21,128,61,0.4);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(21,128,61,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(21,128,61,0); }
}

/* Hero live demo — focal point */
.hero-demo {
    max-width: 760px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 6px;
    box-shadow: var(--shadow-lift);
    text-align: left;
}
.hero-demo-tabs {
    display: flex;
    gap: 2px;
    padding: 4px;
    background: var(--surface-2);
    border-radius: 14px;
    margin-bottom: 6px;
}
.hero-demo-tab {
    flex: 1;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-3);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .12s, color .12s;
}
.hero-demo-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.hero-demo-tab:hover:not(.active) { color: var(--text-2); }
.hero-demo-pane { padding: 14px; }
.hero-demo-input {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.hero-demo-input input, .hero-demo-input textarea, .hero-demo-input select {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 11px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}
.hero-demo-input select { flex: 0 0 auto; min-width: 130px; }
.hero-demo-input input:focus, .hero-demo-input textarea:focus, .hero-demo-input select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(24,24,27,0.08);
}
.hero-demo-suggestions {
    display: flex; flex-wrap: wrap; gap: 5px;
    margin-top: 10px;
    align-items: center;
}
.hero-demo-suggestions .lbl { font-size: 11px; color: var(--text-3); margin-right: 2px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.hero-demo-suggestions button {
    padding: 4px 9px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-pill);
    color: var(--text-2);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}
.hero-demo-suggestions button:hover { color: var(--text); border-color: var(--border-bright); }
.hero-demo-output { margin-top: 12px; }
.hero-demo-output:empty { display: none; }
.hero-demo-output img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: var(--r-md);
    border: 1px solid var(--border-soft);
}
.hero-demo-output .skeleton {
    aspect-ratio: 4/3;
    background: linear-gradient(105deg,
        var(--surface-2) 35%,
        var(--elevated) 50%,
        var(--surface-2) 65%);
    background-size: 200% 100%;
    border-radius: var(--r-md);
    animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.hero-demo-output .err {
    padding: 10px 12px;
    background: rgba(185, 28, 28, 0.06);
    border: 1px solid rgba(185, 28, 28, 0.2);
    border-radius: var(--r-md);
    color: var(--rose);
    font-size: 13px;
}

.hero-trust {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
    color: var(--text-4);
    font-size: 11px;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}
.hero-trust span { display: inline-flex; align-items: center; gap: 5px; }
.hero-trust svg { color: var(--emerald); }

/* Tool grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 12px;
}

.tool-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    min-height: 150px;
    overflow: hidden;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tool-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-bright);
    color: inherit;
    box-shadow: var(--shadow-lift);
}
.tool-card .tool-card-icon {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    margin-bottom: 14px;
    transition: background .15s, color .15s;
}
.tool-card:hover .tool-card-icon { background: var(--accent); color: var(--bg); }
.tool-card h3 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
    font-family: var(--font-body);
    color: var(--text);
}
.tool-card p {
    color: var(--text-3);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    flex: 1;
}
.tool-card .tool-card-meta {
    display: flex; gap: 4px;
    margin-top: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
    color: var(--text-3);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-pill);
}
.pill.pill-success { color: var(--emerald); border-color: rgba(21,128,61,0.2); background: rgba(21,128,61,0.05); }
.pill.pill-warm { color: var(--amber); border-color: rgba(180,83,9,0.2); background: rgba(180,83,9,0.05); }

/* Section heading */
.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.section-head h2 { max-width: 16ch; }
.section-head p { max-width: 50ch; margin: 6px 0 0; }
.section-cat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-3);
    font-weight: 500;
    margin: 40px 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-cat-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-soft);
    margin-left: 8px;
}

/* Why grid */
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1px;
    background: var(--border-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.why-cell { background: var(--surface); padding: 24px; }
.why-cell .why-num {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}
.why-cell h4 {
    font-family: var(--font-body);
    font-size: 15.5px;
    font-weight: 600;
    margin: 0 0 6px;
}
.why-cell p { color: var(--text-3); font-size: 13.5px; margin: 0; line-height: 1.5; }

/* Search keyword cloud */
.kw-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-cloud a {
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-pill);
    color: var(--text-2);
    font-size: 12.5px;
    font-family: var(--font-mono);
    transition: all .12s;
}
.kw-cloud a:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-bright); }

/* Final CTA */
.cta-final {
    position: relative;
    padding: clamp(48px, 7vw, 80px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    text-align: center;
    box-shadow: var(--shadow-card);
}
.cta-final h2 { margin-bottom: 10px; }
.cta-final p { max-width: 50ch; margin: 0 auto 24px; }

/* Footer */
.foot {
    border-top: 1px solid var(--border-soft);
    padding: 56px 0 32px;
    background: var(--bg-soft);
    margin-top: 64px;
}
.foot-grid {
    display: grid;
    grid-template-columns: 2fr repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}
@media (max-width: 880px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-grid h6 {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-3);
    margin: 0 0 14px;
    font-weight: 500;
}
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid ul li { margin-bottom: 6px; }
.foot-grid ul a { color: var(--text-2); font-size: 13.5px; }
.foot-grid ul a:hover { color: var(--text); }
.foot-bottom {
    border-top: 1px solid var(--border-soft);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-3);
    font-size: 12.5px;
    font-family: var(--font-mono);
}

/* Tool page */
.tool-hero {
    padding: 48px 0 24px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg);
}
.tool-hero .breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-3);
    margin-bottom: 16px;
    font-family: var(--font-mono);
}
.tool-hero .breadcrumb a:hover { color: var(--text-2); }
.tool-hero h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-bottom: 12px; max-width: 26ch; }
.tool-hero .lead { max-width: 56ch; margin-bottom: 0; }
.tool-hero .tool-hero-meta { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }

.tool-page {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 32px;
    padding: 40px 0 64px;
    align-items: start;
}
@media (max-width: 980px) { .tool-page { grid-template-columns: 1fr; } }

.tool-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 28px;
    box-shadow: var(--shadow-card);
}
.tool-widget label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.tool-widget input, .tool-widget select, .tool-widget textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 11px 13px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}
.tool-widget textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.tool-widget input:focus, .tool-widget select:focus, .tool-widget textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(24,24,27,0.08);
}
.tool-widget .form-row { margin-bottom: 14px; }
.tool-widget .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tool-widget .form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) {
    .tool-widget .form-row-2, .tool-widget .form-row-3 { grid-template-columns: 1fr; }
}
.tool-widget .input-help { font-size: 12px; color: var(--text-3); margin-top: 5px; }

/* Style preset chips */
.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-chip {
    padding: 7px 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    color: var(--text-2);
    font-size: 12.5px;
    cursor: pointer;
    font-family: inherit;
    transition: all .12s;
}
.preset-chip:hover { color: var(--text); border-color: var(--border-bright); }
.preset-chip.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* Advanced options collapse */
.adv-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    background: none;
    border: none;
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
}
.adv-toggle:hover { color: var(--text-2); }
.adv-section { display: none; padding-top: 8px; border-top: 1px solid var(--border-soft); margin-top: 8px; }
.adv-section.open { display: block; }

/* Tool output */
.tool-out {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border-soft);
}
.tool-out:empty { display: none; padding: 0; border: none; }
.tool-out .err {
    padding: 12px 14px;
    background: rgba(185, 28, 28, 0.06);
    border: 1px solid rgba(185, 28, 28, 0.2);
    border-radius: var(--r-md);
    color: var(--rose);
    font-size: 13px;
}
.tool-out .loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 0;
    color: var(--text-3);
    font-size: 13.5px;
}
.tool-out .skeleton-img {
    aspect-ratio: 4/3;
    background: linear-gradient(105deg, var(--surface-2) 35%, var(--elevated) 50%, var(--surface-2) 65%);
    background-size: 200% 100%;
    border-radius: var(--r-md);
    animation: shimmer 1.4s ease-in-out infinite;
    width: 100%;
    max-width: 480px;
}
.tool-out img, .tool-out video {
    width: 100%;
    border-radius: var(--r-md);
    margin-bottom: 12px;
    border: 1px solid var(--border-soft);
}
.tool-out audio { width: 100%; }
.tool-out pre {
    margin: 0;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 600px;
    overflow-y: auto;
}
.tool-out .download-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

/* Tool sidebar */
.tool-aside {
    position: sticky; top: 80px;
    display: flex; flex-direction: column;
    gap: 12px;
}
.aside-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px;
}
.aside-card h4 {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
    font-weight: 500;
    margin: 0 0 12px;
}
.aside-card ul { list-style: none; padding: 0; margin: 0; }
.aside-card ul li { margin-bottom: 2px; }
.aside-card ul a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin: 0 -8px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 13px;
}
.aside-card ul a:hover { color: var(--text); background: var(--surface-2); }
.aside-card .aside-feat {
    display: flex;
    align-items: start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
}
.aside-card .aside-feat svg { color: var(--emerald); flex-shrink: 0; margin-top: 2px; }

/* Chat */
.chat-thread {
    height: 460px;
    overflow-y: auto;
    padding: 8px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-msg { display: flex; gap: 10px; align-items: flex-start; padding: 4px 6px; }
.chat-msg .avatar {
    width: 26px; height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
}
.chat-msg.you .avatar { background: var(--surface-2); color: var(--text-2); }
.chat-msg.bot .avatar { background: var(--accent); color: var(--bg); }
.chat-msg .body {
    color: var(--text);
    font-size: 14px;
    line-height: 1.65;
    flex: 1;
    white-space: pre-wrap;
}
.chat-empty { padding: 40px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input-row textarea { min-height: 44px; max-height: 200px; }

/* Tool index */
.tools-page-hero {
    padding: 64px 0 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-soft);
}
.tools-page-hero h1 { margin-bottom: 12px; }
.tools-page-hero .lead { max-width: 60ch; margin: 0 auto; }

/* Detector result */
.det-score { text-align: center; padding: 24px 8px; }
.det-score .ring {
    width: 140px; height: 140px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: conic-gradient(var(--ring-color, var(--rose)) calc(var(--p, 50) * 1%), var(--border) 0);
    position: relative;
}
.det-score .ring::before { content: ''; position: absolute; inset: 6px; background: var(--surface); border-radius: 50%; }
.det-score .ring span { position: relative; font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--text); }
.det-score .verdict { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 12px; color: var(--text-3); }
.det-reasons { list-style: none; padding: 0; margin: 14px 0 0; }
.det-reasons li {
    padding: 10px 13px;
    background: var(--bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 5px;
    line-height: 1.5;
}

/* Auth pages */
.auth-shell { max-width: 420px; margin: 56px auto 96px; padding: 0 var(--gutter); }
.auth-shell h1 { font-size: 28px; margin-bottom: 8px; }
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 28px;
    margin-top: 22px;
    box-shadow: var(--shadow-card);
}
.auth-card label { display: block; font-size: 13px; color: var(--text-2); margin: 12px 0 6px; }
.auth-card input, .auth-card select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 11px 13px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}
.auth-card input:focus, .auth-card select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(24,24,27,0.08);
}
.auth-card .btn { width: 100%; margin-top: 16px; }
.auth-card .auth-alt { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-3); }
.auth-card .auth-alt a { color: var(--accent); text-decoration: underline; }

/* Pricing */
.price-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 28px;
}
.price-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 28px;
    display: flex;
    flex-direction: column;
}
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.price-card h3 {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 16px;
    font-weight: 500;
}
.price-card .price {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -0.03em;
}
.price-card .price span { font-size: 15px; font-weight: 400; color: var(--text-3); }
.price-card .price-credits { color: var(--text-2); font-size: 14px; margin-bottom: 22px; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 20px; flex: 1; }
.price-card ul li { display: flex; gap: 8px; padding: 5px 0; font-size: 13.5px; color: var(--text-2); }
.price-card ul li svg { color: var(--emerald); flex-shrink: 0; margin-top: 2px; }

/* Mobile nav */
.mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 6px 10px;
    color: var(--text);
    cursor: pointer;
}
@media (max-width: 880px) {
    .mobile-toggle { display: inline-flex; }
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 60px;
        left: 16px; right: 16px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--r-lg);
        padding: 12px;
        box-shadow: var(--shadow-lift);
    }
    .nav-links.open .menu-panel {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: none; padding: 4px;
    }
    .hero-demo-input { flex-direction: column; }
    .hero-demo-input select, .hero-demo-input input { width: 100%; }
    .hero-trust { gap: 12px; font-size: 11px; }
}

/* Legacy fallback for old templates */
.container .row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; align-items: start; padding: 32px 0; }
.col, .col-md-6, .col-md-8, .col-lg-5, .col-lg-6, .col-md-3, .col-md-4 { grid-column: 1 / -1; }
@media (min-width: 880px) {
    .col-md-6, .col-lg-5, .col-lg-6 { grid-column: span 6; }
    .col-md-8 { grid-column: span 8; }
    .col-md-3 { grid-column: span 3; }
    .col-md-4 { grid-column: span 4; }
}
.text-center { text-align: center; }
.text-muted, .text-secondary { color: var(--text-3); }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.p-4 { padding: 24px; } .shadow-sm { box-shadow: var(--shadow-card); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 16px; }
.card-body { padding: 20px; }
.alert { padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert-danger { background: rgba(185,28,28,0.06); border-color: rgba(185,28,28,0.2); color: var(--rose); }
.alert-success { background: rgba(21,128,61,0.06); border-color: rgba(21,128,61,0.2); color: var(--emerald); }
.alert-warning { background: rgba(180,83,9,0.06); border-color: rgba(180,83,9,0.2); color: var(--amber); }
.alert ul { margin: 0; padding-left: 20px; }

.form-control, .form-select {
    width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 11px 13px; color: var(--text); font-family: inherit; font-size: 14px; outline: none;
}
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(24,24,27,0.08); }
.form-label { display: block; font-size: 13px; color: var(--text-2); margin: 12px 0 6px; font-weight: 500; }
.form-text { font-size: 12px; color: var(--text-3); margin-top: 5px; }

.badge { display: inline-flex; align-items: center; padding: 3px 8px; font-size: 11px; font-family: var(--font-mono); border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); }
.bg-success { background: rgba(21,128,61,0.1); color: var(--emerald); }
.bg-danger { background: rgba(185,28,28,0.1); color: var(--rose); }
.bg-warning { background: rgba(180,83,9,0.1); color: var(--amber); }

.btn-success { background: var(--accent); color: var(--bg); border: none; padding: 10px 18px; border-radius: var(--r-md); font-weight: 500; font-size: 14px; cursor: pointer; }
.btn-success:hover { color: var(--bg); background: #000; }
.btn-danger { background: var(--rose); color: #FFF; border: none; padding: 7px 14px; border-radius: var(--r-md); font-weight: 500; font-size: 13px; cursor: pointer; }
.btn-outline-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 7px 14px; border-radius: var(--r-md); font-size: 13px; }
.btn-outline-danger { background: var(--surface); color: var(--rose); border: 1px solid rgba(185,28,28,0.2); padding: 7px 14px; border-radius: var(--r-md); font-size: 13px; }

.d-grid { display: grid; }
.d-grid > .btn, .d-grid > button { width: 100%; }
table { color: var(--text-2); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 8px; text-align: left; border-bottom: 1px solid var(--border-soft); }
.table th { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); font-weight: 500; }
.page-header { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -0.02em; margin: 32px 0 16px; }
hr { border: none; border-top: 1px solid var(--border-soft); margin: 24px 0; }
code { font-family: var(--font-mono); font-size: 13px; padding: 2px 6px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 4px; color: var(--text); }
.h3 { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.h4 { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.captcha { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px; }

/* Model picker */
.model-picker .model-picker-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.model-picker select { flex: 1; min-width: 220px; }
.model-picker .model-info-link { display: none; padding: 8px 10px; color: var(--text-3); font-size: 12px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none; }
.model-hint { font-size: 12.5px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }

/* Share-after-success */
.share-after { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px; padding: 12px 14px; background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: var(--r-md); }
.share-after .share-label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-right: 4px; }
.share-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); color: var(--text-2); font-size: 12.5px; font-weight: 500; cursor: pointer; text-decoration: none; font-family: inherit; transition: all .12s; }
.share-btn:hover { color: var(--text); border-color: var(--border-bright); }
.share-wa:hover { color: #FFF; background: #25D366; border-color: #25D366; }
.share-x:hover { color: var(--bg); background: var(--text); border-color: var(--text); }
.share-fb:hover { color: #FFF; background: #1877F2; border-color: #1877F2; }
.share-tg:hover { color: #FFF; background: #0088CC; border-color: #0088CC; }

/* Quota / upsell card */
.quota-card { padding: 28px; background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%); border: 1px solid var(--accent); border-radius: var(--r-lg); text-align: center; }
.quota-card-icon { width: 48px; height: 48px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--bg); font-size: 22px; }
.quota-card-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.02em; }
.quota-card-body { color: var(--text-2); font-size: 14px; line-height: 1.55; max-width: 50ch; margin: 0 auto 20px; }
.quota-card-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.quota-card-fine { font-size: 12px; color: var(--text-3); margin: 0; font-family: var(--font-mono); letter-spacing: 0.04em; }

/* Per-model landing page */
.model-hero { padding: 56px 0 32px; border-bottom: 1px solid var(--border-soft); background: var(--bg); }
.model-hero .meta-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.model-hero h1 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin: 8px 0 14px; }
.model-strengths { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.model-strengths .pill { padding: 5px 10px; }

/* ============================================================
   Slim tool layout — tool above the fold
   ============================================================ */
.tool-shell { background: var(--bg); }
.tool-shell-head {
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg-soft);
    padding: 10px 0;
}
.breadcrumb-mini {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px;
    color: var(--text-3);
    font-family: var(--font-mono);
}
.breadcrumb-mini a:hover { color: var(--text-2); }
.breadcrumb-mini span:last-child { color: var(--text-2); }

.tool-shell-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    padding: 20px 0 56px;
    align-items: start;
}
@media (max-width: 980px) { .tool-shell-grid { grid-template-columns: 1fr; } }

.tool-widget-prominent { padding: 22px 24px 24px; box-shadow: var(--shadow-card); }
.tool-widget-head { margin-bottom: 18px; }
.tool-widget-title {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    font-family: var(--font-body);
}
.tool-widget-meta { display: flex; gap: 5px; flex-wrap: wrap; }

.tool-seo { padding: 56px 0 80px; border-top: 1px solid var(--border-soft); background: var(--bg-soft); }
.tool-seo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 880px) { .tool-seo-grid { grid-template-columns: 1fr; gap: 24px; } }
.tool-seo h2 { margin-bottom: 16px; font-size: clamp(1.25rem, 2vw, 1.625rem); }
.tool-seo .lead { font-size: 16px; margin-bottom: 12px; }
.tool-seo p { color: var(--text-2); line-height: 1.65; }
.tool-seo-h3 {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
    font-weight: 500;
    margin: 0 0 14px;
}

/* ============================================================
   Chat app layout — like ChatGPT / Claude / duck.ai
   ============================================================ */
.chat-app {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: calc(100vh - 60px);
    max-height: calc(100vh - 60px);
    background: var(--bg);
    overflow: hidden;
}
@media (max-width: 880px) {
    .chat-app { grid-template-columns: 1fr; height: calc(100vh - 60px); }
}

.chat-sidebar {
    background: var(--bg-soft);
    border-right: 1px solid var(--border-soft);
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
@media (max-width: 880px) {
    .chat-sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 0 24px 60px rgba(0,0,0,0.15);
    }
    .chat-sidebar.open { transform: translateX(0); }
}
.chat-newbtn { width: 100%; }

.chat-side-section h6 {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
    font-weight: 500;
    margin: 0 0 8px;
}

.chat-personas { display: flex; flex-direction: column; gap: 2px; }
.persona-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background .12s, color .12s;
}
.persona-btn:hover { background: var(--surface); color: var(--text); }
.persona-btn.active { background: var(--surface); color: var(--text); border-color: var(--border); }
.persona-btn svg { color: var(--text-3); flex-shrink: 0; }

.chat-history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-history-empty { color: var(--text-3); font-size: 12.5px; padding: 6px 10px; }
.chat-history-item {
    display: flex; align-items: center;
    border-radius: var(--r-sm);
    padding: 0;
}
.chat-history-item:hover { background: var(--surface); }
.chat-history-item.active { background: var(--surface); }
.chat-history-pick {
    flex: 1;
    background: transparent; border: none;
    padding: 7px 10px;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-history-item:hover .chat-history-pick { color: var(--text); }
.chat-history-del {
    background: transparent; border: none;
    color: var(--text-3);
    font-size: 16px; line-height: 1;
    padding: 4px 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s;
}
.chat-history-item:hover .chat-history-del { opacity: 1; }
.chat-history-del:hover { color: var(--rose); }

.chat-side-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
}
.chat-side-foot a {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-3);
    font-size: 12.5px;
    font-family: var(--font-mono);
}
.chat-side-foot a:hover { color: var(--text-2); }

/* Main chat area */
.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
}
.chat-toolbar {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg);
    flex-shrink: 0;
}
.chat-toolbar-model { flex: 1; max-width: 480px; }
.chat-toolbar-model .model-picker { margin: 0; }
.chat-toolbar-model .model-picker label { display: none; }
.chat-toolbar-model .model-picker .model-picker-row { gap: 0; }
.chat-toolbar-model .model-picker select {
    border: 1px solid var(--border-soft);
    background: var(--surface);
    font-size: 13px;
    padding: 7px 12px;
    min-width: 200px;
}
.chat-toolbar-model .model-info-link, .chat-toolbar-model .model-hint { display: none !important; }
.chat-toolbar-actions { display: flex; gap: 4px; margin-left: auto; }
.chat-mobile-toggle {
    display: none;
    background: transparent; border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 6px 8px;
    color: var(--text);
    cursor: pointer;
}
@media (max-width: 880px) { .chat-mobile-toggle { display: inline-flex; } }

.chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 20px;
    background: var(--bg);
}
.chat-empty-state {
    max-width: 580px;
    margin: 6vh auto 0;
    text-align: center;
    padding: 24px 16px;
}
.chat-empty-icon {
    width: 56px; height: 56px;
    margin: 0 auto 16px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-2);
}
.chat-empty-state h2 { font-size: 22px; margin-bottom: 8px; letter-spacing: -0.02em; }
.chat-suggestions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 24px;
}
@media (max-width: 600px) { .chat-suggestions { grid-template-columns: 1fr; } }
.chat-suggestions button {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: all .12s;
}
.chat-suggestions button:hover { background: var(--surface-2); border-color: var(--border-bright); }
.chat-suggestions button svg { color: var(--text-3); flex-shrink: 0; }

/* Messages */
.chat-msg {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 780px;
    margin: 0 auto 18px;
    padding: 8px 4px;
}
.chat-msg-avatar {
    width: 28px; height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 10.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-top: 2px;
}
.chat-msg.you .chat-msg-avatar { background: var(--surface-2); color: var(--text-2); }
.chat-msg.bot .chat-msg-avatar { background: var(--accent); color: var(--bg); }
.chat-msg-body { flex: 1; min-width: 0; }
.chat-msg-text {
    color: var(--text);
    font-size: 15px;
    line-height: 1.65;
    word-wrap: break-word;
}
.chat-msg.you .chat-msg-text { color: var(--text); font-weight: 500; }

/* Markdown rendering inside messages */
.chat-msg-text p { margin: 0 0 0.65em; }
.chat-msg-text p:last-child { margin-bottom: 0; }
.chat-msg-text h1, .chat-msg-text h2, .chat-msg-text h3 { font-family: var(--font-display); margin: 0.6em 0 0.3em; }
.chat-msg-text h1 { font-size: 1.4em; }
.chat-msg-text h2 { font-size: 1.2em; }
.chat-msg-text h3 { font-size: 1.07em; }
.chat-msg-text ul, .chat-msg-text ol { padding-left: 1.4em; margin: 0.4em 0; }
.chat-msg-text li { margin-bottom: 0.3em; }
.chat-msg-text code {
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.92em;
    color: var(--text);
}
.chat-msg-text pre {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    margin: 0.7em 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
}
.chat-msg-text pre code { background: none; border: none; padding: 0; }
.chat-msg-text a { color: var(--accent); text-decoration: underline; }
.chat-msg-text strong { font-weight: 600; }
.chat-msg-text blockquote {
    border-left: 3px solid var(--border);
    padding-left: 14px;
    margin: 0.5em 0;
    color: var(--text-2);
}
.chat-msg-text table { border-collapse: collapse; margin: 0.6em 0; font-size: 14px; }
.chat-msg-text th, .chat-msg-text td { border: 1px solid var(--border-soft); padding: 6px 10px; }
.chat-msg-text th { background: var(--surface-2); font-weight: 600; }

.chat-msg-actions {
    display: flex; gap: 4px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity .15s;
}
.chat-msg.bot:hover .chat-msg-actions { opacity: 1; }
.chat-msg-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-3);
    padding: 4px 7px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}
.chat-msg-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-soft); }

/* Typing indicator */
.chat-typing {
    display: inline-flex; gap: 3px;
    padding: 4px 0;
}
.chat-typing span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--text-3);
    animation: typing-bounce 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Composer */
.chat-composer {
    border-top: 1px solid var(--border-soft);
    background: var(--bg);
    padding: 12px 20px 16px;
    flex-shrink: 0;
}
.chat-composer textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 13px 56px 13px 16px;
    color: var(--text);
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.5;
    outline: none;
    resize: none;
    min-height: 48px;
    max-height: 200px;
    transition: border-color .12s, box-shadow .12s;
    max-width: 780px;
    margin: 0 auto;
    display: block;
    box-shadow: var(--shadow-sm);
}
.chat-composer textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(24,24,27,0.08);
}
.chat-composer-actions {
    max-width: 780px;
    margin: 6px auto 0;
    display: flex; align-items: center; gap: 8px;
}
.chat-hint {
    flex: 1;
    color: var(--text-3);
    font-size: 11.5px;
    font-family: var(--font-mono);
}
.kbd {
    display: inline-block;
    padding: 1px 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 3px;
    font-size: 10.5px;
}
.chat-send-btn { padding: 8px 14px; }
.chat-stop-btn { padding: 6px 12px; font-size: 12px; }

/* Custom-persona modal */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    display: grid; place-items: center;
    z-index: 200;
    backdrop-filter: blur(6px);
}
.modal-overlay[hidden] { display: none; }
.modal-card {
    width: min(520px, calc(100% - 32px));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 24px;
    box-shadow: var(--shadow-lift);
}
.modal-card h3 { font-size: 18px; margin-bottom: 6px; }
.modal-card textarea {
    width: 100%; margin-top: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    color: var(--text);
}
.modal-card textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(24,24,27,0.08); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Pricing page */
.pricing-hero {
    padding: 64px 0 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-soft);
}
.pricing-toggle {
    display: inline-flex;
    margin-top: 24px;
    padding: 4px;
    background: var(--surface-2);
    border-radius: var(--r-pill);
    gap: 2px;
}
.pricing-toggle-btn {
    background: none; border: none;
    padding: 9px 18px;
    font-size: 13.5px;
    color: var(--text-3);
    border-radius: var(--r-pill);
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .12s, color .12s;
}
.pricing-toggle-btn:hover:not(.active) { color: var(--text-2); }
.pricing-toggle-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.price-card {
    position: relative;
}
.price-card .price-badge {
    position: absolute;
    top: -10px; left: 50%;
    transform: translateX(-50%);
    padding: 4px 14px;
    background: var(--accent);
    color: var(--bg);
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--r-pill);
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Token-cost reference grid */
.token-costs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1px;
    background: var(--border-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.token-cost-cell { background: var(--surface); padding: 18px 20px; }
.token-cost-cell h6 {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
    font-weight: 500;
    margin: 0 0 12px;
}
.token-cost-cell ul { list-style: none; padding: 0; margin: 0; }
.token-cost-cell li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-2);
    border-bottom: 1px solid var(--border-soft);
}
.token-cost-cell li:last-child { border-bottom: none; }
.token-cost-cell li b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }

/* Override display: grid when hidden attribute is set */
.pricing-pane[hidden] { display: none !important; }

/* Searchable model picker (combobox) */
.model-picker { position: relative; }
.combo-trigger {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 11px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: border-color .12s, box-shadow .12s;
}
.combo-trigger:hover { border-color: var(--border-bright); }
.combo-trigger:focus, .combo-trigger[aria-expanded="true"] {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(24,24,27,0.08);
}
.combo-current {
    display: flex; align-items: baseline; gap: 8px;
    min-width: 0; flex: 1;
    overflow: hidden;
}
.combo-label { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-meta { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-meta-price.free { color: var(--emerald); }
.combo-meta-price.paid { color: var(--text-2); font-family: var(--font-mono); font-size: 12.5px; }
.combo-chev { color: var(--text-3); flex-shrink: 0; }
.combo-trigger[aria-expanded="true"] .combo-chev { transform: rotate(180deg); }

.combo-panel {
    position: absolute;
    top: calc(100% - 4px);
    left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lift);
    z-index: 50;
    max-height: 480px;
    display: flex;
    flex-direction: column;
}
.combo-panel[hidden] { display: none; }
.combo-search-row {
    border-bottom: 1px solid var(--border-soft);
    padding: 10px;
    background: var(--bg-soft);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.combo-search-row input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    outline: none;
}
.combo-search-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(24,24,27,0.08);
}
.combo-list {
    overflow-y: auto;
    padding: 6px;
    flex: 1;
}
.combo-group {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px 4px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-3);
    font-weight: 500;
}
.combo-group-n {
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
}
.combo-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 12px;
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    padding: 8px 10px;
    margin-bottom: 1px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background .1s ease, border-color .1s ease;
}
.combo-row:hover { background: var(--surface-2); }
.combo-row.selected {
    background: var(--surface-2);
    border-color: var(--border);
}
.combo-row.locked .combo-row-label { color: var(--text-2); }
.combo-row-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
    grid-column: 1;
    grid-row: 1;
    overflow: hidden;
}
.combo-row-label { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-row-vendor { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.combo-row-tail {
    grid-column: 2;
    grid-row: 1;
    display: flex; align-items: center;
}
.combo-row-price {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    border: 1px solid var(--border-soft);
    color: var(--text-3);
    background: var(--bg);
}
.combo-row-price.free {
    color: var(--emerald);
    border-color: rgba(21,128,61,0.2);
    background: rgba(21,128,61,0.05);
}
.combo-row-desc {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 12.5px;
    color: var(--text-3);
    margin-top: 2px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.combo-empty {
    padding: 24px 12px;
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
}

/* Hide chat-toolbar's old-style label since combobox is its own thing */
.chat-toolbar-model .model-picker label { display: none; }
.chat-toolbar-model .combo-trigger { padding: 7px 12px; font-size: 13px; }
.chat-toolbar-model .combo-meta { display: none; }
.chat-toolbar-model .model-hint { display: none; }

/* Catalog page — counters + models by vendor */
.catalog-counters {
    display: flex; justify-content: center; gap: 28px;
    margin-top: 28px; flex-wrap: wrap;
}
.catalog-counter {
    display: flex; flex-direction: column; align-items: center;
    text-decoration: none; color: var(--text);
    padding: 12px 22px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    min-width: 110px;
    transition: border-color .12s, transform .12s;
}
a.catalog-counter:hover { border-color: var(--border-bright); transform: translateY(-1px); color: var(--text); }
.catalog-counter-n {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
}
.catalog-counter-label {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-3);
    margin-top: 6px;
}

.catalog-search {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 14px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    min-width: 220px;
    transition: border-color .12s, box-shadow .12s;
}
.catalog-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(24,24,27,0.08); }

.vendor-block { margin-bottom: 32px; }
.vendor-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
    display: flex; align-items: baseline; gap: 8px;
    letter-spacing: -0.01em;
}
.vendor-count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
    background: var(--surface);
    padding: 1px 8px;
    border-radius: var(--r-pill);
    border: 1px solid var(--border-soft);
    font-weight: 500;
}

.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.model-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    display: flex; flex-direction: column;
    transition: border-color .12s, box-shadow .12s;
}
.model-card:hover {
    border-color: var(--border-bright);
    box-shadow: var(--shadow-sm);
    color: inherit;
}
.model-card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.model-card-label {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.model-card-desc {
    color: var(--text-3);
    font-size: 12.5px;
    line-height: 1.45;
    margin: 0 0 8px;
    flex: 1;
}
.model-card-meta {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin-top: auto;
}
.model-card-meta .pill {
    font-size: 10.5px;
    padding: 2px 7px;
}
