/* GrexLabs × OpenRouter design system — tokens matched to openrouter.ai */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Geist+Mono:wght@400;500;600&display=swap');

:root{
  --background:0 0% 100%;
  --foreground:240 10% 3.9%;
  --card:0 0% 100%;
  --card-foreground:240 10% 3.9%;
  --popover:0 0% 100%;
  --popover-foreground:240 10% 3.9%;
  --primary:239 84% 67%;
  --primary-foreground:0 0% 98%;
  --secondary:240 4.8% 95.9%;
  --secondary-foreground:240 5.9% 10%;
  --muted:240 4.8% 95.9%;
  --muted-foreground:240 3.8% 46.1%;
  --accent:240 4.8% 95.9%;
  --accent-foreground:240 5.9% 10%;
  --destructive:0 84.2% 60.2%;
  --destructive-foreground:0 0% 98%;
  --border:240 5.9% 90%;
  --input:240 5.9% 90%;
  --ring:239 84% 67%;
  --success:142 71% 29%;
  --warning:32 95% 44%;
  --radius:.5rem;
  --radius-sm:.25rem;
  --radius-md:.375rem;
  --radius-lg:.5rem;
  --radius-xl:.75rem;
  --radius-2xl:1rem;
  --radius-pill:9999px;
  --radius-button:6px;
  --radius-card:12px;
  --radius-chip:8px;
  --accent-brand:#7624f4;
  --accent-subtle:#7624f408;
  --accent-border:#7624f420;
  --accent-hover:#7624f4e0;
  --card-hover:#03080a05;
  --fill-muted:#03080a09;
  --focus-border:#03080a4d;
  --focus-shadow:0 0 0 3px #03080a0f;
  --shadow-1:0 1px 2px #180e300f,0 1px 1px #180e3008;
  --shadow-2:0 14px 34px -16px #24125038,0 2px 6px #2412500f;
  --font-sans:"Plus Jakarta Sans",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --font-mono:"Geist Mono",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  --font-heading:var(--font-sans);
  --font-tech:var(--font-mono);
  --ease:cubic-bezier(.22,.61,.36,1);
  --duration:.15s;
  /* legacy aliases used across pages */
  --brand:239 84% 67%;
  --brand-hex:#6366f1;
  --brand-h:239;
  --brand-s:84%;
  --brand-l:67%;
  --border-brand:hsl(var(--primary));
  --green:#059669;
  --green-light:#e0f5eb;
  --red:#dc2626;
  --red-light:#fef2f2;
  --purple:#7c3aed;
  --amber:#d97706;
  --pink:#ec4899;
  --ease-smooth:cubic-bezier(.22,.61,.36,1);
  --duration-fast:.18s;
  /* ui-kit aliases */
  --ui-bg:hsl(var(--background));
  --ui-surface:hsl(var(--card));
  --ui-surface-2:hsl(var(--secondary));
  --ui-fg:hsl(var(--foreground));
  --ui-muted:hsl(var(--muted-foreground));
  --ui-faint:hsl(var(--muted-foreground)/.7);
  --ui-border:hsl(var(--border));
  --ui-border-strong:hsl(var(--border));
  --ui-brand:hsl(var(--primary));
  --ui-brand-fg:hsl(var(--primary-foreground));
  --ui-brand-soft:hsl(var(--primary)/.1);
  --ui-ok:hsl(var(--success));
  --ui-ok-soft:hsl(var(--success)/.1);
  --ui-warn:hsl(var(--warning));
  --ui-warn-soft:hsl(var(--warning)/.1);
  --ui-danger:hsl(var(--destructive));
  --ui-danger-soft:hsl(var(--destructive)/.1);
  --ui-radius:12px;
  --ui-radius-lg:16px;
  --ui-radius-sm:8px;
  --ui-shadow:var(--shadow-1);
  --ui-shadow-lg:var(--shadow-2);
  --ui-font:var(--font-sans);
  --ui-mono:var(--font-mono);
  --ui-header-h:56px;
  --ui-sidebar-w:260px;
  --ui-max:1200px;
  --ui-ease:cubic-bezier(.22,.61,.36,1);
  --text-body:.9375rem;
  --text-section:1rem;
  --text-button:.875rem;
}
html[data-theme="dark"],
[data-theme="dark"]{
  --background:224 7% 4%;
  --foreground:206 6% 88%;
  --inverse:206 6% 88%;
  --inverse-foreground:224 7% 4%;
  --card:240 10% 3.9%;
  --card-foreground:0 0% 98%;
  --popover:240 10% 3.9%;
  --popover-foreground:0 0% 98%;
  --primary:239 84% 67%;
  --primary-foreground:0 0% 98%;
  --secondary:240 3.7% 15.9%;
  --secondary-foreground:0 0% 98%;
  --muted:240 3.7% 15.9%;
  --muted-foreground:240 5% 64.9%;
  --accent:240 3.7% 15.9%;
  --accent-foreground:0 0% 98%;
  --destructive:0 84.2% 60.2%;
  --destructive-foreground:0 0% 98%;
  --border:240 4.7% 24.9%;
  --input:240 4.7% 24.9%;
  --ring:239 84% 67%;
  --success:142 71% 65%;
  --warning:42 100% 62%;
  --accent-subtle:#7624f414;
  --accent-border:#7624f433;
  --accent-hover:#7624f4e0;
  --card-hover:#fcfcfe08;
  --fill-muted:#fcfcfe09;
  --focus-border:#fcfcfe4d;
  --focus-shadow:0 0 0 3px #fcfcfe0f;
  --shadow-1:0 1px 2px #00000040;
  --shadow-2:0 14px 34px -16px #00000080,0 2px 6px #00000040;
  --brand:239 84% 67%;
  --brand-hex:#818cf8;
  --border-strong:240 4.7% 34.9%;
  --foreground-faint:240 5% 55%;
  /* ui-kit dark aliases */
  --ui-bg:#09090b;
  --ui-surface:#111113;
  --ui-surface-2:#18181b;
  --ui-fg:#fafafa;
  --ui-muted:#a1a1aa;
  --ui-faint:#71717a;
  --ui-border:rgba(250,250,250,.09);
  --ui-border-strong:rgba(250,250,250,.16);
  --ui-brand:#818cf8;
  --ui-brand-fg:#0a0a0b;
  --ui-brand-soft:rgba(129,140,248,.14);
  --ui-ok:#34d399;
  --ui-ok-soft:rgba(52,211,153,.12);
  --ui-warn:#fbbf24;
  --ui-warn-soft:rgba(251,191,36,.12);
  --ui-danger:#f87171;
  --ui-danger-soft:rgba(248,113,113,.12);
  --ui-shadow:0 1px 2px rgba(0,0,0,.4),0 8px 24px -12px rgba(0,0,0,.5);
  --ui-shadow-lg:0 16px 48px -16px rgba(0,0,0,.6);
}

