/* lgteamai console.
   Built on the main site: /styles.css gives the tokens (colours, radii, the
   --ease curve), the buttons, the reveal on scroll and the split titles.
   Everything below is the console's own and carries the c- prefix so it never
   collides with the site's classes. */

:root {
  --c-side: 248px;
  --c-line: rgba(255, 255, 255, 0.07);
  --c-fill: rgba(255, 255, 255, 0.05);
  --c-fill-2: rgba(255, 255, 255, 0.09);
  --c-danger: #ff9a9a;
  --c-ok: #a6e6b8;
  --c-link: #8fb5ff;
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ---------- top bar (the site's .nav) ---------- */

.c-left { display: flex; align-items: center; gap: 4px; min-width: 0; }
.c-brand-sub { color: var(--muted); font-weight: 400; }

.c-slogan {
  font-size: 0.875rem;
  color: var(--dim);
  padding-left: 14px;
  margin-left: 8px;
  border-left: 1px solid var(--c-line);
  white-space: nowrap;
}

.c-search {
  flex: 1 1 auto;
  max-width: 420px;
  height: 40px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 16px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--dim);
  font-size: 0.9375rem;
  text-align: left;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.c-search:hover { background: var(--c-fill-2); color: var(--muted); }
.c-search svg { width: 16px; height: 16px; flex: none; }
.c-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.c-kbd {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--surface-3);
}

.c-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 320ms var(--ease);
}

.c-icon-btn:hover { background: var(--c-fill-2); color: var(--fg); }
.c-icon-btn:active { transform: scale(0.94); }
.c-icon-btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.c-icon-btn svg { width: 18px; height: 18px; }

.c-balance {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding-inline: 4px;
  white-space: nowrap;
}

.btn.c-sm { min-height: 40px; padding: 0 20px; font-size: 0.9375rem; }
.btn.c-xs { min-height: 34px; padding: 0 16px; font-size: 0.875rem; }
.btn-danger { --bg-rest: rgba(255, 154, 154, 0.1); --fg-rest: var(--c-danger); --bg-hover: var(--c-danger); --fg-hover: var(--bg); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

/* ---------- frame ---------- */

.c-main {
  margin-left: var(--c-side);
  padding-top: var(--nav-h);
  min-height: 100svh;
}

.c-wrap {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding: clamp(28px, 4vw, 52px) clamp(20px, 3vw, 40px) 120px;
  display: flex;
  flex-direction: column;
  gap: clamp(44px, 6vw, 72px);
}

/* ---------- sidebar with a floating highlight ---------- */

.c-side {
  position: fixed;
  left: 0;
  top: var(--nav-h);
  bottom: 0;
  width: var(--c-side);
  padding: 8px 14px 20px;
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.c-side-nav { position: relative; display: flex; flex-direction: column; gap: 2px; }

.c-ind {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 40px;
  border-radius: 12px;
  background: var(--c-fill-2);
  transform: translate3d(0, var(--y, 0px), 0);
  opacity: 0;
  pointer-events: none;
  transition: transform 520ms var(--ease-drawer), height 520ms var(--ease-drawer), opacity 240ms var(--ease);
}

.c-ind.on { opacity: 1; }

.c-group {
  font-size: 0.75rem;
  color: var(--dim);
  padding: 20px 12px 8px;
  letter-spacing: 0.02em;
}

.c-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.9375rem;
  transition: color var(--dur) var(--ease);
}

.c-link svg { width: 18px; height: 18px; flex: none; transition: transform 420ms var(--ease); }
.c-link:hover, .c-link.is-active { color: var(--fg); }
.c-link:hover svg { transform: scale(1.12) rotate(-4deg); }

.c-account {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  min-width: 0;
  transition: background-color var(--dur) var(--ease);
}

.c-account:hover { background: var(--c-fill); }
.c-account > div { min-width: 0; }

.c-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
}

.c-account b { display: block; font-size: 0.875rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-account small { font-size: 0.75rem; color: var(--muted); }

/* the shell slides in once per visit, then page changes only animate the content */
.c-first .c-link { animation: c-slide-l 700ms var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms); }
.c-first .c-account { animation: c-fade 700ms var(--ease) 500ms both; }

