@charset "UTF-8";
@import url("/assets/themes.css");
.balance-currency-toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; }
.balance-currency-toolbar label { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 12px; color: var(--muted); }
.balance-currency-toolbar select { width: auto; min-width: 135px; margin: 0; padding: 7px 10px; }
.balance-currency-toolbar span { font-size: 11px; color: var(--muted); }
/* Creative workbench: one shared layout for every theme. */
.creative-page .studio-header { margin-bottom: 22px; padding-bottom: 18px; }
.creative-page h1 { font-size: 25px; }
.creative-page aside .studio-nav { margin-top: 30px; margin-bottom: 22px; }
.studio-nav button { text-align: left; width: 100%; }
.studio-nav button.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.studio-layout { display: grid; grid-template-columns: minmax(330px,400px) minmax(0,1fr); gap: 24px; align-items: start; }
.studio-compose { min-width: 0; position: sticky; top: 24px; }
.studio-tool { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow-xs); }
.studio-tool form { gap: 16px; }
.studio-tool label { font-size: 12px; font-weight: 500; }
.studio-tool textarea { min-height: 165px; resize: vertical; line-height: 1.8; font-family: var(--font-sans); background: var(--panel-subtle); }
.studio-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.studio-section-head h2 { margin: 0; font-size: 16px; }
.studio-provider { font-size: 10px; letter-spacing: .06em; color: var(--muted); padding: 4px 7px; background: var(--panel-subtle); border-radius: 5px; }
.studio-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--panel-subtle); border-radius: 9px; }
.studio-modes button { border: 1px solid transparent; background: transparent; box-shadow: none; }
.studio-modes button.active { background: var(--panel); border-color: var(--line); color: var(--accent); box-shadow: var(--shadow-xs); }
.studio-upload { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; min-height: 120px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--panel-subtle); color: var(--muted); text-align: center; cursor: pointer; padding: 16px; position: relative; overflow: hidden; }
.studio-upload strong { font-size: 13px; color: var(--text-secondary); }
.studio-upload span { font-size: 11px; }
.studio-upload input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.studio-upload:focus-within,.studio-upload.dragging { border-color: var(--accent); box-shadow: var(--focus-ring); }
.reference-previews { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; }
.reference-previews:empty { display: none; }
.reference-previews figure { flex: 0 0 88px; margin: 0; min-width: 0; }
.reference-previews img { width: 88px; height: 72px; object-fit: cover; border: 1px solid var(--line); border-radius: 7px; display: block; }
.reference-previews figcaption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 88px; font-size: 10px; color: var(--muted); }
.studio-text-button { margin-top: 7px; padding: 4px 0; border: 0; box-shadow: none; background: transparent; color: var(--muted); font-size: 11px; }
.prompt-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: -10px; }
.prompt-heading label { margin: 0; }
.prompt-heading span { color: var(--muted); font-size: 10px; }
.studio-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-suggestions button { border-radius: 20px; font-size: 11px; padding: 5px 10px; background: var(--panel); color: var(--text-secondary); box-shadow: none; }
.studio-settings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.studio-settings label { min-width: 0; }
.studio-hint { font-size: 11px; color: var(--muted); margin: 0; }
.studio-submit { padding-top: 16px; border-top: 1px solid var(--line); }
.studio-submit .studio-price { font-size: 12px; color: var(--text-secondary); margin: 0 0 12px; line-height: 1.6; }
.studio-submit [data-generate] { width: 100%; padding: 12px; font-weight: 600; border-radius: 9px; }
.studio-editor-link { display: block; font-size: 12px; text-align: center; margin-top: 16px; }
.studio-results { min-width: 0; min-height: 650px; background: var(--panel-subtle); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.studio-results-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.studio-results-heading h2 { font-size: 16px; margin: 0 0 5px; }
#studiostats,.studio-private-label { font-size: 11px; color: var(--muted); }
.studio-empty { min-height: 465px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 24px; }
.studio-empty-icon { width: 112px; height: 80px; display: grid; place-items: center; color: var(--accent); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; font-size: 36px; box-shadow: var(--shadow-sm); margin-bottom: 22px; }
.studio-empty h3 { font-size: 17px; margin: 0 0 8px; }
.studio-empty p { font-size: 12px; color: var(--muted); margin: 0; }
.studio-result-card { margin: 0 0 16px; padding: 18px; overflow: hidden; }
.studio-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 15px; }
.studio-card-head strong { font-size: 12px; overflow-wrap: anywhere; }
.studio-status { font-size: 10px; border-radius: 5px; padding: 4px 7px; white-space: nowrap; background: var(--panel-subtle); color: var(--text-secondary); }
.status-succeeded { color: var(--success-text); background: var(--success-soft); }
.status-queued,.status-submitted { color: var(--accent); background: var(--accent-soft); }
.status-needs_review,.status-failed { color: var(--warning-text); background: var(--warning-soft); }
.studio-result-card img,.studio-result-card video { display: block; max-width: 100%; width: 100%; max-height: 480px; object-fit: contain; border-radius: 9px; background: var(--bg); }
.studio-result-card audio { width: 100%; }
.studio-result-actions,.studio-card-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 13px; font-size: 11px; }
.studio-card-meta { color: var(--muted); }
.studio-job-details { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.studio-job-details p { font-size: 11px; overflow-wrap: anywhere; margin: 6px 0; }
.studio-pending { display: grid; place-items: center; min-height: 150px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }
.creative-page #mediaadmin { margin-top: 26px; }
@media(max-width:1150px) { .studio-layout { grid-template-columns: minmax(300px,360px) minmax(0,1fr); gap: 16px; } .studio-tool,.studio-results { padding: 18px; } }
@media(max-width:900px) { .studio-layout { grid-template-columns: minmax(0,1fr); } .studio-compose { position: static; } .studio-results { min-height: 350px; } .studio-empty { min-height: 260px; } .creative-page aside .studio-nav { display: flex; gap: 6px; margin: 10px 0; } .studio-nav button { width: auto; white-space: nowrap; } }
@media(max-width:480px) { .studio-tool,.studio-results { padding: 16px; } .creative-page .studio-header { margin-bottom: 16px; gap: 12px; } .studio-settings { gap: 10px; } .studio-provider { font-size: 9px; } .studio-card-head { align-items: flex-start; } }
.model-pricing { min-width: 310px; max-width: 460px; padding: 4px 0; }
.price-currency { display: block; color: var(--muted); font-size: 11px; font-weight: 600; margin-bottom: 7px; }
.price-tier + .price-tier { margin-top: 12px; }
.price-tier-label { color: var(--text-secondary); font-size: 11px; margin-bottom: 6px; }
.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.price-item { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--radius-sm); }
.price-label { color: var(--text-secondary); font-size: 11px; }
.price-value { color: var(--accent); font-size: 19px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* Shared layout and components for every theme. Do not add theme-specific selectors here. */
:root {
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

/* Typography & Links */
h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.3;
  margin: 2px 0 4px;
}

h2 {
  font-size: 15px;
  line-height: 1.4;
  margin: 0 0 10px;
}

h3 {
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 8px;
}

p {
  color: var(--muted);
  margin: 6px 0 14px;
  line-height: 1.6;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

main a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

main a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Sidebar Navigation (224px Fixed) */
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  z-index: 30;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  flex-shrink: 0;
}

.brand i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-style: normal;
  font-size: 13px;
  margin-right: 2px;
  box-shadow: var(--brand-shadow);
}

