/* webrpc — Apple / big-tech light product site
 * Class names preserved for existing JS. Visual only.
 */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --secondary: #6e6e73;
  --tertiary: #86868b;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --track: #e8e8ed;
  --line: rgba(0, 0, 0, 0.08);
  --danger: #ff3b30;
  --ok: #248a3d;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: none;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  --top-row: 48px;
  --primary: var(--blue);
  --primary-soft: rgba(0, 113, 227, 0.1);
  --bg-card: var(--surface);
  --panel-bg: var(--surface);
  --text-main: var(--ink);
  --text-muted: var(--secondary);
  --text-dim: var(--tertiary);
  --topbar-h: 48px;
  --sidebar-w: 0px;
  --nav-fg: rgba(255, 255, 255, 0.8);
  --nav-fg-active: #fff;
  --nav-bg: rgba(22, 22, 23, 0.8);
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { overflow-x: hidden; overflow-y: auto; height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

#matrix-canvas,
.overlay-grid,
.floating-copy { display: none !important; }

.is-hidden { display: none !important; }

/* ========== Apple global nav (dark frosted, centered links) ========== */
.app { min-height: 100vh; background: var(--bg); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  /* Equal side rails so the link group is truly viewport-centered */
  grid-template-columns: 160px 1fr 160px;
  align-items: center;
  height: var(--top-row);
  padding: 0 22px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: none;
  color: var(--nav-fg);
}

.topbar::before,
.topbar::after { display: none; content: none; }

.brand {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
}
.desc { display: none; }

.sidebar {
  grid-column: 2;
  justify-self: stretch;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 1.6vw, 32px);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  height: 100%;
  position: static;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

a.nav-item {
  text-decoration: none;
  color: var(--nav-fg);
}
.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--nav-fg);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  opacity: 1;
  transition: color .15s ease;
}
.nav-item::before { display: none; }
.nav-item:hover {
  color: var(--nav-fg-active);
  background: transparent;
  box-shadow: none;
  transform: none;
}
.nav-item.active {
  color: var(--nav-fg-active);
  background: transparent;
  font-weight: 400;
  box-shadow: none;
}
.nav-icon { display: none; }
.nav-label { color: inherit; }

.top-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo { display: inline-flex; align-items: center; gap: 8px; user-select: none; }
.logo-mark {
  width: 18px; height: 18px; border-radius: 4px;
  background: url("./webrpc-logo.svg") center / cover no-repeat;
  filter: brightness(1.05);
}
.logo-mark::before, .logo-mark::after { display: none; }
.logo-word {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}
.logo-word-web { color: #f5f5f7; }
.logo-word-rpc { color: #2997ff; }

.lang-toggle,
.user-trigger {
  border: 0;
  background: transparent;
  color: var(--nav-fg);
  border-radius: 0;
  padding: 4px 2px;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
}
.lang-toggle:hover,
.user-trigger:hover {
  color: var(--nav-fg-active);
  background: transparent;
}

.user-wrap { position: relative; }
.user-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 148px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  z-index: 20;
}
.user-menu.open { display: block; }
.logout-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--blue);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.logout-btn:hover { background: rgba(0, 113, 227, 0.08); }
#userEmailDisplay {
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.body { min-height: 0; background: var(--bg); }
.content {
  max-width: none;
  margin: 0 auto;
  padding: 0 0 96px;
}