/* ═══ BASE ═══ */
*,*::before,*::after{box-sizing:border-box;border:0 solid hsl(var(--border))}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth;overflow-x:hidden;max-width:100vw;line-height:1.5;font-family:var(--font-sans);tab-size:4;background-color:hsl(var(--background))}
body{
  margin:0;line-height:inherit;font-family:var(--font-sans);
  background-color:hsl(var(--background));color:hsl(var(--foreground));
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;overflow-wrap:break-word;
  overflow-x:clip;min-height:100vh;position:relative;
}
/* neutralize legacy decorative overlays */
body::before,body::after{display:none!important;content:none!important}
img,svg,video,canvas{display:block;vertical-align:middle;max-width:100%;height:auto}
button,input,textarea,select{font:inherit;color:inherit;margin:0;padding:0;background:transparent;border:0}
button{cursor:pointer;text-align:inherit}
a{color:inherit;text-decoration:none}
ul,ol{margin:0;padding:0;list-style:none}
h1,h2,h3,h4,h5,h6,p,figure,blockquote,pre{margin:0;font:inherit}
pre,code,kbd,samp{font-family:var(--font-mono);font-size:1em}
kbd{font-family:var(--font-mono)}
table{border-collapse:collapse;width:100%}
::selection{background:hsl(var(--primary)/.25);color:hsl(var(--foreground))}
:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:2px}
hr{border:0;border-top:1px solid hsl(var(--border));margin:0}

/* ═══ LAYOUT ═══ */
.container{width:100%;margin-inline:auto;max-width:72rem;padding-inline:1rem}
@media(min-width:640px){.container{padding-inline:1.5rem}}
.section{padding-block:4rem;border-top:1px solid hsl(var(--border))}
@media(min-width:640px){.section{padding-block:5rem}}
.section-alt{background:hsl(var(--muted)/.45)}
.section-tight{padding-block:3rem}
.divider{height:1px;width:100%;background:hsl(var(--border))}
.grid{display:grid;gap:1.5rem}
.flex{display:flex}
.items-center{align-items:center}
.justify-between{justify-content:space-between}
.gap-2{gap:.5rem}
.gap-3{gap:.75rem}
.gap-4{gap:1rem}
.mt-1{margin-top:.25rem}
.mt-2{margin-top:.5rem}
.mt-3{margin-top:.75rem}
.mt-4{margin-top:1rem}
.mt-6{margin-top:1.5rem}
.mb-2{margin-bottom:.5rem}
.mb-3{margin-bottom:.75rem}
.mb-4{margin-bottom:1rem}
.mb-6{margin-bottom:1.5rem}
.mb-8{margin-bottom:2rem}
.w-full{width:100%}
.text-center{text-align:center}
.text-right{text-align:right}
.hidden{display:none}

/* ═══ TYPOGRAPHY ═══ */
.font-display,h1,h2,h3{font-family:var(--font-heading)}
.h1,.hero-title{font-weight:700;letter-spacing:-.03em;line-height:1.06;font-size:2.25rem;color:hsl(var(--foreground))}
@media(min-width:640px){.h1,.hero-title{font-size:3rem}}
@media(min-width:1024px){.h1,.hero-title{font-size:3.5rem}}
.h2{font-weight:700;letter-spacing:-.025em;line-height:1.12;font-size:1.75rem}
@media(min-width:640px){.h2{font-size:2.25rem}}
.h3{font-weight:600;letter-spacing:-.015em;font-size:1.125rem;line-height:1.35}
.h4{font-weight:600;letter-spacing:-.01em;font-size:1rem;line-height:1.4}
.lead{font-size:1rem;line-height:1.7;color:hsl(var(--muted-foreground))}
@media(min-width:640px){.lead{font-size:1.125rem}}
.muted{color:hsl(var(--muted-foreground))}
.faint{color:hsl(var(--muted-foreground)/.75)}
.mono{font-family:var(--font-mono)}
.tech-label,.kicker,.section-label{
  display:inline-flex;align-items:center;gap:.5rem;
  font-family:var(--font-mono);font-size:.6875rem;font-weight:500;
  text-transform:uppercase;letter-spacing:.12em;color:hsl(var(--muted-foreground));
  margin-bottom:.75rem;
}
.section-label{color:hsl(var(--primary))}
.live-dot{position:relative;display:inline-flex;width:6px;height:6px;border-radius:9999px;background-color:hsl(var(--primary));box-shadow:0 0 0 3px hsl(var(--primary)/.18)}
.text-spectrum{background-image:linear-gradient(100deg,hsl(var(--primary)),hsl(var(--primary)/.75));-webkit-background-clip:text;background-clip:text;color:transparent}
.spectrum-fill,.btn-spectrum{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  background:hsl(var(--foreground));color:hsl(var(--background));
  border-radius:var(--radius-button);font-weight:600;
  box-shadow:none;transition:opacity var(--duration) var(--ease),transform var(--duration) var(--ease);
}
.spectrum-fill:hover,.btn-spectrum:hover{opacity:.9;transform:translateY(-1px);text-decoration:none;filter:none;box-shadow:none}
.spectrum-fill:active,.btn-spectrum:active{transform:translateY(0)}
.lead-muted{color:hsl(var(--muted-foreground))}