.brand small {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--panel-subtle);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: auto;
}

.environment {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--panel-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin: 14px 4px 12px;
  flex-shrink: 0;
}

.environment span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: var(--status-ring);
  flex-shrink: 0;
}

aside > p {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 8px;
  line-height: 1.45;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 4px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

nav::-webkit-scrollbar {
  width: 4px;
}

nav::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}

/* Grouped Navigation Pseudo-labels */
nav button[data-tab="overview"] {
  margin-top: 2px;
}

nav button[data-tab="wallet"],
nav button[data-tab="wallet_admin"],
nav button[data-tab="security"],
nav a.admin-link[href="/create"] {
  margin-top: 12px;
  padding-top: 9px;
  position: relative;
}

nav button[data-tab="wallet"]::before,
nav button[data-tab="wallet_admin"]::before,
nav button[data-tab="security"]::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 8px;
  right: 8px;
  height: 1px;
  background: var(--line);
  pointer-events: none;
}

nav button,
nav .admin-link {
  appearance: none;
  display: flex;
  align-items: center;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 10px;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
  flex-shrink: 0;
  line-height: 1.4;
}

nav button:hover,
nav .admin-link:hover {
  background: var(--panel-subtle);
  color: var(--text);
  border-color: transparent;
}

nav button.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--active-border);
  font-weight: 600;
}

