:root {
  color-scheme: dark;
  --bg: #07101b;
  --bg-deep: #040a12;
  --panel: #0d1927;
  --panel-2: #101f30;
  --line: #20364b;
  --line-bright: #31516e;
  --text: #edf5fb;
  --muted: #a7b7c5;
  --cyan: #55d7e8;
  --cyan-soft: rgba(85, 215, 232, .13);
  --lime: #a6e96b;
  --amber: #f5bb5c;
  --red: #ff7c80;
  --shadow: 0 30px 90px rgba(0, 0, 0, .36);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(32, 54, 75, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 54, 75, .12) 1px, transparent 1px),
    radial-gradient(circle at 70% 10%, rgba(17, 112, 139, .16), transparent 34rem),
    var(--bg);
  background-size: 56px 56px, 56px 56px, auto, auto;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 9px 13px;
  color: var(--bg);
  background: var(--cyan);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.ambient-a { top: 8rem; right: -15rem; width: 36rem; height: 36rem; background: rgba(38, 169, 194, .08); }
.ambient-b { bottom: 10rem; left: -18rem; width: 32rem; height: 32rem; background: rgba(104, 167, 72, .055); }

.gateway-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid rgba(49, 81, 110, .5);
  background: rgba(7, 16, 27, .87);
  backdrop-filter: blur(18px);
}
.gateway-nav { min-height: 76px; display: flex; align-items: center; gap: 36px; }
.gateway-brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; text-decoration: none; }
.gateway-brand strong, .gateway-brand small { display: block; }
.gateway-brand strong { font-size: 15px; letter-spacing: .08em; }
.gateway-brand small { color: #96a9b8; font: 700 10px/1.5 Consolas, monospace; letter-spacing: .14em; }
.gateway-mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  grid-template-columns: repeat(3, 4px);
  align-content: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line-bright);
  border-radius: 11px;
  background: #0b1723;
  box-shadow: inset 0 0 20px rgba(85, 215, 232, .05);
}
.gateway-mark i { width: 4px; height: 17px; border-radius: 9px; background: var(--cyan); }
.gateway-mark i:nth-child(2) { height: 25px; margin-top: -4px; background: var(--lime); }
.gateway-links { display: flex; align-items: center; gap: 7px; }
.gateway-links a {
  padding: 9px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.gateway-links a:hover, .gateway-links a:focus-visible, .gateway-links a[aria-current="page"] { color: var(--text); background: rgba(85, 215, 232, .08); }
.gateway-links .nav-cta { border-color: rgba(85, 215, 232, .42); color: #bcebf1; background: rgba(85, 215, 232, .08); }
.runtime-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: #a6b7c4; background: #09131f; font: 700 10px/1 Consolas, monospace; letter-spacing: .06em; }
.runtime-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(245, 187, 92, .1); }
.menu-button { display: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: transparent; }

#gatewayMain { min-height: calc(100vh - 150px); outline: none; }
.gateway-view { animation: enter .32s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.migration-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 13px 16px;
  border: 1px solid rgba(245, 187, 92, .28);
  border-radius: 10px;
  color: #d9c298;
  background: rgba(245, 187, 92, .07);
}
.migration-icon { color: var(--amber); font-size: 24px; }
.migration-banner strong, .migration-banner p { margin: 0; }
.migration-banner strong { font-size: 12px; }
.migration-banner p { color: #aa9d86; font-size: 11px; }

.gateway-hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  align-items: center;
  gap: clamp(42px, 7vw, 82px);
  padding-block: 60px 58px;
}
.terminal-label, .panel-index {
  margin: 0 0 19px;
  color: var(--cyan);
  font: 700 10px/1.4 Consolas, "SFMono-Regular", monospace;
  letter-spacing: .15em;
}
.terminal-label span { display: inline-grid; place-items: center; min-width: 27px; height: 20px; margin-right: 9px; border: 1px solid rgba(85, 215, 232, .35); border-radius: 4px; background: var(--cyan-soft); }
.gateway-copy h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(46px, 5vw, 66px);
  line-height: 1.08;
  letter-spacing: -.055em;
}
.gateway-copy h1 span { color: var(--cyan); }
.gateway-lead { max-width: 620px; margin: 22px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.gateway-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 31px; }
.gateway-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 20px;
  border: 1px solid var(--line-bright);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.gateway-button:hover { transform: translateY(-2px); border-color: var(--cyan); }