/* ═══ BUTTONS ═══ */
.btn,.btn-primary,.btn-outline,.btn-ghost,.ui-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  font-family:var(--font-sans);font-size:var(--text-button);font-weight:600;
  line-height:1;white-space:nowrap;user-select:none;cursor:pointer;
  border-radius:var(--radius-button);border:1px solid transparent;
  transition:background-color var(--duration) var(--ease),border-color var(--duration) var(--ease),color var(--duration) var(--ease),opacity var(--duration) var(--ease),transform var(--duration) var(--ease),box-shadow var(--duration) var(--ease);
  text-decoration:none;text-align:center;
}
.btn:focus-visible,.btn-primary:focus-visible,.btn-outline:focus-visible,.btn-ghost:focus-visible,.ui-btn:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:2px}
.btn:disabled,.btn-primary:disabled,.btn-outline:disabled,.btn-ghost:disabled,.ui-btn:disabled{opacity:.5;cursor:not-allowed;transform:none;box-shadow:none}
.btn-primary,.ui-btn-primary{
  height:2.25rem;padding:0 .875rem;
  background:hsl(var(--foreground));color:hsl(var(--background));border-color:hsl(var(--foreground));
}
.btn-primary:hover,.ui-btn-primary:hover{opacity:.88;transform:translateY(-1px);text-decoration:none;box-shadow:none;filter:none}
.btn-primary:active,.ui-btn-primary:active{transform:translateY(0)}
.btn-outline,.ui-btn-outline{
  height:2.25rem;padding:0 .875rem;
  background:hsl(var(--card));color:hsl(var(--foreground));
  border-color:hsl(var(--border));font-weight:500;
}
.btn-outline:hover,.ui-btn-outline:hover{background:hsl(var(--secondary));border-color:hsl(var(--foreground)/.25);text-decoration:none}
.btn-ghost,.ui-btn-ghost{
  height:2.25rem;padding:0 .75rem;
  background:transparent;color:hsl(var(--muted-foreground));font-weight:500;
}
.btn-ghost:hover,.ui-btn-ghost:hover{background:hsl(var(--accent));color:hsl(var(--foreground));text-decoration:none}
.ui-btn-brand{
  height:2.25rem;padding:0 .875rem;
  background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-color:transparent;
}
.ui-btn-brand:hover{filter:brightness(1.06);transform:translateY(-1px)}
.btn-sm,.ui-btn-sm{height:2rem;padding:0 .6875rem;font-size:.8125rem}
.btn-lg,.ui-btn-lg{height:2.75rem;padding:0 1.25rem;font-size:.9375rem}
.btn-block,.ui-btn-block{width:100%}
.btn-pill,.ui-btn-pill{border-radius:var(--radius-pill)}
.btn-icon,.ui-btn-icon{width:2.25rem;height:2.25rem;padding:0;border-radius:var(--radius-button)}
.btn-danger{background:hsl(var(--destructive));color:#fff;border-color:hsl(var(--destructive))}
.btn-danger:hover{opacity:.9}
.btn:active:not(:disabled),.btn-primary:active:not(:disabled),.btn-outline:active:not(:disabled){transform:translateY(1px)}

/* ═══ HEADER / NAV ═══ */
.site-header{
  position:sticky;top:0;z-index:40;
  border-bottom:1px solid hsl(var(--border));
  background-color:hsl(var(--background)/.85);
  backdrop-filter:blur(12px) saturate(140%);
  -webkit-backdrop-filter:blur(12px) saturate(140%);
}
.header-inner{
  display:flex;align-items:center;gap:.5rem;
  max-width:80rem;margin-inline:auto;
  height:3.5rem;padding-inline:1rem;
}
@media(min-width:640px){.header-inner{padding-inline:1.5rem}}
.brand{display:flex;align-items:center;gap:.625rem;flex-shrink:0;white-space:nowrap;border-radius:.375rem;color:hsl(var(--foreground))}
.brand:hover{text-decoration:none;opacity:.85}
.brand img{width:28px;height:28px;border-radius:6px;object-fit:contain}
.brand span{font-family:var(--font-sans);font-size:.9375rem;font-weight:700;letter-spacing:-.02em}
.main-nav{display:none;margin-left:.75rem;align-items:center;gap:.125rem;min-width:0}
@media(min-width:1100px){.main-nav{display:flex}}
.main-nav a{
  display:inline-flex;align-items:center;height:2rem;padding-inline:.625rem;
  border-radius:var(--radius-button);
  font-size:.875rem;font-weight:500;color:hsl(var(--muted-foreground));
  transition:color var(--duration) var(--ease),background-color var(--duration) var(--ease);
}
.main-nav a:hover{color:hsl(var(--foreground));background:hsl(var(--accent));text-decoration:none}
.main-nav a[aria-current="page"],.main-nav a.active{color:hsl(var(--foreground));font-weight:600;background:transparent}
.header-actions{display:flex;align-items:center;gap:.375rem;margin-left:auto}
.search-btn{
  display:none;align-items:center;gap:.5rem;height:2rem;
  padding:0 .5rem 0 .625rem;margin-right:.25rem;
  border:1px solid hsl(var(--border));border-radius:var(--radius-button);
  background:hsl(var(--card));color:hsl(var(--muted-foreground));
  font-size:.8125rem;cursor:pointer;min-width:11rem;
  transition:border-color var(--duration) var(--ease),background-color var(--duration) var(--ease);
}
.search-btn:hover{border-color:hsl(var(--foreground)/.2);background:hsl(var(--secondary))}
@media(min-width:900px){.search-btn{display:inline-flex}}
.search-btn svg{width:14px;height:14px;flex-shrink:0}
.search-btn .lbl{flex:1;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.search-btn .kbd{
  font-family:var(--font-mono);font-size:.6875rem;font-weight:500;
  padding:.125rem .3125rem;border:1px solid hsl(var(--border));border-radius:4px;
  background:hsl(var(--secondary));color:hsl(var(--muted-foreground));line-height:1.2;
}
.menu-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:2.25rem;height:2.25rem;border-radius:var(--radius-button);
  background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;
  border:1px solid transparent;
  transition:background-color var(--duration) var(--ease),color var(--duration) var(--ease);
}
.menu-btn:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}
.menu-btn svg{width:18px;height:18px}
.header-cta{display:none;align-items:center;gap:.375rem;margin-left:.25rem}
@media(min-width:720px){.header-cta{display:inline-flex}}
.header-cta .btn-primary,.header-cta .ui-btn-primary{height:2rem;padding:0 .75rem;font-size:.8125rem}
.header-cta .btn-ghost,.header-cta .ui-btn-ghost{height:2rem;padding:0 .625rem;font-size:.8125rem}