.aside-bottom {
  margin-top: auto;
  padding: 12px 8px 2px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  flex-shrink: 0;
}

.aside-bottom small {
  display: block;
  font-size: 10px;
  color: var(--subtle-text);
  margin-top: 2px;
}

/* Main Workspace Container */
main {
  margin-left: 224px;
  max-width: 1440px;
  min-height: 100vh;
  padding: 22px 32px 28px;
  display: flex;
  flex-direction: column;
}

/* Compact SaaS Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

header p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

.userbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.userbar span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.userbar span:empty {
  display: none;
}

/* Buttons & Interactive Controls */
button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

button:hover:not(:disabled) {
  background: var(--panel-subtle);
  border-color: var(--subtle-text);
}

button:active:not(:disabled) {
  transform: translateY(0.5px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

button.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 500;
  box-shadow: var(--button-shadow);
}

button.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

button.danger {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

button.danger:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger-hover-border);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Notices & Status Banners */
.notice {
  padding: 10px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--notice-text);
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.notice.error {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  border-left-color: var(--danger);
  color: var(--danger-text);
}

#message,
#mediamessage {
  position: sticky;
  top: 12px;
  z-index: 25;
  padding: 11px 15px;
  background: var(--panel);
  border: 1px solid var(--success-border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-sm);
  color: var(--success-text);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

#message.error,
#mediamessage.error {
  background: var(--panel);
  border-color: var(--danger-border);
  border-left-color: var(--danger);
  color: var(--danger);
}

/* Cards, Panels & Grid Layouts */
#workspace {
  flex: 1 0 auto;
}

.panel {
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

article,
.auth-card {
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.two article {
  margin-bottom: 16px;
}

/* Let nested forms and long model names shrink within the shared grid. */
.two > *, main, article, label { min-width: 0; }
label { overflow-wrap: anywhere; }
input, select, textarea { min-width: 0; max-width: 100%; }

.narrow {
  max-width: 560px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--panel-subtle);
}

.section-head h2 {
  margin: 0;
}

.section-head .check {
  margin: 0;
  font-size: 12px;
}

/* Dashboard Metrics (New API Style Stat Cards) */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
}

.metric:nth-child(2) {
  border-top-color: var(--metric-secondary);
}

.metric:nth-child(3) {
  border-top-color: var(--metric-tertiary);
}

.metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.metric strong {
  display: block;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin: 6px 0 4px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.metric span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Forms, Inputs & Code Blocks */
label {
  display: block;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  margin: 12px 0;
}

input,
textarea,
select {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  padding: 8px 11px;
  display: block;
  width: 100%;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--subtle-text);
}

input:hover:not(:disabled),
textarea:hover:not(:disabled),
select:hover:not(:disabled) {
  border-color: var(--subtle-text);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

input[type="file"] {
  padding: 6px 8px;
  background: var(--panel-subtle);
  font-size: 12px;
}

textarea {
  font-family: var(--font-mono);
  font-size: 12.5px;
  resize: vertical;
}

.check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  user-select: none;
  color: var(--text-secondary);
}

.check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.inline input {
  max-width: 340px;
  margin: 0;
}

code {
  display: block;
  padding: 10px 12px;
  background: var(--panel-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
  margin: 10px 0;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  background: var(--panel-subtle);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 10px 0;
  color: var(--text);
}

.secret {
  padding: 16px;
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  margin: 16px 0;
}

.secret strong {
  display: block;
  font-size: 12.5px;
  color: var(--warning-text);
  margin-bottom: 6px;
}

.secret button {
  margin-right: 8px;
  margin-top: 4px;
}

/* Data Tables & Lists */
.table-wrap,
#recent,
#keylist,
#calllist,
#spendlist,
#ledgerlist,
#walletorders,
#modellist,
#trialcodes,
#trialorders,
#walletadminledger,
#userlist,
#admincalls,
#commerciallist,
#auditlist,
#mediajobs,
#adminmediajobs {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: var(--panel-subtle);
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-top: 1px solid var(--line);
}

tbody tr:hover {
  background-color: var(--panel-hover);
}

