:root,
html[data-theme="tech-blue"] {
  color-scheme: dark;
  --bg: #060c16;
  --bg-deep: #030812;
  --surface: rgba(12, 24, 42, .78);
  --surface-solid: #0d192a;
  --surface-raised: rgba(17, 33, 56, .92);
  --surface-soft: rgba(74, 164, 255, .07);
  --surface-hover: rgba(82, 177, 255, .12);
  --border: rgba(147, 197, 253, .13);
  --border-strong: rgba(91, 181, 255, .28);
  --text: #eef7ff;
  --text-soft: #a9b9ca;
  --text-muted: #71849a;
  --accent: #35b9ff;
  --accent-bright: #74d5ff;
  --accent-rgb: 53, 185, 255;
  --accent-2: #5986ff;
  --accent-2-rgb: 89, 134, 255;
  --accent-contrast: #02111d;
  --success: #45e6b1;
  --success-rgb: 69, 230, 177;
  --warning: #f6c663;
  --warning-rgb: 246, 198, 99;
  --danger: #ff7085;
  --danger-rgb: 255, 112, 133;
  --violet: #9a8cff;
  --shadow: 0 30px 80px rgba(0, 5, 15, .4);
  --shadow-soft: 0 14px 42px rgba(0, 6, 17, .24);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 10px;
  --sidebar-width: 264px;
  --topbar-height: 72px;
}

