/* ==========================================================================
   Quartil — main stylesheet
   ========================================================================== */

/* ---------- Inter font (self-hosted) ---------- */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: optional;
    src: url("/static/fonts/inter-latin.65850a373e25.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: optional;
    src: url("/static/fonts/inter-latin-ext.01ba6c2a184b.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Design tokens ---------- */

:root {
    /* shadcn/ui — light theme, zinc palette */
    --background: #ffffff;
    --foreground: #09090b;            /* zinc-950 */

    --card: #ffffff;
    --card-foreground: #09090b;

    --popover: #ffffff;
    --popover-foreground: #09090b;

    --primary: #18181b;                /* zinc-900 */
    --primary-foreground: #fafafa;
    --primary-hover: #27272a;          /* zinc-800 */

    --secondary: #f4f4f5;              /* zinc-100 */
    --secondary-foreground: #18181b;

    --muted: #f4f4f5;                  /* zinc-100 */
    --muted-foreground: #71717a;       /* zinc-500 */

    --accent: #f4f4f5;
    --accent-foreground: #18181b;
    --accent-muted: #a1a1aa;           /* zinc-400 */

    --destructive: #ef4444;            /* red-500 */
    --destructive-foreground: #fafafa;

    --border: #e4e4e7;                 /* zinc-200 */
    --border-subtle: #f4f4f5;          /* zinc-100 */
    --input: #e4e4e7;
    --ring: #18181b;

    /* Link */
    --link: #09090b;

    /* Semantic market colors */
    --positive: #16a34a;               /* green-600 */
    --negative: #dc2626;               /* red-600 */

    /* Badge variants — shadcn inline mapping */
    --badge-inactive-bg: #fee2e2;      /* red-100 */
    --badge-inactive-fg: #991b1b;      /* red-800 */
    --badge-active-bg: #dcfce7;        /* green-100 */
    --badge-active-fg: #166534;        /* green-800 */
    --badge-warning-bg: #fef3c7;       /* amber-100 */
    --badge-warning-fg: #854d0e;       /* amber-800 */
    --badge-neutral-bg: #f4f4f5;       /* zinc-100 */
    --badge-neutral-fg: #3f3f46;       /* zinc-700 */

    /* Spacing scale (4px base, Tailwind-style half-steps) */
    --space-0: 0;
    --space-px: 1px;
    --space-0-5: 0.125rem;  /* 2px  */
    --space-1: 0.25rem;     /* 4px  */
    --space-1-5: 0.375rem;  /* 6px  */
    --space-2: 0.5rem;      /* 8px  */
    --space-2-5: 0.625rem;  /* 10px */
    --space-3: 0.75rem;     /* 12px */
    --space-3-5: 0.875rem;  /* 14px */
    --space-4: 1rem;        /* 16px */
    --space-5: 1.25rem;     /* 20px */
    --space-6: 1.5rem;      /* 24px */
    --space-7: 1.75rem;     /* 28px */
    --space-8: 2rem;        /* 32px */
    --space-9: 2.25rem;     /* 36px */
    --space-10: 2.5rem;     /* 40px */
    --space-11: 2.75rem;    /* 44px */
    --space-12: 3rem;       /* 48px */
    --space-14: 3.5rem;     /* 56px */
    --space-16: 4rem;       /* 64px */
    --space-20: 5rem;       /* 80px */

    /* Radius — shadcn default 0.5rem, derived sm/md/lg/xl */
    --radius: 0.5rem;                  /* 8px  */
    --radius-sm: calc(var(--radius) - 4px); /* 4px */
    --radius-md: calc(var(--radius) - 2px); /* 6px */
    --radius-lg: var(--radius);             /* 8px */
    --radius-xl: calc(var(--radius) + 4px); /* 12px */

    /* Shadows — Tailwind canonical */
    --shadow-xs: 0 1px 1px 0 rgb(0 0 0 / 0.04);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Dark code panel */
    --code-dark-bg: #141414;
    --code-dark-bg-header: #1c1c1c;
    --code-dark-text: #d4d4d8;
    --code-dark-muted: #6c757d;
    --code-dark-border: #343a40;
    --code-dark-hover: rgba(255,255,255,0.08);

    /* Focus — shadcn focus-visible: 2px ring, primary color, 2px offset */
    --focus-ring: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);

    /* Z-index */
    --z-tooltip: 50;
    --z-header: 100;
    --z-dropdown: 200;
    --z-banner: 300;
    --z-skip: 1000;
}

/* ---------- Reset & base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    font-variant-numeric: tabular-nums;
    line-height: 1.6;
    color: var(--foreground);
    background: var(--background);
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Global focus styles ---------- */

:focus-visible {
    outline: 2px solid var(--foreground);
    outline-offset: 2px;
}

/* ---------- Typography ---------- */

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-2);
}

h2 {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--space-2);
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-1-5);
}

p {
    margin-bottom: var(--space-3);
}

small {
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

/* ---------- Layout ---------- */

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--space-8);
}

main.container {
    padding-top: var(--space-8);
    padding-bottom: var(--space-12);
    min-height: calc(100vh - 200px);
}

/* ---------- Skip link ---------- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: var(--z-skip);
    background: var(--background);
    color: var(--foreground);
    padding: var(--space-3) var(--space-6);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid var(--foreground);
    border-radius: 4px;
}

.skip-link:focus-visible {
    position: fixed;
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    overflow: visible;
    outline: none;
}

/* ---------- Visually hidden (sr-only) ---------- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Anchor offset for sticky header ---------- */

[id] {
    scroll-margin-top: 5rem;
}

/* ---------- Navigation ---------- */

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--background);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    font-size: 1.05rem;
    color: var(--foreground);
    min-width: 128px;
}

.nav-logo:hover {
    text-decoration: none;
}

.nav-logo-img {
    display: block;
    height: 36px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: var(--space-6);
}

.nav-links a {
    color: var(--secondary-foreground);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--foreground);
    text-decoration: none;
}

/* ---------- Nav mega menu ---------- */

.nav-dropdown-wrap {
    position: relative;
    display: inline-flex;
}

.nav-link-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: none;
    border: none;
    color: var(--secondary-foreground);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.nav-link-btn:hover,
.nav-link-btn.active {
    color: var(--foreground);
}

.nav-megamenu::before {
    content: "";
    position: absolute;
    top: -1rem;
    left: 0;
    right: 0;
    height: 1rem;
}

.nav-megamenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: var(--space-2);
    background: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: var(--z-dropdown);
    min-width: 560px;
    padding: var(--space-2);
}

.megamenu-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: var(--space-1);
}

.megamenu-col {
    padding: var(--space-2);
    display: flex;
    flex-direction: column;
    gap: var(--space-0-5);
}

.megamenu-col-title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    padding: var(--space-1) var(--space-2);
    margin-bottom: var(--space-1);
}

.megamenu-col a {
    display: flex;
    align-items: center;
    padding: var(--space-1-5) var(--space-2);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--foreground);
    border-radius: var(--radius-sm);
    line-height: 1.3;
}

.megamenu-col a:hover {
    background: var(--accent);
    color: var(--accent-foreground);
    text-decoration: none;
}

.megamenu-col-more {
    margin-top: var(--space-1);
    font-size: 0.8125rem !important;
    color: var(--muted-foreground) !important;
}

.megamenu-col-more:hover {
    color: var(--foreground) !important;
}

.nav-mcp {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1-5);
    font-weight: 500;
}

.nav-mcp-icon {
    color: var(--muted-foreground);
    flex-shrink: 0;
}

.nav-mcp:hover .nav-mcp-icon {
    color: var(--foreground);
}

.nav-search-icon {
    display: flex;
    align-items: center;
    color: var(--muted-foreground);
}

.nav-search-icon:hover {
    color: var(--foreground);
    text-decoration: none;
}

.nav-links a.active {
    color: var(--foreground);
    border-bottom: 2px solid var(--foreground);
    padding-bottom: var(--space-0-5);
}

/* ---------- Search ---------- */

/* ---------- Nav account dropdown ---------- */

.nav-account {
    position: relative;
    display: inline-flex;
}

.nav-account-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1-5);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    height: 2rem;
    padding: 0 var(--space-3);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--foreground);
    cursor: pointer;
    box-shadow: var(--shadow-xs);
}

.nav-account-btn:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

/* ---------- Dropdown menu (shadcn DropdownMenu) ---------- */

.dropdown-menu,
.nav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-1-5);
    min-width: 180px;
    background: var(--popover);
    color: var(--popover-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-1);
    z-index: var(--z-dropdown);
}

.dropdown-menu-item,
.nav-dropdown > a,
.nav-dropdown > button {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-1-5) var(--space-2);
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--foreground);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    line-height: 1.4;
}

.dropdown-menu-item:hover,
.nav-dropdown > a:hover,
.nav-dropdown > button:hover {
    background: var(--accent);
    color: var(--accent-foreground);
    text-decoration: none;
}

.dropdown-menu-label {
    padding: var(--space-1-5) var(--space-2) var(--space-1);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.dropdown-menu-separator,
.nav-dropdown hr {
    height: 1px;
    margin: var(--space-1) calc(-1 * var(--space-1));
    background: var(--border);
    border: 0;
}

[x-cloak] {
    display: none !important;
}

/* ---------- Hamburger + mobile menu ---------- */

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--foreground);
    cursor: pointer;
    padding: var(--space-1);
    margin-left: var(--space-2);
}

.nav-desktop-only {
    /* visible by default, hidden on mobile via media query */
}

.nav-mobile-menu {
    border-top: 1px solid var(--border);
    background: var(--background);
    padding: var(--space-4) var(--space-8) var(--space-6);
}