td button {
  font-size: 11.5px;
  padding: 4px 8px;
  margin: 2px 4px 2px 0;
}

.row-note {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
  white-space: normal;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--success-soft);
  border: 1px solid var(--success-border);
  color: var(--badge-success-text);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.badge.pending {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--badge-warning-text);
}

.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--panel-subtle);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin: 8px 0;
}

.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Auth View (Clean Enterprise Split Card) */
#auth {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(280px, 460px);
  gap: 24px;
  align-items: stretch;
  justify-content: center;
  margin: 36px auto 56px;
  width: 100%;
}

.auth-card {
  padding: 28px 30px;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card h2 {
  font-size: 20px;
  margin-top: 8px;
  margin-bottom: 6px;
}

.auth-card .primary {
  width: 100%;
  margin-top: 14px;
  padding: 9px 15px;
}

.auth-art {
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.auth-art::before {
  content: "API INFRASTRUCTURE / LEDGER";
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
}

.auth-art > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 20px;
  margin-bottom: 18px;
  text-shadow: none;
}

.auth-art h2 {
  font-size: 22px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.auth-art p {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  width: 100%;
}

/* Billing & Settlement Breakdown */
.bill-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin: 10px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.bill-heading h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.bill-heading p {
  font-size: 12px;
  margin: 0;
  overflow-wrap: anywhere;
}

.bill-total {
  text-align: right;
  min-width: 170px;
  background: var(--panel-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.bill-total small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.bill-total strong {
  display: block;
  color: var(--accent);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  font-weight: 600;
  margin: 3px 0;
}

.bill-settlement {
  background: var(--panel-subtle);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin: 16px 0;
  font-variant-numeric: tabular-nums;
}

.bill-settlement > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
}

.bill-settlement > div:last-child {
  border-bottom: 0;
}

.bill-settlement span {
  color: var(--muted);
}

.technical {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.technical summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 0;
}

.technical summary:hover {
  color: var(--accent);
}

#walletbalance {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel-subtle);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin: 4px 0 8px;
}

#walletbalance:empty {
  display: none;
}

/* Dialogs / Modals */
dialog {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 820px;
  width: calc(100% - 32px);
  max-height: 86vh;
  padding: 22px 24px;
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(2px);
}

#detail {
  max-width: 960px;
}

#actiondialog {
  max-width: 440px;
}

/* Footer */
footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 16px 0 4px;
  color: var(--muted);
  font-size: 11.5px;
}

.theme-switch {
  display: block;
  flex-shrink: 0;
  padding: 12px 8px;
  margin: 10px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.theme-switch select { margin-top: 5px; padding: 7px 9px; font-size: 12px; }

/* Responsive Breakpoints (Tablet & 390px Mobile) */
@media (max-width: 1024px) {
  main {
    padding: 20px 22px;
  }
  .two {
    grid-template-columns: 1fr;
    gap: 0;
  }
  #auth {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 24px auto 40px;
  }
  .auth-art {
    display: none;
  }
}

