@import url('/chain-assets/crypto-winter/tokens.css?v=aurora-6');

* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  font-family: var(--cw-sans);
  color: var(--cw-text);
  background: var(--cw-bg, #0b1423);
  accent-color: var(--cw-accent);
  --console-bg: var(--cw-bg, #0b1423);
  --console-bar: rgba(9, 16, 29, .88);
  --console-surface: rgba(11, 20, 35, .88);
  --console-raised: rgba(17, 30, 50, .92);
  --console-hover: rgba(196, 218, 250, .07);
  --console-border: rgba(168, 216, 250, .24);
  --console-border-strong: rgba(176, 222, 252, .36);
  --cw-cold: #c7dcf0;
  --cw-ice-edge: #96bed9;
  --cw-ice-rim: rgba(175, 217, 247, .32);
  --cw-ice-glow: rgba(160, 212, 244, .14);
  --radius: 14px;
}
[hidden] { display: none !important; }
html { scroll-padding-top: 72px; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  line-height: 1.55;
  background-color: var(--console-bg);
  background-image: var(--cw-ambient);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--cw-text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, pre { margin: 0; }
h1 { font-size: 1.5rem; font-weight: 650; line-height: 1.25; letter-spacing: -.02em; }
h2 { font-size: 1.12rem; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; }
h3 { font-size: .98rem; font-weight: 650; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cw-accent); outline-offset: 2px; }
button, input, textarea, select { font: inherit; }
.skip:not(:focus), .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--console-raised);
}

/* Glacier Ice Top App Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 58px;
  background: var(--console-bar);
  border-bottom: 1px solid var(--console-border);
  backdrop-filter: blur(16px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 20px;
}
.topbar-left, .nav, .brand, .row, .section-header {
  display: flex;
  align-items: center;
}
.brand {
  gap: 10px;
  color: var(--cw-text);
  font-weight: 650;
  font-size: .95rem;
  text-decoration: none;
  white-space: nowrap;
}
.brand-symbol {
  display: grid;
  place-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--cw-ink);
  background: var(--cw-gradient);
  font-weight: 750;
  font-size: .92rem;
}
.brand-area {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
  color: var(--cw-muted);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.nav {
  gap: 10px;
  font-size: .85rem;
}
.nav-link {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--cw-muted);
  text-decoration: none;
  font-weight: 550;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--cw-text);
  background: var(--console-hover);
}
.locale-select {
  width: auto;
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 34px;
  margin: 0;
  padding: 4px 26px 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--console-border);
  background-color: var(--console-surface);
  color: var(--cw-text);
  font-size: .82rem;
}

/* Topbar Web3 Wallet Identity Chip */
.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--console-border-strong);
  background: var(--console-surface);
  color: var(--cw-text);
  font-size: .82rem;
  cursor: pointer;
  white-space: nowrap;
}
.wallet-chip:hover {
  border-color: color-mix(in srgb, var(--cw-accent) 45%, var(--console-border));
  background: var(--console-raised);
}
.wallet-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .16);
}
#topbar-wallet-label {
  font-family: var(--cw-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: .8rem;
}
.wallet-chip-sep { color: var(--cw-muted); }
#topbar-wallet-balance {
  color: var(--cw-accent);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .14s ease, border-color .14s ease, opacity .14s ease;
}
.button:disabled { opacity: .5; cursor: default; }
.button-primary {
  color: var(--cw-ink);
  background: var(--cw-gradient);
  border-color: color-mix(in srgb, var(--cw-accent) 60%, transparent);
}
.button-primary:hover:enabled { background: var(--cw-accent-hover); }
.button-secondary {
  color: var(--cw-text);
  background: var(--console-raised);
  border-color: var(--console-border-strong);
}
.button-secondary:hover:enabled {
  border-color: color-mix(in srgb, var(--cw-accent) 40%, var(--console-border));
  background: color-mix(in srgb, var(--cw-accent) 8%, var(--console-raised));
}
.button-ghost {
  color: var(--cw-muted);
  background: transparent;
  border-color: transparent;
}
.button-ghost:hover:enabled {
  color: var(--cw-text);
  background: var(--console-hover);
}
.compact { min-height: 34px; padding: 5px 12px; font-size: .82rem; }
.text-link {
  display: inline-block;
  color: var(--cw-accent);
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Root Layout */
.console-root {
  max-width: 1440px;
  margin-inline: auto;
}
.console-banners {
  display: grid;
  gap: 8px;
  padding: 12px 20px 0;
}
.console-banners:not(:has(:not([hidden]))) {
  padding: 0;
}
.banner {
  padding: 9px 14px;
  border: 1px solid color-mix(in srgb, var(--cw-info) 35%, var(--console-border));
  border-radius: 8px;
  color: var(--cw-info);
  background: color-mix(in srgb, var(--cw-info) 8%, var(--console-surface));
  font-size: .85rem;
}

/* Disconnected Web3 Entry Screen (Centered Google Sign-In Card) */
.connect-stage {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 74px);
  padding: 32px 20px 64px;
}
.connect-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(100%, 460px);
  padding: 34px 32px 28px;
  border-radius: 18px;
  border: 1px solid var(--cw-ice-rim);
  background:
    radial-gradient(ellipse at 92% 0%, rgba(86, 137, 178, .22), transparent 58%),
    linear-gradient(150deg, #182230, #101721 82%);
  box-shadow: inset 0 1px rgba(200, 231, 251, .20), 0 22px 60px rgba(2, 6, 14, .56);
  display: grid;
  gap: 22px;
}
.connect-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url('/chain-assets/crypto-winter/frost-edge.png') right top / min(78%, 16rem) auto no-repeat;
  opacity: .50;
}
.welcome-copy {
  display: grid;
  gap: 10px;
}
.connect-badge {
  width: fit-content;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--cw-accent) 32%, var(--console-border));
  background: color-mix(in srgb, var(--cw-accent) 10%, transparent);
  color: var(--cw-accent);
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .02em;
}
.welcome-copy h1 { font-size: 1.6rem; }
.welcome-copy p { color: var(--cw-muted); font-size: .92rem; }
.auth-panel {
  display: grid;
  gap: 12px;
}
.connect-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--console-border);
}
.connect-features span {
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--console-border);
  color: var(--cw-muted);
  font-size: .76rem;
}