@keyframes c-slide-l { from { opacity: 0; transform: translate3d(-18px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes c-fade { from { opacity: 0; } to { opacity: 1; } }

/* phone: the tab bar replaces the sidebar */
.c-tabs { display: none; }

/* ---------- titles ---------- */

.hero-title.c-title {
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  margin: 0;
}

.hero-title.c-title.c-xl { font-size: clamp(2.6rem, 6.4vw, 5.4rem); letter-spacing: -0.05em; }

.c-kicker { color: var(--muted); font-size: 1rem; margin-bottom: 14px; }
.c-lead { color: var(--muted); font-size: 1.0625rem; line-height: 1.5; max-width: 56ch; margin-top: 14px; }

.c-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
}

.c-h2 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.c-h2 small { font-size: 0.875rem; font-weight: 400; color: var(--dim); letter-spacing: 0; }
.c-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.c-link-btn {
  color: var(--c-link);
  font-size: 0.9375rem;
  transition: color var(--dur) var(--ease);
}

.c-link-btn:hover { color: #bcd3ff; }

/* sign-up bonus note on the register page */
.c-bonus {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: #4ade80;
  font-size: 0.9375rem;
  font-weight: 500;
}

.c-bonus svg { flex: none; }

/* captcha on the register page */
.c-captcha { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.c-captcha-img {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 60px;
  border-radius: 16px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.c-captcha-img img { display: block; width: 190px; height: 60px; max-width: 100%; animation: c-captcha-in 220ms var(--ease) both; user-select: none; -webkit-user-drag: none; }

@keyframes c-captcha-in { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: blur(0); } }

.c-captcha-new {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--dim);
  cursor: pointer;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), transform 160ms var(--ease);
}

.c-captcha-new:hover { color: var(--fg); background: var(--c-fill-2); }
.c-captcha-new:active { transform: scale(0.94); }
.c-captcha-new svg { transition: transform 420ms var(--ease); }
.c-captcha-new.spin svg { transform: rotate(360deg); }

/* ---------- reveal variants: the page does not always move the same way ---------- */

.js .reveal.c-scale { translate: 0 0; scale: 0.93; transform-origin: 50% 100%; transition-property: opacity, scale, transform; }
.js .reveal.c-scale.in { scale: 1; }

.js .reveal.c-from-left { translate: -40px 0; }
.js .reveal.c-from-left.in { translate: 0 0; }

.js .reveal.c-from-right { translate: 40px 0; }
.js .reveal.c-from-right.in { translate: 0 0; }

/* The wipes use a mask, not clip-path: an IntersectionObserver treats a fully clipped element as
   invisible, so a clip-path wipe never received the "in" class and stayed blank. */
.js .reveal.c-wipe {
  translate: 0 0;
  -webkit-mask-image: linear-gradient(180deg, #000 0 33%, transparent 66% 100%);
  mask-image: linear-gradient(180deg, #000 0 33%, transparent 66% 100%);
  -webkit-mask-size: 100% 300%;
  mask-size: 100% 300%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 0 100%;
  mask-position: 0 100%;
  transition: opacity 500ms var(--ease) var(--d, 0ms), mask-position 1000ms var(--ease) var(--d, 0ms), -webkit-mask-position 1000ms var(--ease) var(--d, 0ms), transform 500ms var(--ease);
}

.js .reveal.c-wipe.in { -webkit-mask-position: 0 0; mask-position: 0 0; }

.js .reveal.c-line {
  translate: 0 0;
  -webkit-mask-image: linear-gradient(90deg, #000 0 33%, transparent 66% 100%);
  mask-image: linear-gradient(90deg, #000 0 33%, transparent 66% 100%);
  -webkit-mask-size: 300% 100%;
  mask-size: 300% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  transition: opacity 400ms var(--ease) var(--d, 0ms), mask-position 1100ms var(--ease) var(--d, 0ms), -webkit-mask-position 1100ms var(--ease) var(--d, 0ms);
}

.js .reveal.c-line.in { -webkit-mask-position: 0 0; mask-position: 0 0; }

/* ---------- cards: tilt from the site plus a spotlight that follows the cursor ---------- */

.c-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 2.4vw, 28px);
  overflow: hidden;
  isolation: isolate;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 500ms var(--ease), background-color var(--dur-slow) var(--ease);
}

.c-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(380px circle at var(--sx, 50%) var(--sy, 0%), rgba(255, 255, 255, 0.075), transparent 62%);
  opacity: 0;
  transition: opacity 420ms var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .c-card:hover::before { opacity: 1; }
}

a.c-card { display: flex; flex-direction: column; }

.c-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.c-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.c-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* horizontal bars: share of usage per model */
.c-hbar { display: grid; grid-template-columns: minmax(120px, 200px) 1fr auto; align-items: center; gap: 8px 20px; padding: 14px 0; border-top: 1px solid var(--c-line); }
.c-hbar:first-child { border-top: 0; }
.c-hbar-track { height: 8px; border-radius: 8px; background: var(--c-fill); overflow: hidden; }
.c-hbar-track i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #8d8d8d, #f4f4f4); transform-origin: left; transform: scaleX(0); transition: transform 1200ms var(--ease) calc(var(--i, 0) * 90ms + 200ms); }
.in .c-hbar-track i { transform: scaleX(var(--v, 0.02)); }
.c-hbar b { font-weight: 500; font-variant-numeric: tabular-nums; min-width: 6.5em; text-align: right; }
.c-hbar small { grid-column: 1 / -1; color: var(--dim); font-size: 0.8125rem; font-variant-numeric: tabular-nums; margin-top: -4px; }

/* ---------- numbers ---------- */

.c-stat-label { color: var(--muted); font-size: 0.9375rem; display: flex; align-items: center; gap: 8px; }

.c-stat-value {
  margin-top: 10px;
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.c-grid-4 .c-stat-value { font-size: clamp(1.4rem, 2.3vw, 1.9rem); overflow-wrap: anywhere; }

.c-stat-foot {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  flex-wrap: wrap;
}

/* ---------- bars: tokens per day ---------- */

.c-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(8px, 2vw, 22px);
  align-items: end;
  height: 168px;
}

.c-bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; align-items: stretch; min-width: 0; }

.c-bar i {
  display: block;
  height: calc(var(--v, 0.02) * 100% - 26px);
  min-height: 4px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f4f4f4, #8d8d8d);
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 1100ms var(--ease) calc(var(--i, 0) * 70ms + var(--d, 0ms)), filter 300ms var(--ease);
}

.c-bar.empty i { background: var(--c-fill-2); }
.in .c-bar i, .c-bars.in .c-bar i { transform: none; }
.c-bar:hover i { filter: brightness(1.25); }
.c-bar span { font-size: 0.75rem; color: var(--dim); text-align: center; }
.c-bar b { font-weight: 400; font-size: 0.75rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; min-height: 1em; }

/* ---------- model cards ---------- */

.c-model { gap: 16px; min-height: 100%; }

.c-name { font-size: 1.1875rem; font-weight: 500; letter-spacing: -0.02em; }
.c-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.c-pill { font-size: 0.75rem; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--c-fill); color: var(--muted); white-space: nowrap; }
.c-pill.hot { background: var(--fg); color: var(--bg); }

.c-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 6px; font-variant-numeric: tabular-nums; }
.c-prices small { display: block; font-size: 0.75rem; color: var(--dim); }
.c-prices b { font-size: 1.125rem; font-weight: 500; letter-spacing: -0.01em; }