.panel { display: none; }
.panel.active { display: block; animation: fade .28s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Shared product/console page shell (aligned with About) */
.page-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px clamp(20px, 4vw, 40px) 36px;
  text-align: left;
}
.page-hero-compact {
  padding-top: 40px;
  padding-bottom: 28px;
}
.page-hero-copy { min-width: 0; }
.page-title,
.panel-title {
  margin: 0 0 14px;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.08;
  color: #1d1d1f;
  text-align: left;
}
.page-lead,
.panel-sub,
.doc-sub,
.token-sub {
  margin: 0;
  max-width: 460px;
  color: #424245;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.42;
  letter-spacing: 0.011em;
  text-align: left;
  opacity: 1;
}
.page-hero-visual {
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  background: #e8e8ed;
  aspect-ratio: 16 / 10;
}
.page-hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.page-band {
  padding: 36px 0 64px;
  background: #fff;
}
.page-band-alt { background: var(--bg); }
.page-band-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
  text-align: left;
}
.page-console .page-band-inner {
  max-width: min(1440px, 100%);
}
.page-console .token-tools {
  justify-content: flex-start;
  margin-top: 0;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.page-docs .doc-toolbar {
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 18px;
}
.page-security .security-form {
  margin: 0;
}

.buy-onboarding-hint-p,
.buy-compliance-alert p,
.buy-compliance-alert strong,
.notice p,
.notice strong,
.notice h3 {
  color: #1d1d1f;
}

/* Segmented control */
.method-switch,
.doc-toolbar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: var(--track);
  width: max-content;
  max-width: 100%;
  margin-bottom: 20px;
}
.method-switch { display: flex; width: 100%; }
.method-btn, .doc-lang-btn {
  border: 0;
  background: transparent;
  color: #1d1d1f;
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.method-btn { flex: 1; }
.method-btn:hover, .doc-lang-btn:hover { background: rgba(0, 0, 0, 0.04); }
.method-btn.active, .doc-lang-btn.active {
  background: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.doc-lang-icon { display: none; }

/* Buttons — Apple capsule */
.about-cta, .btn, .token-btn, .order-btn, .page-btn, .sdk-download-btn,
.doc-copy-btn, .btn-send-code, .contact-copy, .contact-close,
.buy-plan-order-btn, .buy-notice-primary, .buy-notice-close, .usage-close,
.buy-notice-copy-qq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 980px;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.about-cta-primary, .btn-login, .sdk-download-btn, .buy-plan-order-btn, .buy-notice-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.about-cta-primary:hover, .btn-login:hover, .sdk-download-btn:hover,
.buy-plan-order-btn:hover, .buy-notice-primary:hover {
  background: var(--blue-hover);
  color: #fff;
}
.about-cta-secondary, .btn-register {
  background: rgba(0, 113, 227, 0.08);
  color: var(--blue);
  border-color: transparent;
}
.about-cta-secondary:hover, .btn-register:hover {
  background: rgba(0, 113, 227, 0.12);
}
.page-btn, .token-btn, .order-btn:not(.buy-plan-order-btn), .doc-copy-btn,
.btn-send-code, .contact-copy, .contact-close, .buy-notice-close, .usage-close, .buy-notice-copy-qq {
  border-color: #d2d2d7;
  background: #fff;
  color: var(--blue);
}
.page-btn:hover:not(:disabled), .token-btn:hover, .doc-copy-btn:hover, .btn-send-code:hover {
  background: #f5f5f7;
}
.buy-plan-order-btn {
  background: var(--blue) !important;
  color: #fff !important;
  border-color: var(--blue) !important;
}
.buy-plan-order-btn:hover {
  background: var(--blue-hover) !important;
}
.page-btn:disabled, .sdk-download-btn:disabled, .btn-login:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* Forms */
.field { margin-bottom: 14px; }
.field label, .security-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--secondary);
}
input, select, textarea, .token-input, .security-input-full, .captcha-box {
  width: 100%;
  border: 1px solid #d2d2d7;
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus, .token-input:focus, .security-input-full:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.16);
}
.verify-row, .captcha-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.captcha-box { width: auto; padding: 0; overflow: hidden; height: 44px; }
.captcha-canvas { display: block; }