/* Connected Google Console App Shell */
.console-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: calc(100vh - 58px);
  transition: grid-template-columns .24s cubic-bezier(.22, 1, .36, 1);
}
.console-sidebar {
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 12px 20px;
  background: var(--console-bar);
  border-right: 1px solid var(--console-border);
  transition: padding .22s ease, border-color .22s ease;
}
.workspace-nav {
  display: grid;
  gap: 4px;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--cw-muted);
  font-size: .88rem;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease, padding .2s ease;
}
.nav-live-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #5ad0fa;
  box-shadow: 0 0 0 3px rgba(90, 208, 250, .24);
  animation: cw-bg-pulse 1.2s ease-in-out infinite;
}
@keyframes cw-bg-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.82); }
}

/* Gemini-Style Full-Canvas Immersion when inside Code Studio */
@media (min-width: 861px) {
  .console-shell.is-code-view {
    grid-template-columns: 58px minmax(0, 1fr);
  }
  .console-shell.is-code-view .console-sidebar {
    padding: 14px 8px 16px;
    background: linear-gradient(180deg, rgba(10, 18, 32, 0.92) 0%, rgba(7, 13, 24, 0.96) 100%);
    border-right-color: rgba(176, 220, 252, .18);
    z-index: 35;
    overflow: visible;
  }
  .console-shell.is-code-view .nav-item {
    justify-content: center;
    padding: 8px;
    border-radius: 11px;
  }
  .console-shell.is-code-view .nav-item > span:not(.nav-live-dot) {
    display: none;
  }
  .console-shell.is-code-view .nav-live-dot {
    top: 6px;
    right: 6px;
  }
  .console-shell.is-code-view .nav-item[data-tip]:hover::after,
  .console-shell.is-code-view .nav-item[data-tip]:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 11px;
    border-radius: 8px;
    background: #142238;
    border: 1px solid rgba(176, 222, 252, .26);
    color: #eef6ff;
    font-size: 12.2px;
    font-weight: 550;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(2, 6, 14, .45);
    pointer-events: none;
    z-index: 60;
  }
  .console-shell.is-code-view .sidebar-links {
    display: none;
  }
}