/* ---------- resource tiles ---------- */

.c-res { gap: 10px; }
.c-res h3 { font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.01em; margin-top: 8px; }
.c-res p { color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }

.c-res-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--c-fill);
  transition: background-color 400ms var(--ease), transform 600ms var(--ease);
}

.c-res:hover .c-res-ico { background: var(--fg); color: var(--bg); transform: rotate(-8deg) scale(1.06); }
.c-res-ico svg { width: 20px; height: 20px; }

.c-card .c-arrow-plain { position: absolute; right: 22px; top: 22px; width: 20px; height: 20px; color: var(--dim); transition: transform 500ms var(--ease), color 300ms var(--ease); }
.c-card:hover .c-arrow-plain { transform: translate(4px, -4px); color: var(--fg); }

/* ---------- hero band on the dashboard ---------- */

.c-hero { position: relative; padding: clamp(8px, 2vw, 24px) 0 4px; }
.c-hero .net { opacity: 0.55; -webkit-mask-image: radial-gradient(70% 90% at 70% 40%, #000 20%, transparent 78%); mask-image: radial-gradient(70% 90% at 70% 40%, #000 20%, transparent 78%); }
.c-hero > *:not(.net) { position: relative; z-index: 1; }
.c-hero .c-actions { margin-top: 30px; }

/* ---------- code ---------- */

.c-code {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 22px;
  padding-right: 110px;
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}

.c-code pre { margin: 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.8125rem; line-height: 1.7; color: #e6e6e6; white-space: pre; }
.c-code .c-copy { position: absolute; right: 12px; top: 12px; }
code, .c-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

.c-copy {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--c-fill);
  color: var(--muted);
  font-size: 0.8125rem;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 300ms var(--ease);
}

.c-copy:hover { background: var(--c-fill-2); color: var(--fg); }
.c-copy:active { transform: scale(0.95); }
.c-copy.done { background: var(--fg); color: var(--bg); }

.c-copy-line { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow-card); min-width: 0; }
.c-copy-line code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; }