.disclaimer-block {
  margin: 14px 0;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fbfbfd;
}
.disclaimer-label { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.disclaimer-scroll {
  max-height: 120px;
  overflow: auto;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.55;
}
.disclaimer-p { margin: 0 0 8px; color: var(--secondary); }
.disclaimer-hint { margin: 8px 0; font-size: 12px; color: var(--tertiary); }
.disclaimer-hint.is-done { color: var(--ok); }
.accept-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.accept-row input { width: auto; margin-top: 3px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.btn { width: 100%; padding: 12px 16px; }
.error, .sec-error { margin-top: 10px; min-height: 18px; font-size: 13px; color: var(--danger); }
.sec-error.ok { color: var(--ok); }

/* ========== About — product homepage (split hero + alternating bands) ========== */
.app:has(.panel[data-panel="about"].active) .content {
  max-width: none;
  padding: 0 0 80px;
}

.about-lp {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 0;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px clamp(20px, 4vw, 40px) 40px;
  background: transparent;
  text-align: left;
}

.about-hero-copy { min-width: 0; }
.about-lp-title {
  margin: 0 0 16px;
  max-width: none;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.08;
  color: #1d1d1f;
  text-align: left;
}
.about-lp-lead {
  margin: 0 0 28px;
  max-width: 460px;
  color: #424245;
  font-size: 19px;
  line-height: 1.42;
  font-weight: 400;
  text-align: left;
}
.about-lp-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  margin: 0;
}
.about-hero-visual {
  margin: 0;
  border-radius: 22px;
  overflow: hidden;
  background: #e8e8ed;
  aspect-ratio: 16 / 10;
}
.about-hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  max-width: 1120px;
  margin: 8px auto 0;
  padding: 28px clamp(20px, 4vw, 40px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.about-metric {
  padding: 8px 16px;
  text-align: left;
  border-right: 1px solid var(--line);
}
.about-metric:last-child { border-right: none; }
.about-kpi-value {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #1d1d1f;
}
.about-kpi-label {
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.35;
  max-width: 180px;
}
.about-kpi-icon { display: none; }

.about-band {
  padding: 72px 0;
  background: #fff;
}
.about-band-alt { background: var(--bg); }
.about-band-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 40px);
  text-align: left;
}
.about-band-copy-only,
.about-band-narrow {
  max-width: 760px;
}
.about-band-narrow { margin-left: auto; margin-right: auto; }

.about-h2 {
  margin: 0 0 16px;
  max-width: none;
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1d1d1f;
  text-align: left;
}
.about-h3 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.016em;
  color: #1d1d1f;
  text-align: left;
}
.about-prose {
  margin: 0 0 14px;
  max-width: 640px;
  color: #424245;
  font-size: 17px;
  line-height: 1.47059;
  text-align: left;
}
.about-prose-lead { margin-bottom: 24px; }

.about-split {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.about-split-reverse {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}
.about-split-reverse .about-split-copy { order: 2; }
.about-split-reverse .about-split-media { order: 1; }
.about-split-copy .about-h2 { max-width: 420px; }
.about-split-media {
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #e8e8ed;
  aspect-ratio: 16 / 10;
}
.about-split-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-cap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 0;
  text-align: left;
}
.about-cap-card {
  padding: 28px 24px;
  border-radius: 18px;
  background: #fff;
  border: none;
}
.about-band-alt .about-cap-card { background: #fff; }
.about-band:not(.about-band-alt) .about-cap-card { background: var(--bg); }
.about-cap-card p {
  margin: 0;
  color: var(--secondary);
  font-size: 15px;
  line-height: 1.47;
}

.about-vs-table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: none;
  margin: 8px 0 0;
  text-align: left;
  background: var(--bg);
}
.about-band-alt .about-vs-table-wrap { background: #fff; }
.about-vs-table { width: 100%; border-collapse: collapse; background: transparent; }
.about-vs-table th, .about-vs-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: #1d1d1f;
  vertical-align: top;
}
.about-vs-table th {
  background: transparent;
  color: var(--secondary);
  font-weight: 600;
  font-size: 12px;
}
.about-vs-highlight td {
  background: rgba(0, 113, 227, 0.06);
  font-weight: 500;
}

.about-adv-list {
  margin: 24px 0 0;
  padding-left: 22px;
  max-width: 640px;
  color: #1d1d1f;
  text-align: left;
}
.about-adv-list li { margin-bottom: 10px; color: var(--secondary); }

