/* ============ TypoWise AI — Anthropic-style editorial ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; } /* the hidden attribute always wins over author display rules */

:root {
  --ink: #141413;
  --body-ink: #3d3d3a;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(180deg, #f1f3f7 0%, #e9edf4 100%) fixed;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(1240px, 92%); margin-inline: auto; }

a { color: inherit; }

/* ============ TOP — rounded shell card on cream ============ */
.top {
  position: relative;
  min-height: calc(100svh - 2 * clamp(14px, 2.4vw, 30px));
  margin: clamp(14px, 2.4vw, 30px);
  border-radius: clamp(20px, 2.6vw, 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 76px; /* room for the fixed nav */
  background: linear-gradient(180deg, #f1f3f7 0%, #e9edf4 100%);
}

/* sky frame below the hero text — rounded corners all around */
.sky {
  position: relative;
  width: min(880px, 82%);
  height: clamp(240px, 42svh, 460px);
  margin: 0 auto clamp(14px, 2vw, 22px);
  border-radius: clamp(16px, 2vw, 24px);
  overflow: hidden;
  background: #cfd6e6;
}

/* JS writes a single transform here (pointer + scroll parallax) */
.sky-shift {
  position: absolute;
  inset: -6%;
  will-change: transform;
}

.sky-img {
  width: 100%;
  height: 100%;
  display: block;
  filter: saturate(1.08);
  transform: scale(1.01);
}
/* no-WebGL fallback keeps the painted JPEG */
.sky-img.fallback {
  background: url("hero-bg.jpg") 50% 42% / cover no-repeat;
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 40px;
  /* aligns the wordmark with the card edge: card margin + inner padding */
  padding: calc(clamp(14px, 2.4vw, 30px) + 4px) calc(clamp(14px, 2.4vw, 30px) + 40px) 16px;
  transition: background .3s ease, border-color .3s ease,
              backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
/* glass bar once the user scrolls */
.nav.scrolled {
  background: rgba(241, 243, 247, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(20, 20, 19, .07);
}

.wordmark {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.01em;
  text-decoration: none;
}
.wm-ai { font-weight: 400; font-style: italic; }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  position: relative;
  font-size: 15.5px;
  font-weight: 500;
  text-decoration: none;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s var(--ease-out);
}
.nav-link:hover::after { transform: scaleX(1); }

.btn-try {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 11px 22px;
  border-radius: 10px;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.btn-try:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(20, 20, 19, .28);
}

/* ============ HERO — centered, fills the viewport ============ */
.hero {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 0 32px;
}

.hero-h1 {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 4.9vw, 4.4rem);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.08;
  text-wrap: balance;
  max-width: 1000px;
}

.hero-side {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.45vw, 1.3rem);
  line-height: 1.55;
  color: #55534c;
  max-width: 620px;
  margin-top: 28px;
  text-wrap: pretty;
}

/* one-time entrance for the hero */
.hero-h1, .hero-side { animation: rise .9s var(--ease-out) both; }
.hero-side { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }


/* ============ SECTIONS ============ */
.section { padding: 110px 0; }

.sec-h {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  letter-spacing: -.01em;
  margin-bottom: 48px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.body-serif {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--body-ink);
}
.body-serif strong { color: var(--ink); }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 84px;
}
.pillar { border-top: 1px solid #d8d4ca; padding-top: 20px; }
.pillar h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  margin-bottom: 10px;
}
.pillar p { font-size: 15px; line-height: 1.55; color: var(--body-ink); }

/* scroll reveal — transform/opacity only, compositor-friendly */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity .8s ease var(--d, 0s),
    transform .8s var(--ease-out) var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ============ LATEST RELEASES — release cards ============ */
.rel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.rel-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .5);
  border: 1px solid #d8dce8;
  border-radius: 16px;
  padding: 30px 28px 28px;
}
.rel-card h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 12px;
}
.rel-desc {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
  color: var(--body-ink);
  margin-bottom: 26px;
}
.rel-meta {
  margin-top: auto;
  margin-bottom: 22px;
}
.rel-meta div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid #d8dce8;
  font-size: 13.5px;
}
.rel-meta div:first-child { border-top: 1px solid #d8dce8; }
.rel-meta dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #7a7d88;
}
.rel-meta dd { margin: 0; }
.rel-meta a { text-underline-offset: 3px; }
.rel-btn {
  align-self: flex-start;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 9px;
  text-decoration: none;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.rel-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(20, 20, 19, .24);
}

/* ============ NEWS — index table, editorial style ============ */
.news-table { border-top: 1px solid #c9cede; }
.news-row {
  display: grid;
  grid-template-columns: 170px 220px 1fr;
  gap: 28px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid #d8dce8;
}
.news-head {
  padding: 14px 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7a7d88;
}
.news-empty {
  padding: 46px 0 52px;
  font-family: var(--serif);
  font-size: 19px;
  color: #7a7d88;
}

/* ============ NEWS PAGE (/news) ============ */
.news-main { padding: 150px 0 130px; }
.news-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}
.news-head-row .sec-h {
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  margin: 0;
}

/* search pill — magnifier inset, glass input */
.news-search {
  position: relative;
  display: block;
  width: min(320px, 100%);
}
.news-search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  translate: 0 -50%;
  width: 16px;
  height: 16px;
  color: #7a7d88;
  pointer-events: none;
}
.news-search input {
  width: 100%;
  font: 500 15px var(--sans);
  color: var(--ink);
  padding: 12px 16px 12px 42px;
  border: 1px solid #c9cede;
  border-radius: 10px;
  background: rgba(255, 255, 255, .55);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease,
              background .15s ease;
}
.news-search input::placeholder { color: #9a9daa; }
.news-search input:focus {
  border-color: #8a90a8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(80, 100, 170, .10);
}
/* keep the native clear affordance but drop the odd default styling */
.news-search input::-webkit-search-decoration,
.news-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* ============ RESEARCH PAGE (/research) ============ */
.research-main { padding: 150px 0 110px; }
.research-head {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: start;
  margin-bottom: 56px;
}
.research-head .sec-h {
  font-size: clamp(2.4rem, 4.6vw, 3.6rem);
  margin: 0;
}
.research-intro .body-serif { font-size: 20px; }
.research-areas {
  margin-top: 28px;
  font-size: 14px;
  font-weight: 600;
}
.research-areas a {
  font-weight: 500;
  margin-left: 16px;
  text-underline-offset: 3px;
}
.rule { border: 0; border-top: 1px solid #c9cede; margin: 0 0 64px; }
.teams {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 44px;
}
.team h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
}
.team p {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--body-ink);
}
.teams + .rule { margin-top: 64px; }

/* ============ LEGAL DOCS ============ */
.legal-main { padding: 150px 0 120px; }
.legal-doc { max-width: 720px; }
.legal-doc .sec-h { margin-bottom: 16px; }
.legal-updated { font-size: 14px; color: #7a7f8e; }
.legal-doc section { margin-top: 44px; }
.legal-doc h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -.005em;
  margin-bottom: 12px;
}
.legal-doc p, .legal-doc li {
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--body-ink);
}
.legal-doc p + p { margin-top: 12px; }
.legal-doc ul {
  margin-top: 10px;
  padding-left: 22px;
  display: grid;
  gap: 8px;
}
.legal-doc a { text-decoration: underline; text-underline-offset: 3px; }