.mobile-menu{
  display:none;flex-direction:column;gap:.125rem;
  padding:.5rem 1rem 1rem;border-bottom:1px solid hsl(var(--border));
  background:hsl(var(--background));
}
.mobile-menu.open,.mobile-menu[data-open="true"]{display:flex}
.mobile-menu a{
  display:flex;align-items:center;height:2.5rem;padding-inline:.75rem;
  border-radius:var(--radius-button);
  font-size:.9375rem;font-weight:500;color:hsl(var(--foreground));
}
.mobile-menu a:hover{background:hsl(var(--accent));text-decoration:none}
.mobile-menu a.spectrum-fill{justify-content:center;margin-top:.5rem;height:2.5rem;background:hsl(var(--foreground));color:hsl(var(--background));font-weight:600}
@media(min-width:1100px){.mobile-menu{display:none!important}}

/* ═══ CARDS ═══ */
.card,.ui-card{
  background:hsl(var(--card));
  border:1px solid hsl(var(--border));
  border-radius:var(--radius-card);
  padding:1.25rem;
  transition:border-color var(--duration) var(--ease),box-shadow var(--duration) var(--ease),transform var(--duration) var(--ease),background-color var(--duration) var(--ease);
  position:relative;overflow:hidden;
}
.card::before{display:none!important;content:none!important}
.card:hover,.ui-card:hover{border-color:hsl(var(--foreground)/.14);transform:none;box-shadow:var(--shadow-1)}
.card-flat{box-shadow:none}
.card-hoverable:hover{background:hsl(var(--card-hover));border-color:hsl(var(--border))}
.ui-card{padding:1.25rem;border-radius:var(--radius-card)}
.ui-card-pad{padding:1.5rem}
.ui-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:1rem}
.ui-card-title{font-size:1rem;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground));margin:0}
.ui-card-desc{font-size:.875rem;color:hsl(var(--muted-foreground));margin:.25rem 0 0}
.ui-card-footer{display:flex;align-items:center;justify-content:flex-end;gap:.5rem;margin-top:1.25rem;padding-top:1rem;border-top:1px solid hsl(var(--border))}

/* ═══ FORMS ═══ */
.input-field,.ui-input,select.input-field,textarea.input-field{
  width:100%;height:2.5rem;padding:.5rem .75rem;
  border:1px solid hsl(var(--input));border-radius:var(--radius-button);
  font-family:var(--font-sans);font-size:.9375rem;
  background:hsl(var(--card));color:hsl(var(--foreground));
  transition:border-color var(--duration) var(--ease),box-shadow var(--duration) var(--ease);
  outline:none;
}
textarea.input-field,textarea.ui-input{height:auto;min-height:6rem;resize:vertical;line-height:1.6}
.input-field:focus,.ui-input:focus{border-color:hsl(var(--ring));box-shadow:var(--focus-shadow);background:hsl(var(--card))}
.input-field::placeholder,.ui-input::placeholder{color:hsl(var(--muted-foreground)/.7)}
.input-field:hover:not(:focus),.ui-input:hover:not(:focus){border-color:hsl(var(--foreground)/.25)}
.input-field:disabled,.ui-input:disabled{opacity:.55;cursor:not-allowed}
.label,.ui-label{
  display:block;font-size:.8125rem;font-weight:500;
  color:hsl(var(--foreground));margin-bottom:.375rem;letter-spacing:0;text-transform:none;
  font-family:var(--font-sans);
}
.label .req,.ui-label .req{color:hsl(var(--destructive));margin-left:.125rem}
.field-hint{font-size:.8125rem;color:hsl(var(--muted-foreground));margin-top:.375rem}
.field-error{font-size:.8125rem;color:hsl(var(--destructive));margin-top:.375rem}
.form-group{margin-bottom:1rem}
.social-btn{
  width:2.5rem;height:2.5rem;border-radius:var(--radius-button);
  border:1px solid hsl(var(--border));background:hsl(var(--card));
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;transition:border-color var(--duration) var(--ease),background-color var(--duration) var(--ease);
}
.social-btn:hover{border-color:hsl(var(--foreground)/.25);background:hsl(var(--secondary))}
.social-btn svg{width:18px;height:18px}
.checkbox{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:hsl(var(--muted-foreground));cursor:pointer}
.checkbox input{width:1rem;height:1rem;accent-color:hsl(var(--primary));cursor:pointer}