/* ---------- lists and tables ---------- */

.c-table-wrap { overflow-x: auto; }
.c-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.c-table th { text-align: left; font-weight: 400; font-size: 0.8125rem; color: var(--dim); padding: 0 16px 12px 0; white-space: nowrap; }
.c-table td { padding: 15px 16px 15px 0; border-top: 1px solid var(--c-line); font-variant-numeric: tabular-nums; vertical-align: middle; }
.c-table .num { text-align: right; padding-right: 0; }
.c-table tr { transition: background-color var(--dur) var(--ease); }
.c-table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.c-table .trunc { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.c-badge { display: inline-block; font-size: 0.75rem; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--c-fill); color: var(--muted); white-space: nowrap; }
.c-badge.ok { color: var(--c-ok); }
.c-badge.bad { color: var(--c-danger); }
.c-muted { color: var(--muted); }
.c-dim { color: var(--dim); }

.c-empty { min-height: 120px; display: flex; flex-direction: column; justify-content: center; gap: 8px; color: var(--muted); }
.c-empty .dash { font-size: 1.75rem; color: var(--dim); line-height: 1; }

/* new rows grow in instead of snapping */
.c-row-in { animation: c-row-in 650ms var(--ease) both; }
@keyframes c-row-in { from { opacity: 0; transform: translate3d(-14px, 0, 0); background: rgba(255, 255, 255, 0.08); } to { opacity: 1; transform: none; } }

/* ---------- forms ---------- */

.c-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.c-field > label, .c-label { font-size: 0.875rem; color: var(--muted); }

.c-input {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 16px;
  background: var(--surface-3);
  color: var(--fg);
  outline: none;
  transition: background-color var(--dur) var(--ease), box-shadow 300ms var(--ease);
}

.c-input:focus { background: var(--c-fill-2); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35); }
.c-input::placeholder { color: var(--dim); }
.c-input[aria-invalid="true"] { box-shadow: 0 0 0 1px rgba(255, 154, 154, 0.7); animation: c-shake 420ms var(--ease); }
textarea.c-input { padding: 14px 18px; min-height: 96px; line-height: 1.5; resize: vertical; }

@keyframes c-shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

.c-hint { font-size: 0.8125rem; color: var(--dim); }
.c-error { font-size: 0.875rem; color: var(--c-danger); min-height: 1.3em; }
.c-form { display: flex; flex-direction: column; gap: 20px; }

.c-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.25); border-top-color: #0a0a0a; animation: spin 700ms linear infinite; margin-right: 8px; flex: none; }

/* segmented control with a sliding pill */
.c-seg { position: relative; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); padding: 4px; border-radius: var(--radius-pill); background: var(--surface-3); }
.c-seg-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 4)); border-radius: var(--radius-pill); background: var(--fg); transform: translate3d(calc(var(--i, 0) * 100%), 0, 0); transition: transform 520ms var(--ease-drawer); }
.c-seg button { position: relative; z-index: 1; height: 36px; border-radius: var(--radius-pill); font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; transition: color 300ms var(--ease); }
.c-seg button[aria-checked="true"] { color: var(--bg); }

/* range */
.c-range { width: 100%; height: 28px; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.c-range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--fg) var(--p, 30%), var(--c-fill-2) var(--p, 30%)); }
.c-range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--c-fill-2); }
.c-range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--fg); }
.c-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--fg); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.0); transition: box-shadow 300ms var(--ease), transform 300ms var(--ease); }
.c-range:hover::-webkit-slider-thumb, .c-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12); }
.c-range:active::-webkit-slider-thumb { transform: scale(1.15); }
.c-range::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--fg); }
.c-range-row { display: flex; align-items: center; justify-content: space-between; font-variant-numeric: tabular-nums; }

/* ---------- dialogs: a modal grows from the centre, with a soft blur ---------- */

dialog.c-dialog {
  margin: auto;
  padding: 0;
  border: 0;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100svh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 28px;
  background: var(--surface-2);
  color: var(--fg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 100px -20px rgba(0, 0, 0, 0.9);
  opacity: 0;
  scale: 0.94;
  filter: blur(8px);
  transition: opacity 260ms var(--ease), scale 420ms var(--ease-drawer), filter 260ms var(--ease), overlay 420ms allow-discrete, display 420ms allow-discrete;
}

dialog.c-dialog[open] { opacity: 1; scale: 1; filter: blur(0); }

@starting-style {
  dialog.c-dialog[open] { opacity: 0; scale: 0.94; filter: blur(8px); }
}

dialog.c-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 320ms var(--ease), overlay 320ms allow-discrete, display 320ms allow-discrete;
}