.nav-mobile-section {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.nav-mobile-section:last-child {
    border-bottom: none;
}

.nav-mobile-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-foreground);
    margin-bottom: var(--space-1-5);
}

.nav-mobile-section a {
    display: block;
    padding: var(--space-1-5) 0;
    font-size: 0.9rem;
    color: var(--secondary-foreground);
}

.nav-mobile-section a:hover {
    color: var(--foreground);
    text-decoration: none;
}

.nav-mobile-auth {
    padding-top: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* ---------- Nav auth ---------- */

.nav-auth {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: var(--space-2);
}

/* ---------- Auth forms ---------- */

.auth-container {
    max-width: 480px;
    margin: var(--space-8) auto;
}

.auth-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-8);
    background: var(--background);
}

.auth-title {
    font-size: 1.5rem;
    margin-bottom: var(--space-1);
}

.auth-form {
    margin-top: var(--space-6);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.auth-benefits {
    margin-top: var(--space-6);
    padding: var(--space-5);
    background: var(--muted);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.auth-benefits h3 {
    font-size: 0.85rem;
    margin-bottom: var(--space-2);
}

.auth-benefits ul {
    list-style: none;
    padding: 0;
}

.auth-benefits ul li {
    padding: var(--space-1) 0;
    color: var(--secondary-foreground);
}

.auth-benefits ul li::before {
    content: "\2713  ";
    color: var(--positive);
    font-weight: 600;
}

/* Social auth buttons */

.social-auth {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.btn.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2-5);
    width: 100%;
    padding: var(--space-2-5) var(--space-4);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--input);
    background: var(--background);
    color: var(--foreground);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.btn.btn-social:hover {
    background: var(--muted);
    border-color: var(--accent-muted);
    text-decoration: none;
    color: var(--foreground);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-3) 0;
    color: var(--muted-foreground);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--secondary-foreground);
    margin-bottom: var(--space-1);
}

.form-input {
    display: flex;
    width: 100%;
    height: 2.25rem;               /* h-9 */
    padding: 0 var(--space-3);
    font-size: 0.875rem;
    line-height: 1.25;
    color: var(--foreground);
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--background);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea.form-input {
    height: auto;
    padding: var(--space-2) var(--space-3);
    line-height: 1.5;
}

.form-input::placeholder {
    color: var(--muted-foreground);
}

.form-input:focus-visible {
    outline: none;
    border-color: var(--ring);
    box-shadow: var(--focus-ring);
}

.form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Neutralize Chrome autofill blue tint */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--foreground);
    -webkit-box-shadow: 0 0 0 1000px var(--background) inset;
    caret-color: var(--foreground);
    transition: background-color 5000s;
}

.form-input--error {
    border-color: var(--destructive);
}

.form-error {
    font-size: 0.75rem;
    color: var(--destructive);
    margin-top: var(--space-1);
}

/* Field component aliases - shared field vocabulary (P1-2) */
.field        { margin-bottom: 1rem; }
.field-label  { display: block; font-size: 0.825rem; font-weight: 600; color: var(--secondary-foreground); margin-bottom: 0.25rem; }
.field-control { width: 100%; padding: 0.55rem 0.75rem; font-size: 0.875rem; border: 1px solid var(--input); border-radius: var(--radius); background: var(--background); transition: border-color 0.15s, box-shadow 0.15s; }
.field-control:focus-visible { outline: none; border-color: var(--foreground); box-shadow: var(--focus-ring); }
.field-help   { font-size: 0.75rem; color: var(--muted-foreground); margin-top: 0.2rem; }
.field-error  { font-size: 0.75rem; color: var(--destructive); margin-top: 0.2rem; }
.field-control--error { border-color: var(--destructive); }

/* ---------- Alerts ---------- */

.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: var(--space-4);
    border: 1px solid;
}

.alert--success {
    background: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert--info {
    background: #cff4fc;
    border-color: #b6effb;
    color: #055160;
}

.alert--warning {
    background: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

.alert--error {
    background: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

/* ---------- Plan badges ---------- */

.plan-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-2-5);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius-sm);
}

.plan-badge--free {
    background: var(--border);
    color: var(--secondary-foreground);
}

.plan-badge--pro {
    background: var(--primary);
    color: var(--primary-foreground);
}

.plan-badge--business {
    background: var(--muted-foreground);
    color: var(--primary-foreground);
}

.plan-badge--enterprise {
    background: var(--secondary-foreground);
    color: var(--primary-foreground);
}

/* ---------- Code block ---------- */

.code-block {
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    font-size: 0.825rem;
    overflow-x: auto;
    font-family: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
}

/* ---------- Code panel (copy affordance) ---------- */

.code-panel {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}

.code-panel > .code-block {
    border-radius: 0 0 var(--radius) var(--radius);
}

.code-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-1-5) var(--space-2) var(--space-1-5) var(--space-3);
    font-size: 0.7rem;
    font-weight: 500;
    font-family: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
    background: var(--muted);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    color: var(--muted-foreground);
    user-select: none;
}

.code-panel--dark .code-panel-header {
    background: var(--code-dark-bg-header);
    border-color: var(--code-dark-border);
    color: var(--code-dark-muted);
}

.code-panel--dark > .cta-code-block {
    border-radius: 0 0 var(--radius) var(--radius);
    border-top: none;
}

.code-panel-copy {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    font-size: 0.675rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--muted-foreground);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
    white-space: nowrap;
}

.code-panel-copy:hover {
    background: var(--border-subtle);
    color: var(--foreground);
}

.code-panel-copy:focus-visible {
    outline: 2px solid var(--foreground);
    outline-offset: 1px;
}

.code-panel--dark .code-panel-copy {
    color: var(--code-dark-muted);
    border-color: var(--code-dark-border);
}

.code-panel--dark .code-panel-copy:hover {
    background: var(--code-dark-hover);
    color: var(--code-dark-text);
}

.code-panel-copy[data-copied] {
    color: var(--positive);
    border-color: var(--positive);
}

.code-panel--dark .code-panel-copy[data-copied] {
    color: var(--positive);
    border-color: var(--positive);
}

.code-panel-copy svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.code-tabs-header {
    position: relative;
}

.code-tabs-header .code-panel-copy {
    margin-left: auto;
    align-self: center;
    margin-right: var(--space-2);
    color: var(--code-dark-muted);
    border-color: var(--code-dark-border);
}

.code-tabs-header .code-panel-copy:hover {
    background: var(--code-dark-hover);
    color: var(--code-dark-text);
}

.code-tabs-header .code-panel-copy:focus-visible {
    outline-color: var(--primary-foreground);
}

.code-tabs-header .code-panel-copy[data-copied] {
    color: #a6e3a1;
    border-color: #a6e3a1;
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--muted);
    padding-top: var(--space-8);
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-8);
    padding-bottom: var(--space-6);
}

.footer-col p {
    font-size: 0.85rem;
    color: var(--muted-foreground);
    margin-top: var(--space-1-5);
}

.footer-logo-img {
    display: block;
    width: 120px;
    height: 32px;
    margin-bottom: var(--space-1-5);
}

.footer-col ul {
    list-style: none;
    margin-top: var(--space-1-5);
}

.footer-col ul li {
    margin-bottom: var(--space-1);
}

.footer-col ul a {
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.footer-col ul a:hover {
    color: var(--foreground);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: var(--space-4) var(--space-5);
    text-align: center;
}

/* ---------- Market ticker bar ---------- */

.ticker-bar {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    width: 100%;
    height: 28px;
}

.ticker-track {
    display: flex;
    align-items: center;
    padding: 0;
    height: 28px;
    white-space: nowrap;
}

a.ticker-item,
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1-5);
    font-size: 0.75rem;
    color: var(--muted-foreground);
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0 var(--space-4);
    border-right: 1px solid var(--border);
    text-decoration: none;
    height: 28px;
}

a.ticker-item:hover {
    text-decoration: none;
    background: var(--muted);
}

a.ticker-item:hover .ticker-label {
    color: var(--foreground);
}

.ticker-item:last-child {
    border-right: none;
}

.ticker-label {
    color: var(--foreground);
    font-weight: 600;
}

.ticker-item strong {
    color: var(--foreground);
    font-weight: 500;
}

/* ---------- Hero (homepage) ---------- */

.hero-home {
    padding: var(--space-8) 0 var(--space-12);
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.hero-home h1 {
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: var(--space-5);
    letter-spacing: -0.035em;
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    line-height: 1.6;
    margin-bottom: var(--space-8);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
}

/* ---------- Showcase sections (MCP chat + API terminal) ---------- */

.showcase-section {
    padding: var(--space-10) 0;
}

.showcase-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-12);
    align-items: center;
}

.showcase-row--reverse {
    grid-template-columns: 1.2fr 1fr;
}

.showcase-row--reverse .showcase-text {
    order: 2;
}

.showcase-row--reverse .showcase-visual {
    order: 1;
}

.showcase-text h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-2);
}

.showcase-text p {
    color: var(--foreground);
    line-height: 1.6;
}

.showcase-list {
    list-style: none;
    padding: 0;
    margin: var(--space-4) 0 var(--space-5);
}

.showcase-list li {
    padding: var(--space-1) 0;
    font-size: 0.875rem;
    color: var(--foreground);
}

.showcase-list li::before {
    content: "\2713  ";
    color: #0a8f08;
    font-weight: 600;
}

/* ---------- Mock LLM chat UI ---------- */

/* ---------- Avatar (shadcn Avatar) ---------- */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: var(--muted);
    color: var(--foreground);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    overflow: hidden;
    flex-shrink: 0;
    user-select: none;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- Mock chat (Claude / OpenAI style) ---------- */

.chat-mock {
    display: flex;
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    height: 480px;
}