.gateway-button.primary { border-color: var(--cyan); color: #061119; background: var(--cyan); box-shadow: 0 14px 36px rgba(85, 215, 232, .14); }
.gateway-button.secondary { color: #c5d4df; background: rgba(13, 25, 39, .7); }
.gateway-text-link { display: inline-block; margin-top: 17px; color: #b9dce3; font-size: 13px; font-weight: 700; text-underline-offset: 4px; }
.gateway-text-link:hover, .gateway-text-link:focus-visible { color: var(--cyan); }
.contract-row { display: flex; flex-wrap: wrap; gap: 21px; margin-top: 24px; color: #a2b3c0; font-size: 12px; }
.contract-row span { display: inline-flex; gap: 7px; }
.contract-row b { color: var(--lime); font: 700 10px/1.6 Consolas, monospace; }

.route-visual {
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(16, 31, 48, .97), rgba(8, 18, 29, .97));
  box-shadow: var(--shadow);
}
.visual-toolbar, .request-line, .trace-footer { display: flex; align-items: center; justify-content: space-between; }
.visual-toolbar { min-height: 45px; padding: 0 17px; border-bottom: 1px solid var(--line); color: #9fb1bf; font: 700 11px/1.2 Consolas, monospace; letter-spacing: .1em; }
.visual-toolbar::before { content: "●  ●  ●"; color: #355169; letter-spacing: .3em; }
.trace-id { margin-left: auto; }
.request-line { gap: 11px; margin: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #07111c; }
.request-method { padding: 4px 6px; border-radius: 4px; color: #07111c; background: var(--lime); font: 800 9px/1 Consolas, monospace; }
.request-line strong { margin-right: auto; color: #d8e5ed; font-size: 14px; }
.request-line code { margin-right: auto; color: #d1dee7; font-size: 12px; }
.request-state { color: var(--amber); font: 700 11px/1 Consolas, monospace; }
.trace-list { list-style: none; padding: 0 18px; margin: 0; }
.trace-list li { position: relative; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 13px; min-height: 67px; }
.trace-list li:not(:last-child)::after { content: ""; position: absolute; top: 48px; bottom: -18px; left: 15px; width: 1px; background: var(--line-bright); }
.trace-node { width: 31px; height: 31px; display: grid; place-items: center; z-index: 1; border: 1px solid var(--line-bright); border-radius: 50%; color: #7f96a8; background: var(--panel); font: 700 9px/1 Consolas, monospace; }
.passed .trace-node { border-color: rgba(166, 233, 107, .55); color: var(--lime); }
.waiting .trace-node { border-color: rgba(245, 187, 92, .55); color: var(--amber); }
.trace-list strong, .trace-list small { display: block; }
.trace-list strong { font-size: 14px; }
.trace-list small { color: #98abba; font: 400 12px/1.5 Consolas, monospace; }
.trace-list b { color: var(--lime); font: 700 11px/1 Consolas, monospace; }
.trace-list .waiting b { color: var(--amber); }
.trace-footer { margin-top: 18px; padding: 15px 18px; border-top: 1px solid var(--line); color: #9eb0be; font: 12px/1.5 Consolas, monospace; }
.trace-footer strong { color: #c4d2dc; font-weight: 600; }

.plan-section { padding-block: 72px; border-top: 1px solid rgba(49, 81, 110, .45); }
.capability-section { padding-block: 76px; border-top: 1px solid rgba(49, 81, 110, .45); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 38px; }
.section-heading h2, .workspace-heading h1, .auth-copy h1, .boundary-panel h2 { margin: 0; font-size: clamp(32px, 4vw, 48px); line-height: 1.2; letter-spacing: -.035em; }
.section-heading > p { max-width: 430px; margin: 0; color: var(--muted); font-size: 14px; text-align: right; }
.operation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.operation-grid article {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 25, 39, .65);
  transition: border-color .18s ease, background .18s ease;
}
.operation-grid article:hover { border-color: var(--line-bright); background: var(--panel); }
.operation-grid article > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.operation-grid strong { overflow: hidden; font: 700 14px/1.4 "Segoe UI", "Microsoft YaHei UI", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.operation-grid article span { flex: 0 0 auto; padding: 3px 6px; border-radius: 4px; color: var(--lime); background: rgba(166, 233, 107, .09); font: 700 9px/1 Consolas, monospace; }
.operation-grid code, .operation-grid small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-grid code { margin-top: 17px; color: #b5c6d2; font-size: 12px; }
.operation-grid small { margin-top: 6px; color: #98abba; font: 12px/1.5 "Segoe UI", "Microsoft YaHei UI", sans-serif; }
.section-link { margin: 22px 0 0; text-align: right; }
.section-link a { color: #b9dce3; font-size: 13px; font-weight: 700; text-underline-offset: 4px; }
.section-link a:hover, .section-link a:focus-visible { color: var(--cyan); }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.plan-card { min-width: 0; display: flex; flex-direction: column; min-height: 255px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, rgba(14, 29, 43, .94), rgba(8, 18, 29, .94)); }
.plan-card[data-selected="true"] { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(85, 215, 232, .08); }
.plan-card .plan-tag { align-self: flex-start; padding: 5px 7px; border-radius: 5px; color: var(--amber); background: rgba(245, 187, 92, .09); font: 700 9px/1 Consolas, monospace; letter-spacing: .08em; }
.plan-card h3 { margin: 21px 0 8px; font-size: 20px; }
.plan-card .plan-price { margin: 0; color: var(--text); font: 700 32px/1.2 Consolas, monospace; }
.plan-card .plan-price small { color: var(--muted); font: 500 11px/1.4 inherit; }
.plan-card .plan-credit { margin: 12px 0 22px; color: var(--lime); font: 700 12px/1.5 Consolas, monospace; }
.plan-card .plan-boundary { margin: auto 0 16px; color: var(--muted); font-size: 11px; }
.plan-card a, .plan-card button { width: 100%; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--cyan); border-radius: 8px; color: #07111c; background: var(--cyan); font-size: 11px; font-weight: 750; text-decoration: none; }

.boundary-panel {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 70px;
  margin-bottom: 78px;
  padding: clamp(30px, 5vw, 52px);
  border: 1px solid var(--line-bright);
  border-radius: 15px;
  background: linear-gradient(125deg, #0d1b29, #0a1521);
}
.boundary-copy > p { margin: 3px 0 24px; color: var(--muted); font-size: 15px; }
.boundary-copy ul { padding: 0; margin: 0; list-style: none; }
.boundary-copy li { display: flex; gap: 15px; padding: 11px 0; border-top: 1px solid var(--line); color: #a9bbc8; font-size: 12px; }
.boundary-copy li span { width: 76px; flex: 0 0 auto; color: var(--cyan); font: 700 10px/1.9 Consolas, monospace; }
.boundary-copy li:last-child span { color: var(--amber); }

.workspace-view { padding-block: 72px 100px; }
.workspace-heading { max-width: 820px; margin-bottom: 38px; }
.workspace-heading.split-heading { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 32px; }
.workspace-heading.split-heading > div { max-width: 790px; }
.workspace-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.workspace-actions .gateway-button { min-height: 42px; padding: 0 16px; }
.workspace-heading > p:last-child { max-width: 750px; color: var(--muted); }
.workspace-heading code, .protocol-panel code { color: var(--cyan); font-family: Consolas, monospace; }
.workspace-grid { display: grid; grid-template-columns: 1.08fr .92fr; align-items: start; gap: 16px; }
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 25, 39, .76);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .15);
}
.state-card {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 14px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a1521;
  outline: none;
}
.state-light { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #65798a; box-shadow: 0 0 0 5px rgba(101, 121, 138, .08); }
.state-card strong, .state-card p { display: block; margin: 0; }
.state-card strong { font-size: 12px; }
.state-card p { color: var(--muted); font-size: 11px; }
.state-card[data-state="loading"] .state-light { background: var(--cyan); box-shadow: 0 0 0 5px rgba(85, 215, 232, .1); }
.state-card[data-state="ready"] .state-light { background: var(--lime); box-shadow: 0 0 0 5px rgba(166, 233, 107, .1); }
.state-card[data-state="unknown"] .state-light { background: var(--amber); box-shadow: 0 0 0 5px rgba(245, 187, 92, .1); }
.state-card[data-state="error"] .state-light, .state-card[data-state="forbidden"] .state-light, .state-card[data-state="unauthorized"] .state-light { background: var(--red); box-shadow: 0 0 0 5px rgba(255, 124, 128, .1); }
.form-panel, .protocol-panel, .reconnect-panel { padding: 28px; }
label { display: block; margin-bottom: 9px; color: #9eb1c0; font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
input {
  width: 100%;
  min-height: 48px;
  min-width: 0;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--text);
  background: #07111c;
  font-family: Consolas, monospace;
  outline: none;
}
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(85, 215, 232, .1); }
input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--cyan); }
button {
  min-height: 42px;
  border: 1px solid var(--cyan);
  border-radius: 8px;
  padding: 0 16px;
  color: #07111c;
  background: var(--cyan);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
button:hover:not(:disabled) { filter: brightness(1.07); }
button:disabled { border-color: var(--line); color: #61788a; background: #0b1723; cursor: not-allowed; }
.field-help { margin: 10px 0 0; color: #6f8597; font-size: 10px; }
.protocol-panel h2, .reconnect-panel h2, dialog h2 { margin: 0; font-size: 25px; letter-spacing: -.02em; }
.protocol-panel > p:not(.panel-index):not(.protocol-note), .reconnect-panel > div > p:last-child, dialog p { color: var(--muted); font-size: 12px; }
.protocol-panel ol { padding-left: 20px; color: #b0c0cb; font-size: 12px; }
.protocol-panel li { margin: 8px 0; }
.protocol-note { margin: 21px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--amber); font: 700 10px/1.5 Consolas, monospace; }
.reconnect-panel { display: grid; grid-template-columns: 1fr .9fr; align-items: center; gap: 42px; margin-bottom: 14px; }
.reconnect-panel form button { width: 100%; margin-top: 10px; }
.overview-panel { margin-top: 22px; }
.console-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; color: #6d8497; font: 700 9px/1 Consolas, monospace; letter-spacing: .12em; }
.console-toolbar button { min-height: 32px; border-color: var(--line); color: #9fb1bf; background: transparent; font-size: 10px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.summary-card { min-width: 0; min-height: 178px; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.summary-card > p { margin: 0; color: #70899c; font: 700 9px/1 Consolas, monospace; letter-spacing: .1em; }
.summary-card h2 { margin: 24px 0 auto; overflow-wrap: anywhere; font-size: 22px; line-height: 1.2; }
.summary-card > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 15px; border-top: 1px solid var(--line); color: #7890a2; font-size: 10px; }
.summary-card code { min-width: 0; overflow: hidden; color: #8da3b4; font: 10px/1.4 Consolas, monospace; text-overflow: ellipsis; }
.summary-card .copy-id { min-height: 27px; padding: 0 8px; border-color: var(--line); color: #9fb4c3; background: transparent; font-size: 9px; }
.credit-card h2 { color: var(--lime); font: 700 42px/1 Consolas, monospace; }
.future-panel { margin-top: 14px; padding: 25px; }
.section-heading.compact { align-items: center; margin-bottom: 21px; }
.section-heading.compact h2 { font-size: 26px; }
.panel-index { margin-bottom: 7px; }
.future-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.future-grid article { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #0a1521; }
.future-grid article > span { color: var(--cyan); font: 700 9px/1 Consolas, monospace; }
.future-grid h3 { margin: 14px 0 0; font-size: 14px; }
.future-grid p { margin: 3px 0 14px; color: #72899b; font-size: 10px; }
.future-grid button { width: 100%; min-height: 32px; font-size: 9px; }

.auth-view { padding-block: 76px 110px; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .75fr); align-items: start; gap: clamp(40px, 8vw, 110px); }
.auth-copy { padding-top: 28px; }
.auth-copy > p:last-of-type { max-width: 650px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.auth-promises { display: grid; gap: 11px; padding: 0; margin: 30px 0 0; list-style: none; color: #a9bbc8; font-size: 12px; }
.auth-promises li { padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: rgba(9, 20, 31, .7); }
.auth-promises li::before { content: "✓"; margin-right: 10px; color: var(--lime); }
.auth-panel { padding: 30px; }
.auth-panel form { display: grid; }
.auth-panel form label:not(:first-child) { margin-top: 18px; }
.auth-panel form button { width: 100%; margin-top: 22px; }
.auth-switch { margin: 20px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.auth-switch a { color: var(--cyan); }
.boundary-note { display: flex; align-items: center; gap: 12px; max-width: 620px; margin-top: 28px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 11px; }
.boundary-note strong { color: var(--amber); }
.error-summary { margin-bottom: 16px; padding: 13px 15px; border: 1px solid rgba(255, 124, 128, .42); border-radius: 8px; color: #ffc2c4; background: rgba(255, 124, 128, .07); font-size: 11px; line-height: 1.6; outline: none; }
.empty-state { padding: 25px; border: 1px dashed var(--line-bright); border-radius: 9px; text-align: center; }
.empty-state strong, .empty-state p { display: block; margin: 0; }
.empty-state p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.key-panel { margin-top: 14px; padding: 26px; }
.key-form { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: #091522; }
.key-form fieldset { min-width: 0; display: flex; flex-wrap: wrap; gap: 14px; padding: 0; border: 0; }
.key-form legend { width: 100%; margin-bottom: 10px; color: #879daf; font: 700 9px/1 Consolas, monospace; letter-spacing: .1em; }
.key-form label { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-weight: 500; }
.key-list { display: grid; gap: 9px; }
.key-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 9px; background: #091522; }
.key-row > div { min-width: 0; }
.key-row strong, .key-row code, .key-row small { display: block; }
.key-row strong { font-size: 12px; }
.key-row code { margin-top: 7px; overflow: hidden; color: #8fa6b7; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.key-row small { margin-top: 6px; color: #617b8f; font-size: 9px; }
.key-row[data-state="revoked"] { opacity: .62; }
.key-row button { align-self: center; min-height: 34px; border-color: var(--line-bright); color: #b6c7d2; background: transparent; font-size: 10px; }
.recharge-balance { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.recharge-balance span { color: var(--muted); font-size: 12px; }
.recharge-balance strong { color: var(--lime); font: 700 30px/1 Consolas, monospace; }
.order-panel { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 16px; padding: 24px; }
.order-panel h2 { margin: 0; font-size: 24px; }
.order-panel p:not(.panel-index) { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.order-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.order-state { padding: 7px 9px; border-radius: 5px; color: var(--amber); background: rgba(245, 187, 92, .09); font: 700 9px/1 Consolas, monospace; }
.order-state[data-state="paid"] { color: var(--lime); background: rgba(166, 233, 107, .09); }

.rate-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: stretch;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  background: var(--line);
}
.rate-card > div, .rate-card > a { min-width: 0; padding: 22px; background: var(--panel); }
.rate-card span, .rate-card strong { display: block; }
.rate-card span { color: var(--muted); font: 700 11px/1.4 Consolas, monospace; letter-spacing: .05em; }
.rate-card strong { margin-top: 10px; color: var(--text); font-size: 17px; }
.rate-card > a { display: inline-flex; align-items: center; justify-content: center; color: var(--bg-deep); background: var(--cyan); font-size: 12px; font-weight: 800; text-align: center; }
.integration-section { padding-block: 76px; }
.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.integration-grid article { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.integration-grid b { color: var(--cyan); font: 700 11px/1 Consolas, monospace; }
.integration-grid h3 { margin: 15px 0 7px; font-size: 17px; }
.integration-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.code-window { max-width: 100%; margin: 14px 0 0; padding: 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; color: #c7dde3; background: #06101a; font: 12px/1.8 Consolas, monospace; }
.send-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.send-row button { width: auto !important; min-width: 126px; margin-top: 0 !important; white-space: nowrap; }
.recharge-panel, .recent-panel { margin-top: 14px; padding: 26px; }
.recharge-panel form { display: grid; gap: 12px; }
.amount-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.amount-row > span { color: var(--lime); font: 700 24px/1 Consolas, monospace; }
.amount-row button { white-space: nowrap; }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-amounts button { min-height: 34px; padding: 8px 14px; border-color: var(--line-bright); color: var(--text); background: transparent; font-size: 10px; }
.recharge-preview { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.recharge-preview strong { color: var(--lime); font: 700 18px/1 Consolas, monospace; }
.recharge-preview span { color: var(--amber); }
.order-panel.embedded { margin-top: 20px; border-top: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.order-panel h3 { margin: 0; font-size: 22px; }
.order-list { display: grid; gap: 9px; }
.order-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 9px; background: #091522; }
.order-row strong, .order-row code, .order-row small { display: block; }
.order-row code { margin-top: 7px; color: #8fa6b7; font-size: 10px; }
.order-row small { margin-top: 5px; color: #617b8f; font-size: 9px; overflow-wrap: anywhere; }

dialog {
  width: min(560px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line-bright);
  border-radius: 14px;
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(1, 6, 11, .78); backdrop-filter: blur(6px); }
.dialog-card { padding: 30px; }
.one-time-secret { display: block; margin: 23px 0; padding: 15px; overflow-wrap: anywhere; border: 1px dashed var(--cyan); border-radius: 8px; color: var(--lime); background: #06101a; font-size: 12px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quiet-button { border-color: var(--line); color: #aabac6; background: transparent; }
.toast { position: fixed; z-index: 60; right: 24px; bottom: 24px; max-width: min(390px, calc(100% - 48px)); padding: 12px 16px; border: 1px solid var(--cyan); border-radius: 8px; color: #bceaf0; background: #0b1b28; box-shadow: var(--shadow); font-size: 11px; }
.gateway-footer { border-top: 1px solid var(--line); color: #6f879b; background: var(--bg-deep); }
.gateway-footer > div { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.gateway-footer strong { color: #8ba0b1; font-size: 12px; }
.gateway-footer span { font: 9px/1.5 Consolas, monospace; letter-spacing: .1em; }

:focus-visible { outline: 3px solid rgba(85, 215, 232, .35); outline-offset: 3px; }

@media (max-width: 960px) {
  .gateway-hero { grid-template-columns: 1fr; padding-top: 56px; }
  .route-visual { max-width: 680px; }
  .operation-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace-grid { grid-template-columns: 1fr; }
  .reconnect-panel { grid-template-columns: 1fr; gap: 20px; }
  .auth-layout { grid-template-columns: 1fr; gap: 28px; }
  .auth-copy { padding-top: 0; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 30px, 1180px); }
  .gateway-nav { min-height: 66px; gap: 11px; }
  .menu-button { display: inline-flex; min-height: 35px; color: var(--text); background: transparent; }
  .runtime-pill { display: none; }
  .gateway-links {
    position: absolute;
    top: 66px;
    right: 15px;
    left: 15px;
    display: none;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line-bright);
    border-radius: 10px;
    background: #0b1723;
    box-shadow: var(--shadow);
  }
  .gateway-links[data-open="true"] { display: grid; }
  .gateway-links a { padding: 12px; }
  .gateway-hero { min-height: auto; gap: 32px; padding-block: 42px 54px; }
  .gateway-copy h1 { font-size: clamp(39px, 11.5vw, 54px); }
  .gateway-lead { font-size: 15px; }
  .gateway-actions { align-items: stretch; flex-direction: column; }
  .gateway-button { width: 100%; }
  .contract-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .route-visual { margin-inline: -2px; }
  .trace-id { display: none; }
  .plan-section, .capability-section { padding-block: 58px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .section-heading > p { text-align: left; }
  .operation-grid, .plan-grid { grid-template-columns: 1fr; }
  .rate-card, .integration-grid { grid-template-columns: 1fr; }
  .rate-card, .integration-grid { grid-template-columns: 1fr; }
  .boundary-panel { grid-template-columns: 1fr; gap: 26px; margin-bottom: 60px; }
  .workspace-view { padding-block: 52px 75px; }
  .workspace-heading h1 { font-size: clamp(34px, 10vw, 46px); }
  .workspace-heading.split-heading { align-items: stretch; flex-direction: column; }
  .workspace-actions { align-items: stretch; flex-direction: column; }
  .input-row { grid-template-columns: 1fr; }
  .input-row button { width: 100%; }
  .form-panel, .protocol-panel, .reconnect-panel { padding: 21px; }
  .auth-view { padding-block: 52px 78px; }
  .auth-panel, .key-panel { padding: 21px; }
  .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .key-form, .order-panel { align-items: stretch; flex-direction: column; }
  .send-row, .amount-row { grid-template-columns: minmax(0, 1fr); }
  .send-row button, .amount-row button { width: 100% !important; }
  .amount-row > span { display: none; }
  .send-row, .amount-row { grid-template-columns: 1fr; }
  .send-row button, .amount-row button { width: 100% !important; }
  .amount-row > span { display: none; }
  .key-form fieldset { display: grid; }
  .key-form button, .order-actions button { width: 100%; }
  .key-row { grid-template-columns: minmax(0, 1fr); }
  .order-row { grid-template-columns: minmax(0, 1fr); }
  .key-row button { width: 100%; }
  .order-actions { align-items: stretch; flex-direction: column; }
  .summary-grid, .future-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 150px; }
  .section-heading.compact { align-items: flex-start; }
  .console-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .dialog-actions { align-items: stretch; flex-direction: column; }
  .dialog-actions button { width: 100%; }
  .gateway-footer > div { min-height: 92px; align-items: flex-start; justify-content: center; flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
