:root {
  --ink: #23262f; --ink-soft: #737985; --paper: #f7f8fa; --surface: #ffffff; --line: #e5e7ec;
  --teal: #087a72; --teal-soft: #dcefeb; --coral: #c95f50; --coral-soft: #f8e7e3;
  --yellow: #d6a62e; --yellow-soft: #fbf1d5; --shadow: 0 18px 50px rgba(19, 36, 32, .12);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, .9fr) minmax(420px, 1.1fr); background: var(--surface); }
.auth-signal { position: relative; overflow: hidden; display: flex; align-items: end; padding: 46px; background: #183430; color: white; }
.auth-signal p { position: relative; z-index: 2; margin: 0; font: 700 12px/1 ui-monospace, monospace; }
.signal-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.08); }
.signal-grid span { background: #183430; position: relative; }
.signal-grid span:nth-child(2)::after, .signal-grid span:nth-child(4)::after, .signal-grid span:nth-child(6)::after { content: ""; position: absolute; inset: 28%; border: 1px solid rgba(137,216,202,.55); }
.signal-grid span:nth-child(4)::after { border-radius: 50%; background: rgba(201,95,80,.35); }
.auth-panel { width: min(430px, calc(100% - 48px)); align-self: center; justify-self: center; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font: 750 10px/1 ui-monospace, monospace; }
.auth-panel h1 { margin: 0 0 34px; font-size: 34px; line-height: 1.2; letter-spacing: 0; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.auth-tabs button { padding: 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-soft); }
.auth-tabs button.active { color: var(--ink); border-bottom-color: var(--teal); font-weight: 700; }
.form-stack { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 5px; padding: 9px 11px; background: var(--surface); color: var(--ink); }
input:focus { outline: 2px solid rgba(8,122,114,.2); border-color: var(--teal); }
.form-error { min-height: 18px; margin: 0; color: var(--coral); font-size: 12px; }
.button, .icon-button { border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 13px; font-size: 12px; font-weight: 700; text-decoration: none; }
.button svg, .icon-button svg { width: 16px; height: 16px; }
.button.primary { color: white; background: var(--teal); border-color: var(--teal); }
.button.danger { color: var(--coral); border-color: #e4b5ae; }
.button.full { width: 100%; min-height: 46px; }
.button:disabled { opacity: .55; cursor: wait; }
.icon-button { width: 36px; height: 36px; padding: 0; }
.app-shell { min-height: 100vh; }
.topbar { height: 72px; padding: 0 28px; display: flex; align-items: center; gap: 32px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand > span:last-child strong, .brand > span:last-child small { display: block; }
.brand strong { font-size: 14px; }.brand small { color: var(--ink-soft); font: 9px ui-monospace, monospace; }
.brand-mark { width: 29px; height: 29px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.brand-mark b { background: var(--teal); }.brand-mark b:nth-child(2) { background: var(--yellow); }.brand-mark b:nth-child(3) { background: var(--coral); }
#main-nav { display: flex; align-self: stretch; }
#main-nav button { min-width: 88px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-soft); display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; }
#main-nav button.active { color: var(--teal); border-bottom-color: var(--teal); font-weight: 700; }
#main-nav svg { width: 15px; }
.account { margin-left: auto; display: flex; align-items: center; gap: 9px; font-size: 12px; }
.account > span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); font-weight: 800; }
.page-content { width: min(1060px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 70px; }
.page-head { min-height: 72px; margin-bottom: 26px; display: flex; align-items: start; gap: 18px; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: 0; }.page-head > :last-child { margin-left: auto; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 7px 10px; font: 700 10px/1 ui-monospace, monospace; white-space: nowrap; }
.status svg { width: 13px; }.status.ok { color: #15705b; background: #dff2e9; }.status.wait { color: #896518; background: var(--yellow-soft); }.status.bad { color: #a34237; background: var(--coral-soft); }.status.muted { color: var(--ink-soft); background: #e9eeec; }
.lifecycle { min-height: 92px; display: flex; align-items: center; padding: 17px 24px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 22px; }
.life-step { width: 72px; display: grid; justify-items: center; gap: 8px; color: var(--ink-soft); }
.life-step span { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font: 700 10px monospace; }.life-step span svg { width: 14px; }
.life-step.complete { color: var(--teal); }.life-step.complete span { color: white; background: var(--teal); border-color: var(--teal); }
.life-step small { font-size: 10px; }.lifecycle > b { height: 1px; flex: 1; background: var(--line); }
.metric-band { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--surface); margin-bottom: 22px; }
.metric-band > div { min-width: 0; padding: 21px 23px; border-right: 1px solid var(--line); }.metric-band > div:last-child { border: 0; }
.metric-band span, .metric-band small { display: block; color: var(--ink-soft); font-size: 10px; }.metric-band strong { display: block; margin: 8px 0 5px; font: 700 24px/1 ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; }
.workspace-strip { min-height: 92px; padding: 18px 20px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 16px; }
.workspace-strip > div:first-child { display: flex; align-items: center; gap: 13px; min-width: 0; }.workspace-strip strong, .workspace-strip small { display: block; }.workspace-strip strong { font: 700 13px ui-monospace, monospace; }.workspace-strip small { margin-top: 4px; color: var(--ink-soft); font-size: 10px; }
.workspace-icon, .channel-symbol { width: 44px; height: 44px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }.workspace-icon svg { width: 21px; }
.workspace-actions { margin-left: auto; display: flex; gap: 8px; }
.inline-error { padding: 12px; display: flex; gap: 8px; color: var(--coral); background: var(--coral-soft); font-size: 12px; }.inline-error svg { width: 16px; }
.next-action { width: 100%; margin-top: 22px; padding: 18px 20px; border: 0; border-left: 4px solid var(--yellow); background: var(--yellow-soft); display: flex; align-items: center; text-align: left; color: var(--ink); }
.next-action span small, .next-action span strong { display: block; }.next-action small { color: #886719; font-size: 10px; }.next-action strong { margin-top: 3px; }.next-action > svg { margin-left: auto; width: 18px; }
.bind-layout { min-height: 430px; display: grid; grid-template-columns: minmax(280px, .8fr) minmax(340px, 1.2fr); border: 1px solid var(--line); background: var(--surface); }
.bind-copy { padding: 38px; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: start; justify-content: center; }
.channel-symbol { width: 52px; height: 52px; background: #def1e5; color: #178150; }.channel-symbol svg { width: 25px; }
.bind-copy h2 { margin: 22px 0 8px; font-size: 19px; }.bind-copy p { margin: 0 0 24px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.qr-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #f8faf9; color: var(--ink-soft); font-size: 11px; }.qr-stage > svg { width: 74px; height: 74px; color: #abb6b2; }.qr-stage img { width: min(300px, 78%); aspect-ratio: 1; background: white; }
.balance { text-align: right; }.balance small, .balance strong { display: block; }.balance small { color: var(--ink-soft); font-size: 10px; }.balance strong { margin-top: 5px; font: 700 20px monospace; }
.package-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 34px; }
.package { position: relative; padding: 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }.package.featured { border-top: 3px solid var(--teal); padding-top: 18px; }
.package-head { display: flex; align-items: center; min-height: 20px; }.package-head > span { font-size: 12px; font-weight: 700; }.package-head > small { margin-left: auto; color: var(--teal); font-size: 10px; }
.package-price { display: flex; align-items: baseline; justify-content: center; gap: 5px; margin-top: 24px; color: var(--ink); }.package-price > span { font: 700 17px ui-monospace, monospace; }.package-price > strong { font: 800 38px/1 ui-monospace, monospace; }
.package-tokens { margin: 12px 0 22px; text-align: center; color: var(--ink-soft); font-size: 11px; }.package-tokens strong { color: var(--ink); font-weight: 700; }
.package .button { width: 100%; }
.section-head { display: flex; align-items: center; margin-bottom: 10px; }.section-head h2 { margin: 0; font-size: 14px; }.section-head button { margin-left: auto; }
.order-list { border: 1px solid var(--line); background: var(--surface); }.order-row { min-height: 66px; padding: 11px 14px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }.order-row:last-child { border: 0; }.order-row > div { margin-right: auto; }.order-row strong, .order-row small { display: block; }.order-row strong { font: 650 11px monospace; }.order-row small { margin-top: 4px; color: var(--ink-soft); font-size: 10px; }.empty { margin: 0; padding: 30px; text-align: center; color: var(--ink-soft); font-size: 11px; }
.toast { position: fixed; z-index: 100; right: 20px; bottom: 20px; width: min(350px, calc(100vw - 40px)); padding: 13px 15px; color: white; background: var(--ink); border-left: 4px solid #49b5a8; box-shadow: var(--shadow); font-size: 12px; }.toast.bad { border-color: var(--coral); }.toast.wait { border-color: var(--yellow); }
@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; }.auth-signal { min-height: 120px; padding: 24px; }.auth-panel { padding: 34px 0 48px; }.auth-panel h1 { font-size: 27px; }
  .topbar { height: 64px; padding: 0 12px; gap: 8px; }.brand > span:last-child, .account strong { display: none; }.brand-mark { width: 27px; height: 27px; }
  #main-nav { flex: 1; justify-content: center; }#main-nav button { min-width: 66px; padding: 0 9px; flex-direction: column; gap: 2px; font-size: 9px; }.account { margin-left: 0; }.account > span { display: none; }
  .page-content { width: calc(100% - 28px); padding: 28px 0 50px; }.page-head h1 { font-size: 23px; }
  .lifecycle { padding: 14px 8px; }.life-step { width: 54px; }.metric-band { grid-template-columns: 1fr; }.metric-band > div { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }.metric-band > div:last-child { border-bottom: 0; }
  .workspace-strip { align-items: stretch; flex-direction: column; }.workspace-actions { margin-left: 0; }.workspace-actions .button { flex: 1; }
  .bind-layout { grid-template-columns: 1fr; }.bind-copy { padding: 27px; border-right: 0; border-bottom: 1px solid var(--line); }.qr-stage { min-height: 330px; }
  .package-grid { grid-template-columns: 1fr; }.package-price { margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Billing uses a neutral ledger surface with blue reserved for the primary plan. */
.topbar { padding-inline: max(28px, calc((100% - 1160px) / 2)); gap: 54px; }
.brand strong { font-size: 18px; font-weight: 750; }
.brand small { margin-top: 3px; font: 10px/1.4 system-ui, sans-serif; }
#main-nav button { font-size: 13px; min-width: 96px; }
.page-head > div:first-child { margin-left: 0; }
.page-content { width: min(1104px, calc(100% - 64px)); }
.billing-page { --accent: #315de6; --accent-soft: #eef3ff; font-size: 14px; }
.billing-page svg { flex-shrink: 0; width: 18px; height: 18px; }
.billing-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 28px; }
.billing-heading .eyebrow { color: #858b98; font: 600 11px/1.5 ui-monospace, monospace; margin-bottom: 10px; }
.billing-heading h1 { font-size: 30px; line-height: 1.4; font-weight: 650; margin: 0; }
.billing-heading p:last-child { margin: 8px 0 0; color: var(--ink-soft); font-size: 13px; }
.billing-label { display: flex; gap: 8px; align-items: center; color: var(--ink-soft); font-size: 12px; }
.balance-band { display: grid; grid-template-columns: 1.2fr 1fr 1fr; align-items: center; padding: 29px 32px; background: white; border-block: 1px solid var(--line); }
.metric-label { display: flex; align-items: center; gap: 8px; color: #606774; font-size: 12px; }
.balance-main .metric-label svg { color: var(--accent); }
.balance-value { display: flex; align-items: baseline; gap: 10px; margin: 12px 0 8px; }
.balance-value strong { font: 600 36px/1.2 "Avenir Next", "PingFang SC", sans-serif; font-variant-numeric: tabular-nums; }
.balance-value > span { font-size: 13px; color: var(--ink-soft); }
.balance-main > small { color: #8a909b; font-size: 11px; }
.balance-detail { padding-left: 32px; border-left: 1px solid var(--line); }
.balance-detail > strong { display: block; margin: 12px 0; font: 600 23px/1.3 "Avenir Next", "PingFang SC", sans-serif; }
.balance-detail strong small { font: 400 12px system-ui, sans-serif; color: var(--ink-soft); }
.usage-caption { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 11px; }
.usage-caption svg { width: 14px; height: 14px; color: #278577; }
.balance-brand { justify-self: end; display: flex; align-items: center; gap: 12px; color: #9099ad; }
.balance-brand > svg { width: 40px; height: 40px; stroke-width: 1.2; }
.balance-brand > span { font: 600 23px/1.4 "Avenir Next", sans-serif; }
.balance-brand small { display: block; font: 400 11px/1.5 system-ui, sans-serif; color: #9399a5; }
.recharge-section { margin-top: 34px; }
.billing-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.billing-section-head h2 { font-size: 16px; font-weight: 650; margin: 0; }
.billing-section-head span { color: #828895; font-size: 11px; }
.billing-section-head > div { display: flex; align-items: baseline; gap: 12px; }
.billing-page .package-grid { gap: 20px; margin-bottom: 36px; }
.billing-page .package { padding: 24px; border-radius: 8px; border: 1px solid #e0e4eb; background: #fff; transition: border-color .18s, box-shadow .18s; min-width: 0; }
.billing-page .package:hover { border-color: #b0bedb; box-shadow: 0 8px 24px #23314e08; }
.billing-page .package.featured { border: 1px solid #8ea6ed; background: #fafbff; box-shadow: 0 4px 18px #315de608; }
.billing-page .package-head { gap: 9px; min-height: 30px; }
.package-symbol { display: grid; place-items: center; color: #646e82; }
.featured .package-symbol { color: var(--accent); }
.package-head h3 { font-size: 14px; font-weight: 600; margin: 0; }
.billing-page .package-head > small { color: var(--accent); padding: 4px 7px; background: #eaf0ff; border-radius: 4px; font-size: 10px; white-space: nowrap; }
.billing-page .package-tokens { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 23px 0 8px; text-align: left; }
.billing-page .package-tokens strong { font: 600 30px/1.3 "Avenir Next", "PingFang SC", sans-serif; }
.billing-page .package-tokens span { font-size: 12px; color: #8a909b; }
.billing-page .package-price { justify-content: start; gap: 3px; margin: 0; }
.billing-page .package-price > span { font: 500 14px system-ui, sans-serif; }
.billing-page .package-price > strong { font: 600 23px/1.4 "Avenir Next", sans-serif; }
.package-price > small { color: #8a909b; font-size: 11px; margin-left: 6px; }
.package-rate { display: flex; gap: 7px; align-items: center; border-top: 1px solid var(--line); margin-top: 23px; padding-top: 17px; color: #727a88; font-size: 11px; }
.package-rate svg { color: #288675; width: 14px; height: 14px; }
.billing-page .package .button { margin-top: 21px; justify-content: space-between; min-height: 42px; padding-inline: 14px; border-radius: 5px; color: #454e61; border-color: #dce1eb; font-size: 12px; font-weight: 600; }
.billing-page .package .button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.billing-page .button:hover { background: #f0f3fa; }
.billing-page .button.primary:hover { background: #244dce; }
button:focus-visible, a:focus-visible { outline: 3px solid #91acf1; outline-offset: 3px; }
.billing-page .orders { border-top: 1px solid var(--line); padding-top: 25px; }
.billing-page .order-list { border: 0; background: transparent; }
.order-columns, .billing-page .order-row { display: grid; grid-template-columns: minmax(240px, 2fr) minmax(120px, 1fr) 100px 76px 36px; gap: 16px; align-items: center; padding: 14px 18px; }
.order-columns { background: #eef0f4; color: #858b97; font-size: 11px; }
.billing-page .order-row { min-height: 80px; background: white; border-bottom: 1px solid var(--line); }
.billing-page .order-row > div { margin-right: 0; min-width: 0; }
.order-identity { display: flex; align-items: center; gap: 11px; }
.order-identity > div { min-width: 0; }
.order-symbol { color: #8d97a9; display: flex; }
.billing-page .order-row strong { font: 500 11px/1.6 ui-monospace, monospace; overflow-wrap: anywhere; }
.billing-page .order-row small { color: #9299a6; font-size: 10px; margin-top: 3px; }
.order-tokens { font-size: 12px; }.billing-page .order-tokens small { display: inline; }
.order-amount { font: 500 13px "Avenir Next", sans-serif; font-variant-numeric: tabular-nums; }
.billing-page .status { width: fit-content; border-radius: 4px; font-family: system-ui, sans-serif; font-weight: 500; padding: 6px 8px; }
.billing-page .empty { display: flex; align-items: center; flex-direction: column; gap: 10px; padding: 36px 20px; color: #8a929f; }
.billing-page .empty > svg { width: 28px; height: 28px; }.billing-page .empty > strong { font-size: 13px; font-weight: 500; color: #687080; }
.billing-footer { display: flex; gap: 7px; justify-content: center; align-items: center; margin-top: 24px; font-size: 11px; color: #9097a3; line-height: 1.7; }
.billing-footer svg { width: 14px; height: 14px; }
@media (max-width: 1000px) {
  .balance-brand { display: none; }.balance-band { grid-template-columns: 1fr 1fr; }
  .billing-page .package { padding: 20px; }.billing-page .package-grid { gap: 14px; }
  .order-columns, .billing-page .order-row { grid-template-columns: minmax(190px, 2fr) minmax(100px, 1fr) 76px 60px 32px; gap: 10px; }
}
@media (max-width: 760px) {
  .topbar { padding-inline: 16px; gap: 10px; }#main-nav button { min-width: 65px; font-size: 10px; }
  .page-content { width: calc(100% - 36px); padding-top: 28px; }
  .billing-heading { margin-bottom: 24px; }.billing-heading h1 { font-size: 25px; }.billing-label { display: none; }
  .balance-band { padding: 22px 18px; gap: 12px; }.balance-value { gap: 5px; flex-wrap: wrap; }.balance-value strong { font-size: 28px; }
  .balance-detail { padding-left: 18px; }.balance-detail > strong { font-size: 20px; }.balance-main > small { font-size: 10px; }
  .billing-page .package-grid { grid-template-columns: 1fr; gap: 14px; }
  .billing-page .package { display: grid; grid-template-columns: 1fr auto; column-gap: 14px; padding: 21px; }
  .package-head { grid-column: 1 / -1; }.billing-page .package-tokens { margin: 15px 0 0; }.billing-page .package-tokens strong { font-size: 28px; }
  .billing-page .package-price { justify-content: end; align-self: end; flex-wrap: wrap; }.package-price > small { width: 100%; text-align: right; margin: 0; }
  .package-rate { grid-column: 1 / -1; margin-top: 18px; padding-top: 13px; }.billing-page .package .button { grid-column: 1 / -1; margin-top: 15px; }
  .billing-section-head { gap: 8px; }.billing-section-head h2 { font-size: 15px; }.billing-section-head > span { font-size: 10px; }
  .order-columns { display: none; }.billing-page .order-row { grid-template-columns: 1fr auto auto; gap: 10px; padding: 16px 12px; }
  .order-identity { grid-column: 1 / 3; }.billing-page .order-row .status { grid-column: 3; grid-row: 1; }
  .order-tokens { grid-column: 1; grid-row: 2; padding-left: 29px; }.order-amount { grid-column: 2; grid-row: 2; }.order-action { grid-column: 3; grid-row: 2; }
  .billing-footer { align-items: start; text-align: left; }.billing-footer svg { margin-top: 3px; }
}