.use-case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0 0;
  text-align: left;
}
.use-case-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--bg);
  border: none;
}
.about-band-alt .use-case-card { background: #fff; }
.use-case-visual img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.use-case-title {
  margin: 16px 18px 6px;
  font-size: 19px;
  font-weight: 600;
  color: #1d1d1f;
}
.use-case-text {
  margin: 0 18px 18px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.47;
}
.use-case-featured { grid-column: span 1; }

.about-oss-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px);
  margin: 8px 0 0;
  text-align: left;
}
.about-oss-group-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tertiary);
}
.about-oss-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.about-oss-list li { margin: 0; }
.about-oss-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.about-oss-row:hover { text-decoration: none; }
.about-oss-row:hover .about-oss-name { color: var(--blue); }
.about-oss-row:hover .about-oss-cta { color: var(--blue); }
.about-oss-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.about-oss-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.016em;
  color: #1d1d1f;
}
.about-oss-desc {
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.47;
}
.about-oss-cta {
  flex: none;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--blue);
  white-space: nowrap;
}

.about-faq {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 12px 0 0;
  text-align: left;
}
.about-faq-item {
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0;
}
.about-faq-item summary {
  cursor: pointer;
  padding: 18px 4px;
  font-weight: 600;
  font-size: 17px;
  color: #1d1d1f;
  list-style: none;
}
.about-faq-item summary::-webkit-details-marker { display: none; }
.about-faq-item p {
  margin: 0 4px 18px;
  color: var(--secondary);
  font-size: 15px;
  line-height: 1.47;
}
.about-legal {
  margin: 0;
  border-top: none;
  padding: 0;
}

/* Buy / notices */
.buy-compliance-alert,
.buy-onboarding-hint,
.notice {
  padding: 18px 0;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--line);
  background: transparent;
  margin: 0 0 12px;
  box-shadow: none;
  max-width: none;
}
.buy-onboarding-hint {
  border-top: none;
  padding-top: 0;
}
.buy-compliance-alert strong,
.notice strong,
.notice h3 {
  color: #1d1d1f;
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 600;
}
.buy-compliance-alert p,
.buy-onboarding-hint-p,
.notice p,
.notice li {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.5;
}
.buy-onboarding-hint-p { color: #1d1d1f; font-size: 15px; }
.buy-onboarding-link { color: var(--blue); font-weight: 500; }
.notice { margin-top: 28px; }
.notice ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--secondary);
}
.notice li { margin-bottom: 8px; }