/* ═══ TABLES ═══ */
.ui-table,.data-table{width:100%;border-collapse:collapse;font-size:.875rem}
.ui-table th,.data-table th{
  text-align:left;font-weight:500;font-size:.8125rem;
  color:hsl(var(--muted-foreground));padding:.625rem .75rem;
  border-bottom:1px solid hsl(var(--border));white-space:nowrap;
}
.ui-table td,.data-table td{
  padding:.75rem;border-bottom:1px solid hsl(var(--border));
  color:hsl(var(--foreground));vertical-align:middle;
}
.ui-table tbody tr:hover,.data-table tbody tr:hover{background:hsl(var(--muted)/.5)}
.ui-table tbody tr:last-child td,.data-table tbody tr:last-child td{border-bottom:0}

/* ═══ BADGES / CHIPS ═══ */
.badge,.ui-badge{
  display:inline-flex;align-items:center;gap:.25rem;
  height:1.375rem;padding-inline .4375rem;
  border-radius:var(--radius-chip);
  font-family:var(--font-mono);font-size:.6875rem;font-weight:500;
  background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));
  border:1px solid transparent;line-height:1;white-space:nowrap;
}
.badge-primary,.ui-badge-primary{background:hsl(var(--primary)/.12);color:hsl(var(--primary));border-color:hsl(var(--primary)/.2)}
.badge-success,.ui-badge-success{background:hsl(var(--success)/.12);color:hsl(var(--success));border-color:hsl(var(--success)/.2)}
.badge-warn,.ui-badge-warn{background:hsl(var(--warning)/.14);color:hsl(var(--warning));border-color:hsl(var(--warning)/.25)}
.badge-danger,.ui-badge-danger{background:hsl(var(--destructive)/.1);color:hsl(var(--destructive));border-color:hsl(var(--destructive)/.2)}
.badge-outline,.ui-badge-outline{background:transparent;border-color:hsl(var(--border));color:hsl(var(--muted-foreground))}
.chip{
  display:inline-flex;align-items:center;gap:.375rem;height:2rem;padding-inline .75rem;
  border:1px solid hsl(var(--border));border-radius:var(--radius-pill);
  background:hsl(var(--card));color:hsl(var(--muted-foreground));
  font-size:.8125rem;font-weight:500;cursor:pointer;white-space:nowrap;
  transition:all var(--duration) var(--ease);
}
.chip:hover{border-color:hsl(var(--foreground)/.2);color:hsl(var(--foreground));background:hsl(var(--secondary))}
.chip.active,.chip[aria-pressed="true"],.chip.on{
  background:hsl(var(--foreground));color:hsl(var(--background));border-color:hsl(var(--foreground));
}
.chip .count{font-family:var(--font-mono);font-size:.6875rem;opacity:.7}

/* ═══ CODE ═══ */
pre,.code-block{
  margin:0;padding:1rem;overflow:auto;
  background:hsl(var(--muted)/.6);border:1px solid hsl(var(--border));
  border-radius:var(--radius-card);font-family:var(--font-mono);
  font-size:.8125rem;line-height:1.65;color:hsl(var(--foreground));
}
code{font-family:var(--font-mono);font-size:.875em}
:not(pre)>code{
  padding:.125rem .375rem;border:1px solid hsl(var(--border));
  border-radius:4px;background:hsl(var(--muted));font-size:.8125em;
}
pre code{padding:0;border:0;background:transparent;font-size:inherit}
.code-inline{padding:.125rem .375rem;border:1px solid hsl(var(--border));border-radius:4px;background:hsl(var(--muted));font-family:var(--font-mono);font-size:.8125em}

/* ═══ FOOTER ═══ */
.site-footer{
  border-top:1px solid hsl(var(--border));
  background:hsl(var(--background));
  padding-block:3.5rem 2rem;
  margin-top:auto;
}
.footer-grid{
  display:grid;gap:2.5rem;
  grid-template-columns:1fr;
  max-width:80rem;margin-inline:auto;padding-inline:1.5rem;
}
@media(min-width:640px){.footer-grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.footer-grid{grid-template-columns:1.4fr repeat(4,1fr)}}
.footer-brand{max-width:16rem}
.footer-brand .brand{margin-bottom:.75rem}
.footer-brand p{font-size:.875rem;color:hsl(var(--muted-foreground));line-height:1.6;margin:0}
.footer-col h3,.footer-col h4{
  font-size:.8125rem;font-weight:600;color:hsl(var(--foreground));
  margin:0 0 .875rem;letter-spacing:0;
}
.footer-col ul{display:flex;flex-direction:column;gap:.5rem}
.footer-col a{font-size:.875rem;color:hsl(var(--muted-foreground));transition:color var(--duration) var(--ease)}
.footer-col a:hover{color:hsl(var(--foreground));text-decoration:none}
.footer-bottom{
  max-width:80rem;margin:2.5rem auto 0;padding:1.5rem 1.5rem 0;
  border-top:1px solid hsl(var(--border));
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:1rem;
  font-size:.8125rem;color:hsl(var(--muted-foreground));
}
.footer-bottom a{color:hsl(var(--muted-foreground))}
.footer-bottom a:hover{color:hsl(var(--foreground))}

/* ═══ TOAST ═══ */
.toast-container{
  position:fixed;top:1rem;right:1rem;z-index:10000;
  display:flex;flex-direction:column;gap:.5rem;pointer-events:none;
}
.toast{
  pointer-events:auto;min-width:14rem;max-width:22rem;
  padding:.75rem 1rem;border-radius:var(--radius-card);
  background:hsl(var(--popover));color:hsl(var(--popover-foreground));
  border:1px solid hsl(var(--border));box-shadow:var(--shadow-2);
  font-size:.875rem;animation:fadeUp .2s var(--ease);
}
.toast.success{border-color:hsl(var(--success)/.35)}
.toast.error{border-color:hsl(var(--destructive)/.35)}
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@keyframes spin{to{transform:rotate(360deg)}}