dialog.c-dialog[open]::backdrop { opacity: 1; }

@starting-style {
  dialog.c-dialog[open]::backdrop { opacity: 0; }
}

.c-dialog-in { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.c-dialog-title { font-size: 1.375rem; font-weight: 500; letter-spacing: -0.02em; }
.c-dialog-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- popovers: they grow out of the thing that opened them ---------- */

.c-pop-anchor { position: relative; }

.c-pop {
  position: absolute;
  z-index: 50;
  width: max-content;
  min-width: 300px;
  max-width: min(360px, calc(100vw - 32px));
  display: grid;
  grid-template-rows: 0fr;
  border-radius: 22px;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 70px -20px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  transition: grid-template-rows 520ms var(--ease-drawer), opacity 220ms var(--ease), translate 520ms var(--ease-drawer);
}

.c-pop-in { overflow: hidden; min-height: 0; padding: 0 8px; border-radius: 22px; }
.c-pop.is-open .c-pop-in { padding: 8px; }
.c-pop-in { transition: padding 520ms var(--ease-drawer); }

.c-pop.is-open { grid-template-rows: 1fr; opacity: 1; translate: 0 0; pointer-events: auto; }
.c-pop.up { bottom: calc(100% + 12px); left: 0; translate: 0 14px; }
.c-pop.down { top: calc(100% + 12px); right: 0; translate: 0 -14px; }
.c-pop-empty { padding: 18px 16px; color: var(--muted); font-size: 0.9375rem; }

/* model options, shared by the quick menu and the side panel */
.c-opt {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  padding: 12px 14px;
  border-radius: 16px;
  text-align: left;
  color: var(--muted);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.c-opt:hover { background: var(--c-fill); color: var(--fg); }
.c-opt b { font-weight: 500; font-size: 0.9375rem; color: var(--fg); }
.c-opt small { grid-column: 1; font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.c-opt .c-pill { grid-column: 2; grid-row: 1; }
.c-opt .c-check { grid-column: 2; grid-row: 2; justify-self: end; width: 18px; height: 18px; opacity: 0; scale: 0.25; filter: blur(4px); transition: opacity 300ms var(--ease), scale 300ms var(--ease), filter 300ms var(--ease); }
.c-opt[aria-checked="true"] .c-check { opacity: 1; scale: 1; filter: blur(0); }

/* ---------- playground: the site's chat language (dot rail, speed, examples) ---------- */

.c-main.is-full { padding: calc(var(--nav-h) + 12px) 16px 16px 0; }

.c-play {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 340px;
  height: calc(100svh - var(--nav-h) - 28px);
  min-height: 520px;
  background: var(--surface);
  border-radius: 32px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.c-rail { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; background: var(--surface-2); min-width: 0; }
.c-dots { display: grid; grid-template-columns: repeat(4, 8px); gap: 12px; }
.c-dots i { display: block; width: 8px; height: 8px; border-radius: 50%; background: #333; }
.c-play[data-state="busy"] .c-dots i { animation: dot-wave 1.5s ease-in-out infinite; animation-delay: calc(var(--d) * 110ms); }
.c-rail-label { font-size: 0.8125rem; color: var(--muted); opacity: 0; transform: translate3d(0, 6px, 0); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
.c-play[data-state="busy"] .c-rail-label { opacity: 1; transform: none; }

.c-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.c-chat-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 14px 28px; }
.c-chat-model { display: flex; align-items: center; gap: 12px; min-width: 0; }
.c-model-name { font-weight: 500; font-size: 1rem; letter-spacing: -0.01em; display: grid; overflow: hidden; height: 1.5em; }
.c-model-name span { grid-area: 1 / 1; display: block; white-space: nowrap; }
.c-model-meta { color: var(--muted); font-size: 0.8125rem; }
.c-chat-tools { display: flex; align-items: center; gap: 4px; }
.c-speed { color: var(--muted); font-size: 0.8125rem; margin-right: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-speed b { color: var(--fg); font-weight: 500; margin: 0 2px; }

.c-log { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 28px 8px; display: flex; flex-direction: column; gap: 22px; scroll-behavior: smooth; overscroll-behavior: contain; outline: none; }
.c-log::-webkit-scrollbar { width: 8px; }
.c-log::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 8px; }

.c-welcome { margin: auto; max-width: 560px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding: 12px 0; }
.c-welcome h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 500; letter-spacing: -0.03em; }
.c-welcome p { color: var(--muted); font-size: 0.9375rem; max-width: 44ch; }
.c-examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }

.c-example {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.875rem;
  animation: c-pop-in 600ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms + 400ms);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 320ms var(--ease);
}

.c-example:hover { background: var(--fg); color: var(--bg); transform: translateY(-2px); }
.c-example:active { transform: scale(0.96); }

@keyframes c-pop-in { from { opacity: 0; transform: scale(0.88) translate3d(0, 10px, 0); filter: blur(4px); } to { opacity: 1; transform: none; filter: blur(0); } }

.c-msg { display: flex; flex-direction: column; gap: 8px; max-width: 760px; width: 100%; }
.c-msg.user { align-self: flex-end; align-items: flex-end; animation: c-user-in 520ms var(--ease) both; transform-origin: 100% 100%; }
.c-msg.bot { align-self: flex-start; }

@keyframes c-user-in { from { opacity: 0; transform: translate3d(28px, 10px, 0) scale(0.94); } to { opacity: 1; transform: none; } }

.c-bubble { background: var(--surface-2); padding: 12px 18px; border-radius: 22px 22px 6px 22px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.96875rem; }

.c-bot-row { display: flex; gap: 14px; align-items: flex-start; }
.c-bot-mark { width: 30px; height: 30px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; margin-top: 2px; }
.c-bot-mark img { width: 16px; height: 16px; }
.c-bot-text { min-width: 0; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.96875rem; padding-top: 3px; }

/* words arrive one by one and sharpen as they land */
.c-w { display: inline; opacity: 0; filter: blur(5px); animation: c-word 480ms var(--ease) forwards; animation-delay: calc(var(--k) * var(--step, 16ms)); }
@keyframes c-word { to { opacity: 1; filter: blur(0); } }

.c-msg-meta { display: flex; align-items: center; gap: 10px; margin-left: 44px; color: var(--dim); font-size: 0.8125rem; font-variant-numeric: tabular-nums; opacity: 0; animation: c-fade 600ms var(--ease) forwards; animation-delay: var(--meta-d, 600ms); flex-wrap: wrap; }
.c-mini { height: 28px; padding: 0 12px; border-radius: var(--radius-pill); background: transparent; color: var(--muted); font-size: 0.8125rem; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 300ms var(--ease); }
.c-mini:hover { background: var(--c-fill-2); color: var(--fg); }
.c-mini:active { transform: scale(0.95); }

.c-think { display: inline-flex; gap: 5px; align-items: center; height: 24px; margin-left: 44px; }
.c-think i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: c-think 1.2s var(--ease) infinite; }
.c-think i:nth-child(2) { animation-delay: 150ms; }
.c-think i:nth-child(3) { animation-delay: 300ms; }
@keyframes c-think { 0%, 80%, 100% { opacity: 0.25; transform: none; } 40% { opacity: 1; transform: translateY(-4px); } }

.c-chat-error { margin: 0 28px; min-height: 0; color: var(--c-danger); font-size: 0.875rem; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.c-chat-error:not(:empty) { padding: 8px 0; animation: c-fade 300ms var(--ease) both; }

.c-composer { margin: 8px 20px 20px 20px; background: var(--surface-2); border-radius: 28px; padding: 14px 14px 12px 22px; transition: box-shadow 320ms var(--ease); }
.c-composer:focus-within { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28), 0 0 60px rgba(255, 255, 255, 0.035); }

.c-composer textarea { width: 100%; min-height: 28px; max-height: 180px; resize: none; background: none; border: 0; outline: none; color: var(--fg); font: inherit; font-size: 1rem; line-height: 1.55; padding: 4px 0; }
.c-composer textarea::placeholder { color: var(--dim); }

.c-composer-bar { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.c-hint { margin-left: auto; font-size: 0.75rem; color: var(--dim); opacity: 0; transition: opacity 400ms var(--ease); }
.c-composer:focus-within .c-hint { opacity: 1; }

.c-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 10px; border-radius: var(--radius-pill); background: var(--surface-3); color: var(--muted); font-size: 0.875rem; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 300ms var(--ease); }
.c-chip:hover, .c-chip[aria-expanded="true"] { background: var(--c-fill-2); color: var(--fg); }
.c-chip:active { transform: scale(0.96); }
.c-chip img { width: 18px; height: 18px; border-radius: 5px; }
.c-chip svg { width: 14px; height: 14px; transition: transform 400ms var(--ease-drawer); }
.c-chip[aria-expanded="true"] svg { transform: rotate(180deg); }

.c-send { position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--fg); color: var(--bg); display: grid; place-items: center; transition: transform 320ms var(--ease), opacity 300ms var(--ease), scale 300ms var(--ease); }
.c-send:active:not(:disabled) { transform: scale(0.92); }
.c-send:disabled { opacity: 0.28; scale: 0.9; cursor: default; }
.c-send svg { position: absolute; width: 18px; height: 18px; transition: opacity 300ms var(--ease), scale 300ms var(--ease), filter 300ms var(--ease); }
.c-send .stop { opacity: 0; scale: 0.25; filter: blur(4px); }
.c-send[data-state="busy"] .go { opacity: 0; scale: 0.25; filter: blur(4px); }
.c-send[data-state="busy"] .stop { opacity: 1; scale: 1; filter: blur(0); }