/* ============ PLATFORM AUTH (/login, /home) ============ */
.auth-body { background: #fbfaf8; }
.auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100svh;
}
.auth-left { position: relative; background: #0a0c10; overflow: hidden; }
.auth-left canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.auth-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 96px);
}
.auth-card { width: min(400px, 100%); }
.auth-h {
  font-family: var(--sans);
  font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.12;
  margin-bottom: 38px;
}
.auth-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  border: 1px solid #e3e2db;
  border-radius: 6px;
  background: #ecebe7;
  font: 500 14.5px var(--sans);
  color: var(--ink);
  cursor: pointer;
  transition: background .18s var(--ease-out);
}
.auth-google:hover { background: #e4e3de; }
.auth-google svg { width: 18px; height: 18px; }
.auth-or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: #a8a79f;
  font-size: 12.5px;
}
.auth-or::before, .auth-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid #e3e2db;
}
.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #e3e2db;
  border-radius: 6px;
  background: #f4f3ef;
  font: 400 14.5px var(--sans);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-input::placeholder { color: #a8a79f; }
.auth-input:focus { border-color: #141413; box-shadow: 0 0 0 3px rgba(20,20,19,.06); }
.auth-cta {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: #141413;
  color: #fff;
  font: 500 14.5px var(--sans);
  cursor: pointer;
  transition: background .18s var(--ease-out);
}
.auth-cta:hover { background: #2b2b28; }
.auth-cta:disabled { opacity: .55; cursor: default; }
.auth-err {
  min-height: 18px;
  font-size: 12.5px;
  color: #b0492f;
  margin: 8px 0 10px;
}
.auth-legal {
  margin-top: 30px;
  font-size: 12.5px;
  color: #9a998f;
  line-height: 1.6;
}
.auth-legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* code-entry view */
.auth-box {
  border: 1px solid #e3e2db;
  border-radius: 10px;
  background: rgba(255,255,255,.55);
  padding: 28px 26px 30px;
  text-align: center;
}
.auth-box-lead { font-size: 14px; color: #6f6e68; margin-bottom: 14px; }
.auth-mail-pill {
  display: inline-block;
  background: #efeee9;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.auth-resend {
  display: block;
  font-size: 13.5px;
  color: #3b64c8;
  text-decoration: none;
  margin: 0 0 6px;
}
.auth-resend:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-resend.cooling { color: #a5a49b; pointer-events: none; }
.auth-resend.cooling:hover { text-decoration: none; }
.auth-box-rule {
  border: 0;
  border-top: 1px solid #e7e6e0;
  margin: 24px 0 8px;
}
.auth-code {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid #d9d8d0;
  background: transparent;
  padding: 10px 0 12px;
  text-align: center;
  font: 500 24px var(--sans);
  letter-spacing: .45em;
  color: var(--ink);
  outline: none;
  transition: border-color .18s;
}
.auth-code::placeholder { color: #c9c8bf; letter-spacing: .45em; }
.auth-code:focus { border-bottom-color: #141413; }
.auth-code:disabled { opacity: .55; }
.auth-code-wrap { position: relative; }
.auth-spin {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -11px;
  border: 2px solid #dcdad2;
  border-top-color: #1c1b17;
  border-radius: 50%;
  animation: auth-spin .65s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-code.shake { animation: auth-shake .45s cubic-bezier(.36,.07,.19,.97); border-bottom-color: #b0492f; }
@keyframes auth-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
#view-email:not([hidden]),
#view-code:not([hidden]) { animation: auth-view-in .38s cubic-bezier(.22,.8,.36,1) both; }
@keyframes auth-view-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-note {
  margin-top: 22px;
  font-size: 13px;
  color: #8f8e86;
  text-align: center;
}
.auth-note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* logging-in overlay (OAuth return / post-verify) */
.auth-logging {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: #fbfaf8;
  font: 500 15px var(--sans);
  color: #6f6e68;
  letter-spacing: .01em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.auth-logging.show { opacity: 1; }
.auth-dots i {
  font-style: normal;
  animation: auth-dot 1.05s ease-in-out infinite;
}
.auth-dots i:nth-child(2) { animation-delay: .18s; }
.auth-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes auth-dot { 0%, 100% { opacity: .15; } 45% { opacity: 1; } }

/* /home — minimal authed shell (legacy) */
.home-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.home-shell .wordmark { margin-bottom: 40px; }
.home-h {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -.01em;
  margin-bottom: 14px;
}
.home-sub { font-size: 15px; color: var(--body-ink); }
.home-note { margin-top: 26px; font-size: 14px; color: #8f8e86; }
.home-actions { margin-top: 42px; display: flex; gap: 14px; align-items: center; }
.home-back { width: auto; padding: 0 22px; display: inline-flex; align-items: center; text-decoration: none; }
.auth-out {
  height: 46px;
  padding: 0 22px;
  border: 1px solid #d9d8d0;
  border-radius: 6px;
  background: transparent;
  font: 500 14px var(--sans);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s;
}
.auth-out:hover { border-color: #141413; }

/* ============ FOOTER ============ */
.footer {
  border-top: 1px solid #d8dce8;
  background: #e2e6ef;
  padding: 60px 0 50px;
}
.footer-wm { display: inline-block; margin-bottom: 40px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 40px;
}
.fcol h4 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 14px;
}
.fcol a {
  display: block;
  font-size: 14.5px;
  text-decoration: none;
  color: var(--body-ink);
  padding: 4px 0;
}
.fcol a:hover { text-decoration: underline; text-underline-offset: 3px; }
.copyright {
  margin-top: 50px;
  font-size: 13px;
  color: #888;
}

::selection { background: var(--ink); color: #fff; }

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .hero-h1, .hero-side { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .app, .side-top, .side-collapse svg { transition: none; }
  .snav-t, .snav-ext, .bal-meta, .u-meta, .u-chev, .side-wm .wm-word { transition: none; }
  .view:not([hidden]), .modal:not([hidden]), .modal:not([hidden]) .modal-card,
  .set:not([hidden]), .set:not([hidden]) .set-card { animation: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: 32svh 1fr; }
  .auth-right { justify-content: center; padding-top: 40px; }
  .nav { flex-wrap: wrap; gap: 18px; padding: 16px 20px; }
  .nav-right { margin-left: 0; width: 100%; justify-content: flex-start; gap: 24px; }
  .top { padding-top: 118px; } /* taller wrapped nav */
  .news-main { padding-top: 140px; }
  .research-main { padding-top: 140px; }
  .research-head { grid-template-columns: 1fr; gap: 32px; }
  .teams { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 30px; }
  .pillars { grid-template-columns: 1fr; gap: 28px; margin-top: 60px; }
  .rel-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .news-row { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 560px) {
  .teams { grid-template-columns: 1fr; }
}

/* ============ platform app shell (/home) ============ */
.app-body { background: #fbfbfa; }
.app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100svh;
  transition: grid-template-columns .34s cubic-bezier(.32,.72,.24,1);
}
.app.collapsed { grid-template-columns: 64px minmax(0, 1fr); }

/* ---------- sidebar ---------- */
.side {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e9e9e6;
  padding: 16px 12px 12px;
  background: #f6f6f4;
}
.side { overflow: hidden; }
.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 16px;
  transition: padding .3s cubic-bezier(.32,.72,.24,1);
}
.side-wm { color: var(--ink); display: inline-flex; align-items: baseline; min-height: 24px; }
.side-wm .wm-word {
  display: inline-block;
  max-width: 170px;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity .16s ease, max-width .3s cubic-bezier(.32,.72,.24,1);
}
.side-wm .wm-mark {
  display: none;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}
.side-collapse {
  border: 0;
  background: none;
  color: #a3a39b;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.side-collapse:hover { background: #efefec; color: var(--ink); }
.side-collapse svg { width: 14px; height: 14px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.snav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font: 500 14px var(--sans);
  color: #55554f;
  text-decoration: none;
  overflow: hidden;
  transition: background .18s ease, color .18s ease;
}
.snav svg { width: 16px; height: 16px; flex: none; }
.snav:hover { background: #efefec; color: var(--ink); }
.snav.active { background: #ececea; color: var(--ink); }
.snav-ext { margin-left: auto; width: 12px !important; height: 12px !important; opacity: .45; }

/* animated label collapse — width/opacity so the rail slides smoothly */
.snav-t, .snav-ext, .bal-meta, .u-meta, .u-chev {
  max-width: 170px;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity .16s ease, max-width .3s cubic-bezier(.32,.72,.24,1);
}
.side-collapse svg { transition: transform .3s cubic-bezier(.32,.72,.24,1); }
.app.collapsed .side-collapse svg { transform: rotate(180deg); }

.side-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e9e9e6;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  text-decoration: none;
}
.bal-meta { display: flex; flex-direction: column; gap: 1px; }
.bal-label { font: 400 11px var(--sans); color: #8b8b85; }
.bal-val { font: 500 14px var(--sans); color: var(--ink); }
.bal-chev { width: 13px; height: 13px; color: #a3a39b; }
.balance:hover .bal-chev { color: var(--ink); }

.user-wrap { position: relative; }
.userbtn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  padding: 7px 8px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}
.userbtn:hover { background: #efefec; }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1c1b17;
  color: #f0f0ed;
  font: 600 10.5px var(--sans);
  letter-spacing: .04em;
  display: grid;
  place-items: center;
  flex: none;
}
.u-meta { flex: 1; min-width: 0; }
.u-meta b {
  display: block;
  font: 500 13.5px var(--sans);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.u-meta i {
  display: block;
  font: 400 12px var(--sans);
  font-style: normal;
  color: #8b8b85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.u-chev { width: 13px; height: 13px; color: #a3a39b; flex: none; }
.umenu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e9e9e6;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 14px 40px rgba(20, 20, 19, .12);
  z-index: 40;
}
.um-email {
  font: 400 12px var(--sans);
  color: #8b8b85;
  padding: 7px 10px 8px;
  border-bottom: 1px solid #ececeb;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.um-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: 8px;
  font: 500 13.5px var(--sans);
  color: #3d3d3a;
  cursor: pointer;
  text-align: left;
}
.um-item svg { width: 14px; height: 14px; color: #3b64c8; }
.um-item:hover { background: #f6f6f4; }
.umenu hr { border: 0; border-top: 1px solid #ececeb; margin: 5px 0; }

/* collapsed rail */
.app.collapsed .side { padding: 16px 8px 12px; align-items: center; }
.app.collapsed .snav-t,
.app.collapsed .snav-ext,
.app.collapsed .bal-meta,
.app.collapsed .u-meta,
.app.collapsed .u-chev { opacity: 0; max-width: 0; }
.app.collapsed .side-wm .wm-word { opacity: 0; max-width: 0; }
.app.collapsed .side-wm .wm-mark { display: inline; }
.app.collapsed .side-top { padding: 4px 0 12px; flex-direction: column; gap: 8px; }
.app.collapsed .snav { justify-content: center; padding: 9px 0; width: 40px; }
.app.collapsed .balance { padding: 8px; justify-content: center; }
.app.collapsed .userbtn { justify-content: center; padding: 7px 4px; }

/* ---------- main ---------- */
.main { padding: clamp(28px, 4.5vw, 56px) clamp(24px, 4vw, 56px) 90px; }

.hero2 {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 40px;
}
.hero-copy h1 {
  font: 700 clamp(46px, 5.4vw, 76px) / .98 var(--sans);
  letter-spacing: -.045em;
  color: var(--ink);
}
.btn-hero {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: #171613;
  color: #fbfaf8;
  padding: 13px 24px;
  border-radius: 10px;
  font: 500 14.5px var(--sans);
  text-decoration: none;
  transition: opacity .16s;
}
.btn-hero:hover { opacity: .85; }

/* collage */
.collage {
  position: relative;
  flex: 1;
  min-height: 300px;
  min-width: 380px;
}
.collage-blob {
  position: absolute;
  top: 16%;
  left: 30%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #b7c9ef, #e8d9f2, #cfe3ef, #f2e5cf, #b7c9ef);
  filter: blur(46px);
  opacity: .75;
}
.collage-label {
  position: absolute;
  top: 2px;
  left: 6px;
  font: 500 10px var(--sans);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #a3a39b;
}
.collage-year {
  position: absolute;
  top: 6px;
  right: 4px;
  font: 500 10px var(--sans);
  letter-spacing: .22em;
  color: #a3a39b;
}
.collage-star { position: absolute; color: #b9bab2; }
.cs-1 { width: 44px; top: 8%; right: 26%; }
.cs-2 { width: 26px; bottom: 12%; left: 4%; color: #a3a39b; }

.widget {
  position: absolute;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(3px);
  border: 1px solid #e9e9e6;
  border-radius: 10px;
  padding: 12px 14px;
  font: 500 10px var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8b8b85;
  box-shadow: 0 10px 30px rgba(20, 20, 19, .05);
}
.w-tag { font-weight: 700; letter-spacing: .2em; color: var(--ink); font-size: 12px; }
.w-sub { margin-top: 1px; font-size: 8.5px; letter-spacing: .18em; }
.w-q { margin: 8px 0 8px; font: 500 10.5px/1.5 var(--sans); letter-spacing: .1em; color: #55554f; text-transform: uppercase; }
.w-out { margin-top: 8px; font-size: 9.5px; letter-spacing: .14em; color: #55554f; }
.w-out i {
  display: inline-block;
  width: 7px; height: 7px;
  border: 1.5px solid #7d9bd1;
  border-radius: 50%;
  margin-right: 5px;
}
.w-wave { width: 78px; height: 18px; display: block; }
.w-bubbles { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.w-bubbles i { width: 9px; height: 9px; border-radius: 50%; background: #d9d9d4; }
.w-bubbles i.on { background: #3b64c8; }
.w-bars { display: flex; align-items: flex-end; gap: 4px; height: 22px; }
.w-bars i { width: 8px; background: #d9d9d4; border-radius: 1.5px; }
.w-bars i:nth-child(3) { background: #3b64c8; }

.w-noul { top: 6%; left: 6%; width: 168px; transform: rotate(-1.6deg); }
.w-choice { top: 34%; left: 38%; width: 172px; transform: rotate(1.2deg); }
.w-score { top: 10%; right: 2%; width: 168px; transform: rotate(1.8deg); }

/* content row */
.content-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(28px, 4vw, 64px);
  margin-top: clamp(40px, 5vw, 72px);
}
.sec-h {
  font: 600 clamp(22px, 2vw, 27px) var(--sans);
  letter-spacing: -.02em;
  color: var(--ink);
}
.action-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(20px, 3vw, 44px);
  row-gap: 34px;
}
.act {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-start;
}
.act h3 { font: 600 15px var(--sans); color: var(--ink); margin-bottom: 6px; }
.act p { font: 400 13.5px/1.55 var(--sans); color: #55554f; }
.act svg { width: 34px; height: 34px; flex: none; color: #8b8b85; margin-top: 2px; }
.all-link {
  display: inline-block;
  margin-top: 34px;
  font: 500 13.5px var(--sans);
  color: #3b64c8;
  text-decoration: none;
}
.all-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* rail */
.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.rail-link {
  font: 500 12.5px var(--sans);
  color: #3b64c8;
  text-decoration: none;
}
.rail-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.qs-box {
  margin-top: 16px;
  border: 1px solid #e9e9e6;
  border-radius: 10px;
  background: #fff;
  padding: 18px 18px 14px;
}
.qs-box p { font: 400 13px/1.6 var(--sans); color: #55554f; margin-bottom: 8px; }
.qs-box b { color: var(--ink); font-weight: 600; }
.qs-cta { margin-top: 16px; width: 100%; justify-content: center; }
.rail-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 2px 14px;
  border-bottom: 1px solid #e9e9e6;
}
.rail-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 13px var(--sans);
  color: #55554f;
  text-decoration: none;
}
.rail-row svg { width: 14px; height: 14px; }
.rail-row:hover { color: var(--ink); }
.rail-view { font: 500 12.5px var(--sans); color: #3b64c8; text-decoration: none; }
.rail-view:hover { text-decoration: underline; text-underline-offset: 3px; }
.rail-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid #e9e9e6;
}
.tile {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #e9e9e6;
  border-radius: 10px;
  background: #fff;
  padding: 14px 14px;
  font: 500 13px var(--sans);
  color: var(--ink);
  text-decoration: none;
}
.tile svg { width: 15px; height: 15px; color: #55554f; }
.tile:hover { border-color: #d5d4cb; }
.usage-card { padding-top: 18px; }
.usage-sub { font: 400 12px var(--sans); color: #8b8b85; margin-top: 2px; }
.usage-spark { display: block; width: 100%; height: 34px; margin-top: 16px; }
.usage-empty {
  margin-top: 14px;
  text-align: center;
  font: 400 13px var(--sans);
  color: #8b8b85;
}

/* stubs */
.stub {
  max-width: 460px;
  padding-top: clamp(60px, 10vh, 120px);
}
.stub-h { font: 600 clamp(28px, 3vw, 40px) var(--sans); letter-spacing: -.03em; color: var(--ink); }
.stub-p { margin-top: 14px; font: 400 15px/1.6 var(--sans); color: #55554f; }
.stub-soon { margin-top: 22px; font: 500 13px var(--sans); color: #8b8b85; }

/* footer icons + promo */
.app-foot {
  position: fixed;
  bottom: 18px;
  left: 250px;
  right: 0;
  display: flex;
  justify-content: center;
  gap: clamp(22px, 4vw, 64px);
  pointer-events: none;
}
.app.collapsed .app-foot { left: 64px; }
.app-foot a {
  pointer-events: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font: 400 11px var(--sans);
  color: #8b8b85;
  text-decoration: none;
}
.app-foot a svg { width: 17px; height: 17px; }
.app-foot a:hover { color: var(--ink); }
.promo {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2c58d8;
  color: #fff;
  font: 500 13px var(--sans);
  padding: 12px 18px;
  border-radius: 9px;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(44, 88, 216, .32);
}
.promo svg { width: 14px; height: 14px; }
.promo:hover { background: #274ecb; }

@media (max-width: 980px) {
  .app { grid-template-columns: 64px minmax(0, 1fr); }
  .side { padding: 16px 8px 12px; align-items: center; }
  .snav-t, .snav-ext, .bal-meta, .u-meta, .u-chev { opacity: 0; max-width: 0; }
  .side-wm .wm-word { opacity: 0; max-width: 0; }
  .side-wm .wm-mark { display: inline; }
  .side-top { padding: 4px 0 12px; flex-direction: column; gap: 8px; }
  .snav { justify-content: center; padding: 9px 0; width: 40px; }
  .balance { padding: 8px; justify-content: center; }
  .userbtn { justify-content: center; padding: 7px 4px; }
  .hero2 { flex-direction: column; }
  .collage { min-width: 0; min-height: 260px; }
  .content-row { grid-template-columns: 1fr; }
  .app-foot { left: 64px; }
}
@media (max-width: 640px) {
  .action-grid { grid-template-columns: 1fr; }
  .w-noul { left: 0; }
  .w-choice { left: 30%; }
  .w-score { right: 0; }
}

/* ============ playground ============ */
.pg-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e9e9e6;
}
.pg-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 500 15px var(--sans);
  color: var(--ink);
}
.pg-title svg { width: 15px; height: 15px; }
.pg-sub { font: 400 12px var(--sans); color: #8b8b85; margin-left: 4px; }
.pg-actions { display: flex; align-items: center; gap: 8px; }
.pg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e9e9e6;
  background: #fff;
  border-radius: 8px;
  padding: 7px 12px;
  font: 500 13px var(--sans);
  color: #55554f;
  cursor: pointer;
}
.pg-btn:hover { border-color: #c9c9c3; color: var(--ink); }
.pg-btn svg { width: 13px; height: 13px; }
.pg-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #e9e9e6;
  background: #fff;
  border-radius: 8px;
  color: #55554f;
  cursor: pointer;
}
.pg-icon:hover { border-color: #c9c9c3; color: var(--ink); }
.pg-icon svg { width: 15px; height: 15px; }

.pg { display: flex; flex-direction: column; }
.pg-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  margin-top: 0;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}
.pg-split:has(.pg-right[hidden]) { grid-template-columns: minmax(0, 1fr); }
.pg-left {
  border-right: 1px solid #e9e9e6;
  padding-right: 24px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.pg-left .ed-grow { flex: 1; display: flex; flex-direction: column; border-bottom: 0; min-height: 0; }
.pg-left .ed-grow .ed-body { flex: 1; min-height: 0; }
.pg-left .ed-grow textarea { height: 100%; }
.pg-right {
  padding: 26px 0 0 24px;
  position: relative;
}
.pg-right:not([hidden]) { animation: pg-drawer .3s cubic-bezier(.22,.8,.36,1) both; }
@keyframes pg-drawer { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.pg-right[hidden] { display: none; }
.pg-close {
  position: absolute;
  top: 22px;
  right: 0;
  border: 0;
  background: none;
  color: #a3a39b;
  font-size: 14px;
  cursor: pointer;
}
.pg-close:hover { color: var(--ink); }
.pg-eyebrow {
  font: 500 10px var(--sans);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #a3a39b;
  margin: 26px 0 14px;
}
.pg-eyebrow:first-of-type { margin-top: 0; }
.pg-h { font: 600 24px var(--sans); letter-spacing: -.02em; color: var(--ink); }

.lessons { display: flex; flex-direction: column; gap: 0; border-top: 1px solid #ececeb; }
.lesson {
  display: grid;
  grid-template-columns: 96px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 14px 6px;
  border: 0;
  border-bottom: 1px solid #ececeb;
  background: none;
  text-align: left;
  cursor: pointer;
  position: relative;
}
.lesson:hover { background: rgba(255,255,255,.6); }
.lesson-tag {
  position: absolute;
  top: 8px;
  right: 6px;
  background: #141413;
  color: #fff;
  font: 500 9.5px var(--sans);
  letter-spacing: .08em;
  padding: 3px 7px;
  border-radius: 3px;
}
.lesson-art {
  grid-row: 1 / 3;
  height: 72px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.la-1 { background: linear-gradient(135deg, #d9c9f2, #c9e3f0 55%, #f0dcc9); }
.la-2 { background: linear-gradient(135deg, #cfe0f6, #e6d4f0 55%, #d5ecdd); }
.la-3 { background: linear-gradient(135deg, #e8d3ee, #c9d8f2 55%, #d2e9e2); }
.lesson-art svg { width: 64px; }
.la-dots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.la-dots i { width: 13px; height: 13px; border-radius: 50%; background: rgba(30,30,40,.16); }
.la-dots i.on { background: #3b64c8; }
.la-bars { display: flex; align-items: flex-end; gap: 5px; height: 26px; }
.la-bars i { width: 9px; background: rgba(30,30,40,.22); border-radius: 2px; }
.la-bars i:nth-child(3) { background: #3b64c8; }
.lesson b { font: 500 13.5px var(--sans); color: var(--ink); align-self: end; }
.lesson i { font: 400 12px var(--sans); font-style: normal; color: #8b8b85; align-self: start; }

.usecases { border-top: 1px solid #ececeb; }
.uc {
  display: flex;
  gap: 12px;
  align-items: baseline;
  width: 100%;
  padding: 14px 6px;
  border: 0;
  border-bottom: 1px solid #ececeb;
  background: none;
  text-align: left;
  cursor: pointer;
}
.uc:hover { background: rgba(255,255,255,.6); }
.uc b { font: 500 13.5px var(--sans); color: var(--ink); white-space: nowrap; }
.uc span { font: 400 12.5px var(--sans); color: #8b8b85; }

/* editors */
.ed { border-bottom: 1px solid #ececeb; }
.ed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
}
.ed-name { font: 500 13px var(--sans); color: #55554f; }
.ed-tools { display: flex; align-items: center; gap: 12px; color: #a3a39b; }
.ed-tools svg { width: 14px; height: 14px; }
.ed-fmt {
  border: 0;
  background: none;
  font: 500 12px var(--sans);
  color: #8b8b85;
  cursor: pointer;
}
.ed-fmt:hover { color: var(--ink); }
.ed-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid #e9e9e6;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  font: 500 10.5px var(--sans);
  color: #8b8b85;
  background: #fff;
}
.ed-body { display: flex; align-items: stretch; }
.ed-gut {
  width: 26px;
  padding: 10px 0;
  font: 400 12.5px/1.65 "SF Mono", Menlo, Consolas, monospace;
  color: #b9bab2;
  text-align: right;
  user-select: none;
  flex: none;
  white-space: pre;
}
.ed-body textarea {
  flex: 1;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  padding: 10px 0 10px 12px;
  font: 400 12.5px/1.65 "SF Mono", Menlo, Consolas, monospace;
  color: #232320;
  min-height: 120px;
}
.prim { position: relative; padding: 10px 0 14px 38px; }
.prim-btn {
  border: 0;
  background: none;
  font: 500 13px var(--sans);
  color: #55554f;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
}
.prim-btn svg { width: 12px; height: 12px; color: #a3a39b; }
.prim-docs { margin-left: 14px; font: 500 12.5px var(--sans); color: #3b64c8; text-decoration: none; }
.prim-docs:hover { text-decoration: underline; }
.prim-menu {
  position: absolute;
  top: 38px;
  left: 30px;
  z-index: 30;
  width: 330px;
  background: #fff;
  border: 1px solid #e9e9e6;
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(20, 22, 32, .13);
  padding: 6px;
}
.prim-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}
.prim-opt:hover { background: #f6f6f4; }
.prim-opt b { font: 600 13.5px var(--sans); color: var(--ink); margin-right: 8px; }
.prim-opt span { font: 400 12.5px var(--sans); color: #55554f; }
.prim-opt i { display: block; margin-top: 3px; font: 400 12px var(--sans); font-style: italic; color: #8b8b85; }
.prim-opt code { font-family: "SF Mono", Menlo, monospace; font-style: normal; font-size: 11px; }
.pg-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 0;
}
.pg-model {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: #ececea;
  border-radius: 7px;
  padding: 6px 11px;
  font: 500 12.5px "SF Mono", Menlo, monospace;
  color: #3d3d3a;
  cursor: pointer;
}
.pg-model svg { width: 11px; height: 11px; color: #8b8b85; }
.pg-run {
  margin-left: auto;
  border: 0;
  background: #141413;
  border-radius: 8px;
  padding: 9px 28px;
  font: 600 13.5px var(--sans);
  color: #fff;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.pg-run:hover { background: #2a2a28; }
.pg-run:active { transform: scale(.97); }
.pg-run:disabled { opacity: .55; }

/* ============ usage ============ */
.metric { border-bottom: 1px solid #ececeb; padding: 18px 0 26px; }
.m-head { display: flex; align-items: baseline; justify-content: space-between; }
.m-head h3 { font: 500 15px var(--sans); color: var(--ink); }
.m-head b { font: 500 20px var(--sans); color: var(--ink); letter-spacing: -.01em; }
.m-chart { position: relative; height: 200px; display: flex; flex-direction: column; justify-content: flex-end; }
.m-none {
  position: absolute;
  inset: 0 0 26px;
  display: grid;
  place-items: center;
  font: 400 12.5px var(--sans);
  color: #a3a39b;
}
.m-axis {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #ececeb;
  padding-top: 6px;
}
.m-axis span { font: 400 10px var(--sans); color: #a3a39b; white-space: nowrap; }
.us-note { margin-top: 18px; font: 400 12px var(--sans); color: #a3a39b; }

/* ============ api keys ============ */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid #e9e9e6; margin-bottom: 0; }
.tab {
  border: 0;
  background: none;
  padding: 10px 2px 12px;
  font: 500 13px var(--sans);
  color: #8b8b85;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }

.keys-empty {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}
.keys-empty svg { width: 30px; height: 30px; color: #a3a39b; margin-bottom: 8px; }
.keys-empty h3 { font: 600 16px var(--sans); color: var(--ink); }
.keys-empty p { font: 400 13.5px var(--sans); color: #8b8b85; margin-bottom: 14px; }

.keys-list { padding-top: 22px; }
.keys-table { width: 100%; border-collapse: collapse; font: 400 13px var(--sans); margin-bottom: 20px; }
.keys-table th {
  text-align: left;
  font: 500 11px var(--sans);
  letter-spacing: .06em;
  color: #a3a39b;
  padding: 0 12px 10px 0;
}
.keys-table td { padding: 11px 12px 11px 0; border-top: 1px solid #ececeb; color: #3d3d3a; }
.keys-table td.k-key { font-family: "SF Mono", Menlo, monospace; font-size: 12px; color: #55554f; }
.keys-x { border: 0; background: none; color: #a3a39b; cursor: pointer; font-size: 13px; }
.keys-x:hover { color: #b0403c; }
.keys-note { font: 400 12px var(--sans); color: #a3a39b; margin-top: 18px; }
.keys-more {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: 0; border-radius: 6px;
  background: none; color: #8b8b85; cursor: pointer; font-size: 15px;
  letter-spacing: .08em; line-height: 0; transition: background .15s, color .15s;
}
.keys-more:hover, .keys-more.open { background: #f0f0ed; color: var(--ink); }
.kmenu {
  position: absolute; z-index: 80; min-width: 132px;
  background: #fff; border: 1px solid #e9e9e6; border-radius: 10px;
  padding: 4px; box-shadow: 0 8px 28px rgba(20,20,19,.10), 0 2px 6px rgba(20,20,19,.06);
  transform-origin: top right;
  animation: km-in .14s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes km-in { from { opacity: 0; transform: scale(.92) translateY(-3px); } }
.kmenu.closing { animation: km-out .11s ease forwards; }
@keyframes km-out { to { opacity: 0; transform: scale(.95) translateY(-2px); } }
.kmenu button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; border: 0; border-radius: 6px; background: none;
  font: 400 12.5px var(--sans); color: #3d3d3a; cursor: pointer; text-align: left;
  transition: background .12s;
}
.kmenu button svg { width: 13px; height: 13px; color: #8b8b85; flex: none; }
.kmenu button:hover { background: #f5f5f2; }
.kmenu button.danger { color: #b0403c; }
.kmenu button.danger svg { color: #b0403c; }
.kmenu button.danger:hover { background: #faf0ef; }
.btn-danger {
  padding: 9px 16px; border: 0; border-radius: 8px; background: #b0403c;
  color: #fff; font: 500 13px var(--sans); cursor: pointer; transition: background .15s, transform .06s;
}
.btn-danger:hover { background: #9c332f; }
.btn-danger:active { transform: scale(.98); }
.key-reveal {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  border: 0; border-radius: 0; background: transparent;
  padding: 0;
}
.key-reveal code {
  flex: 1; min-width: 0; font: 400 12px/1.5 "SF Mono", Menlo, monospace;
  color: #3d3d3a; word-break: break-all;
}
.key-reveal-copy {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 11px; border: 1px solid #e9e9e6; border-radius: 7px;
  background: #fff; font: 500 12px var(--sans); color: #3d3d3a;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.key-reveal-copy svg { width: 13px; height: 13px; }
.key-reveal-copy:hover { background: #f5f5f2; border-color: #d5d5cf; }
body.dark .keys-more:hover, body.dark .keys-more.open { background: #262b3a; }
body.dark .kmenu { background: #1f2330; border-color: #2e3342; box-shadow: 0 8px 28px rgba(0,0,0,.45); }
body.dark .kmenu button { color: #c6cbd8; }
body.dark .kmenu button:hover { background: #262b3a; }
body.dark .kmenu button.danger { color: #e08a85; }
body.dark .kmenu button.danger svg { color: #e08a85; }
body.dark .kmenu button.danger:hover { background: #33222b; }
body.dark .key-reveal { background: transparent; border-color: transparent; }
body.dark .key-reveal code { color: #c6cbd8; }
body.dark .key-reveal-copy { background: #262b3a; border-color: #2e3342; color: #c6cbd8; }
body.dark .key-reveal-copy:hover { background: #2e3342; }

.rl-p { font: 400 13.5px/1.6 var(--sans); color: #55554f; margin-top: 20px; max-width: 640px; }
.rl-q { display: grid; grid-template-columns: 14px minmax(0, 1fr); align-items: start; gap: 8px; font: 400 13px var(--sans); color: #55554f; margin: 10px 0 18px; max-width: 720px; }
.rl-q svg { width: 14px; height: 14px; color: #a3a39b; margin-top: 2px; }
.rl-q-copy b { font: 500 13px var(--sans); color: var(--ink); }
.rl-q-copy p { margin: 8px 0 0; font: 400 13px/1.6 var(--sans); color: #55554f; }
.rl-table { width: 100%; max-width: 720px; border-collapse: collapse; font: 400 13px var(--sans); }
.rl-table th {
  text-align: left;
  font: 500 11px var(--sans);
  letter-spacing: .05em;
  color: #a3a39b;
  padding: 0 0 10px;
}
.rl-table td { padding: 12px 0; border-top: 1px solid #ececeb; color: #3d3d3a; }
.rl-table td:first-child { width: 180px; font-weight: 500; color: var(--ink); }
.rl-tag {
  display: inline-block;
  background: #ececea;
  border-radius: 5px;
  padding: 3px 8px;
  font: 500 11.5px var(--sans);
  color: #3d3d3a;
}
.rl-callout {
  margin-top: 26px;
  max-width: 720px;
  background: #eef2fb;
  border: 1px solid #dde4f5;
  border-radius: 10px;
  padding: 16px 18px;
}
.rl-callout b { font: 600 13.5px var(--sans); color: var(--ink); }
.rl-callout p { font: 400 13px var(--sans); color: #55554f; margin: 4px 0 8px; }
.rl-callout a { color: #3b64c8; }
.rl-copy { background: none; border: 0; padding: 0; cursor: pointer; }

/* ============ modal ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 21, 28, .42);
  display: grid;
  place-items: center;
}
.modal[hidden] { display: none; }
.modal:not([hidden]) { animation: ov-fade .22s ease both; }
.modal:not([hidden]) .modal-card { animation: ov-pop .28s cubic-bezier(.22,.8,.36,1) both; }
@keyframes ov-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ov-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-card {
  width: min(460px, 92vw);
  background: #fff;
  border-radius: 14px;
  padding: 22px 24px 24px;
  box-shadow: 0 30px 80px rgba(15, 17, 26, .3);
}
#key-modal .modal-card { width: min(512px, 92vw); border-radius: 6px; padding: 24px; box-shadow: 0 18px 48px rgba(20, 21, 28, .18); }
#key-modal .modal-head { margin-bottom: 8px; }
#key-modal .modal-p { margin: 8px 0 16px; color: #8b8b85; }
#key-modal .modal-in { border-radius: 2px; padding: 9px 12px; }
#key-modal .modal-actions .btn-hero { border-radius: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font: 600 17px var(--sans); letter-spacing: -.01em; color: var(--ink); }
.modal-x { border: 0; background: none; color: #8b8b85; font-size: 15px; cursor: pointer; }
.modal-x:hover { color: var(--ink); }
.modal-p { font: 400 13px/1.55 var(--sans); color: #55554f; margin: 8px 0 18px; }
.modal-label { display: block; font: 500 12.5px var(--sans); color: #55554f; margin-bottom: 6px; }
.modal-in {
  width: 100%;
  border: 1px solid #e9e9e6;
  border-radius: 8px;
  padding: 10px 12px;
  font: 400 14px var(--sans);
  color: var(--ink);
  outline: none;
  background: #fff;
}
.modal-in:focus { border-color: #141413; box-shadow: 0 0 0 3px rgba(20,20,19,.05); }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.modal-actions .btn-hero { margin-top: 0; padding: 10px 20px; }

/* ============ settings dialog ============ */
.set {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(20, 21, 28, .45);
  display: grid;
  place-items: center;
  padding: 24px;
}
.set[hidden] { display: none; }
.set:not([hidden]) { animation: ov-fade .22s ease both; }
.set:not([hidden]) .set-card { animation: ov-pop .3s cubic-bezier(.22,.8,.36,1) both; }
.set-card {
  width: min(900px, 94vw);
  height: min(720px, 92vh);
  background: #fff;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 210px 1fr;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(15, 17, 26, .32);
}
.set-nav {
  background: #f8f8f6;
  border-right: 1px solid #ececeb;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.set-x {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  padding: 6px 10px 16px;
  font: 500 10.5px var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #a3a39b;
  cursor: pointer;
}
.set-x:hover { color: var(--ink); }
.set-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0;
  background: none;
  font: 500 13.5px var(--sans);
  color: #55554f;
  cursor: pointer;
  text-align: left;
}
.set-item svg { width: 15px; height: 15px; color: #a3a39b; }
.set-item:hover { background: #f0f0ed; color: var(--ink); }
.set-item.active { background: #efefec; color: var(--ink); }
.set-item.active svg { color: var(--ink); }

.set-body { overflow-y: auto; padding: 34px 40px 40px; }
.set-pane h2 { font: 600 22px var(--sans); letter-spacing: -.02em; color: var(--ink); margin-bottom: 26px; }
.set-pane[hidden] { display: none; }
.f-label {
  display: block;
  font: 500 12.5px var(--sans);
  color: #55554f;
  margin: 24px 0 7px;
}
.f-label:first-of-type { margin-top: 0; }
.f-in {
  width: min(380px, 100%);
  border: 1px solid #e9e9e6;
  border-radius: 8px;
  padding: 9px 12px;
  font: 400 13.5px var(--sans);
  color: var(--ink);
  background: #fff;
  outline: none;
}
.f-in:focus { border-color: #141413; }
.f-btns { display: flex; gap: 8px; margin-top: 12px; }
.f-save {
  border: 0;
  background: #141413;
  color: #fff;
  border-radius: 8px;
  padding: 8px 18px;
  font: 500 13px var(--sans);
  cursor: pointer;
}
.f-save:disabled { opacity: .35; cursor: default; }
.f-save:not(:disabled):hover { background: #2b2b28; }
.f-reset {
  border: 1px solid #e9e9e6;
  background: #fff;
  color: #8b8b85;
  border-radius: 8px;
  padding: 8px 16px;
  font: 500 13px var(--sans);
  cursor: pointer;
}
.f-reset:disabled { opacity: .4; cursor: default; }
.f-mono {
  font: 400 13px "SF Mono", Menlo, monospace;
  color: #55554f;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px dotted #c9cede;
  padding-bottom: 1px;
}
.f-copy { border: 0; background: none; color: #a3a39b; cursor: pointer; padding: 0; }
.f-copy:hover { color: var(--ink); }
.f-copy svg { width: 13px; height: 13px; }
.f-hint { font: 400 11.5px var(--sans); color: #a3a39b; vertical-align: middle; margin-left: 5px; }

.seg {
  display: inline-flex;
  border: 1px solid #e9e9e6;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.seg button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  padding: 8px 16px;
  font: 500 13px var(--sans);
  color: #55554f;
  cursor: pointer;
}
.seg button svg { width: 13px; height: 13px; }
.seg button.active { background: #efefec; color: var(--ink); }
.seg button + button { border-left: 1px solid #ececeb; }

.f-check { display: flex; align-items: center; gap: 9px; font: 400 13.5px var(--sans); color: #3d3d3a; }
.f-check input { accent-color: #141413; width: 15px; height: 15px; }

.switch {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  border: 0;
  background: #d3d8e4;
  cursor: pointer;
  transition: background .15s;
  vertical-align: middle;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s;
}
.switch.on { background: #43a35a; }
.switch.on::after { left: 18px; }
.switch-row { display: flex; align-items: center; gap: 12px; font: 400 13.5px var(--sans); color: #3d3d3a; }

/* members + shares */
.set-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.set-head h2 { margin-bottom: 0; }
.btn-dark {
  border: 0;
  background: #141413;
  color: #fff;
  border-radius: 8px;
  padding: 9px 16px;
  font: 500 13px var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-dark:hover { background: #2b2b28; }
.m-search {
  width: 100%;
  max-width: 420px;
  border: 1px solid #e9e9e6;
  border-radius: 8px;
  padding: 9px 12px;
  font: 400 13.5px var(--sans);
  color: var(--ink);
  outline: none;
  margin-bottom: 16px;
}
.m-table { width: 100%; border-collapse: collapse; font: 400 13px var(--sans); }
.m-table th {
  text-align: left;
  font: 500 11.5px var(--sans);
  color: #a3a39b;
  padding: 0 12px 10px 0;
  border-bottom: 1px solid #ececeb;
}
.m-table td { padding: 13px 12px 13px 0; border-bottom: 1px solid #f6f6f4; color: #3d3d3a; }
.m-table td:first-child { font-weight: 500; color: var(--ink); }
.m-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f4ea;
  color: #2e7d3f;
  border-radius: 5px;
  padding: 3px 9px;
  font: 500 11.5px var(--sans);
}
.m-active::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #43a35a; }
.m-empty { text-align: center; color: #a3a39b; font: 400 13px var(--sans); padding: 46px 0; }

/* billing */
.bill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 30px; }
.bill-card {
  border: 1px solid #ececeb;
  border-radius: 12px;
  padding: 18px 20px;
  background: #fff;
}
.bill-card h4 { font: 500 13.5px var(--sans); color: var(--ink); margin-bottom: 12px; }
.bill-val { font: 500 26px var(--sans); letter-spacing: -.02em; color: var(--ink); margin-bottom: 14px; }
.bill-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: #141413;
  color: #fff;
  border-radius: 8px;
  padding: 11px;
  font: 500 13px var(--sans);
  cursor: pointer;
  margin-bottom: 10px;
}
.bill-btn:hover { background: #2b2b28; }
.bill-btn2 {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #e9e9e6;
  background: #fff;
  color: #55554f;
  border-radius: 8px;
  padding: 10px;
  font: 500 13px var(--sans);
  cursor: pointer;
  margin-bottom: 10px;
}
.bill-btn2:hover { border-color: #c9c9c3; color: var(--ink); }
.bill-btn.gray { background: #e9ecf3; color: #55554f; }
.bill-btn.gray:hover { background: #e0e4ee; }
.bill-recharge { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.bill-recharge b { font: 500 13px var(--sans); color: var(--ink); }
.bill-recharge small { display: block; font: 400 11.5px var(--sans); color: #a3a39b; margin-top: 2px; }
.bill-off {
  border: 1px solid #e9e9e6;
  background: #fff;
  border-radius: 5px;
  padding: 3px 10px;
  font: 500 11.5px var(--sans);
  color: #55554f;
}
.bill-h h3 { font: 600 15px var(--sans); color: var(--ink); margin-bottom: 8px; }

/* toast */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #141413;
  color: #fbfbfa;
  font: 500 13px var(--sans);
  padding: 11px 20px;
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 90;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ dark theme (app shell) ============ */
body.dark .app-body,
body.dark { background: #14161c; }
body.dark .app-body { background: linear-gradient(180deg, #171a22 0%, #12151c 100%); }
body.dark .side { background: #191c24; border-right-color: #2a2e3a; }
body.dark .snav { color: #a8aebf; }
body.dark .snav:hover { background: #222634; color: #eceef4; }
body.dark .snav.active { background: #252a38; color: #eceef4; }
body.dark .side-wm { color: #eceef4; }
body.dark .balance { background: #1f2330; border-color: #2a2e3a; }
body.dark .bal-val { color: #eceef4; }
body.dark .userbtn:hover { background: #222634; }
body.dark .u-meta b { color: #eceef4; }
body.dark .umenu, body.dark .modal-card, body.dark .prim-menu { background: #1f2330; border-color: #2e3342; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
body.dark .um-item { color: #c6cbd8; }
body.dark .um-item:hover { background: #262b3a; }
body.dark .umenu hr, body.dark .um-help-row { border-color: #2e3342; }
body.dark .um-mail, body.dark .um-help small { color: #8b91a3; }
body.dark .main { color: #c6cbd8; }
body.dark .hero-copy h1, body.dark .sec-h, body.dark .act h3, body.dark .pg-h,
body.dark .pg-title, body.dark .m-head h3, body.dark .m-head b,
body.dark .keys-empty h3, body.dark .set-pane h2, body.dark .rl-callout b,
body.dark .modal-head h3, body.dark .stub-h, body.dark .lesson b, body.dark .uc b { color: #eceef4; }
body.dark .act p, body.dark .stub-p, body.dark .qs-box p, body.dark .uc span,
body.dark .rl-p, body.dark .rl-q, body.dark .modal-p, body.dark .keys-table td,
body.dark .m-table td { color: #a8aebf; }
body.dark .pg-btn, body.dark .pg-icon, body.dark .pg-run, body.dark .ed-badge,
body.dark .f-in, body.dark .m-search, body.dark .modal-in, body.dark .f-reset,
body.dark .bill-btn2, body.dark .bill-off, body.dark .seg, body.dark .tile,
body.dark .qs-box, body.dark .bill-card, body.dark .keys-table td.k-key { background: #1f2330; border-color: #2e3342; color: #c6cbd8; }
body.dark .widget { background: rgba(31,35,48,.85); border-color: #2e3342; }
body.dark .w-tag { color: #eceef4; }
body.dark .w-q { color: #a8aebf; }
body.dark .w-bubbles i { background: #343947; }
body.dark .w-bars i { background: #343947; }
body.dark .w-bars i:nth-child(3) { background: #5b82e0; }
body.dark .w-bubbles i.on { background: #5b82e0; }
body.dark .pg-left { border-right-color: #2a2e3a; }
body.dark .pg-bar, body.dark .tabs, body.dark .ed, body.dark .keys-table td,
body.dark .m-table th, body.dark .m-table td, body.dark .lessons, body.dark .lesson,
body.dark .usecases, body.dark .uc, body.dark .metric, body.dark .m-axis { border-color: #2a2e3a; }
body.dark .ed-body textarea { color: #d6dae6; }
body.dark .lesson:hover, body.dark .uc:hover, body.dark .prim-opt:hover { background: #222634; }
body.dark .rl-table td { border-color: #2a2e3a; color: #a8aebf; }
body.dark .rl-table td:first-child, body.dark .m-table td:first-child { color: #eceef4; }
body.dark .rl-tag, body.dark .pg-model { background: #262b3a; color: #a8aebf; }
body.dark .rl-callout { background: #1c2438; border-color: #2a3550; }
body.dark .set-card { background: #1a1e28; }
body.dark .set-nav { background: #171a22; border-right-color: #2a2e3a; }
body.dark .set-item { color: #a8aebf; }
body.dark .set-item:hover { background: #222634; color: #eceef4; }
body.dark .set-item.active { background: #262d3e; color: #eceef4; }
body.dark .f-in, body.dark .modal-in, body.dark .m-search { background: #1f2330; border-color: #2e3342; color: #eceef4; }
body.dark .f-save, body.dark .btn-dark, body.dark .bill-btn, body.dark .btn-hero { background: #eceef4; color: #14161c; }
body.dark .f-mono, body.dark .f-check, body.dark .f-label, body.dark .switch-row,
body.dark .bill-card h4, body.dark .bill-recharge b, body.dark .bill-val { color: #c6cbd8; }
body.dark .m-active { background: #1d3325; color: #5cb86e; }
body.dark .app-foot a { color: #8b91a3; }
body.dark .app-foot a:hover { color: #eceef4; }
body.dark .toast { background: #eceef4; color: #14161c; }

/* user menu — head row + help + colors */
.um-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px 9px;
  border-bottom: 1px solid #ececeb;
  margin-bottom: 5px;
}
.um-mail {
  font: 400 12px var(--sans);
  color: #8b8b85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.um-tools { display: inline-flex; gap: 2px; flex: none; }
.um-tools a,
.um-tools button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #8b8b85;
  cursor: pointer;
}
.um-tools a:hover,
.um-tools button:hover { background: #f6f6f4; color: var(--ink); }
.um-tools svg { width: 13px; height: 13px; }
.um-new { color: #3b64c8 !important; }
.um-new svg { color: #3b64c8 !important; }
.um-help { padding: 4px 10px 8px; }
.um-help small {
  display: block;
  font: 400 11.5px var(--sans);
  color: #a3a39b;
  margin-bottom: 3px;
}
.um-help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: 400 12.5px var(--sans);
  color: #3d3d3a;
}
.um-copy {
  border: 0;
  background: none;
  padding: 0;
  font: 500 12px var(--sans);
  color: #3b64c8;
  cursor: pointer;
}
.um-copy:hover { text-decoration: underline; text-underline-offset: 3px; }
.um-out { color: #b0403c; }
.um-out svg { color: #b0403c !important; }
body.dark .um-mail, body.dark .um-help small { color: #8b91a3; }
body.dark .um-help-row { color: #c6cbd8; }
body.dark .um-tools a:hover, body.dark .um-tools button:hover { background: #262b3a; color: #eceef4; }

/* balance — hover reveals the billing link (exact reference behavior) */
.balance { position: relative; overflow: hidden; }
.bal-hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #fff;
  font: 500 12.5px var(--sans);
  color: var(--ink);
  opacity: 0;
  transition: opacity .12s;
  pointer-events: none;
}
.balance:hover .bal-hover { opacity: 1; }
body.dark .bal-hover { background: #1f2330; color: #eceef4; }

/* avatar — rounded square like the reference */
.avatar { border-radius: 7px; }

/* user button — highlighted while the menu is open */
.userbtn[aria-expanded="true"] { background: #e9ebf3; }
body.dark .userbtn[aria-expanded="true"] { background: #262b3a; }

/* menu tools — grouped icons like the reference */
.um-tools {
  border: 1px solid #e9e9e6;
  border-radius: 7px;
  background: #f7f7f5;
  padding: 1px;
}
.um-tools a { background: #e8edf9; color: #3b64c8; }
body.dark .um-tools { background: #1a1e28; border-color: #2e3342; }
body.dark .um-tools a { background: #27324a; color: #8fb0f0; }

/* settings close icon */
.set-x svg { width: 13px; height: 13px; flex: none; }

/* ---------- home: viewport-fit + new footer ---------- */
.app-main .main,
.main {
  display: flex;
  flex-direction: column;
  height: 100svh;
  overflow: hidden;
  padding-bottom: 24px;
}
.main:has(#v-home:not([hidden])) { padding: 0; }
.view { flex: 1; min-height: 0; overflow-y: auto; }
.view[hidden] { display: none; }
.view:not([hidden]) { animation: view-in .3s cubic-bezier(.22,.8,.36,1) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#v-home:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
#v-home .hero2 {
  flex: none;
  height: clamp(210px, 28vh, 272px);
  min-height: 210px;
  padding: 28px clamp(28px, 4vw, 48px);
  align-items: center;
  background: #f7f7f6;
}
#v-home .hero-copy h1 { font-size: clamp(42px, 5vw, 68px); }
#v-home .collage { height: 100%; min-height: 0; min-width: 320px; }
#v-home .content-row {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 356px);
  gap: clamp(24px, 3vw, 44px);
  margin-top: 0;
  padding: 26px 40px 14px;
}
#v-home .action-col { min-height: 0; overflow: hidden; padding-right: 10px; }
#v-home .action-grid { margin-top: 20px; column-gap: clamp(18px, 2.6vw, 36px); row-gap: 26px; }
#v-home .act { display: block; color: inherit; text-decoration: none; }
#v-home .act:hover h3 { color: #3b64c8; }
#v-home .act:focus-visible { outline: 2px solid #3b64c8; outline-offset: 4px; border-radius: 2px; }
#v-home .act h3 { margin-bottom: 7px; font-size: 14px; }
#v-home .act p { font-size: 13px; line-height: 1.55; }
#v-home .act svg { display: none; }
#v-home .all-link { margin-top: 24px; }
#v-home .rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid #e9e9e6;
  padding-left: 24px;
}
#v-home .rail-tiles { flex: none; gap: 0; padding: 10px 0; border-bottom: 1px solid #e9e9e6; }
#v-home .tile {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 12px;
}
#v-home .tile + .tile { border-left: 1px solid #e9e9e6; }
#v-home .tile svg { color: #3b64c8; }
#v-home .agent-setup { flex: none; padding: 14px 0; border-bottom: 1px solid #e9e9e6; }
#v-home .agent-setup .sec-h { font-size: 20px; }
#v-home .usage-card { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 16px 0 0; }
#v-home .usage-card .sec-h { font-size: 24px; }
#v-home .usage-sub { margin-top: 4px; }
.usage-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.usage-kpi { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.usage-kpi strong { font: 600 22px/1.15 var(--sans); letter-spacing: -.03em; color: var(--ink); }
.usage-kpi span { font: 400 11.5px var(--sans); color: #8b8b85; }
#v-home .usage-spark { height: 54px; margin-top: auto; padding-top: 12px; }
#v-home .usage-empty { margin-top: 8px; text-align: left; font-size: 13px; }
body.dark .usage-kpi strong { color: #eceef4; }
body.dark .usage-kpi span { color: #9aa3b8; }
#v-home .agent-setup + .usage-card { border: 0; }

/* agent prompt box */
.qs-prompt { overflow-y: auto; }
.qs-prompt pre {
  margin: 0;
  font: 400 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #3d3d3a;
  white-space: pre-wrap;
}
#qs-copy { cursor: pointer; border: 0; font: 600 13.5px var(--sans); }
#qs-copy.qs-cta { flex: none; width: 100%; justify-content: center; margin-top: 8px; padding: 10px 14px; }

/* home footer tiles */
.home-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  margin-top: auto;
  padding: 0 40px;
  border-top: 1px solid #e9e9e6;
}
.hf-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 72px;
  padding: 8px 10px;
  border: 0;
  border-right: 1px solid #e9e9e6;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font: 500 12.5px/1.3 var(--sans);
  text-align: center;
  transition: border-color .15s, background .15s;
}
.hf-tile:first-child { border-left: 1px solid #e9e9e6; }
.hf-tile svg { width: 20px; height: 20px; color: #3b64c8; }
.hf-tile:hover { background: #f7f7f6; }
body.dark .hf-tile { border-color: #2e3342; color: #eceef4; }
body.dark .hf-tile svg { color: #8fb0f0; }
body.dark .hf-tile:hover { background: #262b3a; }
body.dark .qs-prompt pre { color: #c6cbd8; }
body.dark #v-home .rail { border-color: #2e3342; }
body.dark #v-home .usage-card,
body.dark #v-home .rail-tiles { border-color: #2e3342; }
body.dark #v-home .tile + .tile { border-color: #2e3342; }

@media (max-width: 980px) {
  #v-home:not([hidden]) { overflow-y: auto; }
  #v-home .hero2 { height: auto; min-height: 0; }
  #v-home .collage { min-width: 0; min-height: 220px; }
  #v-home .content-row { flex: none; overflow: visible; grid-template-columns: 1fr; padding: 24px 32px 12px; }
  #v-home .action-col, #v-home .rail { overflow: visible; }
  #v-home .rail { border-left: 0; padding-left: 0; }
  #v-home .usage-card { flex: none; }
  #v-home .home-foot { margin-top: 18px; padding: 0 32px; }
}
@media (max-height: 740px) and (min-width: 981px) {
  #v-home:not([hidden]) { overflow-y: auto; }
  #v-home .content-row { flex: none; min-height: 460px; overflow: visible; }
  #v-home .action-col, #v-home .rail { overflow: visible; }
}

/* ---------- danger zone + pg status ---------- */
.danger-zone { margin-top: 34px; border: 1px solid #eec9c5; border-radius: 10px; padding: 16px; }
.danger-h { font: 600 13px "Inter", sans-serif; color: #b3261e; margin: 0 0 6px; }
.danger-p { font: 400 12.5px "Inter", sans-serif; color: #55554f; margin: 0 0 12px; }
.danger-btn { font: 600 12.5px "Inter", sans-serif; color: #fff; background: #b3261e; border: 0; border-radius: 7px; padding: 8px 14px; cursor: pointer; }
.danger-btn:hover:not(:disabled) { background: #9c2118; }
.danger-btn:disabled { opacity: .45; cursor: default; }
.pg-out-status { font: 500 11px "Inter", sans-serif; color: #8b8b85; margin-left: 8px; }

/* ---------- usage bars ---------- */
.m-bars { position: absolute; inset: 0 0 26px; display: flex; align-items: flex-end; gap: 10%; padding: 0 2px; }
.m-bars i { flex: 1; background: #dcdacf; border-radius: 5px 5px 0 0; min-height: 3px; transition: height .4s cubic-bezier(.22,.8,.36,1); }
.m-bars i:not(.off) { background: #3b64c8; }
.m-bars i.off { background: #efeee9; }
body.dark .m-bars i.off { background: #262b38; }
.m-none[hidden] { display: none; }