/* Plans / SDK tiles */
.plan-grid, .sdk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: none;
  margin: 20px 0 8px;
}
.page-band-alt .plan-card,
.page-band-alt .sdk-card { background: #fff; }
.page-band:not(.page-band-alt) .plan-card,
.page-band:not(.page-band-alt) .sdk-card { background: var(--bg); }

.plan-card, .sdk-card {
  padding: 28px 26px;
  border-radius: 22px;
  background: var(--bg);
  border: 1px solid transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  transition: transform .2s ease, border-color .15s ease, box-shadow .15s ease;
  cursor: default;
}
.sdk-card { cursor: pointer; }
.plan-card:hover, .sdk-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 113, 227, 0.28);
}
.sdk-card[aria-selected="true"],
.sdk-card.sdk-card--selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}
.plan-card-head, .sdk-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.plan-icon {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.page-band-alt .plan-icon { background: var(--bg); }
.plan-name {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.016em;
  color: #1d1d1f;
}
.plan-meta {
  margin: 0;
  color: var(--secondary);
  font-size: 15px;
  line-height: 1.4;
}
.plan-meta:first-of-type {
  color: #1d1d1f;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 8px 0 12px;
}
.plan-card p, .sdk-card p {
  margin: 0;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.45;
}
.plan-card .buy-plan-order-btn {
  margin-top: auto;
  align-self: flex-start;
}
.sdk-card {
  min-height: 0;
  padding: 24px;
}
.sdk-card-head { margin-bottom: 8px; }
.sdk-card-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.016em;
}
.sdk-icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--bg);
  color: var(--blue);
  font-weight: 700;
  font-size: 11px;
}
.page-band-alt .sdk-icon { background: var(--bg); }
.page-band:not(.page-band-alt) .sdk-icon { background: #fff; }
.sdk-actions {
  margin-top: 28px;
  text-align: left;
}
.sdk-download-btn { min-width: 180px; }

/* Tables — fit all columns on screen, no horizontal scroll chrome */
.token-table-wrap, .order-table-wrap {
  overflow-x: visible;
  overflow-y: visible;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}
.token-table, .order-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.panel[data-panel="order"] .order-table {
  table-layout: fixed;
}
.token-table th, .token-table td,
.order-table th, .order-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 12px;
  color: #1d1d1f;
  vertical-align: middle;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.token-table th, .order-table th {
  background: transparent;
  color: var(--secondary);
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
}
.token-table tbody tr:hover, .order-table tbody tr:hover { background: #fbfbfd; }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  word-break: break-all;
}

/* Token list columns only (not usage modal table) */
.panel[data-panel="token"] .token-table { table-layout: fixed; }
.panel[data-panel="token"] .token-table th:nth-child(1),
.panel[data-panel="token"] .token-table td:nth-child(1) { width: 14%; }
.panel[data-panel="token"] .token-table th:nth-child(2),
.panel[data-panel="token"] .token-table td:nth-child(2) { width: 10%; }
.panel[data-panel="token"] .token-table th:nth-child(3),
.panel[data-panel="token"] .token-table td:nth-child(3) { width: 64px; }
.panel[data-panel="token"] .token-table th:nth-child(4),
.panel[data-panel="token"] .token-table td:nth-child(4) { width: 16%; }
.panel[data-panel="token"] .token-table th:nth-child(5),
.panel[data-panel="token"] .token-table td:nth-child(5) { width: 12%; }
.panel[data-panel="token"] .token-table th:nth-child(6),
.panel[data-panel="token"] .token-table td:nth-child(6) { width: 12%; }
.panel[data-panel="token"] .token-table th:nth-child(7),
.panel[data-panel="token"] .token-table td:nth-child(7) { width: 12%; }
.panel[data-panel="token"] .token-table th:nth-child(8),
.panel[data-panel="token"] .token-table td:nth-child(8) { width: 120px; }

.token-remark-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  margin: 0;
  border: 1px solid #d2d2d7;
  background: #fff;
  color: #1d1d1f;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.3;
  outline: none;
}
.token-remark-input::placeholder {
  color: var(--tertiary);
  opacity: 1;
}
.token-remark-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
}

.token-qr-cell {
  text-align: center;
}
.token-qr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  width: 52px;
  height: 52px;
}
.token-qr-btn:hover { background: #f5f5f7; }
.token-qr-box {
  display: block;
  width: 44px;
  height: 44px;
  overflow: hidden;
  line-height: 0;
}
.token-qr-box img,
.token-qr-box canvas,
.token-qr-box table {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px;
  max-height: 44px;
}
.token-qr-disabled {
  display: inline-block;
  max-width: 64px;
  color: var(--tertiary);
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
}

.token-tools, .token-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0;
  justify-content: flex-start;
}
.token-tools .token-input {
  max-width: 280px;
  width: min(280px, 100%);
}
.token-tools-label, .page-info { color: var(--secondary); font-size: 13px; }
.token-pagination { justify-content: center; margin-top: 18px; }

.token-table td:last-child,
.order-table td:last-child {
  white-space: normal;
  vertical-align: middle;
}
.token-action-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  width: 100%;
}
.token-more-btn,
.renew-btn,
.pay-order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid #d2d2d7;
  background: #fff;
  color: var(--blue);
  border-radius: 980px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  width: auto;
  min-width: 0;
  max-width: none;
}
.token-more-btn:hover,
.renew-btn:hover,
.pay-order-btn:hover {
  background: #f5f5f7;
}
.token-more-menu {
  display: none;
  position: fixed;
  z-index: 120;
  min-width: 148px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}
.token-more-menu.open { display: block; }
.token-more-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  color: #1d1d1f;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.token-more-item:hover { background: #f5f5f7; }