/* Floating Background Code-Generation Status Pill (shown on other portal tabs) */
.cw-bg-code-pill {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 28px));
  padding: 9px 12px 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(90, 208, 250, .38);
  background: rgba(14, 25, 42, .94);
  backdrop-filter: blur(14px);
  color: #e6f2ff;
  font-size: 12.8px;
  font-weight: 550;
  box-shadow: 0 12px 32px rgba(2, 6, 14, .52);
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}
.cw-bg-code-pill.is-done {
  border-color: rgba(52, 211, 153, .46);
  background: rgba(12, 34, 30, .94);
}
.cw-bg-code-pill.is-error {
  border-color: rgba(242, 139, 130, .44);
}
.cw-bg-code-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #5ad0fa;
  flex-shrink: 0;
  animation: cw-bg-pulse 1.15s ease-in-out infinite;
}
.cw-bg-code-pill.is-done .cw-bg-code-dot {
  background: #34d399;
  animation: none;
}
.cw-bg-code-pill.is-error .cw-bg-code-dot {
  background: #f28b82;
  animation: none;
}
.cw-bg-code-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cw-bg-code-go {
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(168, 216, 250, .28);
  background: rgba(90, 208, 250, .14);
  color: #9be2ff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.cw-bg-code-go:hover {
  background: rgba(90, 208, 250, .24);
  color: #ffffff;
}
.cw-bg-code-pill.is-done .cw-bg-code-go {
  background: rgba(52, 211, 153, .18);
  border-color: rgba(52, 211, 153, .38);
  color: #6ee7b7;
}
.cw-bg-code-close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--cw-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cw-bg-code-close:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.nav-item:hover {
  color: var(--cw-text);
  background: var(--console-hover);
}
.nav-item[aria-current="page"] {
  color: var(--cw-accent);
  background: color-mix(in srgb, var(--cw-accent) 12%, transparent);
  font-weight: 650;
}
.nav-item svg { flex-shrink: 0; opacity: .88; }
.sidebar-links {
  display: grid;
  gap: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--console-border);
}
.sidebar-links a {
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--cw-muted);
  font-size: .8rem;
  text-decoration: none;
}
.sidebar-links a:hover {
  color: var(--cw-text);
  background: var(--console-hover);
}
.workspace-body {
  min-width: 0;
  padding: 26px clamp(18px, 3vw, 36px) 56px;
}
.console-view {
  max-width: 1040px;
  display: grid;
  gap: 18px;
}