/* ═══ SIDE NAV (app pages) ═══ */
.side-nav{
  position:fixed;inset:0 auto 0 0;width:var(--ui-sidebar-w);z-index:50;
  background:hsl(var(--card));border-right:1px solid hsl(var(--border));
  display:flex;flex-direction:column;padding:1rem .75rem;gap:.25rem;
  overflow-y:auto;
}
.side-nav-brand{display:flex;align-items:center;gap:.625rem;padding:.25rem .5rem .875rem;text-decoration:none;color:hsl(var(--foreground));border-bottom:1px solid hsl(var(--border));margin-bottom:.625rem}
.side-nav-brand img{width:24px;height:24px;border-radius:6px}
.side-nav-brand span{font-weight:700;font-size:.9375rem;letter-spacing:-.02em}
.side-nav-link{
  display:flex;align-items:center;gap:.625rem;height:2.25rem;padding-inline:.625rem;
  border-radius:var(--radius-button);font-size:.875rem;font-weight:500;
  color:hsl(var(--muted-foreground));text-decoration:none;
  transition:background-color var(--duration) var(--ease),color var(--duration) var(--ease);
}
.side-nav-link:hover{background:hsl(var(--accent));color:hsl(var(--foreground));text-decoration:none}
.side-nav-link.active{background:hsl(var(--primary)/.1);color:hsl(var(--primary));font-weight:600}
.side-nav-section{font-family:var(--font-mono);font-size:.625rem;text-transform:uppercase;letter-spacing:.1em;color:hsl(var(--muted-foreground)/.7);padding:.875rem .625rem .375rem}
.side-nav-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:49;opacity:0;pointer-events:none;transition:opacity .2s var(--ease)}
.side-nav-overlay.open{opacity:1;pointer-events:auto}
.app-shell{display:flex;min-height:100vh}
.app-main{flex:1;min-width:0;margin-left:0}
@media(min-width:960px){.app-main{margin-left:var(--ui-sidebar-w)}}

/* ═══ STATS / HERO (OpenRouter patterns) ═══ */
.hero{
  padding-block:4.5rem 3.5rem;
  background:hsl(var(--background));
  border-bottom:1px solid hsl(var(--border));
}
@media(min-width:768px){.hero{padding-block:6rem 4.5rem}}
.hero-inner{max-width:80rem;margin-inline:auto;padding-inline:1.5rem}
.hero-title{max-width:18ch}
.hero-lead{max-width:36rem;margin-top:1.25rem;font-size:1.125rem;line-height:1.65;color:hsl(var(--muted-foreground))}
.hero-actions{display:flex;flex-wrap:wrap;gap:.75rem;margin-top:2rem}
.hero-actions .btn,.hero-actions .spectrum-fill{height:2.75rem;padding-inline:1.35rem;font-size:.9375rem}
.stats{
  display:grid;grid-template-columns:repeat(3,1fr);gap:1px;
  margin-top:3.5rem;background:hsl(var(--border));
  border:1px solid hsl(var(--border));border-radius:var(--radius-card);overflow:hidden;
}
.stat{background:hsl(var(--card));padding:1.25rem 1.5rem}
.stat .stat-value{font-size:1.5rem;font-weight:700;letter-spacing:-.02em;color:hsl(var(--foreground));font-variant-numeric:tabular-nums}
@media(min-width:640px){.stat .stat-value{font-size:1.75rem}}
.stat .stat-label{font-size:.8125rem;color:hsl(var(--muted-foreground));margin-top:.25rem}