/* Docs */
.doc-toolbar { margin-left: auto; margin-right: auto; display: flex; }
.doc-code-wrap {
  position: relative;
  border-radius: 18px;
  border: none;
  background: #fff;
  box-shadow: none;
  padding: 22px;
}
.doc-copy-btn { position: absolute; top: 12px; right: 12px; z-index: 2; }
.doc-md { color: #1d1d1f; max-width: 100%; overflow-x: auto; }
.doc-md h1, .doc-md h2, .doc-md h3 {
  color: #1d1d1f;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.doc-md p, .doc-md li { color: var(--secondary); }
.doc-md pre, .doc-md code, pre, code, .hljs {
  background: #f5f5f7 !important;
  color: #1d1d1f !important;
  border-radius: 10px;
}

/* Security */
.security-form {
  max-width: 480px;
  margin: 0;
  padding: 28px;
  border-radius: 20px;
  border: none;
  background: #fff;
  box-shadow: none;
}
.security-field { margin-bottom: 14px; }
.security-form .order-btn,
.security-form .buy-plan-order-btn {
  width: auto;
  margin-top: 8px;
}

/* Contact */
.contact-fab {
  position: fixed;
  right: 20px;
  bottom: 64px;
  z-index: 40;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background: #1d1d1f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.contact-fab::before { display: none; }
.contact-fab:hover { background: #000; }
.contact-icon { width: 20px; height: 20px; color: #fff; }
.contact-panel {
  position: fixed;
  right: 20px;
  bottom: 124px;
  z-index: 41;
  width: min(320px, calc(100vw - 36px));
  display: none;
  padding: 16px;
  border-radius: 16px;
  border: none;
  background: #fff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}
.contact-panel.open { display: block; }
.contact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.contact-title { margin: 0; font-size: 15px; font-weight: 600; color: #1d1d1f; }
.contact-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: var(--bg);
  margin-bottom: 10px;
}
.contact-label { font-size: 12px; color: var(--secondary); margin-bottom: 4px; }
.contact-value { font-size: 13px; color: #1d1d1f; word-break: break-all; }
.contact-hint { margin: 0; font-size: 12px; color: var(--tertiary); }

/* Modals */
.usage-modal,
.buy-notice-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(0, 0, 0, 0.4);
  padding: 40px 20px;
  overscroll-behavior: contain;
}
.usage-modal.open,
.buy-notice-modal.open {
  display: flex;
}
.usage-card,
.buy-notice-card {
  width: min(960px, 100%);
  max-width: 100%;
  margin: auto;
  background: #fff;
  border-radius: 18px;
  border: none;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  padding: 24px;
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
.usage-card {
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.buy-notice-card {
  width: min(560px, 100%);
}
.usage-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
}
.usage-body .token-table-wrap {
  flex: 1 1 auto;
  min-height: 160px;
  max-height: min(56vh, 480px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 14px;
  overscroll-behavior: contain;
}
.usage-body .token-table {
  table-layout: auto;
  min-width: 100%;
}
.usage-body .token-pagination {
  flex: 0 0 auto;
  justify-content: center;
  margin: 4px 0 0;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.usage-body .page-btn {
  pointer-events: auto;
  cursor: pointer;
  padding: 7px 14px;
  font-size: 13px;
}
.usage-head {
  flex: 0 0 auto;
}
.usage-head, .buy-notice-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.usage-title, .buy-notice-title {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  color: #1d1d1f;
}
.usage-sub, .buy-notice-lead, .buy-notice-detail, .buy-notice-foot, .buy-notice-body {
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.47;
}
.buy-notice-qq {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
  border: none;
  margin: 14px 0;
}
.buy-notice-qq-label { color: var(--secondary); font-size: 13px; }
.buy-notice-qq-value { color: #1d1d1f; font-weight: 600; }
.token-pwd-foot, .token-pwd-token { color: var(--secondary); font-size: 13px; }
.token-qr-modal-box { display: grid; place-items: center; padding: 12px; }
.token-qr-modal-box img, .token-qr-modal-box canvas { max-width: 220px; }

/* Auth pages — Apple ID style */
.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 16px;
  background: #fff;
}
.login-card, .register-card {
  width: min(420px, calc(100vw - 32px));
  padding: 8px 8px 28px;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  text-align: center;
}
.login-card h1, .register-card h1 {
  margin: 20px 0 8px;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}
.subtitle, .brand-tag {
  margin: 0 0 28px;
  color: var(--secondary);
  font-size: 17px;
}
.stage .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.stage .logo-word-web { color: #1d1d1f; }
.stage .logo-word-rpc { color: var(--blue); }
.stage .logo-mark { filter: none; width: 36px; height: 36px; border-radius: 8px; }
.stage .logo-word { font-size: 21px; }
.stage .lang-toggle {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 20;
  color: var(--secondary);
}
.stage .lang-toggle:hover { color: #1d1d1f; }
.stage .field { text-align: left; }
.stage .actions { margin-top: 18px; }
.stage .method-switch { margin-left: auto; margin-right: auto; }
.auth-notice {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(36, 138, 61, 0.1);
  color: #1d7a35;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
}
.register-success-card h1 {
  margin-top: 8px;
}
.register-success-badge {
  width: 52px;
  height: 52px;
  margin: 8px auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(36, 138, 61, 0.12);
  color: #1d7a35;
  font-size: 28px;
  font-weight: 600;
}
.register-success-lead {
  margin-bottom: 12px;
}
.register-success-email {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: #1d1d1f;
  word-break: break-all;
}
.register-success-countdown {
  margin: 0 0 22px;
  color: #1d7a35;
  font-size: 15px;
  font-weight: 500;
}
.register-success-actions {
  justify-content: center;
}
.register-success-hint {
  margin: 14px 0 0;
  color: var(--tertiary);
  font-size: 13px;
  line-height: 1.45;
}
.welcome-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 240;
  max-width: min(440px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, 12px);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.welcome-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Responsive — keep centered nav until phone */
@media (max-width: 1100px) {
  .sidebar { gap: 12px; }
  .nav-item { font-size: 11px; }
}

@media (max-width: 980px) {
  .about-hero,
  .page-hero {
    grid-template-columns: 1fr;
    padding: 36px 20px 28px;
    gap: 24px;
  }
  .about-hero-visual,
  .page-hero-visual { order: -1; }
  .about-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-metric:nth-child(2) { border-right: none; }
  .about-metric:nth-child(1),
  .about-metric:nth-child(2) { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 8px; }
  .about-split,
  .about-split-reverse {
    grid-template-columns: 1fr;
  }
  .about-split-reverse .about-split-copy,
  .about-split-reverse .about-split-media { order: initial; }
  .about-cap-grid, .use-case-grid, .about-oss-groups, .plan-grid, .sdk-grid { grid-template-columns: 1fr; }
  .about-band,
  .page-band { padding: 36px 0 48px; }
  .content { padding: 0 0 64px; }
  .app:has(.panel[data-panel="about"].active) .content { padding: 0 0 64px; }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 88px 1fr 88px;
    padding: 0 12px;
  }
  .sidebar { gap: 12px; padding: 0; }
  .nav-item { font-size: 11px; }
}

@media (max-width: 734px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 12px;
  }
  .sidebar {
    justify-self: stretch;
    justify-content: flex-start;
    gap: 16px;
    max-width: none;
  }
  .nav-item { font-size: 11px; }
  #userEmailDisplay { max-width: 72px; }
  .panel-title { font-size: 32px; }
  .panel-sub, .doc-sub, .token-sub { font-size: 17px; margin-bottom: 28px; }
  .about-metrics { grid-template-columns: 1fr 1fr; padding: 20px 16px; }
  .actions { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .about-metrics { grid-template-columns: 1fr; }
  .about-metric { border-right: none; border-bottom: 1px solid var(--line); }
  .about-metric:last-child { border-bottom: none; }
}

@media (prefers-reduced-motion: reduce) {
  .panel.active { animation: none; }
  .plan-card:hover, .sdk-card:hover { transform: none; }
}