/* side panel: model, length, temperature, system prompt */
.c-panel { min-width: 0; overflow: hidden; background: var(--surface); border-left: 1px solid var(--c-line); }
.c-panel-in { width: 100%; height: 100%; overflow-y: auto; padding: 26px 24px 28px; display: flex; flex-direction: column; gap: 30px; overscroll-behavior: contain; }
.c-panel h3 { font-size: 0.8125rem; font-weight: 400; color: var(--dim); letter-spacing: 0.02em; margin-bottom: 12px; }
.c-panel-sec { position: relative; }

.c-pick { position: relative; display: flex; flex-direction: column; gap: 2px; }
.c-pick-ind { position: absolute; left: 0; right: 0; top: 0; height: 68px; border-radius: 16px; background: var(--c-fill-2); transform: translate3d(0, var(--y, 0px), 0); transition: transform 520ms var(--ease-drawer), height 520ms var(--ease-drawer); pointer-events: none; }
.c-pick .c-opt { position: relative; z-index: 1; }
.c-pick .c-opt:hover { background: transparent; }

.c-acc { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 600ms var(--ease-drawer); }
.c-acc.open { grid-template-rows: 1fr; }
.c-acc > div { overflow: hidden; min-height: 0; }
.c-acc textarea { margin-top: 12px; }
.c-acc-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; color: var(--muted); font-size: 0.9375rem; }
.c-acc-btn svg { width: 16px; height: 16px; transition: transform 500ms var(--ease-drawer); }
.c-acc-btn[aria-expanded="true"] svg { transform: rotate(45deg); }