/* model rows (OpenRouter list style) */
.model-row{
  display:flex;align-items:center;gap:1rem;
  padding:.875rem 1rem;border:1px solid hsl(var(--border));
  border-radius:var(--radius-card);background:hsl(var(--card));
  transition:border-color var(--duration) var(--ease),background-color var(--duration) var(--ease);
  text-decoration:none;color:inherit;
}
.model-row:hover{border-color:hsl(var(--foreground)/.16);background:hsl(var(--card-hover));text-decoration:none}
.model-row .model-icon{
  width:2.25rem;height:2.25rem;border-radius:8px;flex-shrink:0;
  background:hsl(var(--secondary));display:flex;align-items:center;justify-content:center;
  font-family:var(--font-mono);font-size:.75rem;font-weight:600;color:hsl(var(--muted-foreground));
}
.model-row .model-meta{min-width:0;flex:1}
.model-row .model-name{font-size:.9375rem;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.model-row .model-id{font-family:var(--font-mono);font-size:.75rem;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:.125rem}
.model-row .model-stats{display:none;gap:1.5rem;flex-shrink:0;font-size:.8125rem;color:hsl(var(--muted-foreground));font-variant-numeric:tabular-nums}
@media(min-width:768px){.model-row .model-stats{display:flex}}
.model-row .model-end{display:flex;align-items:center;gap:.5rem;flex-shrink:0}

/* pricing cards */
.plan-card{
  display:flex;flex-direction:column;
  background:hsl(var(--card));border:1px solid hsl(var(--border));
  border-radius:var(--radius-card);padding:1.75rem;
  transition:border-color var(--duration) var(--ease),box-shadow var(--duration) var(--ease);
}
.plan-card.featured{border-color:hsl(var(--primary)/.45);box-shadow:0 0 0 1px hsl(var(--primary)/.2),var(--shadow-2)}
.plan-card .plan-name{font-size:.875rem;font-weight:600;color:hsl(var(--muted-foreground));text-transform:uppercase;letter-spacing:.06em;font-family:var(--font-mono)}
.plan-card .plan-price{font-size:2.5rem;font-weight:700;letter-spacing:-.03em;color:hsl(var(--foreground));margin-top:.75rem;font-variant-numeric:tabular-nums}
.plan-card .plan-price span{font-size:.9375rem;font-weight:500;color:hsl(var(--muted-foreground));letter-spacing:0}
.plan-card .plan-desc{font-size:.9375rem;color:hsl(var(--muted-foreground));margin-top:.5rem;line-height:1.6}
.plan-card .plan-features{display:flex;flex-direction:column;gap:.625rem;margin-top:1.5rem;padding-top:1.5rem;border-top:1px solid hsl(var(--border));flex:1}
.plan-card .plan-features li{display:flex;align-items:flex-start;gap:.625rem;font-size:.875rem;color:hsl(var(--foreground));line-height:1.5}
.plan-card .plan-features li::before{
  content:"";flex-shrink:0;width:1rem;height:1rem;margin-top:.125rem;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}
.plan-card .btn{margin-top:1.5rem;width:100%;height:2.5rem}

/* feature grid */
.feature-grid{display:grid;gap:1.5rem;grid-template-columns:1fr}
@media(min-width:768px){.feature-grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.feature-grid{grid-template-columns:repeat(3,1fr)}}
.feature-card{
  background:hsl(var(--card));border:1px solid hsl(var(--border));
  border-radius:var(--radius-card);padding:1.5rem;
  transition:border-color var(--duration) var(--ease),box-shadow var(--duration) var(--ease);
}
.feature-card:hover{border-color:hsl(var(--foreground)/.14);box-shadow:var(--shadow-1)}
.feature-card .feature-icon{
  width:2.25rem;height:2.25rem;border-radius:8px;
  background:hsl(var(--primary)/.1);color:hsl(var(--primary));
  display:flex;align-items:center;justify-content:center;margin-bottom:1rem;
}
.feature-card .feature-icon svg{width:18px;height:18px}
.feature-card h3{font-size:.9375rem;font-weight:600;letter-spacing:-.01em;margin-bottom:.375rem;color:hsl(var(--foreground))}
.feature-card p{font-size:.875rem;color:hsl(var(--muted-foreground));line-height:1.6;margin:0}

/* tabs */
.tabs{display:flex;gap:.25rem;border-bottom:1px solid hsl(var(--border));margin-bottom:1.5rem;overflow-x:auto}
.tab{
  height:2.25rem;padding-inline:.875rem;border-radius:var(--radius-button) var(--radius-button) 0 0;
  font-size:.875rem;font-weight:500;color:hsl(var(--muted-foreground));
  background:transparent;border:0;border-bottom:2px solid transparent;
  margin-bottom:-1px;cursor:pointer;white-space:nowrap;
  transition:color var(--duration) var(--ease),border-color var(--duration) var(--ease);
}
.tab:hover{color:hsl(var(--foreground))}
.tab.active,.tab[aria-selected="true"]{color:hsl(var(--foreground));font-weight:600;border-bottom-color:hsl(var(--primary))}

/* alert */
.alert{
  display:flex;gap:.75rem;padding:.875rem 1rem;
  border:1px solid hsl(var(--border));border-radius:var(--radius-card);
  background:hsl(var(--card));font-size:.875rem;line-height:1.55;
}
.alert-info{border-color:hsl(var(--primary)/.25);background:hsl(var(--primary)/.05);color:hsl(var(--foreground))}
.alert-success{border-color:hsl(var(--success)/.3);background:hsl(var(--success)/.06)}
.alert-danger{border-color:hsl(var(--destructive)/.3);background:hsl(var(--destructive)/.05)}
.alert-warn{border-color:hsl(var(--warning)/.35);background:hsl(var(--warning)/.07)}

/* progress */
.progress{height:.5rem;background:hsl(var(--muted));border-radius:var(--radius-pill);overflow:hidden}
.progress-bar{height:100%;background:hsl(var(--primary));border-radius:var(--radius-pill);transition:width .4s var(--ease)}

/* skeleton */
.skeleton{
  background:linear-gradient(90deg,hsl(var(--muted)) 25%,hsl(var(--muted)/.5) 50%,hsl(var(--muted)) 75%);
  background-size:200% 100%;animation:shimmer 1.4s infinite;border-radius:var(--radius-sm);
}
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* dropdown / popover */
.popover{
  background:hsl(var(--popover));color:hsl(var(--popover-foreground));
  border:1px solid hsl(var(--border));border-radius:var(--radius-card);
  box-shadow:var(--shadow-2);padding:.375rem;min-width:12rem;z-index:60;
}
.popover-item{
  display:flex;align-items:center;gap:.5rem;width:100%;
  padding:.5rem .625rem;border-radius:var(--radius-sm);
  font-size:.875rem;color:hsl(var(--foreground));cursor:pointer;background:transparent;
}
.popover-item:hover{background:hsl(var(--accent))}

/* misc utilities */
.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}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tabular{font-variant-numeric:tabular-nums}
.scroll-x{overflow-x:auto;-webkit-overflow-scrolling:touch}
.sticky-t{position:sticky;top:0;z-index:30}
.rounded-card{border-radius:var(--radius-card)}
.border-t{border-top:1px solid hsl(var(--border))}
.border-b{border-bottom:1px solid hsl(var(--border))}
.bg-muted{background:hsl(var(--muted))}
.hover-bg:hover{background:hsl(var(--accent))}
.transition{transition:all var(--duration) var(--ease)}

/* login/signup shell */
.auth-shell{
  display:flex;align-items:center;justify-content:center;
  min-height:calc(100vh - 3.5rem);padding:2.5rem 1.25rem;
  background:hsl(var(--background));
}
.auth-card{
  width:100%;max-width:26rem;
  background:hsl(var(--card));border:1px solid hsl(var(--border));
  border-radius:var(--radius-2xl);padding:2rem;
  box-shadow:var(--shadow-1);
}
.auth-card .auth-logo{display:flex;align-items:center;justify-content:center;gap:.625rem;margin-bottom:1.5rem}
.auth-card .auth-logo img{width:32px;height:32px;border-radius:8px}
.auth-card .auth-logo span{font-weight:700;font-size:1.0625rem;letter-spacing:-.02em}
.auth-card h1{font-size:1.375rem;font-weight:700;letter-spacing:-.02em;text-align:center;margin-bottom:.375rem}
.auth-card .auth-sub{font-size:.9375rem;color:hsl(var(--muted-foreground));text-align:center;margin-bottom:1.75rem}
.auth-divider{display:flex;align-items:center;gap:.875rem;margin:1.25rem 0;color:hsl(var(--muted-foreground));font-size:.8125rem}
.auth-divider::before,.auth-divider::after{content:"";flex:1;height:1px;background:hsl(var(--border))}
.auth-foot{margin-top:1.5rem;text-align:center;font-size:.875rem;color:hsl(var(--muted-foreground))}
.auth-foot a{color:hsl(var(--foreground));font-weight:500;text-decoration:underline;text-underline-offset:2px}
.auth-foot a:hover{color:hsl(var(--primary))}