/* Panels & Summary KPI Bar */
.panel, .summary {
  min-width: 0;
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--console-border);
  background: linear-gradient(155deg, #151e2b, #0f1520 82%);
  box-shadow: inset 0 1px rgba(236, 248, 255, .06);
}
.panel.chain-jobs {
  padding: 4px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.summary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-color: var(--cw-ice-rim);
  background:
    radial-gradient(ellipse at 92% 0%, rgba(69, 102, 129, .24), transparent 56%),
    linear-gradient(148deg, #161f2b, #0e141e 72%);
  box-shadow: inset 0 1px rgba(200, 231, 251, .18), 0 16px 42px rgba(2, 6, 14, .44);
}
.summary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url('/chain-assets/crypto-winter/frost-edge.png') right top / min(50%, 18rem) auto no-repeat;
  opacity: .34;
}
/* Shared Glacier Step Strip for Review & API Views */
.portal-step-strip {
  margin-top: 14px;
  padding: 11px 15px;
  border-radius: 12px;
  border: 1px solid rgba(168, 206, 240, .16);
  background: rgba(9, 14, 22, .78);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: .82rem;
  color: var(--cw-cold);
}
.portal-step-strip > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.portal-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 750;
  background: rgba(90, 208, 250, .16);
  color: var(--cw-accent);
  border: 1px solid rgba(90, 208, 250, .42);
}
.portal-step-arrow {
  color: var(--cw-muted);
  opacity: .4;
}
.summary p {
  margin-top: 6px;
  color: var(--cw-muted);
  font-size: .86rem;
  overflow-wrap: anywhere;
}
.summary-main { min-width: 0; flex: 1 1 320px; }
.summary-id-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.summary-id-row p { margin-top: 0; }
.summary-copy-feedback { margin-top: 0; font-size: .78rem; }
.summary-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.summary-quick-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--console-border-strong);
  background: rgba(11, 17, 27, .74);
  color: var(--cw-cold);
  font-size: .78rem;
  font-weight: 550;
  text-decoration: none;
  transition: border-color .14s ease, background-color .14s ease, color .14s ease;
}
.summary-quick-pill:hover {
  border-color: var(--cw-accent);
  background: color-mix(in srgb, var(--cw-accent) 12%, var(--console-bg));
  color: var(--cw-text);
}
.billing-return-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--cw-info) 38%, var(--console-border));
  background: linear-gradient(145deg, rgba(16, 28, 44, .88), rgba(11, 18, 28, .94));
}
.billing-return-bar.is-funded {
  border-color: color-mix(in srgb, var(--cw-success) 55%, var(--console-border));
  background: linear-gradient(145deg, rgba(14, 42, 34, .88), rgba(11, 20, 26, .94));
}
.billing-return-copy { display: grid; gap: 2px; min-width: 0; }
.billing-return-copy strong { font-size: .88rem; color: var(--cw-text); font-weight: 650; }
.billing-return-bar.is-funded .billing-return-copy strong { color: var(--cw-success); }
.billing-return-copy span { font-size: .79rem; color: var(--cw-muted); }
.billing-history-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  border: 1px solid var(--console-border);
  background: var(--console-surface);
  align-self: flex-start;
}
.billing-tab {
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--cw-muted);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
.billing-tab:hover { color: var(--cw-text); }
.billing-tab[aria-selected="true"] {
  background: var(--console-raised);
  border-color: var(--console-border-strong);
  color: var(--cw-text);
}
.summary code {
  color: var(--cw-text);
  font-size: .84rem;
}
.balance {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--cw-accent) 28%, var(--console-border));
  background: var(--console-bg);
  min-width: 170px;
}
.balance span { display: block; color: var(--cw-muted); font-size: .78rem; }
.balance strong {
  display: block;
  margin-top: 2px;
  color: var(--cw-accent);
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.section-header {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.section-header p { margin-top: 4px; color: var(--cw-muted); font-size: .88rem; }
.muted { color: var(--cw-muted); }

/* Wallet Checkout Widget */
.wallet-checkout { min-width: 0; display: grid; gap: 12px; }
.wallet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.wallet-head h2 { font-size: 1.05rem; }
.wallet-network-hint {
  padding: 2px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--console-border);
  color: var(--cw-muted);
  font-size: .75rem;
  font-weight: 600;
}
.wallet-checkout > .muted { font-size: .87rem; }
.wallet-connect-cta { width: 100%; min-height: 44px; font-size: .92rem; }
.wallet-identity { font-size: .84rem; color: var(--cw-muted); }
.wallet-identity > code { color: var(--cw-info); overflow-wrap: anywhere; }
.wallet-checkout code { overflow-wrap: anywhere; }
.wallet-form { max-width: 560px; }
.wallet-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}
.preset-pill {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 11px 8px;
  border-radius: 10px;
  border: 1px solid var(--console-border-strong);
  background: var(--console-bg);
  color: var(--cw-text);
  text-align: center;
  cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease, transform .12s ease;
}
.preset-pill strong { font-size: .92rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.preset-pill .preset-sub { font-size: .72rem; color: var(--cw-muted); }
.preset-pill .preset-bonus {
  font-size: .73rem;
  font-weight: 650;
  color: var(--cw-success);
  font-variant-numeric: tabular-nums;
}
.preset-pill .preset-badge {
  position: absolute;
  top: -8px;
  right: 8px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--cw-accent);
  color: #11161d;
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .01em;
}
.preset-pill.recommended {
  border-color: color-mix(in srgb, var(--cw-accent) 52%, var(--console-border));
  background: color-mix(in srgb, var(--cw-accent) 6%, var(--console-bg));
}
.preset-pill.tier-top {
  border-color: color-mix(in srgb, var(--cw-success) 42%, var(--console-border));
}
.preset-pill:hover,
.preset-pill.active {
  border-color: var(--cw-accent);
  background: color-mix(in srgb, var(--cw-accent) 13%, var(--console-bg));
}
.wallet-bonus-preview {
  margin: -4px 0 10px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--console-border);
  background: var(--console-bg);
  color: var(--cw-muted);
  font-size: .81rem;
  line-height: 1.5;
}
.wallet-bonus-preview[data-state="nudge"] {
  border-color: color-mix(in srgb, var(--cw-accent) 36%, var(--console-border));
  color: var(--cw-text);
}
.wallet-bonus-preview[data-state="good"],
.wallet-bonus-preview[data-state="max"] {
  border-color: color-mix(in srgb, var(--cw-success) 44%, var(--console-border));
  background: color-mix(in srgb, var(--cw-success) 8%, var(--console-bg));
  color: var(--cw-success);
  font-weight: 600;
}
.wallet-bonus-terms {
  margin-top: 10px;
  color: var(--cw-muted);
  font-size: .76rem;
  line-height: 1.55;
}
.wallet-bonus-accent { color: var(--cw-success); }
.balance-breakdown {
  display: block;
  margin-top: 3px;
  color: var(--cw-muted);
  font-size: .76rem;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 520px) {
  .wallet-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.wallet-order {
  padding: 14px;
  border: 1px solid var(--console-border);
  border-radius: 10px;
  background: var(--console-bg);
}
.wallet-order dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
  font-size: .85rem;
}
.wallet-order dt { color: var(--cw-muted); }
.wallet-order dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
#wallet-amount { color: var(--cw-accent); }
#wallet-amount-hint { color: var(--cw-muted); font-size: .82rem; margin: -4px 0 8px; }
#wallet-pay { margin-top: 10px; }
.wallet-recovery { margin-top: 4px; }
.wallet-recovery summary { color: var(--cw-accent); cursor: pointer; font-size: .84rem; }
#wallet-recover-hash, #wallet-recover-order { font-family: var(--cw-mono); }
#wallet-billing-slot > .wallet-checkout:not([hidden]) { margin-top: 14px; }
#wallet-billing-slot .wallet-head { display: none; }
#wallet-access-slot .wallet-head h2 { display: none; }
#wallet-access-slot .wallet-head { justify-content: flex-start; }