.c-estimate { padding: 16px 18px; border-radius: 18px; background: var(--surface-3); font-size: 0.875rem; color: var(--muted); line-height: 1.5; font-variant-numeric: tabular-nums; }
.c-estimate b { color: var(--fg); font-weight: 500; }

/* ---------- docs layout ---------- */

.c-docs { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 56px; align-items: start; }
.c-toc { position: sticky; top: calc(var(--nav-h) + 28px); display: flex; flex-direction: column; gap: 2px; font-size: 0.9375rem; }
.c-toc a { position: relative; padding: 8px 0 8px 16px; color: var(--muted); transition: color var(--dur) var(--ease); }
.c-toc a::before { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--fg); transform: scale(0); transition: transform 420ms var(--ease-drawer); }
.c-toc a:hover { color: var(--fg); }
.c-toc a[aria-current="true"] { color: var(--fg); }
.c-toc a[aria-current="true"]::before { transform: scale(1); }

.c-doc { display: flex; flex-direction: column; gap: 56px; min-width: 0; }
.c-doc section { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.c-doc h2 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); font-weight: 500; letter-spacing: -0.03em; }
.c-doc h3 { font-size: 1.0625rem; font-weight: 500; margin-top: 8px; }
.c-doc p, .c-doc li { color: #cfcfcf; line-height: 1.7; font-size: 1rem; }
.c-doc ul { padding-left: 20px; list-style: disc; display: flex; flex-direction: column; gap: 8px; }
.c-doc a { color: var(--c-link); }
.c-doc a:hover { text-decoration: underline; }
.c-doc code:not(pre code) { background: var(--c-fill); padding: 2px 8px; border-radius: 8px; font-size: 0.875em; color: var(--fg); }

/* ---------- misc ---------- */

.c-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 12px 22px; border-radius: var(--radius-pill); background: var(--surface-2); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 50px -10px rgba(0, 0, 0, 0.8); font-size: 0.9375rem; z-index: 120; animation: c-pop-in 420ms var(--ease) both; max-width: calc(100vw - 32px); }
.c-toast.out { animation: c-toast-out 260ms var(--ease) forwards; }
@keyframes c-toast-out { to { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.96); filter: blur(4px); } }