/* docs layout */
.docs-layout{display:grid;grid-template-columns:1fr;gap:2.5rem;max-width:80rem;margin-inline:auto;padding-inline:1.5rem;padding-block:2.5rem}
@media(min-width:1024px){.docs-layout{grid-template-columns:15rem minmax(0,1fr);gap:3.5rem}}
.docs-toc{display:none;font-size:.875rem}
@media(min-width:1024px){.docs-toc{display:block;position:sticky;top:4.5rem;align-self:start;max-height:calc(100vh - 6rem);overflow-y:auto}}
.docs-toc ul{display:flex;flex-direction:column;gap:.125rem;border-left:1px solid hsl(var(--border))}
.docs-toc a{display:block;padding:.3125rem .875rem;color:hsl(var(--muted-foreground));border-left:2px solid transparent;margin-left:-1px;font-size:.8125rem;line-height:1.45}
.docs-toc a:hover{color:hsl(var(--foreground));text-decoration:none}
.docs-toc a.active{color:hsl(var(--primary));border-left-color:hsl(var(--primary));font-weight:600}
.docs-content{min-width:0;max-width:48rem}
.docs-content h2{font-size:1.5rem;font-weight:700;letter-spacing:-.02em;margin-top:2.75rem;margin-bottom:.875rem;scroll-margin-top:5rem}
.docs-content h3{font-size:1.125rem;font-weight:600;margin-top:2rem;margin-bottom:.625rem;scroll-margin-top:5rem}
.docs-content p{font-size:.9375rem;line-height:1.75;color:hsl(var(--muted-foreground));margin:.75rem 0}
.docs-content ul,.docs-content ol{margin:.75rem 0;padding-left:1.375rem;display:flex;flex-direction:column;gap:.375rem}
.docs-content ul{list-style:disc}
.docs-content ol{list-style:decimal}
.docs-content li{font-size:.9375rem;line-height:1.7;color:hsl(var(--muted-foreground))}
.docs-content a{color:hsl(var(--primary));text-decoration:underline;text-underline-offset:2px}
.docs-content pre{margin:1.25rem 0}
.docs-content blockquote{
  margin:1.25rem 0;padding:.875rem 1.125rem;
  border-left:3px solid hsl(var(--primary));
  background:hsl(var(--muted)/.5);border-radius:0 var(--radius-sm) var(--radius-sm) 0;
  font-size:.9375rem;color:hsl(var(--muted-foreground));
}

/* responsive: collapse nav under 1100 already handled; small tweaks */
@media(max-width:640px){
  .stats{grid-template-columns:1fr}
  .hero-actions .btn,.hero-actions .spectrum-fill{width:100%}
  .footer-bottom{flex-direction:column;align-items:flex-start}
}

/* ═══ SPECIFICITY FIXES vs gm.css ═══ */
/* gm.css .hero h1 / .hero-inner outspecifies .hero-title — override with equal-or-higher */
.hero .hero-title,
.hero h1.hero-title{
  font-weight:700;letter-spacing:-.03em;line-height:1.06;
  font-size:2.25rem;color:hsl(var(--foreground));margin-top:0;max-width:18ch;
}
@media(min-width:640px){.hero .hero-title,.hero h1.hero-title{font-size:3rem}}
@media(min-width:1024px){.hero .hero-title,.hero h1.hero-title{font-size:3.5rem}}
.hero .hero-inner{max-width:80rem;margin-inline:auto;padding:4.5rem 1.5rem 3.5rem;position:relative;z-index:1}
@media(min-width:768px){.hero .hero-inner{padding:6rem 1.5rem 4.5rem}}
.hero .hero-lead{max-width:36rem;margin-top:1.25rem;font-size:1.125rem;line-height:1.65;color:hsl(var(--muted-foreground))}
.hero .kicker{margin-bottom:1rem}
.hero .stats{margin-top:3.5rem}
/* neutralize gm.css decorative body::after */
body::after{display:none!important;content:none!important}
body::before{display:none!important;content:none!important}
/* gm.css feature-grid spacing */
.section .feature-grid{margin-top:0;gap:1.5rem}
/* ensure .sec-head kicker/lead spacing matches */
.sec-head .kicker{margin-bottom:.75rem}
.sec-head .lead{margin-top:1rem}
/* gm.css .hero .sub no longer used but guard */
.hero .sub{display:none}
/* lab-card img white bg → token */
.lab-card img{background:hsl(var(--card))}
/* palette uses --foreground-faint / --primary-text — map them */
:root{
  --primary-text:hsl(var(--primary));
  --foreground-faint:hsl(var(--muted-foreground)/.75);
}
html[data-theme="dark"],[data-theme="dark"]{
  --primary-text:hsl(var(--primary));
  --foreground-faint:hsl(var(--muted-foreground)/.75);
}

/* pricing .plan → OpenRouter card radius */
.plans .plan{border-radius:var(--radius-card)}
.plans .plan.featured{border-color:hsl(var(--primary)/.45);box-shadow:0 0 0 1px hsl(var(--primary)/.2),var(--shadow-2)}