.chat-mock-sidebar {
    width: 200px;
    flex-shrink: 0;
    background: var(--muted);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: var(--space-3);
    gap: var(--space-3);
}

.chat-mock-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1-5);
    width: 100%;
    height: 2rem;
    padding: 0 var(--space-3);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    cursor: not-allowed;
    opacity: 0.95;
}

.chat-mock-history {
    display: flex;
    flex-direction: column;
    gap: var(--space-0-5);
    overflow: hidden;
}

.chat-mock-history-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    padding: var(--space-2) var(--space-2) var(--space-1);
    letter-spacing: 0.02em;
}

.chat-mock-history-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: var(--space-1-5) var(--space-2);
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: not-allowed;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.chat-mock-history-item.is-active {
    background: var(--background);
    color: var(--foreground);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.chat-mock-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chat-mock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2-5) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--muted);
}

.chat-mock-title {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1-5);
}

.chat-mock-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
    background: var(--accent-muted);
}
.chat-mock-dot--red    { background: #ef4444; }
.chat-mock-dot--yellow { background: #eab308; }
.chat-mock-dot--green  { background: #22c55e; }

.chat-mock-model {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

.chat-mock-thread {
    flex: 1;
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    background: var(--background);
    overflow: hidden;
}

.chat-turn {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    animation: chat-in 0.4s ease-out backwards;
}
.chat-turn:nth-child(1) { animation-delay: 0.1s; }
.chat-turn:nth-child(2) { animation-delay: 0.5s; }

@keyframes chat-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-avatar {
    composes: avatar;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}
.chat-avatar--user {
    background: var(--primary);
    color: var(--primary-foreground);
}
.chat-avatar--ai {
    background: var(--muted);
    color: var(--foreground);
    border: 1px solid var(--border);
}

.chat-bubble {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--foreground);
}
.chat-bubble p { margin: 0 0 var(--space-2); }
.chat-bubble p:last-child { margin-bottom: 0; }

.chat-bubble--user p {
    color: var(--foreground);
}

.chat-bubble--ai {
    /* No bubble background — Claude-style flat assistant block */
}

.chat-tool-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1-5);
    padding: var(--space-1) var(--space-2-5);
    margin-bottom: var(--space-3);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: 9999px;
}
.chat-tool-pill svg { color: var(--positive); }
.chat-tool-pill code {
    font-family: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
    font-size: 0.95em;
    color: var(--foreground);
}

.chat-mock-input {
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
    background: var(--card);
}

.chat-mock-input textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.4;
    background: var(--background);
    color: var(--foreground);
    box-shadow: var(--shadow-xs);
}
.chat-mock-input textarea::placeholder { color: var(--muted-foreground); }
.chat-mock-input textarea:disabled { cursor: not-allowed; }

.chat-mock-send {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: var(--primary-foreground);
    cursor: not-allowed;
    opacity: 0.7;
}

.chat-table {
    font-size: 0.8125rem;
    margin: var(--space-3) 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--background);
}

.chat-table-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    padding: var(--space-2) var(--space-3);
    font-variant-numeric: tabular-nums;
}

.chat-table-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.chat-table-head {
    font-weight: 500;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    background: var(--muted);
}

.chat-source {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin: var(--space-2) 0 0;
}

/* ---------- Stock search + popular ---------- */

.stock-search-section {
    padding: var(--space-12) 0;
    text-align: center;
    background: #fff;
}

.stock-search-section h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-5);
}

.stock-search-form {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 600px;
    margin: 0 auto var(--space-6);
    position: relative;
}

.stock-search-form .search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--accent-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.stock-search-form input {
    flex: 1;
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
    font-size: 0.925rem;
    border: 2px solid var(--input);
    border-right: none;
    border-radius: 10px 0 0 10px;
    background: #fff;
}

.stock-search-form input:focus-visible {
    outline: none;
    border-color: var(--foreground);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.stock-search-form:focus-within {
    border-radius: 10px;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.stock-search-form .btn {
    border-radius: 0 10px 10px 0;
    padding: var(--space-3) var(--space-6);
    font-size: 0.925rem;
}

.popular-stocks {
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
}

.popular-label {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: var(--space-3);
}

.popular-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.popular-stock-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: var(--space-3-5);
    text-decoration: none;
    color: var(--foreground);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.popular-stock-card:hover {
    border-color: var(--accent-muted);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    text-decoration: none;
}

.popular-stock-top {
    display: flex;
    align-items: center;
    gap: var(--space-1-5);
    margin-bottom: var(--space-1-5);
}

.popular-stock-top strong {
    font-size: 0.9rem;
}

.popular-stock-price {
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.popular-stock-change {
    font-size: 0.8rem;
    font-weight: 500;
}

.popular-all {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    margin-top: var(--space-2);
}

/* ---------- Code tabs (language switcher) ---------- */

.code-tabs-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.code-tabs-header {
    display: flex;
    gap: 0;
    background: var(--code-dark-bg-header);
    padding: 0 var(--space-2);
}

.code-tab {
    display: flex;
    align-items: center;
    gap: var(--space-1-5);
    padding: var(--space-2-5) var(--space-4);
    font-size: 0.775rem;
    font-weight: 500;
    color: var(--code-dark-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
}

.code-tab:hover {
    color: var(--accent-muted);
}

.code-tab-active {
    color: var(--primary-foreground);
    border-bottom-color: var(--primary-foreground);
}

.code-tabs-body {
    background: var(--code-dark-bg);
    color: var(--code-dark-text);
    padding: var(--space-5) var(--space-6);
    font-size: 0.8rem;
    font-family: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
    line-height: 1.7;
    margin: 0;
    border: none;
    border-radius: 0;
    overflow-x: auto;
    min-height: 220px;
}

.term-str {
    color: #a6e3a1;
}

/* ---------- Proof band ---------- */

.proof-band {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-10);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.proof-band li {
    display: flex;
    align-items: baseline;
    gap: var(--space-2-5);
    font-size: 0.875rem;
    color: var(--secondary-foreground, var(--foreground));
    line-height: 1.5;
}

.proof-band li svg {
    flex-shrink: 0;
    position: relative;
    top: 2px;
    color: var(--foreground, var(--foreground));
}

.proof-band li strong {
    color: var(--foreground, var(--foreground));
}

/* ---------- Data groups ---------- */

.data-groups {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    margin-bottom: var(--space-10);
}

.data-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground, var(--muted-foreground));
    margin: 0 0 var(--space-2);
}

.data-group-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-3);
}

/* ---------- Data icon cards ---------- */

.data-card {
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.data-card:hover {
    border-color: var(--foreground);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.data-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--muted, var(--muted));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-2-5);
    color: var(--secondary-foreground, var(--foreground));
}

.data-card strong {
    display: block;
    font-size: 0.85rem;
    margin-bottom: var(--space-1);
}

.data-card span {
    font-size: 0.75rem;
    color: var(--muted-foreground, var(--muted-foreground));
    line-height: 1.4;
}

.term-prompt {
    color: #a6e3a1;
}

.term-key {
    color: #89b4fa;
}

/* (why-grid removed — replaced by .proof-band above) */

/* ---------- CTA section (full-width dark, two-column) ---------- */

.cta-section {
    background: var(--foreground);
    color: #fff;
    padding: var(--space-16) 0;
}

.cta-inner {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: var(--space-12);
    align-items: center;
}

.cta-text h2 {
    font-size: 2rem;
    margin-bottom: var(--space-3);
    color: #fff;
}

.cta-desc {
    font-size: 1rem;
    color: var(--accent-muted);
    line-height: 1.6;
    margin-bottom: var(--space-6);
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1-5);
    padding: var(--space-3-5) var(--space-10);
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    background: #fff;
    color: var(--foreground);
    transition: background 0.15s, transform 0.15s;
}

.btn-cta:hover {
    background: var(--muted);
    color: var(--foreground);
    text-decoration: none;
    transform: translateY(-1px);
}

.cta-sub {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    margin-top: var(--space-4);
    margin-bottom: 0;
}

.cta-sub a {
    color: var(--accent-muted);
}

.cta-sub a:hover {
    color: #fff;
}

.cta-code-block {
    background: var(--code-dark-bg);
    border: 1px solid var(--code-dark-border);
    border-radius: var(--radius);
    padding: var(--space-6);
    font-size: 0.8rem;
    font-family: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
    color: var(--code-dark-text);
    line-height: 1.7;
    overflow-x: auto;
    margin: 0;
}

.term-comment {
    color: var(--code-dark-muted);
}

/* ---------- Hero (legacy — kept for non-home pages) ---------- */


/* ---------- Buttons (shadcn Button) ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 2.25rem;              /* h-9 */
    padding: 0 var(--space-4);     /* px-4 */
    font-size: 0.875rem;           /* text-sm */
    font-weight: 500;
    line-height: 1;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn:hover { text-decoration: none; }

.btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn-disabled,
.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
}

/* -- Variants -- */

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: var(--primary-foreground);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border-color: var(--secondary);
}
.btn-secondary:hover {
    background: color-mix(in srgb, var(--secondary) 80%, var(--foreground) 20%);
}

.btn-outline {
    background: var(--background);
    color: var(--foreground);
    border-color: var(--input);
    box-shadow: var(--shadow-sm);
}
.btn-outline:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

.btn-ghost {
    background: transparent;
    color: var(--foreground);
}
.btn-ghost:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

.btn-link {
    background: transparent;
    color: var(--primary);
    padding: 0;
    height: auto;
    text-underline-offset: 4px;
}
.btn-link:hover { text-decoration: underline; }

