/* ========== API portal (light by default) ========== */
.page-api {
  background: #fff;
  color: #0F1419;
  min-height: 100vh;
}
.page-api[data-theme="dark"],
html[data-theme="dark"] .page-api {
  background: #0F0F12;
  color: #F5FBFF;
}

/* Gold wordmark + circular mark, matching allowed 算元力量 chrome */
.page-api .brand { gap: .45rem; }
.page-api .brand-tile {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 20, 25, .06);
}
html[data-theme="dark"] .page-api .brand-tile { background: #16181e; box-shadow: 0 0 0 1px rgba(255,255,255,.1); }
.page-api .brand-word,
html[data-theme="light"] .page-api .brand-word {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: #E0A800;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: .03em;
}
html[data-theme="dark"] .page-api .brand-word { color: #F5C542; }

.api-header {
  position: sticky; top: 0; z-index: 80;
  height: 4rem;
  display: flex; align-items: center;
  padding: 0 2rem;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0,0,0,.04);
}
html[data-theme="dark"] .api-header {
  background: rgba(15,15,18,.86);
  border-bottom-color: rgba(255,255,255,.06);
}
.api-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  height: 100%;
  gap: 1rem;
}
.api-nav { display: flex; align-items: center; gap: 1.25rem; font-size: .9rem; color: #5b6570; }
html[data-theme="dark"] .api-nav { color: var(--text-secondary); }
.api-nav a { color: inherit; }
.api-nav a:hover { color: #111; }
html[data-theme="dark"] .api-nav a:hover { color: #fff; }
.api-nav a.is-active { color: #111; font-weight: 600; }
html[data-theme="dark"] .api-nav a.is-active { color: #fff; }
.api-nav .ext { font-size: .72em; opacity: .55; margin-left: .12rem; }
.api-nav-right { display: flex; align-items: center; gap: .7rem; margin-left: auto; }
.api-header-inner .api-nav { margin-left: auto; margin-right: 0; }
.api-header-inner .api-nav-right { margin-left: 1.1rem; }
.api-cs {
  display: inline-flex; align-items: center; gap: .3rem;
  color: #4a5560; font-size: .88rem; background: none; padding: .2rem .1rem;
}
.api-cs .icon { width: 1.05em; height: 1.05em; }
.api-cs:hover { color: #111; }
html[data-theme="dark"] .api-cs { color: var(--text-secondary); }
html[data-theme="dark"] .api-cs:hover { color: #fff; }
.theme-btn {
  width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #5a6570;
}
.theme-btn:hover { background: rgba(0,0,0,.05); }
html[data-theme="dark"] .theme-btn:hover { background: rgba(255,255,255,.06); }
.btn-login-sky {
  height: 2rem; padding: 0 .95rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #6BA8FF, #4C8DFF);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  box-shadow: 0 0 .7rem rgba(91,156,255,.28);
}

/* Landing: transparent overlay header that compacts into a centered pill */
.page-api-home .api-header {
  position: fixed; left: 0; right: 0; top: 0;
  height: auto;
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  padding: .85rem 1.5rem 0;
  justify-content: center;
  pointer-events: none;
}
.page-api-home .api-header-inner {
  pointer-events: auto;
  max-width: 1120px;
  height: 3.4rem;
  margin: 0 auto;
  transition: max-width .28s ease, background .28s ease, box-shadow .28s ease, padding .28s ease, border-radius .28s ease, height .28s ease;
}
.page-api-home .api-header.is-compact { padding-top: .65rem; }
.page-api-home .api-header.is-compact .api-header-inner {
  max-width: max-content;
  width: auto;
  height: 3.15rem;
  padding: 0 .7rem 0 1.05rem;
  gap: 1.35rem;
  background: rgba(255,255,255,.96);
  border-radius: 999px;
  box-shadow: 0 10px 32px rgba(30, 50, 80, .1), 0 0 0 1px rgba(15,20,25,.05);
  backdrop-filter: blur(16px);
}
html[data-theme="dark"] .page-api-home .api-header.is-compact .api-header-inner {
  background: rgba(22,24,30,.96);
  box-shadow: 0 10px 32px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.08);
}
.page-api-home .api-header.is-compact .api-nav { margin-left: 0; }
.page-api-home .api-header.is-compact .api-nav-right { margin-left: 0; }

/* Hero */
.api-hero-wrap {
  background:
    radial-gradient(ellipse 75% 70% at 12% 0%, rgba(168, 222, 230, .5), transparent 58%),
    radial-gradient(ellipse 55% 50% at 92% 8%, rgba(196, 224, 245, .42), transparent 52%),
    radial-gradient(ellipse 40% 35% at 50% 0%, rgba(232, 246, 248, .85), transparent 70%),
    linear-gradient(180deg, #eef7f8 0%, #ffffff 74%);
  padding: 6.6rem 2rem 2.6rem;
}
.page-api-home .api-hero-wrap { padding-top: 7.1rem; }
html[data-theme="dark"] .api-hero-wrap {
  background:
    radial-gradient(ellipse 70% 80% at 15% 30%, rgba(0, 80, 120, .25), transparent 60%),
    #0F0F12;
}
.api-hero {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.08fr; gap: 2.6rem;
  align-items: center;
}
.api-badge {
  display: inline-flex; align-items: center; gap: .28rem;
  padding: .22rem .7rem;
  border-radius: 999px;
  background: #e8f1ff;
  color: #4b7adf;
  font-size: .75rem;
  font-weight: 500;
  margin-bottom: 1.05rem;
}
.api-badge .icon { width: .85rem; height: .85rem; color: #6b8eef; }
html[data-theme="dark"] .api-badge { background: rgba(91,156,255,.16); color: #9cbcff; }
.api-hero h1 {
  font-size: clamp(2.35rem, 4.4vw, 3.35rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: .01em;
  color: #111;
}
.api-hero h1 .purp { color: #7850ff; display: block; }
html[data-theme="dark"] .api-hero h1 { color: #fff; }
.api-hero .lead {
  margin-top: 1.05rem;
  color: #5b6570;
  font-size: .98rem;
  line-height: 1.8;
  max-width: 28.5rem;
}
html[data-theme="dark"] .api-hero .lead { color: var(--text-secondary); }
.api-hero-ctas { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.7rem; }
.api-hero-ctas .btn-sky {
  padding: .72rem 1.25rem;
  border-radius: 999px;
  font-size: .9rem;
}
.api-hero-ctas .btn-white .icon { width: .95em; height: .95em; }
.btn-white {
  padding: .72rem 1.1rem;
  border-radius: 999px;
  border: 1px solid #e4e8ee;
  background: #fff;
  color: #222;
  font-size: .9rem;
}
.btn-white:hover { border-color: #c9d2dc; }
html[data-theme="dark"] .btn-white {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
  color: #fff;
}

/* Request card */
.req-card {
  background: #fff;
  border-radius: 1.15rem;
  box-shadow: 0 18px 55px rgba(30, 50, 80, .1), 0 0 0 1px rgba(0,0,0,.04);
  padding: 1.05rem 1.15rem 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .76rem;
  color: #3a4450;
}
html[data-theme="dark"] .req-card {
  background: #16181e;
  color: #c5ccd4;
  box-shadow: 0 16px 50px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.06);
}
.req-tabs { display: flex; align-items: center; gap: .2rem; margin-bottom: .65rem; }
.req-tabs button {
  padding: .2rem .55rem;
  border-radius: .35rem;
  color: #9aa3ab;
  font-size: .78rem;
  font-family: inherit;
  background: transparent;
}
.req-tabs button.is-on { background: transparent; color: #E0A800; font-weight: 700; }
html[data-theme="dark"] .req-tabs button.is-on { background: transparent; color: #F5C542; }
.req-ok { margin-left: auto; font-size: .72rem; color: #16a34a; letter-spacing: .02em; }
.req-base {
  font-size: .68rem; color: #9aa3ab; letter-spacing: .06em;
  margin-bottom: .35rem;
}
.req-base code {
  font-family: inherit; font-size: .75rem; letter-spacing: 0;
  color: #44515c; margin-left: .35rem;
}
html[data-theme="dark"] .req-base code { color: #c5ccd4; }
.req-path { margin-bottom: .55rem; }
.req-path .m { color: #16a34a; font-weight: 700; margin-right: .4rem; }
.req-sec { color: #9aa3ab; font-size: .66rem; letter-spacing: .1em; margin: .7rem 0 .3rem; }
.req-code { white-space: pre; line-height: 1.55; overflow: auto; color: #2a3340; margin: 0; font-family: inherit; font-size: inherit; }
html[data-theme="dark"] .req-code { color: #d0d6de; }
.req-foot {
  display: flex; justify-content: space-between;
  margin-top: .8rem; padding-top: .55rem;
  border-top: 1px solid #f0f2f5;
  font-size: .66rem; color: #9aa3ab; letter-spacing: .04em;
}
html[data-theme="dark"] .req-foot { border-top-color: rgba(255,255,255,.06); }

/* Stats */
.api-stats {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 2.7rem 1rem 2.8rem;
  text-align: center;
}
.api-stats .n { font-size: 2.15rem; font-weight: 800; letter-spacing: -0.03em; color: #111; }
html[data-theme="dark"] .api-stats .n { color: #fff; }
.api-stats .l { font-size: .8rem; color: #8a939b; margin-top: .3rem; }
.api-stats-line { height: 1px; background: #eef0f3; margin: 0 2.5rem; }
html[data-theme="dark"] .api-stats-line { background: rgba(255,255,255,.06); }

/* Features */
.api-sec { max-width: 1120px; margin: 0 auto; padding: 3.4rem 1.5rem 1rem; }
.api-kicker { font-size: .8rem; color: #8a939b; margin-bottom: .45rem; }
.api-sec h2 { font-size: 1.95rem; font-weight: 800; line-height: 1.28; letter-spacing: -0.025em; color: #111; }
html[data-theme="dark"] .api-sec h2 { color: #fff; }
.feat-board {
  margin-top: 1.7rem;
  display: grid;
  grid-template-columns: 1.22fr .88fr;
  grid-template-rows: auto auto;
  gap: 0;
  border: 1px solid #eceff3;
  border-radius: 1.25rem;
  overflow: hidden;
  background: #f6f7f9;
}
html[data-theme="dark"] .feat-board { background: #16181e; border-color: rgba(255,255,255,.08); }
.feat-cell { padding: 1.4rem 1.4rem 1.3rem; border-right: 1px solid #eceff3; border-bottom: 1px solid #eceff3; }
html[data-theme="dark"] .feat-cell { border-color: rgba(255,255,255,.06); }
.feat-cell:nth-child(2), .feat-cell:nth-child(4) { border-right: none; }
.feat-cell:nth-child(3), .feat-cell:nth-child(4) { border-bottom: none; }
.feat-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .4rem; }
.feat-n { font-size: .75rem; color: #9aa3ab; font-weight: 500; }
.feat-cell h3 { font-size: 1rem; margin: 0; font-weight: 650; }
.feat-cell p { font-size: .85rem; color: #5b6570; line-height: 1.65; }
html[data-theme="dark"] .feat-cell p { color: var(--text-secondary); }
.vendor-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .95rem; }
.vendor-pills span {
  background: #fff; border-radius: .65rem;
  padding: .7rem .4rem; text-align: center;
  font-size: .82rem; color: #333;
  box-shadow: 0 1px 3px rgba(20,30,50,.05);
  border: 1px solid rgba(0,0,0,.03);
}
html[data-theme="dark"] .vendor-pills span { background: #1E1F25; color: #eee; border-color: rgba(255,255,255,.06); }
.feat-cell-route { display: flex; flex-direction: column; }
.feat-cell-route .route-viz { margin-top: auto; }
.route-viz { display: flex; justify-content: flex-end; padding: .6rem .4rem .2rem; }
.route-orb {
  width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(80, 210, 140, .14), rgba(80, 210, 140, .04) 70%);
  display: flex; align-items: center; justify-content: center;
  color: #22a85a; position: relative;
}
.route-orb svg { width: 3.2rem; height: 3.2rem; display: block; }
.route-orb .ok {
  position: absolute; top: 10px; right: 10px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #22c55e; color: #fff;
  font-size: .62rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px #f6f7f9;
}
.poll-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: .95rem;
}
.poll-track {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  position: relative;
}
.poll-track::before {
  content: "";
  position: absolute; top: .7rem; bottom: .7rem; left: 50%;
  width: 1px; background: #e4e8ee; transform: translateX(-50%);
}
.poll-track span {
  position: relative; z-index: 1;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  border: 1px solid #dde2e8; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; color: #666;
  margin: .18rem 0;
}
.poll-track span.on {
  background: #fff; color: #c99716; border-color: #E0A800;
  box-shadow: 0 0 0 3px rgba(224, 168, 0, .14);
  font-weight: 600;
}
.poll-labels { font-size: .8rem; color: #5b6570; display: flex; flex-direction: column; gap: .72rem; justify-content: center; text-align: right; }
html[data-theme="dark"] .poll-track::before { background: rgba(255,255,255,.1); }
html[data-theme="dark"] .poll-track span { background: #16181e; border-color: rgba(255,255,255,.12); color: #c5ccd4; }
html[data-theme="dark"] .poll-track span.on { color: #F5C542; border-color: #F5C542; box-shadow: 0 0 0 3px rgba(245,197,66,.15); }
.skill-tags { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: .85rem; }
.skill-tags span {
  font-size: .75rem; padding: 0; border-radius: 0;
  background: none; color: #6b757c;
}

.compat-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem; margin-top: 2.6rem; text-align: center;
}
.compat-item .ic {
  width: 3.15rem; height: 3.15rem; border-radius: 1rem;
  margin: 0 auto .8rem;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: #333;
  border: 1px solid #eef0f3;
  box-shadow: 0 6px 16px rgba(20,30,50,.05);
}
.compat-item .ic .icon { width: 1.15rem; height: 1.15rem; }
html[data-theme="dark"] .compat-item .ic { background: #1E1F25; color: #eee; border-color: rgba(255,255,255,.08); box-shadow: none; }
.compat-item h4 { font-size: .92rem; margin-bottom: .3rem; font-weight: 650; }
.compat-item p { font-size: .78rem; color: #8a939b; line-height: 1.65; max-width: 16.8rem; margin: 0 auto; }
.nowrap { white-space: nowrap; }

/* Steps */
.steps-head { text-align: center; margin-top: 3.8rem; }
.steps-head h2 { font-size: 1.7rem; font-weight: 800; text-align: center; letter-spacing: -0.02em; }
.steps-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; margin: 2.2rem auto 3.2rem; text-align: center;
  max-width: 920px;
  padding: 0 1.5rem;
}
.step-ic {
  width: 4.1rem; height: 4.1rem; border-radius: 50%;
  margin: 0 auto .85rem;
  background: #f4f6f8;
  border: 1px solid #e8eaee;
  display: flex; align-items: center; justify-content: center;
  position: relative; color: #222;
}
.step-ic .icon { width: 1.55rem; height: 1.55rem; }
.step-ic .n {
  position: absolute; top: -3px; right: -3px;
  width: 1.2rem; height: 1.2rem; border-radius: 50%;
  background: #111; color: #fff; font-size: .68rem;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
html[data-theme="dark"] .step-ic { background: #1E1F25; color: #eee; border-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .step-ic .n { background: #eee; color: #111; }
.step-item h4 { font-size: .98rem; margin-bottom: .35rem; font-weight: 700; }
.step-item p { font-size: .8rem; color: #8a939b; line-height: 1.65; max-width: 16rem; margin: 0 auto; }

.api-cta {
  text-align: center;
  padding: 3.8rem 1.5rem 4.2rem;
  background:
    radial-gradient(ellipse 50% 80% at 50% 85%, rgba(180, 215, 255, .38), transparent 70%),
    radial-gradient(ellipse 30% 40% at 50% 100%, rgba(200, 235, 230, .3), transparent 60%);
}
html[data-theme="dark"] .api-cta { background: none; }
.api-cta h2 { font-size: 1.95rem; font-weight: 800; line-height: 1.35; letter-spacing: -0.02em; }
.api-cta h2 .purp { color: #7850ff; }
.api-cta .lead { margin: .75rem 0 1.4rem; color: #8a939b; font-size: .9rem; }
.api-cta .api-hero-ctas { justify-content: center; margin-top: 0; }

.api-footer {
  border-top: none;
  padding: 2.4rem 2rem 1.5rem;
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
}
html[data-theme="dark"] .api-footer { border-top-color: rgba(255,255,255,.06); }
.api-footer-sub { font-size: .8rem; color: #8a939b; margin-top: .4rem; }
.api-footer .col-r { text-align: left; justify-self: end; }
.api-footer h5 { font-size: .8rem; margin-bottom: .5rem; color: #8a939b; font-weight: 500; }
.api-footer a { font-size: .82rem; color: #5b6570; margin-right: .75rem; }
.api-footer a:hover { color: #111; }
html[data-theme="dark"] .api-footer a:hover { color: #fff; }
.api-copy {
  max-width: 1120px; margin: 0 auto;
  padding: 1rem 2rem 1.7rem;
  font-size: .75rem; color: #b0b6bc;
  border-top: 1px solid #eef0f3;
}
html[data-theme="dark"] .api-copy { border-top-color: rgba(255,255,255,.06); }

/* Pricing */
.pricing-hero { text-align: center; padding: 3.2rem 1.5rem 1.2rem;
  background: linear-gradient(180deg, #f3f7fb 0%, #fff 100%); }
.pricing-hero .count-pill {
  display: inline-block; font-size: .8rem; color: #6b757c;
  padding: .2rem .7rem; border-radius: 999px; background: #fff;
  border: 1px solid #e8eaee; margin-bottom: 1rem;
}
.pricing-hero h1 { font-size: 2.2rem; font-weight: 800; }
.pricing-hero p { color: #6b757c; margin: .7rem 0 1.3rem; }
.search-bar {
  max-width: 36rem; margin: 0 auto;
  display: flex; align-items: center;
  background: #fff; border: 1px solid #e4e8ee; border-radius: 999px;
  padding: .25rem .25rem .25rem 1rem;
  box-shadow: 0 6px 24px rgba(30,50,80,.06);
}
.search-bar input { flex: 1; border: 0; outline: none; font-size: .9rem; background: transparent; color: inherit; }
.search-bar button {
  height: 2.2rem; padding: 0 1.1rem; border-radius: 999px;
  background: #5B9CFF; color: #fff; font-size: .85rem; font-weight: 600;
}
.pricing-body {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 220px 1fr;
  gap: 1.2rem; padding: 1.4rem 1.5rem 3rem;
  align-items: start;
}
.filter-side {
  background: #fff; border: 1px solid #eef0f3; border-radius: .9rem; padding: 1rem .9rem;
  position: sticky; top: 5rem;
}
html[data-theme="dark"] .filter-side { background: #16181e; border-color: rgba(255,255,255,.08); }
.filter-side h4 { font-size: .82rem; margin-bottom: .5rem; display: flex; justify-content: space-between; }
.filter-side h4 button { font-size: .75rem; color: #8a939b; }
.filter-group { margin: .85rem 0; }
.filter-group .g { font-size: .78rem; color: #5b6570; margin-bottom: .4rem; font-weight: 600; }
.filter-group .opts { display: flex; flex-wrap: wrap; gap: .3rem; }
.filter-group .opts button, .side-tag {
  font-size: .72rem; padding: .15rem .4rem; border-radius: .3rem;
  background: #f4f6f8; color: #445;
}
.filter-group .opts button.is-on { background: #e8f1ff; color: #2b6cdf; }
.model-toolbar {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: .85rem; font-size: .82rem; color: #5b6570;
}
.model-toolbar .tab.is-on { color: #111; font-weight: 600; }
.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .85rem; }
.model-card {
  background: #fff; border: 1px solid #eef0f3; border-radius: .9rem;
  padding: 1rem .95rem .85rem;
  display: flex; flex-direction: column; gap: .45rem;
  transition: box-shadow .2s ease, transform .2s ease;
}
.model-card:hover { box-shadow: 0 8px 24px rgba(30,50,80,.08); transform: translateY(-1px); }
html[data-theme="dark"] .model-card { background: #16181e; border-color: rgba(255,255,255,.08); }
.mc-top { display: flex; align-items: flex-start; gap: .55rem; }
.mc-top .vicon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .7rem; font-weight: 700; flex-shrink: 0; }
.mc-top .vicon.has-img { background: transparent !important; overflow: visible; }
.mc-top .nm { font-weight: 700; font-size: .92rem; }
.mc-top .id { font-size: .7rem; color: #8a939b; }
.mc-top .rt { margin-left: auto; font-size: .72rem; color: #8a939b; }
.mc-bar { height: 4px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.mc-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #34d399); border-radius: 4px; }
.price-link { color: #3b82f6; font-size: .82rem; }
.mc-desc { font-size: .78rem; color: #5b6570; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mc-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.mc-tags span { font-size: .68rem; color: #6b757c; background: #f4f6f8; padding: .1rem .35rem; border-radius: .25rem; }
.mc-foot { display: flex; justify-content: flex-end; }
.quick-use { font-size: .75rem; color: #3b82f6; }

/* Rankings */
.rank-wrap { max-width: 1000px; margin: 0 auto; padding: 2.4rem 1.5rem 3rem; }
.rank-wrap h1 { font-size: 1.85rem; font-weight: 800; }
.rank-wrap .sub { color: #6b757c; margin: .4rem 0 1.1rem; font-size: .9rem; }
.rank-tabs, .rank-types { display: flex; gap: 1rem; font-size: .9rem; color: #8a939b; border-bottom: 1px solid #eef0f3; margin-bottom: .3rem; }
.rank-tabs button, .rank-types button { padding: .55rem 0; border-bottom: 2px solid transparent; }
.rank-tabs button.is-on, .rank-types button.is-on { color: #111; font-weight: 600; border-bottom-color: #111; }
.rank-card {
  background: #fff; border: 1px solid #eef0f3; border-radius: 1rem;
  padding: 1.15rem 1.2rem; margin-top: 1rem;
}
html[data-theme="dark"] .rank-card { background: #16181e; border-color: rgba(255,255,255,.08); }
.rank-card-h { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: .8rem; }
.rank-card-h h3 { font-size: 1rem; display: flex; align-items: center; gap: .35rem; }
.rank-card-h .s { font-size: .75rem; color: #8a939b; font-weight: 400; }
.rank-total { font-size: 1.4rem; font-weight: 700; }
.rank-total span { font-size: .75rem; font-weight: 400; color: #8a939b; }
.chart-empty { height: 160px; display: flex; align-items: center; justify-content: center; color: #b0b6bc; font-size: .85rem; }
.rank-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.rank-item { display: flex; align-items: center; gap: .5rem; padding: .45rem 0; }
.rank-item .rk { width: 1.2rem; font-size: .8rem; color: #8a939b; }
.rank-item .vicon { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .6rem; font-weight: 700; }
.rank-item .vicon.has-img { background: transparent !important; overflow: visible; }
.rank-item .nm { font-size: .88rem; font-weight: 500; }
.rank-item .vendor { font-size: .68rem; color: #8a939b; }
.rank-item .cnt { margin-left: auto; text-align: right; font-size: .85rem; font-weight: 600; }
.rank-item .delta { font-size: .7rem; }
.delta.up { color: #16a34a; }
.delta.down { color: #ef4444; }
.share-chart { display: flex; align-items: flex-end; gap: 1.1rem; height: 220px; padding: .5rem 0 0; }
.share-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.share-stack { flex: 1; width: 100%; display: flex; flex-direction: column-reverse; border-radius: .35rem .35rem 0 0; overflow: hidden; }
.share-stack i { display: block; width: 100%; }
.share-col .dt { font-size: .7rem; color: #8a939b; margin-top: .35rem; }
.trend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }

/* Docs */
.docs-app { display: flex; flex-direction: column; min-height: 100vh; background: #f3f5f8; }
html[data-theme="dark"] .docs-app { background: #0F0F12; }
.docs-header {
  height: 3.5rem; display: flex; align-items: center; gap: 1rem;
  padding: 0 1.2rem; background: #fff; border-bottom: 1px solid #e8eaee;
}
html[data-theme="dark"] .docs-header { background: #16181e; border-color: rgba(255,255,255,.06); }
.docs-header .titles { display: flex; flex-direction: column; line-height: 1.2; }
.docs-header .titles b { font-size: .95rem; }
.docs-header .titles small { font-size: .7rem; color: #8a939b; }
.docs-base { margin-left: auto; font-size: .78rem; color: #5b6570; display: flex; align-items: center; gap: .4rem; }
.docs-base code { background: #f4f6f8; padding: .15rem .4rem; border-radius: .3rem; font-size: .75rem; }
.docs-actions { display: flex; gap: .45rem; }
.docs-actions a, .docs-actions button {
  height: 2rem; padding: 0 .7rem; border-radius: .4rem;
  border: 1px solid #e4e8ee; background: #fff; font-size: .78rem;
  display: inline-flex; align-items: center; gap: .3rem; color: #334;
}
.docs-body { display: grid; grid-template-columns: 260px 1fr; flex: 1; min-height: 0; }
.docs-side {
  background: #f7f8fa; border-right: 1px solid #e8eaee;
  padding: .8rem .65rem; overflow: auto; height: calc(100vh - 3.5rem);
  position: sticky; top: 3.5rem;
}
html[data-theme="dark"] .docs-side { background: #141419; border-color: rgba(255,255,255,.06); }
.docs-search { width: 100%; border: 1px solid #e4e8ee; border-radius: .4rem; padding: .4rem .55rem; font-size: .8rem; background: #fff; outline: none; margin-bottom: .6rem; }
.docs-cats { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .7rem; }
.docs-cats button {
  font-size: .72rem; padding: .15rem .4rem; border-radius: .3rem;
  background: #fff; border: 1px solid #e8eaee; color: #445;
}
.docs-cats button.is-on { background: #e8f1ff; border-color: #c9dbff; color: #2b6cdf; }
.doc-group { font-size: .75rem; color: #8a939b; margin: .5rem 0 .25rem; }
.doc-item {
  display: flex; align-items: center; gap: .45rem;
  padding: .4rem .4rem; border-radius: .4rem; font-size: .8rem; color: #334;
}
.doc-item:hover { background: #eceff3; }
.doc-item.is-on { background: #e8f1ff; color: #1d4ed8; }
.doc-item .vicon { width: 22px; height: 22px; border-radius: 8px; font-size: .55rem; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.doc-item .vicon.has-img { background: transparent !important; overflow: visible; }
.docs-main { padding: 1.4rem 2rem 3rem; max-width: 920px; }
.docs-crumb { font-size: .78rem; color: #8a939b; margin-bottom: .6rem; }
.docs-main h1 { font-size: 1.6rem; display: flex; align-items: center; gap: .6rem; }
.btn-copy-all { font-size: .78rem; color: #3b82f6; border: 1px solid #dbe7ff; background: #f4f8ff; padding: .2rem .5rem; border-radius: .35rem; }
.doc-ids { display: flex; gap: .35rem; margin: .45rem 0 1rem; flex-wrap: wrap; }
.notice-ok {
  background: #e9f8ee; border: 1px solid #c9ecd4; border-radius: .55rem;
  padding: .75rem .9rem; font-size: .85rem; color: #166534; line-height: 1.7; margin-bottom: 1rem;
}
.docs-main h2 { font-size: 1.05rem; margin: 1.4rem 0 .6rem; }
.endpoint { background: #f4f6f8; border-radius: .45rem; padding: .45rem .7rem; font-size: .85rem; font-family: ui-monospace, monospace; }
.endpoint .m { color: #16a34a; font-weight: 700; margin-right: .4rem; }
.auth-box { background: #e9f8ee; border: 1px solid #c9ecd4; border-radius: .7rem; padding: 1rem 1.05rem; margin: .8rem 0; }
.auth-box h3 { font-size: .95rem; margin-bottom: .5rem; }
.code-block {
  background: #0f1419; color: #e6edf3; border-radius: .55rem;
  padding: .85rem 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem; overflow: auto; position: relative; line-height: 1.55;
}
.code-block .copy { position: absolute; top: .4rem; right: .4rem; color: #9ab; font-size: .72rem; background: #1a222b; border: 1px solid #2a3340; padding: .15rem .4rem; border-radius: .3rem; }

@media (max-width: 1100px) {
  .api-hero, .pricing-body, .docs-body { grid-template-columns: 1fr; }
  .model-grid { grid-template-columns: 1fr 1fr; }
  .docs-side { position: relative; top: 0; height: auto; max-height: 40vh; }
}
@media (max-width: 800px) {
  .api-stats, .compat-row, .steps-row, .rank-cols, .trend-grid { grid-template-columns: 1fr 1fr; }
  .feat-board { grid-template-columns: 1fr; }
  .model-grid { grid-template-columns: 1fr; }
  .api-nav { gap: .6rem; font-size: .8rem; }
}

.model-drawer { position: fixed; inset: 0; z-index: 80; display: none; }
.model-drawer.is-open { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(10,16,24,.35); }
.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(420px, 92vw);
  background: #fff;
  padding: 1.4rem 1.3rem 2rem;
  overflow: auto;
  box-shadow: -12px 0 40px rgba(0,0,0,.12);
}
html[data-theme="dark"] .drawer-panel { background: #16181e; color: #e8eef2; }
.drawer-x { position: absolute; right: .7rem; top: .6rem; font-size: 1.3rem; color: #8a939b; }
.detail-kv { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1rem 0; font-size: .85rem; }
.detail-kv b { display: block; color: #8a939b; font-weight: 500; font-size: .72rem; margin-bottom: .15rem; }
.drawer-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.link-detail { margin-left: auto; font-size: .75rem; color: #2b6cdf; }
.doc-table { width: 100%; border-collapse: collapse; font-size: .82rem; margin: .4rem 0 1rem; }
.doc-table th, .doc-table td { border-bottom: 1px solid #e8edf2; padding: .45rem .5rem; text-align: left; vertical-align: top; }
.doc-table th { color: #8a939b; font-weight: 600; }
html[data-theme="dark"] .doc-table th, html[data-theme="dark"] .doc-table td { border-color: rgba(255,255,255,.08); }
.guide-ol { padding-left: 1.15rem; line-height: 1.85; color: #5b6570; }
.filter-side .opts button { display: block; width: 100%; text-align: left; padding: .28rem .45rem; border-radius: .35rem; font-size: .78rem; color: #4a5560; }
.filter-side .opts button.is-on { background: #e8f1ff; color: #2b6cdf; }
.bar-chart { display: flex; align-items: flex-end; gap: .45rem; height: 160px; padding: .4rem 0 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar-col i { display: block; width: 100%; max-width: 28px; background: linear-gradient(180deg, #5B9CFF, #00CAE0); border-radius: .25rem .25rem 0 0; }
.bar-col span { font-size: .62rem; color: #8a939b; margin-top: .25rem; }
.chart-legend { font-size: .75rem; color: #8a939b; margin-top: .5rem; }
.console-wrap { max-width: 980px; margin: 2.2rem auto 3rem; padding: 0 1.2rem; }
.console-gate {
  text-align: center;
  background: #fff;
  border: 1px solid #e8edf2;
  border-radius: 1.1rem;
  padding: 2.2rem 1.5rem 1.8rem;
  margin-bottom: 1.2rem;
}
html[data-theme="dark"] .console-gate, html[data-theme="dark"] .console-card { background: #16181e; border-color: rgba(255,255,255,.08); }
.console-mark {
  width: 52px; height: 52px; margin: 0 auto .8rem;
  border-radius: .8rem;
  background: linear-gradient(135deg, #00CAE0, #5B9CFF);
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.console-gate h1 { font-size: 1.6rem; margin-bottom: .4rem; }
.console-gate p { color: #5b6570; line-height: 1.75; max-width: 36rem; margin: 0 auto; }
.console-actions { display: flex; justify-content: center; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.console-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.console-card {
  background: #fff; border: 1px solid #e8edf2; border-radius: .9rem;
  padding: 1.1rem 1.15rem;
}
.console-card h3 { margin-bottom: .3rem; }
.console-card p { font-size: .82rem; color: #5b6570; line-height: 1.6; }
.locked-line {
  margin-top: .8rem; padding: .55rem .7rem;
  border-radius: .5rem;
  background: repeating-linear-gradient(135deg, #f4f6f8, #f4f6f8 8px, #eef1f4 8px, #eef1f4 16px);
  color: #8a939b; font-size: .78rem;
}
@media (max-width: 800px) { .console-grid { grid-template-columns: 1fr; } .docs-body { grid-template-columns: 1fr; } }

#vendor-opts { max-height: 16rem; overflow: auto; }

/* Account chip in API chrome */
.api-user {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .15rem .15rem .15rem .7rem;
  border-radius: 999px;
  background: #f3f6f9;
  border: 1px solid #e4eaef;
  font-size: .78rem;
  color: #334155;
  max-width: 22rem;
}
html[data-theme="dark"] .api-user {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
  color: #e5e7eb;
}
.api-user .api-user-name {
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 7rem;
  color: inherit;
  text-decoration: none;
}
.api-user .api-bal {
  color: #0e7490;
  font-weight: 700;
  white-space: nowrap;
}
html[data-theme="dark"] .api-user .api-bal { color: #5ee6f0; }
.api-user .api-logout {
  height: 1.7rem;
  padding: 0 .7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e4eaef;
  font-size: .72rem;
  color: #4b5563;
}
html[data-theme="dark"] .api-user .api-logout {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
  color: #d1d5db;
}
.docs-actions .api-user { margin-left: .4rem; }

/* Live console */
.console-app { margin-top: .2rem; }
.console-head { margin-bottom: 1.1rem; }
.console-head h1 { font-size: 1.5rem; margin-bottom: .35rem; }
.console-userline { color: #5b6570; font-size: .9rem; }
.console-userline b { color: #0e7490; }
html[data-theme="dark"] .console-userline b { color: #5ee6f0; }
.console-grid-live { grid-template-columns: 1fr; }
.console-card-wide { grid-column: 1 / -1; }
.console-card h3 { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.console-card .sub { font-weight: 400; font-size: .78rem; color: #8a939b; }
.console-toolbar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin: .8rem 0 .7rem;
}
.console-toolbar input, .console-redeem input {
  flex: 1;
  min-width: 10rem;
  height: 2.1rem;
  border: 1px solid #dbe3ea;
  border-radius: .5rem;
  padding: 0 .7rem;
  font: inherit;
  background: #fff;
  color: inherit;
}
html[data-theme="dark"] .console-toolbar input,
html[data-theme="dark"] .console-redeem input {
  background: #12141a;
  border-color: rgba(255,255,255,.12);
  color: #eee;
}
.console-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.console-table th, .console-table td {
  text-align: left;
  padding: .55rem .4rem;
  border-bottom: 1px solid #eef1f4;
  vertical-align: middle;
}
html[data-theme="dark"] .console-table th,
html[data-theme="dark"] .console-table td { border-bottom-color: rgba(255,255,255,.08); }
.console-table th { color: #8a939b; font-weight: 600; }
.console-table code { font-size: .76rem; }
.console-empty { color: #8a939b; font-size: .82rem; padding: .6rem 0; }
.key-banner {
  margin: .3rem 0 .8rem;
  padding: .8rem .9rem;
  border-radius: .6rem;
  background: #f0fbfc;
  border: 1px solid rgba(0,202,224,.35);
}
.key-banner p { margin: 0 0 .4rem; font-size: .8rem; color: #335; }
.key-banner code {
  display: block;
  word-break: break-all;
  font-size: .82rem;
  background: #fff;
  border-radius: .4rem;
  padding: .45rem .55rem;
  margin-bottom: .45rem;
}
.console-actions-inline { display: flex; flex-wrap: wrap; gap: .35rem; }
.btn-tiny {
  height: 1.7rem;
  padding: 0 .55rem;
  border-radius: .4rem;
  border: 1px solid #dbe3ea;
  background: #fff;
  font-size: .72rem;
  color: #334155;
}
html[data-theme="dark"] .btn-tiny {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: #e5e7eb;
}
.btn-tiny.danger { color: #b91c1c; border-color: #fecaca; }
.token-status { font-size: .72rem; }
.token-status.is-on { color: #15803d; }
.token-status.is-off { color: #b45309; }
.console-redeem { display: flex; gap: .5rem; margin-top: .8rem; }
.quota-figure { font-size: 1.6rem; font-weight: 760; color: #0e7490; margin: .3rem 0 .15rem; }
.quota-meta { font-size: .8rem; color: #5b6570; }
.mc-price { font-size: .82rem; color: #0f766e; font-weight: 650; margin: .35rem 0 .15rem; }
html[data-theme="dark"] .mc-price { color: #5ee6f0; }
.price-note { font-size: .75rem; color: #8a939b; margin: .4rem 0 0; }


/* vendor logos */
.vicon.has-img { background: transparent !important; overflow: visible; padding: 0; }
.vicon.has-img img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit; }


/* Landing header + typography at smaller widths */
@media (max-width: 1100px) {
  .page-api-home .api-header { padding-left: 1rem; padding-right: 1rem; }
  .page-api-home .api-header.is-compact .api-header-inner { max-width: calc(100% - 1.2rem); }
  .api-hero-copy { text-align: left; }
}
@media (max-width: 800px) {
  .page-api-home .api-header-inner { height: auto; flex-wrap: wrap; row-gap: .45rem; padding-bottom: .35rem; }
  .page-api-home .api-nav { margin-left: 0; gap: .7rem; }
  .page-api-home .api-nav-right { margin-left: auto; }
  .page-api-home .api-header.is-compact .api-header-inner {
    border-radius: 1.1rem;
    flex-wrap: wrap;
    height: auto;
    padding: .45rem .8rem .5rem;
  }
  .api-stats .n { font-size: 1.7rem; }
  .req-code { white-space: pre-wrap; }
  .feat-cell-route .route-viz { justify-content: center; }
}