/* Final client typography overrides (kept scoped to the customer workspace). */
html[data-theme="tech-blue"],html[data-theme="obsidian"],html[data-theme="aurora"],html[data-theme="light"]{font-size:15px}
.sidebar-nav .nav-item{font-size:15px!important}
.sidebar-nav .nav-external{text-decoration:none;display:flex;align-items:center}
.sidebar-nav .nav-external:hover{color:var(--accent);background:var(--surface-hover)}
.buysr-config-banner{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-top:22px;padding:26px 30px;border-radius:18px;background:linear-gradient(110deg,#101b3e 0%,#183b86 52%,#285ed0 100%);color:#fff;box-shadow:0 18px 38px rgba(28,65,150,.2);overflow:hidden;position:relative}
.buysr-config-banner::after{content:'✦';position:absolute;right:7%;font-size:92px;line-height:1;color:rgba(255,255,255,.13);transform:rotate(12deg)}
.buysr-config-banner .section-kicker{color:#9fd8ff}.buysr-config-banner h2{margin:7px 0 5px;font-size:24px;letter-spacing:-.02em}.buysr-config-banner p{margin:0;color:#d7e6ff;font-size:14px}.buysr-config-button{display:inline-flex;align-items:center;gap:9px;z-index:1;white-space:nowrap;padding:12px 19px;border:1px solid rgba(255,255,255,.35);border-radius:999px;background:rgba(255,255,255,.12);color:#fff;text-decoration:none;font-weight:700;transition:background .2s ease,transform .2s ease}.buysr-config-button:hover{background:rgba(255,255,255,.22);transform:translateY(-1px)}.buysr-config-button .icon{width:17px;height:17px}
@media(max-width:700px){.buysr-config-banner{display:block;padding:22px}.buysr-config-button{margin-top:16px}.buysr-config-banner::after{right:-2%;bottom:-18px;font-size:72px}}
.page-view h1{font-size:clamp(27px,3vw,38px)!important}
.page-view h2{font-size:clamp(21px,2.2vw,29px)!important}
.page-view p,.page-view label,.page-view td,.page-view th{font-size:14px!important}

/* Client readability polish: stronger type scale and calmer light palette. */
html[data-theme="tech-blue"],html[data-theme="obsidian"],html[data-theme="aurora"],html[data-theme="light"]{font-size:15px}
body{letter-spacing:.005em}
.sidebar-nav .nav-item{font-size:15px;font-weight:650}
.brand-copy strong{letter-spacing:.08em}
.page-view h1,.page-view h2{letter-spacing:-.025em}
.page-view h1{font-size:clamp(27px,3vw,38px)}
.page-view h2{font-size:clamp(21px,2.2vw,29px)}
.page-view p,.page-view label,.page-view td,.page-view th{font-size:14px}
.glass-card,.balance-card,.table-card{box-shadow:0 14px 34px rgba(45,112,160,.10)}
.primary-button{font-weight:750;letter-spacing:.01em}

html[data-theme="obsidian"] {
  --bg: #090a0c;
  --bg-deep: #030405;
  --surface: rgba(21, 23, 25, .82);
  --surface-solid: #17191c;
  --surface-raised: rgba(31, 34, 37, .94);
  --surface-soft: rgba(187, 255, 235, .055);
  --surface-hover: rgba(189, 255, 235, .095);
  --border: rgba(231, 244, 240, .105);
  --border-strong: rgba(139, 241, 210, .25);
  --text: #f4f8f6;
  --text-soft: #b5bfbc;
  --text-muted: #7d8985;
  --accent: #80e9cc;
  --accent-bright: #b4f8e5;
  --accent-rgb: 128, 233, 204;
  --accent-2: #b9c5ca;
  --accent-2-rgb: 185, 197, 202;
  --accent-contrast: #07120f;
  --success: #6ce0ad;
  --success-rgb: 108, 224, 173;
  --violet: #c4b5fd;
  --shadow: 0 30px 90px rgba(0, 0, 0, .56);
  --shadow-soft: 0 14px 44px rgba(0, 0, 0, .35);
}

html[data-theme="aurora"] {
  --bg: #09091a;
  --bg-deep: #05040e;
  --surface: rgba(24, 20, 48, .79);
  --surface-solid: #17152d;
  --surface-raised: rgba(35, 29, 67, .94);
  --surface-soft: rgba(168, 132, 255, .08);
  --surface-hover: rgba(176, 140, 255, .13);
  --border: rgba(196, 178, 255, .14);
  --border-strong: rgba(177, 142, 255, .3);
  --text: #f7f3ff;
  --text-soft: #c2b8da;
  --text-muted: #83799c;
  --accent: #a984ff;
  --accent-bright: #d0baff;
  --accent-rgb: 169, 132, 255;
  --accent-2: #47d9e6;
  --accent-2-rgb: 71, 217, 230;
  --accent-contrast: #100721;
  --success: #52e1c0;
  --success-rgb: 82, 225, 192;
  --violet: #cf9dff;
  --shadow: 0 30px 90px rgba(3, 1, 17, .55);
  --shadow-soft: 0 14px 44px rgba(3, 1, 17, .35);
}

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

/* Delivery policy: a single high-readability light appearance. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f9fc;
  --bg-deep: #eef3f9;
  --surface: rgba(255, 255, 255, .94);
  --surface-solid: #ffffff;
  --surface-raised: #ffffff;
  --surface-soft: rgba(37, 99, 235, .07);
  --surface-hover: rgba(79, 70, 229, .09);
  --border: rgba(15, 23, 42, .13);
  --border-strong: rgba(37, 99, 235, .32);
  --text: #111827;
  --text-soft: #374151;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-bright: #1d4ed8;
  --accent-rgb: 37, 99, 235;
  --accent-2: #7c3aed;
  --accent-2-rgb: 124, 58, 237;
  --accent-contrast: #ffffff;
  --success: #15803d;
  --success-rgb: 21, 128, 61;
  --warning: #b45309;
  --warning-rgb: 180, 83, 9;
  --danger: #dc2626;
  --danger-rgb: 220, 38, 38;
  --violet: #6d28d9;
  --shadow: 0 24px 64px rgba(30, 64, 175, .12);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, .09);
}

.auth-theme-control,
.theme-menu-wrap { display: none !important; }

html[data-theme="light"] .input-shell,
html[data-theme="light"] .search-box,
html[data-theme="light"] .select-shell { background: #ffffff; }

html[data-theme="light"] .sidebar { background: rgba(255, 255, 255, .96); }
html[data-theme="light"] .topbar { background: rgba(247, 249, 252, .92); }
html[data-theme="light"] .modal-head { background: rgba(255, 255, 255, .97); }
html[data-theme="light"] .glass-card {
  background: linear-gradient(145deg, rgba(37, 99, 235, .025), transparent 45%), var(--surface);
}

/* Public landing treatment inspired by the reference service: clear pricing CTA,
   model capability cards and practical use-case chips, while retaining the
   existing light-only accessible portal theme. */
.public-nav{display:flex;align-items:center;gap:22px;margin:26px 0 0 2px;font-size:12px;font-weight:650;color:var(--text-soft)}
.public-nav a{color:inherit;text-decoration:none;transition:color .2s ease}.public-nav a:hover{color:var(--accent)}
.public-nav-cta{padding:9px 16px;border-radius:999px;background:var(--accent);color:#fff!important;box-shadow:0 8px 18px rgba(var(--accent-rgb),.2)}
.public-hero-actions{display:flex;gap:11px;align-items:center;margin:24px 0 26px}.public-hero-actions .primary-button{display:inline-flex;align-items:center;gap:9px;width:auto;margin:0;padding:0 18px}.public-hero-actions .ghost-button{display:inline-flex;align-items:center;gap:8px}
.public-model-showcase{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;max-width:560px;margin:14px 0 24px}.public-model-showcase article{padding:13px 14px;border:1px solid var(--border);border-radius:13px;background:rgba(255,255,255,.72);box-shadow:var(--shadow-soft)}.public-model-showcase strong,.public-model-showcase small{display:block}.public-model-showcase strong{font-size:13px}.public-model-showcase small{margin-top:5px;color:var(--text-muted);font-size:10px}
.public-use-cases{display:grid;gap:10px;max-width:600px;margin-bottom:22px;color:var(--text-soft);font-size:11px}.public-use-cases>div{display:flex;flex-wrap:wrap;gap:7px}.public-use-cases i{font-style:normal;padding:7px 11px;border-radius:999px;background:var(--surface-soft);border:1px solid var(--border);color:var(--text)}
@media(max-width:760px){.public-nav{gap:12px;flex-wrap:wrap}.public-nav a:nth-child(3){display:none}.public-model-showcase{grid-template-columns:1fr 1fr}.public-model-showcase article:last-child{grid-column:span 2}}

/* LOVtoken customer workspace visual layer.  This is intentionally scoped to
   the authenticated app shell; all existing IDs, forms and data attributes
   remain unchanged so the API behaviour is preserved while every work page
   shares the same light, high-contrast presentation. */
html[data-theme="tech-blue"], html[data-theme="obsidian"], html[data-theme="aurora"] {
  color-scheme: light;
  --bg: #f4fbff; --bg-deep: #eaf4ff;
  --surface: rgba(255,255,255,.94); --surface-solid: #fff; --surface-raised: #fff;
  --surface-soft: rgba(42,185,155,.08); --surface-hover: rgba(42,185,155,.12);
  --border: rgba(25,91,124,.14); --border-strong: rgba(37,99,235,.25);
  --text: #071a35; --text-soft: #425a76; --text-muted: #70839a;
  --accent: #168f8c; --accent-bright: #0c7b88; --accent-rgb: 22,143,140;
  --accent-2: #2563eb; --accent-2-rgb: 37,99,235; --accent-contrast:#fff;
  --success:#118a71; --success-rgb:17,138,113; --danger:#d33a55; --danger-rgb:211,58,85;
  --shadow: 0 22px 55px rgba(45,112,160,.13); --shadow-soft: 0 10px 28px rgba(45,112,160,.09);
}
body { background: linear-gradient(120deg,#eff8ff 0%,#f7fbff 46%,#effff8 100%) !important; }
.app-shell { padding-left: 0; }
.sidebar { position: sticky; top: 0; z-index: 120; width: 100%; height: 82px; min-height: 82px; flex-direction: row; align-items: center; padding: 0 clamp(22px,4vw,62px); overflow: visible; background: rgba(255,255,255,.9) !important; border-right: 0; border-bottom: 1px solid rgba(53,125,161,.13); box-shadow: 0 5px 24px rgba(32,105,146,.06); }
.sidebar-head { padding: 0; flex: 0 0 auto; }
.sidebar-head .brand-copy strong, .sidebar-head .brand-copy small { color: #06152d; }
.sidebar-nav { display:flex; align-items:center; gap: 7px; margin-left: clamp(28px,8vw,130px); }
.sidebar-nav > p { display:none; }
.sidebar-nav .nav-item { width:auto; min-height:42px; padding:0 17px; color:#243b58; border-radius:999px; font-size:14px; }
.sidebar-nav .nav-item .icon { display:none; }
.sidebar-nav .nav-item::before { display:none; }
.sidebar-nav .nav-item.is-active { color:#087f75; background:#e2fbf2; border-color:#b8efdc; }
.sidebar-support { display:none; }
.sidebar-account { margin-left:auto; padding:0 0 0 18px; border-top:0; border-left:1px solid var(--border); }
.sidebar-account strong { font-size:12px; color:#0c2544; }
.sidebar-account small { color:#71839a; }
.workspace { width:100%; }
.topbar { position:static; height:58px; padding:0 clamp(22px,4vw,62px); background:transparent !important; border:0; }
.topbar-left { display:none; }
.topbar-actions { margin-left:auto; }
.main-content { width:min(100%, 1600px); padding: 24px clamp(22px,5.5vw,96px) 72px; }
.page-view { background:rgba(255,255,255,.43); border:1px solid rgba(93,175,198,.13); border-radius:18px; padding: clamp(20px,3vw,36px); box-shadow:var(--shadow-soft); }
.page-hero { min-height:112px; margin-bottom:24px; padding:18px 0 25px; border-bottom:1px solid rgba(49,126,151,.12); }
.page-hero h1 { color:#061a36; font-size:clamp(30px,3vw,46px); letter-spacing:-.055em; }
.page-hero p { color:#60758d; font-size:13px; }
.eyebrow { color:#0c9783 !important; }
.metric-grid { gap:16px; }
.metric-card, .panel, .catalog-toolbar, .account-profile-card { background:rgba(255,255,255,.91) !important; border:1px solid rgba(74,149,172,.16); box-shadow:var(--shadow-soft); }
.metric-card { min-height:140px; border-radius:17px; }
.metric-card small, .metric-card span { color:#5f7691; }
.metric-card strong { color:#071a35; font-size:28px; }
.metric-icon { border-radius:50%; background:#e0fbf2; color:#108b80; }
.usage-panel, .overview-grid .panel { border-radius:18px; }
.data-table th { color:#56708b; background:#f5fbff; }
.data-table td { color:#183653; border-bottom-color:rgba(74,149,172,.1); }
.nav-item, button, input, select, textarea { font-family:inherit; }
.primary-button { background:linear-gradient(100deg,#182d55,#205fd5) !important; box-shadow:0 11px 24px rgba(24,73,171,.2); }
.secondary-button { background:#eff8ff; color:#1455a7; border-color:#cde2fa; }
.balance-pill { background:#fff; border-color:#cce7ea; }
.balance-pill strong { color:#0a7c72; }
.modal { background:#fff; color:#102b46; }
@media (max-width:900px) {
  .sidebar { height:auto; min-height:72px; padding:14px 18px; flex-wrap:wrap; gap:10px; }
  .sidebar-nav { order:3; width:100%; margin:4px 0 0; overflow:auto; }
  .sidebar-account { margin-left:auto; }
  .main-content { padding-inline:14px; }
  .page-view { padding:18px 14px; }
  .page-hero { align-items:flex-start; flex-direction:column; }
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-deep);
  font-family: Inter, "SF Pro Display", "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 70% -15%, rgba(var(--accent-rgb), .09), transparent 34%),
    linear-gradient(145deg, var(--bg-deep), var(--bg));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

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

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  color: inherit;
}

button {
  border: 0;
}

button:not(:disabled),
a,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 10px;
  left: 12px;
  padding: 10px 14px;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: 9px;
  transform: translateY(-160%);
  transition: transform .2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: inline-block;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg use[href="#i-grid"],
svg use[href="#i-user"],
svg use[href="#i-wallet"] {
  fill: currentColor;
  stroke: none;
}

.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-orb {
  position: absolute;
  width: min(44vw, 620px);
  aspect-ratio: 1;
  border-radius: 999px;
  filter: blur(100px);
  opacity: .17;
  animation: drift 16s ease-in-out infinite alternate;
}

.ambient-orb-a {
  top: -20%;
  right: 7%;
  background: rgba(var(--accent-rgb), .82);
}

.ambient-orb-b {
  bottom: -30%;
  left: -10%;
  background: rgba(var(--accent-2-rgb), .62);
  animation-delay: -7s;
}

.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: .13;
  background-image:
    linear-gradient(rgba(139, 188, 255, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 188, 255, .12) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 68% 20%, #000, transparent 65%);
}

.ambient-noise {
  position: absolute;
  inset: 0;
  opacity: .025;
  background-image:
    repeating-radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .6) 0 1px, transparent 1px 7px),
    repeating-radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .34) 0 1px, transparent 1px 11px);
  background-size: 83px 79px, 109px 101px;
}

@keyframes drift {
  to { transform: translate3d(4%, 5%, 0) scale(1.08); }
}

.glass-card {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, .018), transparent 45%), var(--surface);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  overflow: hidden;
  color: var(--accent-contrast);
  background: linear-gradient(145deg, var(--accent-bright), var(--accent));
  border-radius: 11px;
  box-shadow: 0 0 30px rgba(var(--accent-rgb), .25);
  isolation: isolate;
}

.brand-mark::before {
  position: absolute;
  inset: -40% 52% -40% -10%;
  content: "";
  background: rgba(255, 255, 255, .44);
  transform: rotate(26deg);
}

.brand-mark span {
  position: relative;
  z-index: 1;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -.06em;
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  overflow: hidden;
  white-space: nowrap;
}

.brand-copy strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  font-weight: 780;
  letter-spacing: .12em;
  text-overflow: ellipsis;
}

.brand-copy small {
  display: block;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 7px;
  font-weight: 650;
  letter-spacing: .25em;
  text-overflow: ellipsis;
}

.brand-large {
  max-width: min(100%, 620px);
}

.brand-large .brand-copy {
  max-width: min(460px, calc(100vw - 180px));
}

.brand-large .brand-mark {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  border-radius: 13px;
}

.brand-large .brand-copy strong { font-size: 17px; }
.brand-large .brand-copy small { font-size: 8px; }

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 17px;
  font-size: 13px;
  font-weight: 680;
  line-height: 1;
  border-radius: 11px;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.primary-button {
  color: var(--accent-contrast);
  background: linear-gradient(125deg, var(--accent-bright), var(--accent));
  box-shadow: 0 10px 28px rgba(var(--accent-rgb), .2), inset 0 1px rgba(255, 255, 255, .35);
}

.secondary-button {
  color: var(--text);
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
}

.ghost-button {
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border);
}

.danger-button {
  color: #fff;
  background: rgba(var(--danger-rgb), .84);
  box-shadow: 0 10px 26px rgba(var(--danger-rgb), .13);
}

.primary-button:not(:disabled):hover,
.secondary-button:not(:disabled):hover,
.ghost-button:not(:disabled):hover,
.danger-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.primary-button:not(:disabled):hover {
  box-shadow: 0 15px 34px rgba(var(--accent-rgb), .28), inset 0 1px rgba(255, 255, 255, .4);
}

.secondary-button:not(:disabled):hover,
.ghost-button:not(:disabled):hover {
  color: var(--accent-bright);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.compact { min-height: 35px; padding: 0 12px; font-size: 12px; }

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: var(--text-soft);
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.icon-button:hover {
  color: var(--accent-bright);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.text-button,
.inline-link {
  padding: 0;
  color: var(--accent-bright);
  font-size: inherit;
  background: transparent;
}

.text-button:hover,
.inline-link:hover { text-decoration: underline; }

.with-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  text-decoration: none !important;
}

.with-arrow .icon { width: 14px; height: 14px; }

.eyebrow,
.section-kicker {
  color: var(--accent-bright);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.eyebrow i {
  width: 19px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.auth-shell {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 100vh;
  grid-template-columns: minmax(400px, 1.12fr) minmax(430px, .88fr);
}

.auth-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: 45px clamp(44px, 6vw, 108px) 38px;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.auth-story::before {
  position: absolute;
  top: 13%;
  right: -25%;
  width: 620px;
  aspect-ratio: 1;
  content: "";
  opacity: .72;
  border: 1px solid rgba(var(--accent-rgb), .1);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(var(--accent-rgb), .025),
    0 0 0 140px rgba(var(--accent-rgb), .018),
    0 0 90px rgba(var(--accent-rgb), .09);
}

.auth-story::after {
  position: absolute;
  right: 14%;
  bottom: 23%;
  width: 260px;
  height: 1px;
  content: "";
  opacity: .45;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 -84px var(--accent), 0 84px var(--accent);
  transform: rotate(-38deg);
}

.auth-story > * { position: relative; z-index: 1; }

.auth-story-content {
  width: min(620px, 100%);
  margin: 70px 0;
}

.auth-story-content h1 {
  margin: 18px 0 24px;
  font-size: clamp(44px, 5.2vw, 76px);
  font-weight: 710;
  line-height: 1.05;
  letter-spacing: -.055em;
}

.auth-story-content h1 em {
  color: transparent;
  font-style: normal;
  background: linear-gradient(100deg, var(--accent-bright), var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
}

.auth-story-content > p {
  max-width: 540px;
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.85;
}

.feature-rail {
  display: grid;
  max-width: 560px;
  margin-top: 46px;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
}

.feature-rail article {
  position: relative;
  display: flex;
  gap: 13px;
  padding: 20px 20px 4px 0;
}

.feature-rail article:not(:last-child)::after {
  position: absolute;
  top: 20px;
  right: 15px;
  bottom: 0;
  width: 1px;
  content: "";
  background: var(--border);
}

.feature-rail article > span {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.feature-rail article div { display: grid; gap: 6px; }
.feature-rail strong { font-size: 13px; }
.feature-rail small { color: var(--text-muted); font-size: 11px; line-height: 1.55; }

.auth-footnote {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: .04em;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(var(--success-rgb), .75);
}

.auth-panel {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 70px clamp(32px, 6vw, 96px);
}

.auth-theme-control {
  position: absolute;
  top: 30px;
  right: 34px;
}

.theme-options {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.theme-option {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  background: transparent;
  border-radius: 50%;
}

.theme-option span {
  width: 12px;
  height: 12px;
  background: #35b9ff;
  border: 2px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  box-shadow: 0 0 0 2px transparent;
}

.theme-option[data-theme-value="obsidian"] span { background: #80e9cc; }
.theme-option[data-theme-value="aurora"] span { background: #a984ff; }
.theme-option.is-active span { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }

.auth-card {
  width: min(100%, 470px);
  padding: 38px;
  border-radius: var(--radius-xl);
}

.mobile-brand { display: none; min-width: 0; }
.mobile-brand > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-card-head { margin-bottom: 28px; }
.auth-card-head .section-kicker { display: block; margin-bottom: 11px; }
.auth-card-head h2 { margin: 0; font-size: 29px; letter-spacing: -.035em; }
.auth-card-head p:last-child { margin: 9px 0 0; color: var(--text-soft); font-size: 13px; }

.auth-tabs {
  position: relative;
  display: grid;
  margin-bottom: 25px;
  padding: 4px;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.auth-tab {
  min-height: 38px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
  background: transparent;
  border-radius: 8px;
  transition: color .18s ease, background-color .18s ease;
}

.auth-tab.is-active {
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .16);
}

.auth-form,
.settings-form,
.modal-body { display: grid; gap: 18px; }

.field { display: grid; gap: 8px; min-width: 0; color: var(--text-soft); font-size: 12px; font-weight: 580; }
.field > small { min-height: 0; color: var(--text-muted); font-size: 10px; font-weight: 450; line-height: 1.45; }
.field-error { color: var(--danger) !important; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field-label-row .text-button { font-size: 11px; }

.input-shell,
.search-box,
.select-shell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  background: rgba(2, 8, 18, .32);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: color .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.input-shell:focus-within,
.search-box:focus-within,
.select-shell:focus-within {
  color: var(--accent);
  background: rgba(var(--accent-rgb), .045);
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .07);
}

.input-shell > .icon { margin-left: 13px; width: 16px; height: 16px; }
.input-shell input,
.search-box input {
  width: 100%;
  min-width: 0;
  height: 45px;
  padding: 0 13px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.input-shell > .icon + input { padding-left: 0; }

.input-shell input[readonly] {
  color: var(--text-muted);
  cursor: not-allowed;
}

.password-toggle {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
}

.password-toggle:hover { color: var(--accent); }
.password-toggle .icon { width: 17px; height: 17px; }

.field-pair {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
}

.check-row input,
.permission-item input {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
}

.auth-submit .icon { width: 17px; height: 17px; }

.form-status {
  min-height: 17px;
  margin: -7px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.form-status.is-error { color: var(--danger); }
.form-status.is-success { color: var(--success); }

.verification-row {
  display: grid;
  align-items: end;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.verification-row .secondary-button { min-height: 45px; white-space: nowrap; }

.challenge-placeholder {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  color: var(--warning);
  font-size: 10px;
  background: rgba(var(--warning-rgb), .055);
  border: 1px solid rgba(var(--warning-rgb), .14);
  border-radius: 10px;
}

.challenge-placeholder.is-complete {
  color: var(--success);
  background: rgba(var(--success-rgb), .055);
  border-color: rgba(var(--success-rgb), .14);
}

.challenge-placeholder .icon { width: 15px; height: 15px; }

.auth-legal {
  position: absolute;
  bottom: 25px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
}

.auth-legal .icon { width: 13px; height: 13px; color: var(--success); }

.app-shell {
  position: relative;
  min-height: 100vh;
  padding-left: var(--sidebar-width);
}

.sidebar {
  position: fixed;
  z-index: 120;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 22px 17px 18px;
  overflow-y: auto;
  background: rgba(5, 12, 23, .76);
  border-right: 1px solid var(--border);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

html[data-theme="obsidian"] .sidebar { background: rgba(7, 8, 9, .84); }
html[data-theme="aurora"] .sidebar { background: rgba(8, 7, 20, .8); }

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 24px;
}

.sidebar-head .brand {
  max-width: 190px;
}

.sidebar-close { display: none; }

.sidebar-nav { display: grid; gap: 5px; }
.sidebar-nav > p {
  margin: 18px 12px 7px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 560;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.nav-item::before {
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: -18px;
  width: 3px;
  content: "";
  background: transparent;
  border-radius: 0 4px 4px 0;
}

.nav-item .icon { width: 18px; height: 18px; color: var(--text-muted); }
.nav-item:hover { color: var(--text); background: var(--surface-soft); }
.nav-item.is-active { color: var(--text); background: var(--surface-hover); border-color: rgba(var(--accent-rgb), .1); }
.nav-item.is-active::before { background: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), .8); }
.nav-item.is-active .icon { color: var(--accent-bright); }

.nav-badge {
  min-width: 23px;
  margin-left: auto;
  padding: 2px 6px;
  color: var(--accent-bright);
  font-size: 9px;
  text-align: center;
  background: rgba(var(--accent-rgb), .09);
  border: 1px solid rgba(var(--accent-rgb), .13);
  border-radius: 999px;
}

.sidebar-support {
  position: relative;
  display: grid;
  margin: auto 3px 18px;
  padding: 17px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), .1), rgba(var(--accent-2-rgb), .035));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.sidebar-support::after {
  position: absolute;
  top: -55px;
  right: -48px;
  width: 110px;
  aspect-ratio: 1;
  content: "";
  background: rgba(var(--accent-rgb), .15);
  border-radius: 50%;
  filter: blur(22px);
}

.support-visual {
  display: grid;
  width: 31px;
  height: 31px;
  margin-bottom: 13px;
  place-items: center;
  color: var(--accent-bright);
  background: rgba(var(--accent-rgb), .12);
  border: 1px solid rgba(var(--accent-rgb), .18);
  border-radius: 9px;
}

.support-visual .icon { width: 16px; height: 16px; }
.sidebar-support strong { font-size: 12px; }
.sidebar-support small { margin: 7px 0 14px; color: var(--text-muted); font-size: 10px; line-height: 1.55; }

.sidebar-account {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 14px 6px 2px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  border-top: 1px solid var(--border);
}

.sidebar-account > span:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.sidebar-account strong,
.sidebar-account small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: 11px; }
.sidebar-account small { color: var(--text-muted); font-size: 9px; }
.sidebar-account .icon-button { width: 32px; height: 32px; flex-basis: 32px; background: transparent; border: 0; }
.sidebar-account .icon-button .icon { width: 15px; height: 15px; }

.avatar {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  place-items: center;
  color: var(--accent-contrast);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent));
  border: 2px solid rgba(255, 255, 255, .12);
  border-radius: 11px;
}

.workspace { min-width: 0; }

.topbar {
  position: sticky;
  z-index: 90;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 3vw, 44px);
  background: rgba(6, 13, 24, .68);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}

html[data-theme="obsidian"] .topbar { background: rgba(8, 9, 10, .75); }
html[data-theme="aurora"] .topbar { background: rgba(9, 8, 23, .72); }

.topbar-left,
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.menu-button { display: none; }
.breadcrumb { display: flex; min-width: 0; align-items: center; gap: 9px; }
.breadcrumb small { max-width: min(28vw, 260px); overflow: hidden; color: var(--text-muted); font-size: 10px; letter-spacing: .12em; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb span { color: var(--border-strong); }
.breadcrumb strong { font-size: 12px; font-weight: 620; }

.balance-pill {
  display: flex;
  min-height: 37px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.balance-pill span { color: var(--text-muted); font-size: 9px; }
.balance-pill strong { color: var(--accent-bright); font-size: 12px; }

.topbar-avatar {
  padding: 0;
  background: transparent;
  border-radius: 11px;
}

.topbar-avatar .avatar { width: 36px; height: 36px; }

.notification-button { position: relative; }
.notification-button i {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  background: var(--danger);
  border: 2px solid var(--surface-solid);
  border-radius: 50%;
}

.theme-menu-wrap { position: relative; }

.theme-menu {
  position: absolute;
  z-index: 150;
  top: calc(100% + 10px);
  right: 0;
  width: 225px;
  padding: 10px;
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.theme-menu > small { display: block; padding: 6px 9px 8px; color: var(--text-muted); font-size: 9px; letter-spacing: .12em; }

.theme-menu > button {
  display: grid;
  width: 100%;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  color: var(--text-soft);
  text-align: left;
  background: transparent;
  grid-template-columns: auto 1fr auto;
  border-radius: 10px;
}

.theme-menu > button:hover,
.theme-menu > button.is-active { color: var(--text); background: var(--surface-hover); }
.theme-menu > button > span { display: grid; gap: 3px; }
.theme-menu > button strong { font-size: 11px; }
.theme-menu > button small { color: var(--text-muted); font-size: 9px; }
.theme-menu .theme-check { width: 14px; height: 14px; color: var(--accent); opacity: 0; }
.theme-menu > button.is-active .theme-check { opacity: 1; }

.theme-preview {
  width: 25px;
  height: 25px;
  background: linear-gradient(135deg, #0a1726 50%, #35b9ff 50%);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
}

.theme-preview.black { background: linear-gradient(135deg, #111315 50%, #80e9cc 50%); }
.theme-preview.purple { background: linear-gradient(135deg, #15112c 50%, #a984ff 50%); }

.main-content {
  width: min(100%, 1580px);
  margin: 0 auto;
  padding: 38px clamp(22px, 3vw, 44px) 72px;
}

.page-view { animation: page-in .26s ease both; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.page-hero {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.page-hero h1 {
  margin: 7px 0 7px;
  font-size: clamp(27px, 2.5vw, 36px);
  font-weight: 680;
  line-height: 1.15;
  letter-spacing: -.04em;
}

.page-hero p { margin: 0; color: var(--text-soft); font-size: 12px; line-height: 1.6; }

.metric-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 126px;
  align-items: center;
  gap: 16px;
  padding: 22px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.metric-card::after {
  position: absolute;
  top: -45px;
  right: -40px;
  width: 100px;
  aspect-ratio: 1;
  content: "";
  opacity: .45;
  background: rgba(var(--accent-rgb), .1);
  border-radius: 50%;
  filter: blur(24px);
}

.metric-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
}

.metric-icon .icon { width: 19px; height: 19px; }
.metric-icon.cyan { color: var(--accent-bright); background: rgba(var(--accent-rgb), .1); border: 1px solid rgba(var(--accent-rgb), .15); }
.metric-icon.violet { color: var(--violet); background: rgba(154, 140, 255, .1); border: 1px solid rgba(154, 140, 255, .15); }
.metric-icon.blue { color: #75a6ff; background: rgba(89, 134, 255, .1); border: 1px solid rgba(89, 134, 255, .15); }
.metric-icon.green { color: var(--success); background: rgba(var(--success-rgb), .09); border: 1px solid rgba(var(--success-rgb), .14); }

.metric-card > div { display: grid; min-width: 0; gap: 5px; }
.metric-card small { color: var(--text-muted); font-size: 10px; }
.metric-card strong { overflow: hidden; font-size: clamp(20px, 2vw, 27px); font-weight: 690; letter-spacing: -.035em; text-overflow: ellipsis; }
.metric-card span:not(.metric-icon) { color: var(--text-muted); font-size: 9px; }

.overview-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, .7fr);
}

.lower-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.panel {
  position: relative;
  min-width: 0;
  padding: 22px;
  border-radius: var(--radius-lg);
}

.panel-head {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-head h2 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.02em;
}

.panel-head h2 small { margin-left: 5px; color: var(--text-muted); font-size: 10px; font-weight: 500; }

.segmented {
  display: flex;
  padding: 3px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.segmented button {
  min-width: 48px;
  height: 29px;
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 9px;
  background: transparent;
  border-radius: 7px;
}

.segmented button.is-active { color: var(--text); background: var(--surface-raised); }

.chart-summary { display: flex; align-items: baseline; gap: 8px; margin: 0 0 -12px; }
.chart-summary strong { font-size: 25px; letter-spacing: -.04em; }
.chart-summary span { color: var(--text-muted); font-size: 10px; }
.chart-summary small { margin-left: auto; color: var(--text-muted); font-size: 9px; }

.line-chart {
  position: relative;
  height: 225px;
  margin-top: 6px;
}

.line-chart > svg { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-grid-lines { position: absolute; z-index: 0; inset: 25px 0 13px; display: flex; flex-direction: column; justify-content: space-between; }
.chart-grid-lines i { width: 100%; height: 1px; background: var(--border); }
.chart-area { fill: url(#chart-fill); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 5px rgba(var(--accent-rgb), .6)); }
.chart-point { fill: var(--surface-solid); stroke: var(--accent-bright); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-labels { display: flex; justify-content: space-between; min-height: 15px; color: var(--text-muted); font-size: 8px; }

.chart-empty {
  position: absolute;
  z-index: 4;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 10px;
}

.chart-empty .icon { width: 23px; height: 23px; opacity: .6; }

.quick-steps { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.quick-steps li { display: grid; min-height: 64px; align-items: center; gap: 11px; padding: 8px; grid-template-columns: auto minmax(0, 1fr) auto; border-radius: 11px; }
.quick-steps li:hover { background: var(--surface-soft); }
.quick-steps li > span { display: grid; width: 27px; height: 27px; place-items: center; color: var(--accent-bright); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; background: rgba(var(--accent-rgb), .08); border: 1px solid rgba(var(--accent-rgb), .13); border-radius: 8px; }
.quick-steps li div { display: grid; gap: 4px; }
.quick-steps strong { font-size: 11px; }
.quick-steps small { color: var(--text-muted); font-size: 9px; line-height: 1.4; }
.quick-steps button { padding: 5px; color: var(--accent-bright); font-size: 9px; background: transparent; }

.secure-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 14px;
  padding: 13px;
  color: var(--success);
  background: rgba(var(--success-rgb), .055);
  border: 1px solid rgba(var(--success-rgb), .1);
  border-radius: 11px;
}

.secure-note .icon { width: 16px; height: 16px; margin-top: 1px; }
.secure-note span { display: grid; gap: 4px; }
.secure-note strong { font-size: 10px; }
.secure-note small { color: var(--text-muted); font-size: 9px; line-height: 1.5; }

.compact-list { display: grid; min-height: 112px; }
.compact-row { display: grid; min-height: 54px; align-items: center; gap: 12px; padding: 8px 4px; grid-template-columns: auto minmax(0, 1fr) auto; border-top: 1px solid var(--border); }
.compact-row:first-child { border-top: 0; }
.compact-row-icon { display: grid; width: 31px; height: 31px; place-items: center; color: var(--accent-bright); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 9px; }
.compact-row-icon .icon { width: 14px; height: 14px; }
.compact-row > div { display: grid; min-width: 0; gap: 4px; }
.compact-row strong,
.compact-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-row strong { font-size: 11px; }
.compact-row small { color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.compact-row > span:last-child { color: var(--text-muted); font-size: 9px; }

.security-banner,
.payment-notice {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 16px;
  padding: 16px 18px;
  color: var(--accent-bright);
  background: rgba(var(--accent-rgb), .07);
  border: 1px solid rgba(var(--accent-rgb), .15);
  border-radius: var(--radius-md);
}

.security-banner > span,
.payment-notice > span { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; background: rgba(var(--accent-rgb), .09); border-radius: 9px; }
.security-banner .icon,
.payment-notice .icon { width: 17px; height: 17px; }
.security-banner > div,
.payment-notice > div { display: grid; gap: 5px; }
.security-banner strong,
.payment-notice strong { color: var(--text); font-size: 11px; }
.security-banner p,
.payment-notice p { margin: 0; color: var(--text-muted); font-size: 10px; line-height: 1.55; }

.payment-notice.is-disabled { color: var(--warning); background: rgba(var(--warning-rgb), .055); border-color: rgba(var(--warning-rgb), .14); }
.payment-notice.is-disabled > span { background: rgba(var(--warning-rgb), .08); }
.payment-notice.is-enabled { color: var(--success); background: rgba(var(--success-rgb), .055); border-color: rgba(var(--success-rgb), .14); }

.table-panel { min-height: 260px; }
.table-tools { margin-bottom: 12px; }
.search-box { width: min(260px, 100%); height: 39px; }
.search-box .icon { width: 15px; height: 15px; margin-left: 12px; }
.search-box input { height: 37px; padding-left: 0; font-size: 10px; }

.table-scroll { width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.data-table { width: 100%; border-spacing: 0; border-collapse: collapse; font-size: 10px; }
.data-table th { height: 43px; padding: 0 11px; color: var(--text-muted); font-size: 8px; font-weight: 650; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table td { height: 63px; padding: 9px 11px; color: var(--text-soft); white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--surface-soft); }
.table-primary { display: grid; gap: 4px; }
.table-primary strong { color: var(--text); font-size: 10px; }
.table-primary small { color: var(--text-muted); font-size: 8px; }
.key-prefix { padding: 5px 7px; color: var(--accent-bright); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 6px; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.table-action { min-height: 29px; padding: 0 8px; color: var(--text-muted); font-size: 8px; background: transparent; border: 1px solid transparent; border-radius: 7px; }
.table-action:hover { color: var(--accent-bright); background: var(--surface-hover); border-color: var(--border); }
.table-action.danger:hover { color: var(--danger); background: rgba(var(--danger-rgb), .07); border-color: rgba(var(--danger-rgb), .13); }

.status-badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  color: var(--text-muted);
  font-size: 8px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.status-badge::before { width: 5px; height: 5px; content: ""; background: currentColor; border-radius: 50%; box-shadow: 0 0 7px currentColor; }
.status-badge.healthy,
.status-badge.paid,
.status-badge.active { color: var(--success); background: rgba(var(--success-rgb), .055); border-color: rgba(var(--success-rgb), .13); }
.status-badge.pending { color: var(--warning); background: rgba(var(--warning-rgb), .055); border-color: rgba(var(--warning-rgb), .13); }
.status-badge.failed,
.status-badge.disabled,
.status-badge.expired { color: var(--danger); background: rgba(var(--danger-rgb), .055); border-color: rgba(var(--danger-rgb), .13); }

.chip-list { display: flex; max-width: 220px; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; max-width: 130px; overflow: hidden; padding: 3px 6px; color: var(--text-soft); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 6px; }

.empty-state {
  display: grid;
  min-height: 220px;
  place-content: center;
  justify-items: center;
  padding: 28px;
  text-align: center;
}

.empty-state > span { display: grid; width: 48px; height: 48px; margin-bottom: 14px; place-items: center; color: var(--accent); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 15px; }
.empty-state > span .icon { width: 21px; height: 21px; }
.empty-state h3 { margin: 0; font-size: 13px; }
.empty-state p { max-width: 320px; margin: 8px 0 17px; color: var(--text-muted); font-size: 10px; line-height: 1.55; }
.page-empty { min-height: 330px; }

.data-loading {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 10px;
}

.data-loading > span {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.data-loading p { margin: 0; }
.panel-loading { min-height: 220px; }
.page-loading { min-height: 330px; }
.inline-loading { min-height: 60px; }

@keyframes spin { to { transform: rotate(360deg); } }

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
  padding: 13px;
  border-radius: var(--radius-md);
}

.filter-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.filter-chips button { min-height: 31px; padding: 0 12px; color: var(--text-muted); font-size: 9px; background: transparent; border: 1px solid transparent; border-radius: 8px; }
.filter-chips button:hover { color: var(--text); background: var(--surface-soft); }
.filter-chips button.is-active { color: var(--accent-bright); background: rgba(var(--accent-rgb), .08); border-color: rgba(var(--accent-rgb), .16); }

.model-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.model-card { position: relative; display: grid; min-height: 244px; gap: 17px; padding: 21px; overflow: hidden; background: linear-gradient(145deg, rgba(255, 255, 255, .02), transparent 45%), var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); transition: transform .2s ease, border-color .2s ease; }
.model-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.model-card::after { position: absolute; top: -55px; right: -45px; width: 120px; aspect-ratio: 1; content: ""; background: rgba(var(--accent-rgb), .07); border-radius: 50%; filter: blur(26px); }
.model-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.model-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.model-logo { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; color: var(--accent-bright); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 750; background: linear-gradient(145deg, rgba(var(--accent-rgb), .16), rgba(var(--accent-2-rgb), .06)); border: 1px solid rgba(var(--accent-rgb), .18); border-radius: 11px; }
.model-identity > div { display: grid; min-width: 0; gap: 4px; }
.model-identity strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.model-identity code { overflow: hidden; color: var(--text-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.model-description { min-height: 38px; margin: 0; color: var(--text-soft); font-size: 10px; line-height: 1.65; }
.model-capabilities { display: flex; flex-wrap: wrap; gap: 5px; }
.model-capabilities .chip { color: var(--accent-bright); background: rgba(var(--accent-rgb), .055); border-color: rgba(var(--accent-rgb), .11); }
.model-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--border); }
.model-meta > div { display: grid; gap: 5px; padding-top: 14px; }
.model-meta > div + div { padding-left: 14px; border-left: 1px solid var(--border); }
.model-meta small { color: var(--text-muted); font-size: 8px; }
.model-meta strong { font-size: 10px; font-weight: 590; }
.model-pricing { display: flex; justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.model-pricing span { display: grid; gap: 4px; }
.model-pricing small { color: var(--text-muted); font-size: 8px; }
.model-pricing strong { font-size: 10px; font-weight: 620; }
.catalog-note { display: flex; align-items: center; gap: 7px; margin: 18px 3px 0; color: var(--text-muted); font-size: 9px; line-height: 1.5; }
.catalog-note .icon { width: 14px; height: 14px; color: var(--warning); }

.select-shell { position: relative; height: 40px; padding-left: 12px; }
.select-shell > span { color: var(--text-muted); font-size: 9px; }
.select-shell select { height: 100%; padding: 0 34px 0 3px; color: var(--text); font-size: 10px; background: transparent; border: 0; outline: 0; appearance: none; }
.select-shell option { color: #111827; background: #fff; }
.select-shell > .icon { position: absolute; right: 10px; width: 14px; height: 14px; pointer-events: none; }
.compact-select { min-width: 120px; padding-left: 4px; }
.compact-select select { width: 100%; padding-left: 8px; }

.compact-metrics .metric-card { min-height: 105px; }
.compact-metrics .metric-card > div { width: 100%; }

.usage-detail-panel { margin-bottom: 16px; }
.legend { display: flex; gap: 13px; color: var(--text-muted); font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; background: var(--accent); border-radius: 2px; }
.legend i.output { background: var(--accent-2); }

.bar-chart {
  position: relative;
  display: flex;
  height: 245px;
  align-items: flex-end;
  gap: clamp(4px, .8vw, 10px);
  padding: 15px 4px 25px;
  background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 53px);
}

.bar-group { display: grid; min-width: 5px; height: 100%; flex: 1; align-items: end; gap: 2px; grid-template-columns: repeat(2, 1fr); }
.bar { min-height: 2px; background: linear-gradient(to top, rgba(var(--accent-rgb), .42), var(--accent)); border-radius: 3px 3px 0 0; box-shadow: 0 0 9px rgba(var(--accent-rgb), .12); }
.bar.output { background: linear-gradient(to top, rgba(var(--accent-2-rgb), .38), var(--accent-2)); box-shadow: 0 0 9px rgba(var(--accent-2-rgb), .12); }
.bar-label { align-self: end; grid-column: 1 / -1; overflow: hidden; color: var(--text-muted); font-size: 7px; text-align: center; text-overflow: ellipsis; white-space: nowrap; transform: translateY(17px); }
.bar-height-1 { height: 5%; }
.bar-height-2 { height: 10%; }
.bar-height-3 { height: 15%; }
.bar-height-4 { height: 20%; }
.bar-height-5 { height: 25%; }
.bar-height-6 { height: 30%; }
.bar-height-7 { height: 35%; }
.bar-height-8 { height: 40%; }
.bar-height-9 { height: 45%; }
.bar-height-10 { height: 50%; }
.bar-height-11 { height: 55%; }
.bar-height-12 { height: 60%; }
.bar-height-13 { height: 65%; }
.bar-height-14 { height: 70%; }
.bar-height-15 { height: 75%; }
.bar-height-16 { height: 80%; }
.bar-height-17 { height: 85%; }
.bar-height-18 { height: 90%; }
.bar-height-19 { height: 95%; }
.bar-height-20 { height: 100%; }

.wallet-grid { display: grid; gap: 16px; margin-bottom: 16px; grid-template-columns: minmax(330px, .7fr) minmax(0, 1.3fr); }
.balance-card { position: relative; display: flex; min-height: 218px; flex-direction: column; justify-content: center; padding: 28px; overflow: hidden; color: #f5fbff; background: linear-gradient(135deg, #103d66, #09203c 55%, #111b38); border: 1px solid rgba(126, 211, 255, .22); border-radius: var(--radius-lg); box-shadow: 0 22px 60px rgba(0, 10, 28, .35); }
html[data-theme="obsidian"] .balance-card { background: linear-gradient(135deg, #1c3c34, #111b19 55%, #171a1a); border-color: rgba(128, 233, 204, .2); }
html[data-theme="aurora"] .balance-card { background: linear-gradient(135deg, #43347a, #211a4a 55%, #152344); border-color: rgba(197, 175, 255, .24); }
.balance-card-glow { position: absolute; top: -60%; right: -25%; width: 80%; aspect-ratio: 1; background: rgba(101, 205, 255, .17); border-radius: 50%; filter: blur(25px); }
.balance-card > *:not(.balance-card-glow) { position: relative; z-index: 1; }
.balance-card p { margin: 10px 0 4px; color: rgba(235, 248, 255, .65); font-size: 10px; }
.balance-card > strong { margin: 0 0 7px; font-size: clamp(32px, 4vw, 45px); font-weight: 660; letter-spacing: -.045em; }
.balance-card > small { color: rgba(235, 248, 255, .48); font-size: 9px; }
.balance-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding-top: 15px; color: rgba(235, 248, 255, .62); font-size: 8px; border-top: 1px solid rgba(255, 255, 255, .12); }
.balance-card-foot span { display: flex; align-items: center; gap: 5px; }
.balance-card-foot .icon { width: 12px; height: 12px; }
.billing-summary dl { display: grid; height: 125px; align-items: center; margin: 0; grid-template-columns: repeat(3, 1fr); }
.billing-summary dl > div { display: grid; gap: 8px; padding: 7px 18px; }
.billing-summary dl > div + div { border-left: 1px solid var(--border); }
.billing-summary dt { color: var(--text-muted); font-size: 9px; }
.billing-summary dd { margin: 0; font-size: 19px; font-weight: 630; letter-spacing: -.03em; }

.account-layout { display: grid; align-items: start; gap: 16px; grid-template-columns: 290px minmax(0, 1fr); }
.account-profile-card { position: sticky; top: calc(var(--topbar-height) + 20px); display: grid; justify-items: center; padding: 27px 22px; text-align: center; border-radius: var(--radius-lg); }
.avatar-large { width: 68px; height: 68px; font-size: 23px; border-radius: 19px; box-shadow: 0 12px 34px rgba(var(--accent-rgb), .18); }
.account-profile-card h2 { margin: 15px 0 4px; font-size: 16px; }
.account-profile-card > p { margin: 0; color: var(--text-muted); font-size: 9px; }
.verified-badge { display: inline-flex; align-items: center; gap: 5px; margin: 13px 0 20px; padding: 5px 8px; color: var(--success); font-size: 8px; background: rgba(var(--success-rgb), .06); border: 1px solid rgba(var(--success-rgb), .13); border-radius: 999px; }
.verified-badge .icon { width: 11px; height: 11px; }
.account-profile-card dl { display: grid; width: 100%; margin: 0 0 21px; text-align: left; }
.account-profile-card dl div { display: flex; min-width: 0; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.account-profile-card dt { color: var(--text-muted); font-size: 9px; }
.account-profile-card dd { overflow: hidden; margin: 0; color: var(--text-soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.account-profile-card .secondary-button { width: 100%; }
.account-forms { display: grid; gap: 16px; }
.settings-form { padding: 23px; border-radius: var(--radius-lg); }
.settings-form .panel-head { margin-bottom: 3px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 5px; }
.form-actions .form-status { margin: 0; }
.security-level { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 9px; }
.security-level i { width: 6px; height: 6px; background: var(--success); border-radius: 50%; box-shadow: 0 0 8px var(--success); }
.security-settings { padding: 23px; }
.setting-row { display: grid; min-height: 70px; align-items: center; gap: 12px; padding: 8px 0; grid-template-columns: auto minmax(0, 1fr) auto; border-top: 1px solid var(--border); }
.setting-row:first-of-type { border-top: 0; }
.setting-row > div { display: grid; gap: 4px; }
.setting-row strong { font-size: 11px; }
.setting-row small { color: var(--text-muted); font-size: 9px; line-height: 1.5; }
.setting-icon { display: grid; width: 35px; height: 35px; place-items: center; color: var(--accent-bright); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; }
.setting-icon .icon { width: 16px; height: 16px; }

.switch { position: relative; display: inline-block; width: 37px; height: 21px; }
.switch input { width: 0; height: 0; opacity: 0; }
.switch span { position: absolute; inset: 0; background: rgba(255, 255, 255, .1); border: 1px solid var(--border); border-radius: 999px; transition: background-color .18s ease; }
.switch span::before { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; content: ""; background: var(--text-muted); border-radius: 50%; transition: transform .18s ease, background-color .18s ease; }
.switch input:checked + span { background: rgba(var(--accent-rgb), .17); border-color: rgba(var(--accent-rgb), .28); }
.switch input:checked + span::before { background: var(--accent); transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent-bright); outline-offset: 3px; }

.modal-backdrop {
  position: fixed;
  z-index: 500;
  inset: 0;
  background: rgba(0, 4, 12, .72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fade-in .18s ease both;
}

.modal {
  position: fixed;
  z-index: 510;
  top: 50%;
  left: 50%;
  width: min(610px, calc(100vw - 32px));
  max-height: min(86vh, 820px);
  overflow-y: auto;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
  animation: modal-in .22s ease both;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.compact-modal { width: min(440px, calc(100vw - 32px)); }
.guide-modal { width: min(590px, calc(100vw - 32px)); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 9px)) scale(.985); } }

.modal-head {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  background: rgba(13, 25, 42, .93);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

html[data-theme="obsidian"] .modal-head { background: rgba(23, 25, 28, .94); }
html[data-theme="aurora"] .modal-head { background: rgba(23, 21, 45, .94); }
.modal-head h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.025em; }
.modal-body { padding: 23px 24px 25px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }

.permission-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.permission-field legend { margin-bottom: 9px; color: var(--text-soft); font-size: 12px; font-weight: 580; }
.permission-field > small { display: block; margin-top: 7px; color: var(--text-muted); font-size: 10px; }
.permission-list { display: grid; max-height: 180px; gap: 7px; padding: 9px; overflow-y: auto; background: rgba(2, 8, 18, .26); border: 1px solid var(--border); border-radius: 11px; scrollbar-width: thin; }
.permission-item { display: flex; align-items: center; gap: 10px; padding: 8px 9px; color: var(--text-soft); font-size: 10px; background: rgba(255, 255, 255, .018); border: 1px solid transparent; border-radius: 8px; }
.permission-item:has(input:checked) { color: var(--text); background: var(--surface-hover); border-color: rgba(var(--accent-rgb), .13); }
.permission-item span { display: grid; min-width: 0; gap: 3px; }
.permission-item strong,
.permission-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.permission-item small { color: var(--text-muted); font-size: 8px; }

.field-select { height: 45px; padding-left: 0; }
.field-select select { width: 100%; padding-left: 13px; }
.input-with-unit i { padding-right: 12px; color: var(--text-muted); font-size: 9px; font-style: normal; }
.quota-unlimited { margin-top: 2px; font-weight: 450; }

.modal-note { display: flex; align-items: flex-start; gap: 10px; padding: 13px; color: var(--warning); background: rgba(var(--warning-rgb), .055); border: 1px solid rgba(var(--warning-rgb), .13); border-radius: 11px; }
.modal-note .icon { width: 16px; height: 16px; margin-top: 1px; }
.modal-note p { display: grid; gap: 4px; margin: 0; }
.modal-note strong { color: var(--text); font-size: 10px; }
.modal-note span { color: var(--text-muted); font-size: 9px; line-height: 1.5; }

.success-emblem { display: grid; width: 55px; height: 55px; margin: 2px auto 0; place-items: center; color: var(--success); background: rgba(var(--success-rgb), .08); border: 1px solid rgba(var(--success-rgb), .16); border-radius: 17px; box-shadow: 0 0 30px rgba(var(--success-rgb), .08); }
.success-emblem .icon { width: 24px; height: 24px; }
.secret-warning { margin: 0; color: var(--text-soft); font-size: 11px; line-height: 1.65; text-align: center; }
.secret-warning strong { margin: 0 3px; color: var(--warning); }
.secret-box { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 9px 9px 9px 13px; background: rgba(2, 8, 18, .55); border: 1px solid var(--border-strong); border-radius: 12px; }
.secret-box code { min-width: 0; flex: 1; overflow-wrap: anywhere; color: var(--accent-bright); font-size: 11px; line-height: 1.55; user-select: all; }
.copy-button { display: inline-flex; min-height: 35px; flex: 0 0 auto; align-items: center; gap: 6px; padding: 0 11px; color: var(--accent-contrast); font-size: 9px; font-weight: 680; background: var(--accent); border-radius: 8px; }
.copy-button .icon { width: 14px; height: 14px; }
.confirm-saved { margin: 2px 0; padding: 12px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 10px; }
.confirm-symbol { display: grid; width: 46px; height: 46px; margin: 2px auto; place-items: center; color: var(--warning); background: rgba(var(--warning-rgb), .07); border: 1px solid rgba(var(--warning-rgb), .14); border-radius: 14px; }
.confirm-symbol .icon { width: 21px; height: 21px; }
#confirm-copy { margin: 0; color: var(--text-soft); font-size: 11px; line-height: 1.7; text-align: center; }

.guide-body ol { display: grid; gap: 15px; margin: 0; padding: 0; list-style: none; }
.guide-body li { display: grid; align-items: flex-start; gap: 13px; padding: 13px; grid-template-columns: auto 1fr; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 11px; }
.guide-body li > span { display: grid; width: 32px; height: 32px; place-items: center; color: var(--accent-bright); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; background: rgba(var(--accent-rgb), .08); border-radius: 9px; }
.guide-body li div { display: grid; gap: 5px; }
.guide-body li strong { font-size: 11px; }
.guide-body li p { margin: 0; color: var(--text-muted); font-size: 9px; line-height: 1.6; }
.guide-endpoint { display: flex; min-width: 0; align-items: center; gap: 7px; margin-top: 7px; padding: 7px 7px 7px 10px; background: rgba(2, 8, 18, .35); border: 1px solid var(--border); border-radius: 9px; }
.guide-endpoint code { min-width: 0; flex: 1; overflow-wrap: anywhere; color: var(--accent-bright); font-size: 9px; line-height: 1.5; }
.guide-endpoint .copy-button { min-height: 30px; }
.legal-copy { display: grid; gap: 12px; color: var(--text-soft); font-size: 10px; line-height: 1.75; }
.legal-copy p { margin: 0; }

.toast-region { position: fixed; z-index: 900; right: 22px; bottom: 22px; display: grid; width: min(350px, calc(100vw - 32px)); gap: 9px; pointer-events: none; }
.toast { display: grid; min-height: 62px; align-items: center; gap: 11px; padding: 12px 14px; color: var(--text-soft); background: var(--surface-raised); border: 1px solid var(--border-strong); grid-template-columns: auto minmax(0, 1fr); border-radius: 13px; box-shadow: var(--shadow); animation: toast-in .24s ease both; pointer-events: auto; }
.toast::before { width: 8px; height: 8px; content: ""; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px var(--accent); }
.toast.success::before { background: var(--success); box-shadow: 0 0 10px var(--success); }
.toast.error::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.toast strong { display: block; margin-bottom: 3px; color: var(--text); font-size: 10px; }
.toast span { font-size: 9px; line-height: 1.45; }
.toast.is-leaving { animation: toast-out .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(10px); } }

.connection-banner { position: fixed; z-index: 800; right: 22px; bottom: 22px; display: grid; min-width: 280px; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-raised); border: 1px solid rgba(var(--warning-rgb), .22); grid-template-columns: auto 1fr; border-radius: 13px; box-shadow: var(--shadow); }
.connection-banner > span { width: 8px; height: 8px; background: var(--warning); border-radius: 50%; animation: status-pulse 1.5s ease infinite; }
.connection-banner p { display: grid; gap: 3px; margin: 0; }
.connection-banner strong { font-size: 10px; }
.connection-banner small { color: var(--text-muted); font-size: 8px; }
@keyframes status-pulse { 50% { opacity: .4; box-shadow: 0 0 10px var(--warning); } }

.mobile-scrim { position: fixed; z-index: 110; inset: 0; background: rgba(0, 3, 10, .68); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

@media (max-width: 1180px) {
  .auth-shell { grid-template-columns: minmax(380px, 1fr) minmax(400px, 1fr); }
  .auth-story { padding-inline: 48px; }
  .feature-rail { grid-template-columns: 1fr; max-width: 420px; }
  .feature-rail article { padding-block: 12px; }
  .feature-rail article:not(:last-child)::after { top: auto; right: 0; bottom: 0; left: 0; width: auto; height: 1px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-panel { padding: 75px 24px 68px; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 25px; font-size: 12px; font-weight: 760; letter-spacing: .12em; }
  .mobile-brand .brand-mark { width: 33px; height: 33px; flex-basis: 33px; }
  .app-shell { padding-left: 0; }
  .sidebar { transform: translateX(-102%); box-shadow: var(--shadow); transition: transform .24s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close,
  .menu-button { display: inline-grid; }
  .topbar { padding-inline: 20px; }
  .overview-grid { grid-template-columns: 1fr; }
  .quick-panel { min-height: auto; }
  .wallet-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --topbar-height: 64px; }
  .topbar { padding-inline: 15px; }
  .breadcrumb small,
  .breadcrumb span { display: none; }
  .balance-pill span { display: none; }
  .balance-pill { padding-inline: 10px; }
  .notification-button { display: none; }
  .main-content { padding: 25px 15px 52px; }
  .page-hero { min-height: 0; align-items: flex-start; margin-bottom: 22px; }
  .page-hero p { max-width: 440px; }
  .metric-grid { gap: 10px; }
  .metric-card { min-height: 105px; gap: 11px; padding: 16px; }
  .metric-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .lower-grid { grid-template-columns: 1fr; }
  .panel { padding: 17px; }
  .model-grid { grid-template-columns: 1fr; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .catalog-toolbar .search-box { width: 100%; }
  .filter-chips { justify-content: flex-start; }
  .account-layout { grid-template-columns: 1fr; }
  .account-profile-card { position: static; }
  .table-scroll { margin-inline: -17px; width: calc(100% + 34px); padding-inline: 17px; }
  .data-table { min-width: 780px; }
  .account-forms .field-pair { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .auth-panel { align-items: start; padding: 66px 14px 55px; }
  .auth-theme-control { top: 17px; right: 17px; }
  .auth-card { padding: 25px 20px; border-radius: 19px; }
  .auth-card-head { margin-bottom: 22px; }
  .auth-card-head h2 { font-size: 25px; }
  .field-pair { grid-template-columns: 1fr; }
  .verification-row { grid-template-columns: 1fr; }
  .verification-row .secondary-button { width: 100%; }
  .auth-legal { bottom: 17px; }
  .sidebar { width: min(286px, 86vw); padding-top: calc(20px + env(safe-area-inset-top)); }
  .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-height) + env(safe-area-inset-top)); }
  .main-content { padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
  .page-hero { gap: 16px; }
  .page-hero h1 { font-size: 28px; }
  .page-hero > .primary-button { min-width: 42px; padding-inline: 12px; }
  .page-hero > .primary-button span { display: none; }
  .overview-hero > .primary-button span { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { display: grid; min-height: 119px; align-content: start; gap: 10px; }
  .metric-card strong { font-size: 20px; }
  .metric-card span:not(.metric-icon) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .panel-head { align-items: flex-start; }
  .usage-panel .panel-head { align-items: center; }
  .chart-summary small { display: none; }
  .line-chart { height: 190px; }
  .security-banner,
  .payment-notice { align-items: flex-start; padding: 14px; }
  .table-tools { align-items: stretch; flex-direction: column; }
  .table-tools .search-box { width: 100%; }
  .wallet-grid { grid-template-columns: 1fr; }
  .balance-card { min-height: 205px; padding: 23px; }
  .billing-summary dl { height: auto; grid-template-columns: 1fr; }
  .billing-summary dl > div { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
  .billing-summary dl > div + div { border-top: 1px solid var(--border); border-left: 0; }
  .billing-summary dd { font-size: 16px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .secondary-button { width: 100%; }
  .modal { top: auto; bottom: 0; left: 0; width: 100%; max-width: none; max-height: 92vh; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 22px 22px 0 0; transform: none; animation-name: sheet-in; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } }
  .modal-head { min-height: 72px; padding: 17px 18px; }
  .modal-body { padding: 19px 18px calc(22px + env(safe-area-inset-bottom)); }
  .secret-box { align-items: stretch; flex-direction: column; }
  .copy-button { justify-content: center; }
  .modal-actions > button { min-height: 45px; flex: 1; }
  .toast-region { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .connection-banner { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); left: 16px; min-width: 0; }
}

@media (max-width: 390px) {
  .topbar-actions { gap: 6px; }
  .balance-pill { display: none; }
  .metric-card { padding: 14px; }
  .metric-card strong { font-size: 18px; }
  .panel-head h2 { font-size: 15px; }
  .quick-steps li { padding-inline: 3px; }
  .filter-chips button { padding-inline: 10px; }
}

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

@media (prefers-contrast: more) {
  :root { --border: rgba(210, 232, 255, .28); --border-strong: rgba(159, 218, 255, .58); --text-muted: #9aacc0; }
}

/* Final authenticated layout. Keep this block after all legacy responsive
   rules so the customer console cannot fall back to the old fixed sidebar. */
#app-view.app-shell {
  display: grid;
  width: 100%;
  min-height: 100vh;
  padding-left: 0;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: 82px auto;
  background: linear-gradient(120deg,#edf7ff 0%,#f9fcff 52%,#effff8 100%);
}
#app-view.app-shell::before,
#app-view.app-shell::after { display:none !important; content:none !important; border-left:0 !important; }
html, body, #app-view.app-shell, #app-view .workspace, #app-view .main-content { border-left:0 !important; outline-left:0 !important; }
#app-view .customer-header {
  position: sticky;
  z-index: 140;
  top: 0;
  display: grid;
  height: 82px;
  align-items: center;
  padding: 0 clamp(24px,4vw,64px);
  background: rgba(255,255,255,.94);
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: minmax(220px,1fr) auto minmax(220px,1fr);
  border-bottom: 1px solid rgba(41,112,151,.13);
  box-shadow: 0 5px 25px rgba(35,103,145,.06);
  backdrop-filter: blur(20px);
}
#app-view .customer-brand { justify-self:start; }
#app-view .customer-brand .brand-copy { display:flex; align-items:baseline; gap:9px; }
#app-view .customer-brand .brand-copy strong { color:#07182f; font-size:22px; letter-spacing:-.04em; }
#app-view .customer-brand .brand-copy small { color:#405675; font-size:12px; }
#app-view .customer-public-nav { display:flex; align-items:center; justify-content:center; gap:38px; }
#app-view .customer-public-nav a,
#app-view .customer-console-link { color:#172c49; font-size:14px; font-weight:700; text-decoration:none; }
#app-view .customer-public-nav a:hover { color:#118b81; }
#app-view .customer-console-link { position:relative; justify-self:end; }
#app-view .customer-console-link::after { position:absolute; right:0; bottom:-14px; left:0; height:3px; content:""; background:#2cc8a0; border-radius:3px; }
#app-view > .sidebar {
  position: sticky;
  z-index: 80;
  top: 106px;
  display: flex;
  width: auto;
  height: fit-content;
  max-height: calc(100vh - 130px);
  min-height: 0;
  margin: 28px 0 48px clamp(18px,3vw,52px);
  padding: 18px 14px;
  overflow-y: auto;
  flex-direction: column;
  transform: none;
  background: rgba(255,255,255,.92) !important;
  grid-column: 1;
  grid-row: 2;
  border: 1px solid rgba(51,132,160,.16);
  border-left: 0;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(35,103,145,.08);
  backdrop-filter: blur(16px);
}
#app-view > .sidebar .sidebar-head,
#app-view > .sidebar .sidebar-support,
#app-view > .sidebar .sidebar-account { display:none; }
#app-view > .sidebar .sidebar-nav { display:grid; width:100%; gap:7px; margin:0; }
#app-view > .sidebar .sidebar-nav::before { display:block; padding:3px 10px 8px; color:#60748d; font-size:11px; font-weight:700; content:"功能导航"; }
#app-view > .sidebar .sidebar-nav > p { display:none; }
#app-view > .sidebar .nav-item { width:100%; min-height:46px; padding:0 14px; color:#344c68; font-size:13px; border-radius:11px; }
#app-view > .sidebar .nav-item .icon { display:none; }
#app-view > .sidebar .nav-item::before { display:none; }
#app-view > .sidebar .nav-item.is-active { color:#087b6c; background:#e1fbf1; border-color:#b7efda; }
#app-view > .workspace {
  min-width:0;
  grid-column:2;
  grid-row:2;
}
#app-view .topbar { height:58px; padding:0 clamp(20px,4vw,60px); background:transparent !important; border:0; }
#app-view .topbar-left { display:none; }
#app-view .topbar-actions { margin-left:auto; }
#app-view .main-content { width:min(100%,1450px); margin:0; padding:0 clamp(20px,4vw,60px) 72px 28px; }
#app-view .page-view { min-height:720px; padding:clamp(22px,3vw,38px); background:rgba(255,255,255,.55); border:1px solid rgba(67,148,171,.14); border-radius:18px; box-shadow:0 22px 52px rgba(35,103,145,.1); }
#app-view .page-hero { min-height:114px; margin-bottom:24px; padding:10px 0 25px; border-bottom:1px solid rgba(49,126,151,.12); }
#app-view .key-display { display:flex; min-width:210px; align-items:center; gap:9px; }
#app-view .key-display code { flex:1; }
#app-view .key-reveal { min-height:30px; padding:0 10px; color:#1761ba; font-size:11px; font-weight:700; background:#eff7ff; border:1px solid #cde1f7; border-radius:8px; }
#app-view .key-reveal:hover { background:#e4f1ff; }
@media (max-width: 960px) {
  #app-view.app-shell { display:block; padding-top:72px; }
  #app-view .customer-header { position:fixed; right:0; left:0; height:72px; padding:0 18px; grid-template-columns:1fr auto; }
  #app-view .customer-public-nav { display:none; }
  #app-view .customer-console-link { display:none; }
  #app-view > .sidebar { position:fixed; top:72px; bottom:0; left:0; width:min(286px,86vw); max-height:none; margin:0; padding:20px 17px; transform:translateX(-102%); border-radius:0 16px 16px 0; transition:transform .24s ease; }
  #app-view > .sidebar.is-open { transform:translateX(0); }
  #app-view > .sidebar .sidebar-head { display:flex; }
  #app-view .topbar-left { display:flex; }
  #app-view .menu-button { display:inline-grid; }
  #app-view .main-content { padding:0 14px 50px; }
  #app-view .page-view { min-height:0; padding:20px 15px; }
}