.btn-danger,
.btn-destructive {
    background: var(--destructive);
    color: var(--destructive-foreground);
    border-color: var(--destructive);
    box-shadow: var(--shadow-sm);
}
.btn-danger:hover,
.btn-destructive:hover {
    background: color-mix(in srgb, var(--destructive) 90%, black 10%);
    border-color: color-mix(in srgb, var(--destructive) 90%, black 10%);
}

/* -- Sizes -- */

.btn-sm {
    height: 2rem;                 /* h-8 */
    padding: 0 var(--space-3);
    font-size: 0.8125rem;
    border-radius: var(--radius-md);
}

.btn-lg {
    height: 2.5rem;               /* h-10 */
    padding: 0 var(--space-6);
    font-size: 0.9375rem;
}

.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
}
.btn-icon.btn-sm {
    width: 2rem;
    height: 2rem;
}

.btn-full {
    width: 100%;
}

/* ---------- Cards (shadcn Card) ---------- */

.card {
    background: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-1-5);
    padding: 0 0 var(--space-6);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0;
}

.card-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0;
}

.card-content {
    padding: 0;
}

.card-footer {
    display: flex;
    align-items: center;
    padding: var(--space-6) 0 0;
}

.account-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.account-cards--stats {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.account-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.card-value-unit {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--muted-foreground);
    letter-spacing: 0;
    margin-left: var(--space-1);
}

.card-link {
    display: inline-block;
    margin-top: var(--space-3);
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-decoration: none;
}

.card-link:hover {
    color: var(--foreground);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.card-label {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    font-weight: 500;
    margin-bottom: var(--space-1);
}

.card-value {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums slashed-zero;
}

.card-detail {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    margin-top: var(--space-0-5);
}

/* ---------- Section headings ---------- */

.section-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--secondary-foreground);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-2);
    margin-bottom: var(--space-4);
    margin-top: var(--space-8);
}

/* ---------- Table shell ---------- */

.table-shell {
    margin-bottom: var(--space-6);
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-scroll-hint {
    display: none;
    font-size: 0.8rem;
    color: var(--muted-foreground);
    margin-bottom: var(--space-2);
}

/* Sticky first column inside table-shell */
.table-shell .data-table--sticky-col thead th:first-child,
.table-shell .data-table--sticky-col tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--background);
}

.table-shell .data-table--sticky-col tbody tr:hover td:first-child {
    background: var(--muted);
}

.table-shell .data-table--sticky-col thead th:first-child {
    z-index: 3;
}

/* ---------- Data tables ---------- */

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.table-actions--inline {
    margin: 0;
}

.empty-state-cell {
    text-align: center;
    padding: var(--space-8);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    caption-side: bottom;
}

.data-table th {
    text-align: left;
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    padding: var(--space-3);
    height: 2.5rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--background);
}

.data-table.sticky-header th {
    position: sticky;
    top: 56px;
}

.sort-header {
    color: var(--muted-foreground);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
}
.sort-header:hover {
    color: var(--foreground);
}
.sort-header.active {
    color: var(--foreground);
    font-weight: 600;
}

.data-table td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.15s;
}

.data-table tbody tr:hover {
    background: var(--muted);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums slashed-zero;
    font-size: 0.875rem;
}

.data-table .ticker-link {
    font-weight: 600;
    color: var(--foreground);
}

/* ---------- Color classes ---------- */

.positive {
    color: var(--positive);
}

.negative {
    color: var(--negative);
}

.neutral {
    color: var(--muted-foreground);
}

/* ---------- Status badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-0-5) var(--space-2-5);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    border-radius: 9999px;
    border: 1px solid transparent;
    vertical-align: middle;
    white-space: nowrap;
}

.badge-inactive {
    background: var(--badge-inactive-bg);
    color: var(--badge-inactive-fg);
}

.badge-active {
    background: var(--badge-active-bg);
    color: var(--badge-active-fg);
}

.badge-not-trading {
    background: var(--badge-warning-bg);
    color: var(--badge-warning-fg);
}

/* ---------- API Keys page ---------- */

.api-key-create-form {
    margin-bottom: var(--space-6);
}

.api-key-create-row {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
}

.api-key-create-row .form-input {
    width: 220px;
    flex-shrink: 0;
}

.api-key-masked {
    font-family: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
    font-size: 0.8rem;
}

.api-key-revoked {
    opacity: 0.5;
}

.new-key-panel {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-6);
}

.new-key-panel-title {
    font-size: 0.925rem;
    font-weight: 600;
    margin: 0 0 var(--space-1);
    color: #0f5132;
}

.new-key-panel-warning {
    font-size: 0.8rem;
    color: #0f5132;
    margin: 0 0 var(--space-3);
}

.new-key-panel .code-block {
    background: var(--background);
    border-color: #badbcc;
    word-break: break-all;
    white-space: pre-wrap;
}

/* Revoke confirmation (details/summary) */

.revoke-confirm {
    position: relative;
}

.revoke-confirm > summary {
    list-style: none;
    cursor: pointer;
}

.revoke-confirm > summary::-webkit-details-marker {
    display: none;
}

.revoke-confirm-body {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 10;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    min-width: 260px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.08);
    font-size: 0.825rem;
}

.revoke-confirm-body p {
    margin: 0 0 var(--space-2-5);
}

.revoke-confirm-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-start;
}

/* ---------- Explore links (DDM-style) ---------- */

/* ---------- Tooltips ---------- */

.has-tooltip {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--accent-muted);
}

.has-tooltip .tooltip-text {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--foreground);
    color: var(--background);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    padding: var(--space-1-5) var(--space-2-5);
    border-radius: 4px;
    white-space: normal;
    width: 220px;
    text-transform: none;
    letter-spacing: 0;
    z-index: var(--z-tooltip);
    margin-bottom: var(--space-1);
}

.has-tooltip:hover .tooltip-text,
.has-tooltip:focus-within .tooltip-text {
    display: block;
}

.metric-info {
    all: unset;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: help;
}

.metric-info:focus-visible {
    outline: 2px solid var(--foreground);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---------- Source attribution ---------- */

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.7rem;
    color: var(--muted-foreground);
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-0-5) var(--space-1-5);
    font-weight: 500;
    text-decoration: none;
}

a.source-badge:hover {
    background: var(--border);
    color: var(--secondary-foreground);
    text-decoration: none;
}

.source-row {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    margin-top: var(--space-2);
    flex-wrap: wrap;
}

/* ---------- Indicator summary ---------- */

.indicator-summary {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    max-width: 520px;
}

.indicator-summary-meta {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: var(--space-2);
}

.indicator-summary-label {
    font-weight: 600;
    color: var(--foreground);
}

.indicator-summary-value {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
    margin-bottom: var(--space-4);
}

.indicator-summary-qualifier {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--muted-foreground);
    margin-left: var(--space-2);
}

.indicator-summary-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    font-size: 0.8125rem;
    color: var(--muted-foreground);
}

.macro-table-shell {
    max-width: 640px;
}

/* ---------- News list ---------- */

.news-list {
    margin-bottom: var(--space-6);
}

.news-item {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.news-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
}

.news-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--foreground);
    display: block;
}

a.news-title:hover {
    color: #1a73e8;
}

.news-summary {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    margin-top: var(--space-1);
    margin-bottom: 0;
}

/* ---------- Stock logos ---------- */

.stock-logo {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: var(--space-1);
    display: inline-block;
}

.data-table .ticker-cell {
    white-space: nowrap;
}

.stock-logo-lg {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    vertical-align: middle;
    margin-right: var(--space-2);
}

/* ---------- Stock detail ---------- */

.stock-page-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.stock-header-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
}

.stock-identity {
    display: flex;
    align-items: center;
    gap: var(--space-2-5);
    min-width: 0;
}

.stock-identity-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.stock-page-header .stock-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    min-width: 0;
}

.stock-page-header .ticker {
    font-size: inherit;
    font-weight: inherit;
}

.stock-page-header .name {
    font-size: 1.1rem;
    color: var(--muted-foreground);
    font-weight: 400;
    overflow-wrap: break-word;
    word-break: break-word;
}

.stock-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.stock-badges .badge {
    margin-left: 0;
}

.stock-header-meta {
    padding-top: var(--space-1);
}

/* ---------- Stat primitive (big number + delta badge) ---------- */

.stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted-foreground);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums slashed-zero;
    color: var(--foreground);
}

.stat-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
}

.stock-price-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1-5);
    flex-shrink: 0;
    white-space: nowrap;
}

.stock-price-summary .current-price {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums slashed-zero;
}

.stock-price-meta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.stock-price-timestamp {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

/* ---------- Stock detail — shadcn two-column layout ---------- */

.stock-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--space-8);
    align-items: start;
}

.stock-layout-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.stock-layout-aside {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.stock-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.stock-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.stock-section-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

.stock-section-meta {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    font-variant-numeric: tabular-nums;
}

/* Inline page-level alerts */
.stock-alert {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    font-size: 0.875rem;
    background: var(--card);
}
.stock-alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.stock-alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #854d0e;
}

/* Aside cards (sidebar) */
.aside-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.aside-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    margin: 0;
}

.aside-card-subtitle {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin: 0;
}

.aside-card-text {
    font-size: 0.875rem;
    line-height: 1.55;
    margin: 0;
    color: var(--foreground);
}
.aside-card-text.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aside-card-toggle {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.aside-card-toggle:hover { opacity: 0.8; }

.aside-card-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: 0;
    font-size: 0.875rem;
}
.aside-card-list dt {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-bottom: var(--space-1);
}
.aside-card-list dd {
    margin: 0;
    color: var(--foreground);
    font-weight: 500;
    overflow-wrap: anywhere;
}
.aside-card-list dd a {
    color: inherit;
    text-decoration: none;
}
.aside-card-list dd a:hover { text-decoration: underline; }