.c-palette-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; margin: 0 -8px; }
.c-palette-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; font-size: 0.9375rem; color: var(--muted); text-align: left; transition: background-color 120ms var(--ease), color 120ms var(--ease); }
.c-palette-item:hover, .c-palette-item:focus-visible, .c-palette-item.on { background: var(--c-fill-2); color: var(--fg); outline: none; }

.c-kv { display: grid; grid-template-columns: 140px 1fr; gap: 18px 24px; font-size: 1rem; }
.c-kv dt { color: var(--muted); }
.c-kv dd { min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* sign in and create account */
.c-auth { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 40px 20px; overflow: hidden; }
.c-auth .net { opacity: 0.6; -webkit-mask-image: radial-gradient(70% 70% at 50% 45%, #000 15%, transparent 75%); mask-image: radial-gradient(70% 70% at 50% 45%, #000 15%, transparent 75%); }
.c-auth-card { position: relative; z-index: 1; width: 100%; max-width: 420px; background: rgba(18, 18, 18, 0.82); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-radius: 32px; padding: clamp(28px, 5vw, 40px); box-shadow: var(--shadow-card), 0 0 0 1px rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; gap: 26px; }
.c-auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.c-auth-brand img { border-radius: 9px; }
.c-auth-foot { color: var(--muted); font-size: 0.9375rem; }
.c-auth-foot a { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, 0.3); transition: text-decoration-color var(--dur) var(--ease); }
.c-auth-foot a:hover { text-decoration-color: var(--fg); }

/* ---------- responsive ---------- */

@media (max-width: 1200px) {
  .c-docs { grid-template-columns: 1fr; gap: 28px; }
  .c-toc { display: none; }
}

@media (max-width: 1100px) {
  .c-slogan, .c-search { display: none; }
  .c-grid-3, .c-grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --c-side: 0px; }
  .c-side { display: none; }
  .c-main { padding-bottom: 76px; }
  .c-main.is-full { padding: calc(var(--nav-h) + 8px) 8px 84px; }
  .c-wrap { padding-bottom: 96px; }
  .c-grid-3, .c-grid-2 { grid-template-columns: 1fr; }
  .c-hbar { grid-template-columns: 1fr auto; }
  .c-hbar-track { grid-column: 1 / -1; grid-row: 2; }
  .c-nav-docs { display: none; }

  .c-tabs { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 70; display: grid; grid-template-columns: repeat(6, 1fr); padding: 6px; border-radius: 26px; background: rgba(26, 26, 26, 0.86); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 20px 40px -10px rgba(0, 0, 0, 0.8); }
  .c-tabs a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; border-radius: 20px; font-size: 0.6875rem; color: var(--muted); transition: color var(--dur) var(--ease), background-color 400ms var(--ease); }
  .c-tabs a svg { width: 20px; height: 20px; }
  .c-tabs a.is-active { color: var(--fg); background: var(--c-fill-2); }

  .c-play { display: flex; flex-direction: column; height: auto; min-height: 0; border-radius: 26px; overflow: visible; }
  .c-rail { display: none; }
  .c-chat { min-height: 72svh; }
  .c-log { min-height: 300px; max-height: 60svh; }
  .c-panel { border-left: 0; border-top: 1px solid var(--c-line); }
  .c-hint { display: none; }
  .c-chat-top { padding: 14px 12px 10px 18px; }
  .c-log { padding-inline: 18px; }
  .c-composer { margin: 6px 10px 10px; }
}

@media (max-width: 560px) {
  .c-stat-value { font-size: 2rem; }
  .c-speed { display: none; }
  .c-balance { display: none; }
  .c-kv { grid-template-columns: 1fr; gap: 6px 0; }
  .c-kv dd { margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .c-first .c-link, .c-first .c-account, .c-example, .c-msg.user, .c-w, .c-msg-meta, .c-row-in, .c-toast { animation: none !important; opacity: 1 !important; filter: none !important; transform: none !important; }
  .c-bar i { transform: none; transition: none; }
  dialog.c-dialog, .c-pop { transition-duration: 1ms; filter: none; }
}

/* ---------- states ---------- */

.c-pending #main { opacity: 0; }
#main { transition: opacity 300ms var(--ease); }
.hero-title.c-title:not(.is-split) { visibility: hidden; }
dialog.c-dialog.instant, dialog.c-dialog.instant::backdrop { transition-duration: 1ms !important; }