/* Auth Switch (Local loopback test mode only) */
.auth-switch {
  display: flex;
  border: 1px solid var(--console-border);
  border-radius: 9px;
  gap: 4px;
  margin-bottom: 12px;
  padding: 3px;
  background: var(--console-bg);
}
.auth-switch .button { flex: 1; min-width: 0; min-height: 36px; color: var(--cw-muted); background: transparent; }
.auth-switch [aria-pressed="true"] {
  background: var(--console-raised);
  color: var(--cw-text);
  border-color: var(--console-border-strong);
}

/* Form Elements */
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
label { display: block; margin-bottom: 5px; color: var(--cw-muted); font-size: .84rem; font-weight: 600; }
input, textarea, select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 11px;
  margin-bottom: 11px;
  border: 1px solid var(--console-border-strong);
  border-radius: 8px;
  color: var(--cw-text);
  background: var(--console-bg);
  font-size: .88rem;
}
input:focus, textarea:focus, select:focus {
  border-color: color-mix(in srgb, var(--cw-accent) 65%, var(--console-border));
  outline: none;
}
input::placeholder { color: var(--cw-muted); }
select {
  padding-inline-end: 26px;
}
textarea { resize: vertical; }
.form-submit { margin-top: 4px; }
.field-hint { color: var(--cw-muted); font-size: .8rem; margin: -5px 0 10px; }
.feedback, .empty { color: var(--cw-muted); margin-top: 8px; font-size: .84rem; }
.feedback:empty, .empty:empty { display: none; }
[data-tone="bad"] { color: var(--cw-danger); }
[data-tone="good"] { color: var(--cw-success); }
.row { gap: 8px; flex-wrap: wrap; }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { padding: 10px 10px; border-bottom: 1px solid var(--console-border); text-align: start; vertical-align: middle; }
th { color: var(--cw-muted); background: rgba(255, 255, 255, .02); font-weight: 600; font-size: .78rem; white-space: nowrap; }
tbody tr:hover { background: var(--console-hover); }
td { overflow-wrap: anywhere; }
.number { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* API Keys, Offers, Rewards, Code */
.key-form { margin-top: 14px; }
.key-form fieldset { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.key-form fieldset > div { flex: 1 1 14rem; max-width: 24rem; }
.key-form input, .example-header select { margin: 0; }
.reveal {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cw-accent) 8%, var(--console-raised));
  border: 1px solid color-mix(in srgb, var(--cw-accent) 32%, var(--console-border));
}
.reveal p { margin-bottom: 6px; color: var(--cw-accent); font-size: .84rem; }
.reveal input, #bearer { font-family: var(--cw-mono); }
.offers { margin-top: 14px; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 10px; }
.offers:empty { display: none; }
.offer { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--console-border); border-radius: 10px; background: var(--console-raised); }
.offer p { color: var(--cw-muted); font-size: .84rem; }
.offer strong { color: var(--cw-accent); font-size: 1.05rem; }
.rewards-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 12px;
  margin-top: 14px;
}
.rewards-summary > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--console-border);
  border-radius: 10px;
  background: var(--console-bg);
}
.rewards-totals { padding: 0; margin-top: 6px; list-style: none; }
.rewards-value, .rewards-totals { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rewards-totals li + li { margin-top: 4px; }
.rewards-value { margin-block: 6px 2px; color: var(--cw-accent); font-size: 1.1rem; font-weight: 650; }
.rewards-history { margin-top: 16px; }
.rewards-history caption { padding-bottom: 6px; color: var(--cw-muted); text-align: start; font-size: .82rem; }
#crypto-table td:last-child { font-family: var(--cw-mono); }
.example-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-block: 16px 8px; }
.example-header > div:first-child { flex: 1 1 240px; max-width: 340px; }
.example-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.api-lang-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--console-border);
  background: var(--console-bg);
}
.api-lang-tab {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--cw-muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease, border-color .14s ease;
}
.api-lang-tab:hover { color: var(--cw-text); }
.api-lang-tab[aria-pressed="true"] {
  background: var(--console-raised);
  border-color: var(--console-border-strong);
  color: var(--cw-accent);
}
#api-rows tr { cursor: pointer; }
#api-rows tr.is-selected {
  background: color-mix(in srgb, var(--cw-accent) 10%, transparent);
}
#api-rows tr.is-selected td:first-child { color: var(--cw-accent); font-weight: 600; }
.api-charge { margin-block: 0 8px; }
code, pre { font-family: var(--cw-mono, ui-monospace, SFMono-Regular, Menlo, monospace); }
pre {
  min-width: 0;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--console-border);
  background: var(--console-bg);
  color: var(--cw-text);
  overflow-x: auto;
  font-size: .82rem;
}
#api-test { margin-top: 18px; border-top: 1px solid var(--console-border); padding-top: 16px; }
#api-test fieldset { margin-top: 12px; max-width: 680px; }
#api-input.code-input { font-family: var(--cw-mono); }
#api-result, #api-download { margin-top: 10px; }

/* Responsive Tablet & Mobile */
@media (max-width: 860px) {
  .console-shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
  }
  .console-sidebar {
    position: sticky;
    top: 58px;
    z-index: 6;
    height: auto;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--console-border);
  }
  .workspace-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .workspace-nav::-webkit-scrollbar { display: none; }
  .nav-item {
    width: auto;
    min-height: 36px;
    padding: 6px 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .sidebar-links { display: none; }
  .workspace-body { padding: 16px 14px 48px; }
  .panel, .summary { padding: 16px; }
}
@media (max-width: 560px) {
  .topbar-inner { padding-inline: 12px; gap: 6px; }
  .brand > span:not(.brand-symbol), .nav-link { display: none; }
  .nav { gap: 6px; min-width: 0; }
  .locale-select { padding: 4px 22px 4px 7px; font-size: .76rem; background-position: right 6px center; }
  .wallet-chip { padding: 4px 8px; gap: 5px; font-size: .76rem; min-width: 0; max-width: 175px; }
  #topbar-wallet-label { max-width: 72px; overflow: hidden; text-overflow: ellipsis; }
  #logout { padding: 4px 8px; font-size: .78rem; flex-shrink: 0; }
  .connect-card { padding: 24px 18px 20px; }
}