.aside-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.aside-list li + li {
    border-top: 1px solid var(--border);
}
.aside-list-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-3);
    align-items: baseline;
    padding: var(--space-3) 0;
    font-size: 0.875rem;
    color: var(--foreground);
    text-decoration: none;
    transition: color 0.15s;
}
.aside-list-row:hover {
    text-decoration: none;
    color: var(--primary);
}
.aside-list-key {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.aside-list-meta {
    color: var(--muted-foreground);
    font-size: 0.8125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.aside-list-value {
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
}

.aside-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: 0.875rem;
}
.aside-link-list a {
    color: var(--foreground);
    text-decoration: none;
}
.aside-link-list a:hover {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.aside-card-more {
    margin-top: var(--space-1);
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-decoration: none;
}
.aside-card-more:hover {
    color: var(--foreground);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.aside-card-sources .source-row {
    margin: 0;
}

/* Data pairs: replace "Dados de mercado" table with key/value grid */
.data-pairs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-5) var(--space-6);
    padding: var(--space-5) var(--space-6);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.data-pairs > div { min-width: 0; }
.data-pairs dt {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-bottom: var(--space-1);
}
.data-pairs dd {
    margin: 0;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--foreground);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

.metric-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    background: var(--card);
    box-shadow: var(--shadow-sm);
}

.metric-item .label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    font-weight: 500;
}

.metric-item .value {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    margin-top: var(--space-1);
}

/* ---------- Tabs — underline (shadcn) ---------- */

.stock-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: var(--space-6);
}

.stock-tabs a {
    padding: var(--space-2-5) var(--space-4);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.stock-tabs a:hover {
    color: var(--foreground);
    text-decoration: none;
}

.stock-tabs a.active {
    color: var(--foreground);
    border-bottom-color: var(--foreground);
}

/* ---------- Alert callout (shadcn Alert) ---------- */

.alert-callout {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card);
    margin: var(--space-4) 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--foreground);
}

.alert-callout--info    { border-left: 3px solid var(--foreground); }
.alert-callout--warning { border-left: 3px solid #f59e0b; background: #fffbeb; }
.alert-callout--danger  { border-left: 3px solid var(--destructive); background: #fef2f2; }
.alert-callout--success { border-left: 3px solid var(--positive); background: #f0fdf4; }

.alert-callout-icon {
    flex-shrink: 0;
    color: var(--muted-foreground);
    margin-top: 0.125rem;
}

.alert-callout-body {
    flex: 1;
    min-width: 0;
}

.alert-callout-title {
    font-weight: 600;
    margin: 0 0 var(--space-1);
}

.alert-callout p {
    margin: 0;
}

/* ---------- Prose (docs content typography) ---------- */

.prose {
    max-width: 720px;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--foreground);
}

.prose h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; margin: var(--space-6) 0 var(--space-4); line-height: 1.15; }
.prose h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.015em; margin: var(--space-8) 0 var(--space-3); padding-top: var(--space-2); line-height: 1.25; }
.prose h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; margin: var(--space-6) 0 var(--space-2); line-height: 1.3; }
.prose h4 { font-size: 1rem; font-weight: 600; margin: var(--space-5) 0 var(--space-2); }

.prose p { margin: 0 0 var(--space-4); }
.prose ul, .prose ol { margin: 0 0 var(--space-4) var(--space-6); }
.prose li { margin-bottom: var(--space-1); }
.prose strong { font-weight: 600; }
.prose code:not([class*="language-"]) {
    font-family: "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
    font-size: 0.85em;
    padding: 0.125rem 0.35rem;
    background: var(--muted);
    border-radius: var(--radius-sm);
    color: var(--foreground);
}
.prose pre { margin: 0 0 var(--space-4); }
.prose a { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border); }
.prose a:hover { text-decoration-color: var(--foreground); }

/* ---------- Code block copy button ---------- */

/* ---------- Toast (shadcn Toast) ---------- */

.toast-region {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    z-index: var(--z-banner);
    max-width: min(420px, calc(100vw - var(--space-8)));
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    animation: toast-slide-in 0.2s ease-out;
}

.toast--success { border-left: 3px solid var(--positive); }
.toast--error,
.toast--danger { border-left: 3px solid var(--destructive); }
.toast--warning { border-left: 3px solid #f59e0b; }
.toast--info { border-left: 3px solid var(--foreground); }

.toast-body {
    flex: 1;
    line-height: 1.5;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: 0;
    padding: var(--space-1);
    margin: calc(-1 * var(--space-1));
    color: var(--muted-foreground);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.toast-close:hover { color: var(--foreground); background: var(--accent); }

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .toast { animation: none; }
}

/* ---------- Price change badge (shadcn Badge w/ direction arrow) ---------- */

.price-change {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-0-5) var(--space-2);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    border-radius: 9999px;
    border: 1px solid transparent;
    font-variant-numeric: tabular-nums;
}

.price-change.positive {
    background: color-mix(in srgb, var(--positive) 12%, transparent);
    color: color-mix(in srgb, var(--positive) 80%, #000 20%);
    border-color: color-mix(in srgb, var(--positive) 30%, transparent);
}

.price-change.negative {
    background: color-mix(in srgb, var(--negative) 12%, transparent);
    color: color-mix(in srgb, var(--negative) 80%, #000 20%);
    border-color: color-mix(in srgb, var(--negative) 30%, transparent);
}

.price-change.neutral {
    background: var(--muted);
    color: var(--muted-foreground);
    border-color: var(--border);
}

.price-change-arrow {
    flex-shrink: 0;
}

/* ---------- Tabs — segmented (shadcn TabsList pill variant) ---------- */

.tabs-segmented {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1);
    background: var(--muted);
    border-radius: var(--radius-md);
}

.tabs-segmented-trigger {
    all: unset;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.75rem;
    padding: 0 var(--space-3);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    color: var(--muted-foreground);
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.tabs-segmented-trigger:hover {
    color: var(--foreground);
    text-decoration: none;
}

.tabs-segmented-trigger.active,
.tabs-segmented-trigger[aria-selected="true"] {
    background: var(--background);
    color: var(--foreground);
    box-shadow: var(--shadow-sm);
}

.tabs-segmented-trigger:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* ---------- Chart container ---------- */

.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--card);
}

.chart-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    pointer-events: none;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-3);
    min-width: 180px;
    font-size: 0.75rem;
    z-index: 5;
    transition: transform 0.05s ease-out;
}

.chart-tooltip-date {
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
}

.chart-tooltip-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-1);
    margin: 0;
}

.chart-tooltip-body > div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}

.chart-tooltip-body dt {
    color: var(--muted-foreground);
    font-weight: 400;
}

.chart-tooltip-body dd {
    margin: 0;
    color: var(--foreground);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.chart-tooltip-body dd.positive { color: var(--positive); }
.chart-tooltip-body dd.negative { color: var(--negative); }

/* ---------- Dividend bar chart (CSS) ---------- */

.dividend-bars {
    display: flex;
    align-items: flex-end;
    gap: var(--space-1);
    height: 200px;
    padding: 0;
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--border);
}

.dividend-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    min-width: 0;
}

.dividend-bar {
    width: 100%;
    max-width: 40px;
    background: #1a73e8;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    height: var(--bar-h, 0px);
}

.dividend-bar-label {
    font-size: 0.7rem;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.dividend-bar-value {
    font-size: 0.7rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---------- Financial statements ---------- */

.financials-table {
    margin-bottom: var(--space-6);
}

.financials-table .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.financials-table table {
    width: 100%;
    min-width: 600px;
}

.financials-table th,
.financials-table td {
    font-size: 0.825rem;
}

.financials-table .row-label {
    font-weight: 500;
    white-space: nowrap;
    min-width: 200px;
}

/* Sticky first column for financial tables */
.financials-table .data-table--sticky-col thead th:first-child,
.financials-table .data-table--sticky-col tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--background);
}

.financials-table .data-table--sticky-col tbody tr:hover td:first-child {
    background: var(--muted);
}

.financials-table .data-table--sticky-col thead th:first-child {
    z-index: 3;
}

/* ---------- Financials tabbed cards ---------- */

.financials-shell {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.financials-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.financials-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.financials-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4);
    overflow: hidden;
}

/* ---------- Screener ---------- */

.screener-filters {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    background: var(--card);
    box-shadow: var(--shadow-sm);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

fieldset.filter-group {
    border: 0;
    margin: 0;
    padding: 0;
    min-inline-size: 0;
}

.filter-group label,
.filter-group legend {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: var(--space-1-5);
    padding: 0;
    float: none;
    width: auto;
}

.filter-group .filter-range {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.filter-group .filter-range > span {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.filter-group input[type="number"],
.filter-group select {
    width: 100%;
    height: 2.25rem;
    padding: 0 var(--space-3);
    font-size: 0.875rem;
    line-height: 1.25;
    color: var(--foreground);
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--background);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-group input[type="number"]:focus-visible,
.filter-group select:focus-visible {
    outline: none;
    border-color: var(--ring);
    box-shadow: var(--focus-ring);
}

.filter-group select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: var(--space-8);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
}

.filter-actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

/* ---------- Active filter chips (shadcn Badge outline variant) ---------- */

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.filter-chips-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1-5);
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1-5);
    padding: var(--space-0-5) var(--space-1) var(--space-0-5) var(--space-2-5);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 9999px;
    white-space: nowrap;
}

.filter-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    font-size: 0.875rem;
    line-height: 1;
    color: var(--muted-foreground);
    text-decoration: none;
    border-radius: 9999px;
}

.filter-chip-remove:hover {
    color: var(--foreground);
    background: var(--muted);
    text-decoration: none;
}

.filter-chips-clear {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-decoration: none;
    margin-left: var(--space-1);
}