@media (max-width: 720px) {
  .theme-switch { display: flex; align-items: center; gap: 12px; padding: 6px 0 0; margin: 6px 0 0; }
  .theme-switch select { width: auto; margin: 0; padding: 5px 8px; }
  aside {
    position: static;
    width: 100%;
    height: auto;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 16px;
    padding: 2px 4px;
  }
  .environment {
    margin: 8px 0;
    padding: 5px 8px;
  }
  nav {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    padding: 4px 0 2px;
  }
  nav button,
  nav .admin-link {
    width: auto;
    white-space: nowrap;
    font-size: 12.5px;
    padding: 6px 10px;
    margin-top: 0 !important;
  }
  nav button::before {
    display: none !important;
  }
  .aside-bottom {
    display: none;
  }
  main {
    margin-left: 0;
    padding: 16px 14px 24px;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 12px;
  }
  .userbar {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  article,
  .auth-card {
    padding: 16px 14px;
  }
  .inline {
    flex-direction: column;
    align-items: stretch;
  }
  .inline input {
    max-width: 100%;
  }
  .bill-heading {
    flex-direction: column;
    gap: 10px;
  }
  .bill-total {
    text-align: left;
    width: 100%;
  }
  dialog {
    padding: 16px;
    width: calc(100% - 20px);
  }
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  footer span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Shared navigation and workspace refinement: all themes use the same structure. */
.skip-link { position:fixed;top:-80px;left:20px;z-index:200;background:var(--panel);color:var(--accent);padding:12px 18px;border:1px solid var(--accent); }
.skip-link:focus { top:12px; }
.nav-group-label { font-size:11px;font-weight:600;letter-spacing:.06em;color:var(--muted);padding:16px 12px 6px; }
.grouped-nav button,.grouped-nav .admin-link { margin-top:0!important; }
.grouped-nav button::before { display:none!important; }
.grouped-nav { gap:3px; }
.quick-actions { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 24px; }
.quick-actions a,.quick-actions button { display:flex;align-items:center;gap:12px;padding:20px;text-decoration:none;text-align:left;background:var(--panel);border:1px solid var(--line);border-radius:12px;color:var(--text);min-width:0; }
.quick-actions span { color:var(--accent);background:var(--accent-soft);width:36px;height:36px;display:grid;place-items:center;border-radius:9px;flex-shrink:0; }
.quick-actions strong { font-size:14px;font-weight:600; }
.quick-actions a:hover,.quick-actions button:hover { border-color:var(--accent-border);background:var(--panel-hover); }
.section-shortcuts { display:flex;flex-wrap:wrap;gap:8px;padding:14px;background:var(--panel-subtle);border:1px solid var(--line);border-radius:12px;margin-bottom:24px; }
.section-shortcuts button { font-size:12px;padding:8px 12px;box-shadow:none; }
#admin h2,#wallet_admin h2,#providers h2 { scroll-margin-top:24px; }
#admin form:not(.inline),#providers form { max-width:980px; }
#admin .two>article,#wallet_admin article { min-width:0; }
#endpoint { display:block;overflow-wrap:anywhere;margin:14px 0 20px; }
#overview>.two>article { display:flex;align-items:flex-start;flex-direction:column; }
#overview>.two>article>button { margin-top:auto; }
#redeemform,#simulationform { padding:20px;background:var(--panel-subtle);border:1px solid var(--line);border-radius:10px; }
.connection-details { margin-bottom:22px;border:1px solid var(--line);border-radius:10px;padding:12px 16px;background:var(--panel); }
.connection-details summary,#dev-models-section>summary { cursor:pointer;color:var(--text-secondary);font-weight:600; }
#dev-connect { scroll-margin-top:20px; }
#dev-output>button { margin:12px 0; }
#dev-output details { border-top:1px solid var(--line);padding-top:16px;margin-top:12px; }
.studio-tool label { margin-top:16px; }
.studio-results { min-height:480px; }
.studio-empty { min-height:300px; }
.studio-submit { position:sticky;bottom:0;background:var(--panel);padding-bottom:6px;z-index:2; }
button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid var(--accent);outline-offset:3px; }
@media(min-width:721px){ aside { overflow-y:auto; } .grouped-nav button,.grouped-nav .admin-link { min-height:40px; } }
@media(max-width:1000px){ .quick-actions { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:720px){
 .grouped-nav { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible;gap:5px; }
 .grouped-nav .nav-group-label { display:none; }
 .grouped-nav button,.grouped-nav .admin-link { white-space:normal;text-align:center;justify-content:center;min-height:42px;padding:8px 5px;font-size:12px; }
 .quick-actions { gap:8px;margin-bottom:16px; }.quick-actions a,.quick-actions button { padding:12px 10px;gap:8px; }.quick-actions strong { font-size:12px; }
 .section-shortcuts { flex-wrap:nowrap;overflow-x:auto;max-width:100%; }.section-shortcuts button { white-space:nowrap;flex-shrink:0; }
 .userbar { flex-wrap:wrap;gap:8px; }.userbar #who { max-width:100%;overflow-wrap:anywhere; }
 #redeemform,#simulationform { padding:14px; }.studio-submit { position:static; }.studio-results { min-height:280px; }
}

#controlform .check { display:flex;align-items:center;gap:8px;margin:18px 0; }
#controlform .check input { flex-shrink:0; }

#storagedialog{width:min(720px,calc(100% - 24px));max-height:85vh;overflow:auto}.storage-file{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 0;border-bottom:1px solid var(--line)}.storage-file small{display:block;margin-top:6px;color:var(--muted)}.storage-file .actions{flex-shrink:0}

.storage-file .actions{display:flex;gap:12px;align-items:center}