.filter-chips-clear:hover {
    color: var(--foreground);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Pricing ---------- */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.pricing-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.pricing-card.featured {
    border-color: var(--foreground);
    box-shadow: var(--shadow-md);
}

.pricing-card .tier-name {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-2);
}

.pricing-card .tier-price {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-1);
}

.pricing-card .tier-price--custom {
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

.pricing-card .tier-period {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: var(--space-6);
}

.pricing-card ul {
    list-style: none;
    text-align: left;
    font-size: 0.875rem;
    margin: 0 0 var(--space-6);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.pricing-card ul li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    color: var(--foreground);
}

.pricing-card ul li::before {
    content: "";
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin-top: 0.125rem;
    background-color: var(--foreground);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / contain;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / contain;
}

.pricing-card .pricing-recommended {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: var(--space-1) var(--space-3);
    border-radius: 9999px;
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow-sm);
}

/* Pricing comparison table */

.pricing-compare {
    margin-top: var(--space-10);
}

.pricing-compare h2 {
    font-size: 1.1rem;
    margin-bottom: var(--space-4);
}

.pricing-compare table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.pricing-compare th {
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--muted-foreground);
    padding: var(--space-2) var(--space-3);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.pricing-compare td {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.pricing-compare tbody tr:hover {
    background: var(--muted);
}

.pricing-compare .check {
    color: var(--positive);
}

.pricing-compare .dash {
    color: var(--accent-muted);
}

/* Pricing FAQ */

.pricing-faq {
    margin-top: var(--space-10);
}

.pricing-faq h2 {
    font-size: 1.1rem;
    margin-bottom: var(--space-3);
}

.pricing-faq-item {
    border-bottom: 1px solid var(--border);
}

.pricing-faq-q {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: var(--space-3-5) 0;
    background: none;
    border: none;
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--foreground);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.pricing-faq-arrow {
    font-size: 1rem;
    color: var(--muted-foreground);
    transition: transform 0.15s;
    transform: rotate(180deg);
}

.pricing-faq-open {
    transform: rotate(0deg);
}

.pricing-faq-a {
    padding: 0 0 var(--space-3-5);
}

.pricing-faq-a p {
    font-size: 0.875rem;
    color: var(--secondary-foreground);
}

/* Account plan usage */

.plan-usage {
    margin-bottom: var(--space-6);
}

.plan-usage-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-2);
}

.plan-usage-label {
    font-size: 0.85rem;
    color: var(--muted-foreground);
    min-width: 7rem;
}

.plan-usage-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.plan-usage-progress {
    display: block;
    width: 100%;
    height: 6px;
    appearance: none;
    border: 0;
    border-radius: 3px;
    background: transparent;
}

.plan-usage-progress::-webkit-progress-bar {
    background: var(--border);
    border-radius: 3px;
}

.plan-usage-progress::-webkit-progress-value {
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.2s;
}

.plan-usage-progress::-moz-progress-bar {
    background: var(--primary);
    border-radius: 3px;
}

.plan-usage-progress.warn::-webkit-progress-value {
    background: var(--negative);
}

.plan-usage-progress.warn::-moz-progress-bar {
    background: var(--negative);
}

.plan-usage-count {
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: var(--secondary-foreground);
    min-width: 6rem;
    text-align: right;
}

.plan-billing-note {
    font-size: 0.85rem;
    color: var(--muted-foreground);
    margin-top: var(--space-2);
}

/* ---------- Dashboard usage ---------- */

.dash-usage {
    margin-bottom: var(--space-8);
}

/* ---------- Onboarding checklist ---------- */

.checklist {
    list-style: none;
    padding: 0;
    margin-bottom: var(--space-8);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2-5) 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
}

.checklist-item:last-child {
    border-bottom: 0;
}

.checklist-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--input);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted-foreground);
    flex-shrink: 0;
}

.checklist-item--done .checklist-icon {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.checklist-item--done .checklist-text {
    color: var(--muted-foreground);
}

/* ---------- Quick links ---------- */

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
}

.quick-link {
    display: inline-block;
    padding: var(--space-2) var(--space-3-5);
    font-size: 0.825rem;
    font-weight: 500;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    color: var(--secondary-foreground);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.quick-link:hover {
    background: var(--muted);
    border-color: var(--accent-muted);
    text-decoration: none;
}

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-1);
    margin-top: var(--space-6);
}

.pagination a,
.pagination span {
    padding: var(--space-1-5) var(--space-3);
    font-size: 0.825rem;
    border: 1px solid var(--input);
    border-radius: var(--radius-sm);
    color: var(--secondary-foreground);
}

.pagination a:hover {
    background: var(--muted);
    text-decoration: none;
}

.pagination .current {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* ---------- Empty state ---------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-12) var(--space-6);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--muted);
    gap: var(--space-3);
}

.empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    background: var(--background);
    border: 1px solid var(--border);
    color: var(--muted-foreground);
    margin-bottom: var(--space-1);
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
}

.empty-state-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0;
    max-width: 28rem;
}

.empty-state-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
}

.inline-error,
.data-status {
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: var(--radius);
}

.inline-error {
    color: var(--destructive);
}

.data-status {
    color: var(--muted-foreground);
}

.skeleton {
    min-height: 1rem;
    border-radius: var(--radius);
    background: linear-gradient(90deg, var(--muted) 25%, var(--border-subtle) 37%, var(--muted) 63%);
    background-size: 400% 100%;
    animation: skeleton-pulse 1.4s ease infinite;
}

@keyframes skeleton-pulse {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ---------- Sector list ---------- */

.sector-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-3);
}

.sector-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    transition: border-color 0.15s;
}

.sector-item:hover {
    border-color: var(--foreground);
}

.sector-item-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3-5) var(--space-4);
    text-decoration: none;
    color: inherit;
}

.sector-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
}

.sector-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--foreground);
}

.sector-item-count {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    white-space: nowrap;
}

.sector-item-tickers {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1-5);
}

.sector-ticker {
    display: inline-block;
    padding: var(--space-0-5) var(--space-1-5);
    font-size: 0.7rem;
    font-weight: 500;
    font-family: var(--font-mono, "SFMono-Regular", "Cascadia Code", "Consolas", monospace);
    background: var(--muted);
    color: var(--muted-foreground);
    border-radius: var(--radius);
}

.sector-item-action {
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.sector-item:hover .sector-item-action {
    color: var(--foreground);
}

/* ---------- Dataset list (data dumps) ---------- */

.dataset-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-3);
}

.dataset-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--background);
    padding: var(--space-3-5) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-1-5);
}

.dataset-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
}

.dataset-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--foreground);
}

.dataset-status {
    display: inline-block;
    padding: var(--space-0-5) var(--space-2);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius);
    white-space: nowrap;
}

.dataset-status--coming-soon {
    background: var(--muted);
    color: var(--muted-foreground);
}

.dataset-description {
    font-size: 0.8rem;
    color: var(--secondary-foreground);
    margin: 0;
    line-height: 1.4;
}

.dataset-meta {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-top: var(--space-1);
}

.dataset-format,
.dataset-tier {
    display: inline-block;
    padding: var(--space-0-5) var(--space-1-5);
    font-size: 0.7rem;
    font-weight: 500;
    font-family: var(--font-mono, "SFMono-Regular", "Cascadia Code", "Consolas", monospace);
    background: var(--muted);
    color: var(--muted-foreground);
    border-radius: var(--radius);
}

.dataset-cta {
    margin-top: var(--space-6);
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--muted);
}

.dataset-cta p {
    margin: 0 0 var(--space-3);
    font-size: 0.85rem;
    color: var(--secondary-foreground);
}

.dataset-cta-links {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ---------- Utility ---------- */

.text-muted {
    color: var(--muted-foreground);
}

.text-sm {
    font-size: 0.85rem;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    color: var(--muted);
    z-index: var(--z-banner);
    padding: var(--space-3) 0;
}

.cookie-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.cookie-banner p {
    font-size: 0.825rem;
    margin: 0;
}

.cookie-banner a {
    color: #cff4fc;
}

/* ---------- Unified stock search bar ---------- */

.stock-search-bar {
    margin-bottom: var(--space-4);
    max-width: 640px;
}

.stock-unified-search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
}

.search-icon-inline {
    position: absolute;
    left: 0.75rem;
    color: var(--muted-foreground);
    display: flex;
    pointer-events: none;
}

.stock-unified-search input {
    flex: 1;
    height: 2.5rem;
    padding: 0 var(--space-3) 0 2.5rem;
    font-size: 0.9375rem;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--background);
    box-shadow: var(--shadow-xs);
}

.stock-unified-search input:focus-visible {
    outline: none;
    border-color: var(--ring);
    box-shadow: var(--focus-ring);
}

.screener-toggle button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1-5);
}

/* ---------- Docs layout (sidebar + content) ---------- */

.docs-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: var(--space-10);
    align-items: start;
}

.docs-sidebar {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: var(--space-2);
}

.docs-sidebar-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted-foreground);
    padding: var(--space-1) var(--space-2);
    margin: var(--space-3) 0 var(--space-1);
}

.docs-sidebar-title:first-child { margin-top: 0; }

.docs-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-0-5);
}

.docs-sidebar-nav a {
    display: block;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    padding: var(--space-1-5) var(--space-2);
    border-radius: var(--radius-sm);
    line-height: 1.4;
}

.docs-sidebar-nav a:hover {
    color: var(--accent-foreground);
    background: var(--accent);
    text-decoration: none;
}

.docs-sidebar-nav a[aria-current="location"] {
    color: var(--foreground);
    font-weight: 500;
    background: var(--muted);
}

.docs-content {
    max-width: 800px;
    min-width: 0;
}

/* ---------- Docs shell (quick-start, mobile TOC, method badges) ---------- */

.docs-shell {
    /* wrapper — no visual style, just scoping */
}

.docs-quick-start {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.docs-quick-start-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-3);
}

.docs-quick-start-steps {
    margin: 0;
    padding-left: var(--space-5);
    font-size: 0.875rem;
    line-height: 1.7;
}

.docs-quick-start-steps .code-block {
    margin-top: var(--space-2);
    margin-bottom: var(--space-1);
}

/* Mobile on-this-page dropdown */
.docs-mobile-toc {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: var(--space-6);
    font-size: 0.85rem;
}

.docs-mobile-toc summary {
    padding: var(--space-2-5) var(--space-4);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.docs-mobile-toc summary::-webkit-details-marker {
    display: none;
}

.docs-mobile-toc summary::after {
    content: "▸";
    float: right;
    transition: transform 0.15s ease;
}

.docs-mobile-toc[open] summary::after {
    transform: rotate(90deg);
}

.docs-mobile-toc-nav {
    display: flex;
    flex-direction: column;
    padding: 0 var(--space-4) var(--space-3);
    gap: var(--space-1);
}

.docs-mobile-toc-nav a {
    color: var(--muted-foreground);
    padding: var(--space-1) 0;
    font-size: 0.8rem;
}

.docs-mobile-toc-nav a:hover {
    color: var(--foreground);
    text-decoration: none;
}

.docs-mobile-toc-nav a[aria-current="location"] {
    color: var(--foreground);
    font-weight: 600;
}

/* Method badges */
.method-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: var(--font-mono, ui-monospace, monospace);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15em 0.45em;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 0.35em;
    position: relative;
    top: -1px;
}

.method-get {
    background: #e8f5e9;
    color: #2e7d32;
}

.method-post {
    background: #e3f2fd;
    color: #1565c0;
}

.method-put {
    background: #fff3e0;
    color: #e65100;
}

.method-delete {
    background: #fce4ec;
    color: #c62828;
}

/* Hide mobile TOC on desktop (sidebar visible) */
@media (min-width: 769px) {
    .docs-mobile-toc {
        display: none;
    }
}

/* ---------- Autocomplete dropdown ---------- */

.stock-search-bar,
.stock-search-form,
.stock-search-autocomplete {
    position: relative;
}

.stock-search-autocomplete {
    max-width: 600px;
    margin: 0 auto;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: var(--z-dropdown);
    margin-top: var(--space-1);
    overflow: hidden;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2-5) var(--space-4);
    font-size: 0.875rem;
    color: var(--foreground);
    background: none;
    border: none;
    border-bottom: 1px solid var(--muted);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-active {
    background: var(--muted);
}

.autocomplete-item strong {
    font-size: 0.9rem;
    min-width: 60px;
}

.autocomplete-item span {
    color: var(--muted-foreground);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- MCP docs page ---------- */

.mcp-hero {
    padding: var(--space-8) 0 var(--space-6);
}

.mcp-hero-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid var(--foreground);
    border-radius: 100px;
    margin-bottom: var(--space-4);
}

.mcp-hero h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: var(--space-3);
}

.mcp-hero p {
    font-size: 1.05rem;
    color: var(--foreground);
    line-height: 1.7;
}

.mcp-section {
    padding: var(--space-8) 0;
    border-top: 1px solid var(--border);
}

.mcp-section h2 {
    font-size: 1.35rem;
    margin-bottom: var(--space-3);
}

.mcp-section p {
    color: var(--foreground);
    line-height: 1.7;
}

/* MCP client tabs */

.client-tabs {
    margin-top: var(--space-4);
}

.client-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: var(--space-5);
    overflow-x: auto;
}

.client-tab {
    padding: var(--space-2) var(--space-4);
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--muted-foreground);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.client-tab:hover {
    color: var(--foreground);
}

.client-tab-active {
    color: var(--foreground);
    border-bottom-color: var(--foreground);
}

.client-tab-content {
    padding: var(--space-1) 0;
}

.client-tab-content p {
    font-size: 0.9rem;
}

/* MCP diagram */

.mcp-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-6);
    margin: var(--space-5) 0;
    background: var(--muted);
    border-radius: 10px;
    overflow-x: auto;
}

.mcp-diagram-box {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--input);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #fff;
    white-space: nowrap;
}

.mcp-diagram-highlight {
    background: var(--foreground);
    color: #fff;
    border-color: var(--foreground);
}

.mcp-diagram-arrow {
    color: var(--accent-muted);
    font-size: 1.1rem;
}

/* MCP steps */

.mcp-steps {
    margin-top: var(--space-6);
}

.mcp-step {
    display: flex;
    gap: var(--space-5);
    padding: var(--space-6) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.mcp-step:last-child {
    border-bottom: none;
}

.mcp-step-number {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--foreground);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: var(--space-0-5);
}

.mcp-step-content {
    flex: 1;
}

.mcp-step-content h3 {
    margin-bottom: var(--space-1-5);
}

.mcp-step-content p {
    font-size: 0.9rem;
}

.mcp-config-toggle {
    background: none;
    border: none;
    font-size: 0.825rem;
    color: #1a73e8;
    cursor: pointer;
    padding: 0;
    margin-top: var(--space-2);
    font-family: inherit;
}

.mcp-config-details {
    margin-top: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--muted);
    border-radius: 8px;
    font-size: 0.825rem;
}

.mcp-config-details p {
    font-size: 0.825rem;
    margin-bottom: var(--space-1-5);
}

.mcp-config-details p:last-child {
    margin-bottom: 0;
}

/* MCP examples */

.mcp-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.mcp-example {
    padding: var(--space-2-5) var(--space-3-5);
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.825rem;
    color: var(--foreground);
    font-style: italic;
}

/* MCP FAQ */

.mcp-faq {
    margin-top: var(--space-2);
}

.mcp-faq-item {
    border-bottom: 1px solid var(--border);
}

.mcp-faq-q {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: var(--space-3-5) 0;
    background: none;
    border: none;
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--foreground);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.mcp-faq-arrow {
    font-size: 1rem;
    color: var(--muted-foreground);
    transition: transform 0.15s;
    transform: rotate(180deg);
}

.mcp-faq-open {
    transform: rotate(0deg);
}

.mcp-faq-a {
    padding: 0 0 var(--space-3-5);
}

.mcp-faq-a p {
    font-size: 0.875rem;
}

/* ---------- Ferramentas (tools) ---------- */

.tool-index-header {
    padding: var(--space-6) 0 var(--space-2);
    max-width: 800px;
}

.tool-index-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-1);
}

.tool-index-header p {
    font-size: 0.95rem;
    color: #71717a;
    margin: 0;
}

.tool-category {
    margin-bottom: var(--space-6);
}

.tool-category-heading {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--foreground);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3-5);
    margin-bottom: 0;
}

.tool-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-decoration: none;
    color: var(--card-foreground);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tool-card:hover {
    border-color: var(--foreground);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    transform: translateY(-1px);
}

.tool-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
    background: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
    color: var(--foreground);
}

.tool-card h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-1);
}

.tool-card p {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.5;
    margin: 0;
}

.tool-page {
    max-width: 720px;
}

.tool-page h1 {
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}

.tool-page > p.text-muted {
    font-size: 0.925rem;
    line-height: 1.6;
}

.tool-form {
    margin-bottom: var(--space-6);
}

.tool-form-row {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Calculator input section */

.tool-page .form-group {
    margin-bottom: var(--space-3-5);
}

.tool-page .form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: var(--space-1-5);
}

.tool-page .form-input {
    height: 2.5rem;
    padding: 0 var(--space-3);
    font-size: 0.9375rem;
}

.input-reveal-wrapper {
    position: relative;
}

.input-reveal-wrapper .form-input {
    padding-right: var(--space-20);
}

.input-reveal-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground, #6b7280);
    padding: var(--space-1) var(--space-1-5);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    border-radius: 4px;
}

.input-reveal-toggle:hover {
    color: var(--foreground, #111827);
    background: rgba(0,0,0,0.04);
}

/* Calculator results */

.calc-result,
.sim-result {
    padding: var(--space-6);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.calc-stock-info,
.sim-stock-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2-5);
}

.calc-card {
    padding: var(--space-4) var(--space-3);
    background: #f9fafb;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    text-align: center;
    transition: border-color 0.15s;
}

.calc-card:hover {
    border-color: var(--input);
}

.calc-label {
    font-size: 0.675rem;
    color: var(--muted-foreground);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-1);
    line-height: 1.3;
}

.calc-value {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* Calculator highlight card */
.calc-card-highlight {
    background: var(--foreground);
    border-color: var(--foreground);
}

.calc-card-highlight .calc-label {
    color: #9ca3af;
}

.calc-card-highlight .calc-value {
    color: #fff;
}

/* Calculator section titles */
.calc-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: var(--space-7) 0 var(--space-3);
    padding-bottom: var(--space-1-5);
    border-bottom: 1px solid var(--border-subtle);
}

/* Calculator 2-col grid for comparison layouts */
.calc-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2-5);
}

/* Calculator disclaimer */
.tool-page .text-sm.text-muted.mt-2 {
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    margin-top: var(--space-5);
    font-size: 0.775rem;
    line-height: 1.5;
}

/* Compare form */

.compare-form {
    margin-bottom: var(--space-6);
}

.compare-inputs {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* Prompt cards */

.prompt-category {
    margin-bottom: var(--space-6);
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
}

.prompt-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-4);
}

.prompt-text {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--foreground);
    line-height: 1.5;
    margin: 0;
}

/* ---------- About page ---------- */

.about-page {
    max-width: 800px;
}

.about-hero {
    padding: var(--space-8) 0 var(--space-6);
}

.about-hero h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: var(--space-3);
}

.about-hero p {
    font-size: 1.05rem;
    color: var(--foreground);
    line-height: 1.7;
}

.about-section {
    padding: var(--space-6) 0;
    border-top: 1px solid var(--border);
}

.about-section h2 {
    margin-bottom: var(--space-3);
}

.about-section p {
    color: var(--foreground);
    line-height: 1.7;
}

.about-sources {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-3);
}

.about-source {
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.about-source strong {
    display: block;
    margin-bottom: var(--space-1);
}

.about-source p {
    font-size: 0.85rem;
    margin: 0;
}

.about-access {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    margin-top: var(--space-3);
}

.about-access-item {
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.about-access-item h3 {
    margin-bottom: var(--space-1-5);
}

.about-access-item p {
    font-size: 0.875rem;
    margin-bottom: var(--space-3);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .stock-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .stock-layout-aside {
        order: 2;
    }
}

@media (max-width: 768px) {
    /* Nav: hide desktop, show hamburger */
    .nav-desktop {
        display: none;
    }

    .nav-hamburger {
        display: flex;
    }

    .nav-desktop-only {
        display: none;
    }

    .nav-container {
        padding: var(--space-2) var(--space-4);
    }

    .nav-mobile-menu {
        padding: var(--space-3) var(--space-5) var(--space-5);
    }

    .nav-mobile-section a {
        padding: var(--space-2) 0;
    }

    /* Ticker bar */
    .ticker-bar {
        padding: 0;
    }

    .ticker-item {
        font-size: 0.7rem;
        padding: 0 var(--space-2-5);
    }

    .ticker-set {
        padding: var(--space-1-5) 0;
    }

    /* Hero */
    .hero-home {
        padding: var(--space-8) 0 var(--space-6);
    }

    .hero-home h1 {
        font-size: 1.75rem;
    }

    .hero-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* General spacing on mobile */
    main.container {
        padding-top: var(--space-5);
        padding-bottom: var(--space-8);
    }

    .section-heading {
        font-size: 0.75rem;
    }

    .showcase-section {
        padding: var(--space-6) 0;
    }

    .showcase-row,
    .showcase-row--reverse {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .showcase-row--reverse .showcase-text,
    .showcase-row--reverse .showcase-visual {
        order: unset;
    }

    .showcase-text h2 {
        font-size: 1.25rem;
    }

    .showcase-list li {
        font-size: 0.825rem;
    }

    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-sidebar {
        display: none;
    }

    .nav-megamenu {
        width: 95vw;
        left: 0;
        transform: none;
    }

    .megamenu-inner {
        grid-template-columns: 1fr;
    }

    .megamenu-cols {
        border-left: none;
        border-top: 1px solid var(--border-subtle);
        border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    }

    .chat-mock-sidebar {
        display: none;
    }

    .chat-mock {
        height: 420px;
    }

    .data-group-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .data-card {
        padding: var(--space-3-5);
    }

    .data-card strong {
        font-size: 0.8rem;
    }

    .code-tabs-header {
        gap: 0;
    }

    .code-tab {
        padding: var(--space-2) var(--space-2-5);
        font-size: 0.7rem;
    }

    .code-tabs-body {
        font-size: 0.7rem;
        padding: var(--space-4);
        min-height: 180px;
    }

    .cta-inner {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .cta-section {
        padding: var(--space-8) 0;
    }

    .cta-text h2 {
        font-size: 1.5rem;
    }

    .popular-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }

    .popular-stock-card {
        padding: var(--space-2-5);
    }

    .stock-search-section {
        padding: var(--space-6) 0;
    }

    .stock-search-section h2 {
        font-size: 1.25rem;
    }

    .stock-search-form input {
        font-size: 0.85rem;
        padding: var(--space-2-5) var(--space-3) var(--space-2-5) var(--space-9);
    }

    .stock-search-form .btn {
        padding: var(--space-2-5) var(--space-4);
        font-size: 0.85rem;
    }

    .hero-sub {
        font-size: 0.95rem;
    }

    .cards-row {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stock-header-main {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .stock-price-summary {
        flex-wrap: wrap;
        gap: var(--space-1-5);
    }

    .stock-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .stock-tabs a {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .chart-container {
        height: 280px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .pricing-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-group input[type="number"] {
        width: 100%;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .table-wrap .data-table {
        overflow-x: visible;
    }

    .table-scroll-hint {
        display: block;
    }

    /* Tools/ferramentas grid */
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Calculator results */
    .calc-grid {
        grid-template-columns: 1fr;
    }

    /* Prompt grid */
    .prompt-grid {
        grid-template-columns: 1fr;
    }

    /* About page grids */
    .about-sources {
        grid-template-columns: 1fr;
    }

    .about-access {
        grid-template-columns: 1fr;
    }

    /* Auth forms */
    .auth-card {
        padding: var(--space-5);
    }

    /* Compare inputs */
    .compare-inputs {
        flex-wrap: wrap;
    }

    /* MCP docs examples */
    .mcp-examples {
        grid-template-columns: 1fr;
    }

    /* MCP diagram */
    .mcp-diagram {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* MCP steps */
    .mcp-step {
        flex-direction: column;
        gap: var(--space-3);
    }

    /* Tool form rows */
    .tool-form-row {
        flex-direction: column;
    }
}

@media (max-width: 480px) {

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stock-page-header .stock-title {
        font-size: 1.75rem;
    }

    .stock-price-summary {
        align-items: flex-start;
    }
    .stock-price-summary .current-price {
        font-size: 1.375rem;
    }

    .card-value {
        font-size: 1.1rem;
    }

    .data-group-grid {
        grid-template-columns: 1fr;
    }

    .popular-grid {
        grid-template-columns: 1fr;
    }

    .hero-home {
        padding: var(--space-6) 0 var(--space-4);
    }

    .hero-home h1 {
        font-size: 1.85rem;
        letter-spacing: -0.02em;
    }

    .hero-sub {
        font-size: 0.85rem;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .chat-mock {
        height: 360px;
    }

    .chat-bubble--user p {
        font-size: 0.8125rem;
    }

    .showcase-section {
        padding: var(--space-5) 0;
    }

    .showcase-text h2 {
        font-size: 1.1rem;
    }

    .proof-band li {
        font-size: 0.8rem;
    }

    .cta-text h2 {
        font-size: 1.25rem;
    }

    .btn-cta {
        width: 100%;
        justify-content: center;
    }

    .chat-bubble--ai p {
        font-size: 0.8125rem;
    }

    .cta-inner {
        text-align: center;
    }

    .cta-code {
        display: none;
    }

    .container {
        padding: 0 var(--space-4);
    }

    .tool-index-header {
        padding: var(--space-4) 0 var(--space-1);
    }

    .tool-index-header h1 {
        font-size: 1.35rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .nav-mobile-menu {
        padding: var(--space-3) var(--space-4) var(--space-5);
    }

    .footer-container {
        gap: var(--space-4);
    }

    .footer-col p {
        font-size: 0.8rem;
    }

    .client-tab {
        padding: var(--space-1-5) var(--space-2-5);
        font-size: 0.75rem;
    }

    .code-block {
        font-size: 0.725rem;
        padding: var(--space-3);
    }

    .popular-stock-top strong {
        font-size: 0.825rem;
    }

    .popular-stock-price {
        font-size: 0.9rem;
    }
}

/* ---------- Prose pages (terms, privacy) ---------- */

.prose-page {
    max-width: 720px;
}

.prose-page h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-1);
}

.prose-page .prose-date {
    font-size: 0.85rem;
    color: var(--muted-foreground);
    margin-bottom: var(--space-8);
}

.prose-page h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
}

.prose-page p {
    line-height: 1.7;
    margin-bottom: var(--space-4);
}

.prose-page ul {
    margin-left: var(--space-6);
    margin-bottom: var(--space-4);
}

.prose-page ul li {
    line-height: 1.7;
    margin-bottom: var(--space-1);
}

.prose-page a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------- Error pages (404, 500) ---------- */

.error-page {
    text-align: center;
    padding: var(--space-20) 0 var(--space-16);
}

.error-page h1 {
    font-size: 4rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: var(--space-2);
    line-height: 1;
}

.error-page p {
    color: var(--muted-foreground);
    font-size: 1.05rem;
    margin-bottom: var(--space-2);
}

.error-page .error-actions {
    margin-top: var(--space-7);
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Inline-style replacements (P4-2) ---------- */

.text-center { text-align: center; }
.text-mono   { font-family: monospace; }
.flex-1      { flex: 1; }

.flex-row-center {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.chart-loading,
.chart-empty,
.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--space-4);
    text-align: center;
}

.chart-empty {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.chart-error {
    color: var(--destructive);
    font-size: 0.875rem;
}

.autocomplete-wrap        { position: relative; }
.autocomplete-wrap-inline { position: relative; display: inline-block; }
.autocomplete-status {
    padding: var(--space-2) var(--space-3);
    white-space: nowrap;
}
.btn-self-end             { align-self: end; }

.form-input-xs { width: 120px; }
.form-input-sm { width: 140px; }
.form-input-md { width: 160px; }
.form-input-lg { width: 200px; }

.badge-neutral {
    background: var(--badge-neutral-bg);
    color: var(--badge-neutral-fg);
}

.row-past { opacity: 0.6; }

.compare-section-header {
    background: var(--muted);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-foreground);
}

.news-title-static { color: var(--foreground); }

.nav-dropdown form { margin: 0; }
.nav-dropdown-btn { font-family: inherit; }

.data-table-compact { margin: 0.75rem 0; }
.form-checkbox      { width: auto; }
.form-label-inline  { margin: 0; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

    .ticker-track {
        transform: none !important;
        overflow-x: auto;
    }
}
