:root {
  color-scheme: dark;
  --paper: #050b15;
  --panel: #091523;
  --panel-2: #0d1b2c;
  --line: #1a3047;
  --line-strong: #2a4967;
  --text: #eef7ff;
  --muted: #8299ad;
  --signal: #68dfc2;
  --signal-dark: #0a2c2b;
  --amber: #f4b860;
  --amber-rgb: 244,184,96;
  --red: #ff7b79;
  --blue: #70a9ff;
  --violet: #9b83ff;
  --radius: 14px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 25% 10%, #0a2037 0, var(--paper) 42%) fixed;
  font-family: var(--sans);
  line-height: 1.5;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.danger { color: var(--red); }
.signal { color: var(--signal); }

.topbar {
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(105, 158, 203, .18);
  background: rgba(4, 11, 21, .82);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(22px) saturate(135%);
}
.brand { display: flex; align-items: center; font-weight: 800; letter-spacing: -.045em; }
.brand-word { color: #f5f9ff; font: 800 23px/1 "Avenir Next", "Helvetica Neue", Arial, sans-serif; letter-spacing: -.045em; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--signal); color: var(--signal); font-family: var(--mono); font-size: 13px;
}
.brand-logo { width: 66px; height: 34px; display: block; object-fit: contain; }
.top-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  appearance: none; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--panel-2); color: var(--text); padding: 9px 14px; cursor: pointer;
  transition: border-color .16s, background-color .16s, transform .16s;
}
.btn:hover { border-color: var(--signal); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--signal); color: #031712; border-color: var(--signal); font-weight: 750; }
.btn.ghost { background: transparent; }
.btn.danger-btn { color: var(--red); border-color: #633639; }
.btn.small { padding: 6px 10px; font-size: 13px; }

.auth-shell {
  --pointer-x: 0; --pointer-y: 0;
  min-height: calc(100vh - 64px); display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr);
  position: relative; overflow: hidden; background: #050c17;
}
.auth-shell::before {
  content: ""; position: absolute; inset: -30%; pointer-events: none;
  background: radial-gradient(circle at 24% 38%, rgba(36, 103, 181, .22), transparent 23%), radial-gradient(circle at 53% 78%, rgba(93, 74, 222, .14), transparent 25%);
  animation: aurora-breathe 9s ease-in-out infinite alternate;
}
.auth-story {
  min-width: 0; padding: clamp(56px, 8vh, 92px) 5.5vw 25px; display: flex; flex-direction: column;
  justify-content: flex-start; position: relative; isolation: isolate; overflow: hidden;
}
.auth-story::after {
  content: ""; position: absolute; inset: 0; z-index: -2; opacity: .32;
  background-image: radial-gradient(circle, #8cb8ff 0 1px, transparent 1.5px); background-size: 53px 53px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 35%, transparent 92%);
}
.eyebrow { font: 12px var(--mono); letter-spacing: .12em; color: var(--signal); text-transform: uppercase; }
.auth-copy { position: relative; z-index: 4; animation: hero-copy-in .9s cubic-bezier(.2,.8,.2,1) both; }
.auth-copy .eyebrow { letter-spacing: .45em; }
.auth-copy h1 {
  font-family: "Avenir Next", "Helvetica Neue", Arial, sans-serif; font-size: clamp(62px, 7.6vw, 116px); line-height: .9;
  font-weight: 600; letter-spacing: .065em; max-width: 760px; margin: 20px 0 16px; color: #fff;
  text-shadow: 0 0 38px rgba(149, 194, 255, .22);
}
.auth-copy p { margin: 0; max-width: 600px; font-size: clamp(17px, 1.45vw, 22px); letter-spacing: .08em; color: #cedbea; }
.auth-copy > span { display: block; margin-top: 13px; color: #57748f; font: 10px var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.bridge-stage {
  position: absolute; z-index: 1; left: -2.5%; right: -5%; bottom: -18px; height: min(59vh, 590px); pointer-events: none;
  transform: translate3d(calc(var(--pointer-x) * -7px), calc(var(--pointer-y) * -5px), 0); transition: transform .35s ease-out;
}
.bridge-stage::after { content: ""; position: absolute; left: 2%; right: 0; bottom: 5%; height: 20%; background: #3675ff; opacity: .14; filter: blur(45px); }
.bridge-stage svg { width: 100%; height: 100%; overflow: visible; }
.bridge-flow { stroke-dasharray: 5 38; animation: bridge-flow 2.5s linear infinite; }
.network-lines { opacity: .28; stroke-dasharray: 4 12; animation: network-flow 12s linear infinite; }
.human-node { animation: node-hover 4.8s ease-in-out infinite; transform-origin: 78px 267px; }
.ai-node { animation: node-hover 4.8s 1.1s ease-in-out infinite; transform-origin: 812px 317px; }
.ai-node ellipse { transform-box: fill-box; transform-origin: center; animation: orbit-spin 14s linear infinite; }
.ai-node ellipse:nth-of-type(2) { animation-direction: reverse; animation-duration: 18s; }
.orb { position: absolute; border-radius: 50%; filter: blur(1px); opacity: .4; animation: particle-float 8s ease-in-out infinite; }
.orb-one { width: 6px; height: 6px; left: 46%; top: 25%; background: #85f4ff; box-shadow: 0 0 18px #6ceaff; }
.orb-two { width: 4px; height: 4px; left: 68%; top: 48%; background: #a98cff; box-shadow: 0 0 15px #987cff; animation-delay: -3s; }
.auth-panel {
  position: relative; z-index: 3; background: linear-gradient(150deg, rgba(10, 23, 39, .88), rgba(5, 13, 24, .96));
  border-left: 1px solid rgba(110, 162, 205, .22); display: grid; place-items: center; padding: clamp(28px, 5vw, 72px); overflow-y: auto;
}
.auth-panel::before { content: ""; position: absolute; width: 300px; height: 300px; left: -150px; top: 18%; border-radius: 50%; background: #2b6ea8; opacity: .07; filter: blur(50px); pointer-events: none; }
.auth-stack { width: min(500px, 100%); display: grid; gap: 24px; animation: auth-card-in .9s .08s cubic-bezier(.2,.8,.2,1) both; }
.auth-card {
  width: 100%; padding: clamp(24px, 3vw, 36px); border: 1px solid rgba(104, 151, 192, .2); border-radius: 18px;
  background: linear-gradient(145deg, rgba(14, 30, 49, .86), rgba(7, 17, 30, .72));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .32), inset 0 1px rgba(255, 255, 255, .025); backdrop-filter: blur(24px);
}
.auth-card h2 { font-size: 28px; margin: 10px 0 5px; }
.form-intro { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.auth-community { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 22px; padding-top: 22px; border-top: 1px solid rgba(95, 137, 174, .2); }
.auth-community h2 { margin: 8px 0 6px; font-size: 20px; }
.auth-community p { margin: 0; color: var(--muted); font-size: 13px; }
.switcher { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.switcher button { flex: 1; background: none; color: var(--muted); border: 0; padding: 12px; cursor: pointer; border-bottom: 2px solid transparent; }
.switcher button.active { color: var(--signal); border-bottom-color: var(--signal); text-shadow: 0 0 18px rgba(104, 223, 194, .3); }

.field { display: grid; gap: 7px; margin: 15px 0; }
.field label { font-size: 13px; color: #bfd0d5; }
.field input, .field select {
  width: 100%; border: 1px solid #29435d; background: rgba(3, 11, 21, .7); color: var(--text);
  border-radius: 8px; padding: 12px 13px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:hover { border-color: #3c5d7c; }
.field input:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(104, 223, 194, .08), 0 0 24px rgba(104, 223, 194, .06); background: rgba(3, 12, 23, .92); }
.prompt-service-panel { margin-bottom: 18px; }
.prompt-service-panel .panel-head { align-items: flex-start; }
.prompt-service-panel h2 { margin: 5px 0 0; }
.settings-grid { display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(240px, .8fr); gap: 14px; }
.settings-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 7px; }
.settings-actions span { margin-left: 4px; font-size: 13px; }
.settings-switch { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; cursor: pointer; }
.settings-switch input { width: 17px; height: 17px; accent-color: var(--signal); }
@media (max-width: 760px) {
  .settings-grid { grid-template-columns: 1fr; }
  .prompt-service-panel .panel-head { gap: 14px; flex-direction: column; }
}
.password-field { position: relative; }
.password-field input { padding-right: 46px; }
.password-field button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; }
.password-field button span { width: 17px; height: 11px; border: 1.5px solid #71899d; border-radius: 50% / 60%; position: relative; }
.password-field button span::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #71899d; inset: 0; margin: auto; }
.password-field button.showing span { border-color: var(--signal); }
.password-field button.showing span::after { background: var(--signal); }
.form-error { min-height: 23px; color: var(--red); font-size: 13px; }
.full { width: 100%; }
.auth-card .btn.primary { min-height: 48px; border-radius: 8px; background: linear-gradient(90deg, #62daba, #75e3ca); box-shadow: 0 10px 30px rgba(61, 211, 174, .12); }
.auth-card .btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(61, 211, 174, .2); }
.community-trigger {
  min-width: 118px; border: 1px solid #2d4c68; border-radius: 999px; color: #cfe3f1; background: rgba(11, 27, 45, .68);
  padding: 10px 12px 10px 17px; display: inline-flex; justify-content: space-between; align-items: center; gap: 14px; cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.community-trigger i { font-style: normal; color: var(--signal); font-size: 16px; }
.community-trigger:hover { border-color: var(--signal); background: #0d2637; transform: translateY(-1px); }

@keyframes bridge-flow { to { stroke-dashoffset: -43; } }
@keyframes network-flow { to { stroke-dashoffset: -96; } }
@keyframes node-hover { 0%,100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes orbit-spin { to { rotate: 360deg; } }
@keyframes particle-float { 0%,100% { transform: translate(0,0); opacity: .25; } 50% { transform: translate(22px,-25px); opacity: .8; } }
@keyframes aurora-breathe { to { transform: translate3d(3%, -2%, 0) scale(1.05); opacity: .75; } }
@keyframes hero-copy-in { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes auth-card-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.app-shell {
  min-height: calc(100vh - 64px); display: grid; grid-template-columns: 258px minmax(0, 1fr); position: relative;
  background: radial-gradient(circle at 78% 0%, rgba(42, 87, 142, .13), transparent 32%), #060d17;
}
.app-shell::before { content: ""; position: fixed; inset: 64px 0 0 258px; pointer-events: none; opacity: .18; background-image: radial-gradient(circle, #6e9bc2 0 1px, transparent 1.3px); background-size: 44px 44px; mask-image: linear-gradient(135deg, #000, transparent 58%); }
.sidebar {
  border-right: 1px solid rgba(76, 117, 153, .22); background: linear-gradient(180deg, rgba(8, 21, 35, .97), rgba(5, 13, 23, .96));
  padding: 22px 16px; position: relative; z-index: 2;
}
.identity { padding: 10px 8px 24px; border-bottom: 1px solid rgba(78, 119, 153, .2); margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.identity-mark { width: 52px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(96, 155, 201, .22); border-radius: 10px; background: rgba(18, 42, 65, .55); box-shadow: inset 0 1px rgba(255,255,255,.025); }
.identity-mark img { width: 44px; height: 26px; object-fit: contain; }
.identity strong { display: block; color: #f3f9ff; font-size: 14px; }
.identity code { display: block; color: var(--muted); font: 11px var(--mono); margin-top: 5px; word-break: break-all; }
.nav { display: grid; gap: 6px; }
.nav button {
  background: transparent; color: #7f98ad; border: 1px solid transparent; border-radius: 9px;
  text-align: left; padding: 10px 11px; cursor: pointer; display: flex; align-items: center; gap: 11px; transition: color .18s, border-color .18s, background .18s, transform .18s;
}
.nav-symbol { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #233f57; border-radius: 7px; font: 11px var(--mono); color: #7198b8; transition: inherit; }
.nav button:hover { color: #dcecf7; background: rgba(24, 52, 77, .32); transform: translateX(2px); }
.nav button.active { color: #f0fbff; background: linear-gradient(90deg, rgba(37, 87, 119, .48), rgba(13, 42, 57, .36)); border-color: rgba(95, 205, 187, .24); box-shadow: inset 3px 0 var(--signal), 0 8px 28px rgba(0,0,0,.12); }
.nav button.active .nav-symbol { color: var(--signal); border-color: rgba(104, 223, 194, .38); background: rgba(30, 96, 87, .2); box-shadow: 0 0 18px rgba(104, 223, 194, .08); }
.content { padding: 42px clamp(24px, 4vw, 64px) 78px; max-width: 1640px; width: 100%; position: relative; z-index: 1; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.page-head h1 { margin: 7px 0 0; font-size: 36px; line-height: 1.05; letter-spacing: -.045em; color: #f4f9ff; }

.metric-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 14px; }
.metric {
  background: linear-gradient(145deg, rgba(13, 31, 49, .92), rgba(7, 19, 32, .92)); border: 1px solid rgba(70, 111, 146, .24);
  border-radius: 16px; padding: 22px; min-height: 142px; position: relative; overflow: hidden; box-shadow: 0 16px 44px rgba(0, 0, 0, .12), inset 0 1px rgba(255,255,255,.018); transition: transform .2s, border-color .2s;
}
.metric::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(112, 169, 255, .44), transparent); }
.metric::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; right: -36px; bottom: -46px; background: var(--blue); opacity: .045; filter: blur(4px); }
.metric:hover { transform: translateY(-2px); border-color: rgba(102, 158, 199, .4); }
.metric .label { color: var(--muted); font-size: 12px; font-family: var(--mono); text-transform: uppercase; }
.metric .number { display: block; margin-top: 17px; font: 38px var(--mono); letter-spacing: -.055em; color: #e9f6ff; }
.metric.primary-metric { border-color: rgba(104, 223, 194, .34); background: linear-gradient(145deg, rgba(12, 45, 52, .76), rgba(7, 24, 35, .94)); }
.metric.primary-metric::before { background: linear-gradient(90deg, transparent, rgba(104, 223, 194, .7), transparent); }
.metric.primary-metric .number { color: #a8f2df; }
.credit-rail { height: 5px; background: #142b3c; margin-top: 22px; position: relative; overflow: hidden; border-radius: 99px; }
.credit-rail span { display: block; height: 100%; background: linear-gradient(90deg, #4ac9ae, #7ce8d0); min-width: 3px; border-radius: inherit; box-shadow: 0 0 14px rgba(104, 223, 194, .32); }

.panel { background: linear-gradient(145deg, rgba(10, 25, 40, .94), rgba(7, 17, 29, .96)); border: 1px solid rgba(69, 106, 139, .23); border-radius: 16px; margin-top: 20px; overflow: hidden; box-shadow: 0 18px 55px rgba(0,0,0,.12); }
.panel-head { min-height: 64px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid rgba(65, 103, 134, .2); }
.panel-head h2 { font-size: 15px; margin: 0; }
.overview-call-copy { display:grid; gap:3px; }
.overview-call-copy small { color:var(--muted); font-size:11px; }
.call-retention-note { padding:11px 20px; border-bottom:1px solid rgba(65,103,134,.16); color:var(--muted); font-size:11px; }

/* Logged-in video application */
.studio-page-head { align-items: center; }
.studio-page-head p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.studio-balance {
  display: grid; grid-template-columns: auto auto; column-gap: 7px; align-items: baseline; min-width: 170px;
  padding: 13px 16px; border: 1px solid rgba(104, 223, 194, .28); border-radius: 13px;
  background: linear-gradient(135deg, rgba(18, 58, 62, .7), rgba(8, 27, 40, .92));
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 14px 38px rgba(0,0,0,.12);
}
.studio-balance span { grid-column: 1 / -1; color: #7e9aaa; font: 10px var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.studio-balance strong { color: #a8f2df; font: 25px var(--mono); letter-spacing: -.04em; }
.studio-balance small { color: var(--signal); font: 11px var(--mono); }
.studio-shell { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); gap: 18px; align-items: start; }
.studio-compose, .studio-result {
  border: 1px solid rgba(69, 106, 139, .25); border-radius: 18px;
  background: linear-gradient(145deg, rgba(10, 25, 40, .96), rgba(6, 16, 28, .98));
  box-shadow: 0 24px 70px rgba(0,0,0,.18); overflow: hidden;
}
.studio-compose form { display: grid; }
.studio-section { padding: 21px 22px; border-bottom: 1px solid rgba(65, 103, 134, .19); }
.studio-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 13px; }
.studio-section-head > span, .studio-section-head > label { color: #dcebf6; font-size: 13px; font-weight: 720; }
.studio-section-head small { color: #668399; font-size: 11px; }
.studio-mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 5px; border: 1px solid #1c354a; border-radius: 11px; background: rgba(4, 13, 24, .66); }
.studio-mode-tabs button { min-height: 43px; border: 1px solid transparent; border-radius: 8px; color: #829caf; background: transparent; cursor: pointer; transition: color .18s, background .18s, border-color .18s; }
.studio-mode-tabs button:hover { color: #dcecf7; }
.studio-mode-tabs button.active { color: #c8fff0; border-color: rgba(104, 223, 194, .27); background: linear-gradient(130deg, rgba(29, 101, 90, .42), rgba(18, 59, 70, .48)); box-shadow: inset 0 1px rgba(255,255,255,.035); }
.quality-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quality-choice label { position: relative; cursor: pointer; }
.quality-choice input { position: absolute; opacity: 0; pointer-events: none; }
.quality-choice label > span { display: grid; grid-template-columns: 1fr auto; min-height: 95px; padding: 16px; border: 1px solid #1d374d; border-radius: 12px; background: rgba(5, 16, 28, .72); transition: border-color .18s, background .18s, transform .18s; }
.quality-choice label:hover > span { transform: translateY(-1px); border-color: #365a76; }
.quality-choice b { color: #f1f8ff; font: 23px var(--mono); }
.quality-choice em { align-self: center; color: var(--signal); font: normal 12px var(--mono); }
.quality-choice small { grid-column: 1 / -1; align-self: end; color: #708ca1; font-size: 11px; }
.quality-choice input:checked + span { border-color: rgba(104, 223, 194, .62); background: linear-gradient(145deg, rgba(19, 66, 65, .58), rgba(7, 29, 42, .78)); box-shadow: 0 0 0 1px rgba(104, 223, 194, .07), inset 3px 0 var(--signal); }
.quality-choice input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }
.upload-pair, .reference-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reference-upload-grid { grid-template-columns: repeat(3, 1fr); }
.upload-slot { min-width: 0; min-height: 105px; padding: 18px; display: grid; align-content: center; justify-items: center; gap: 7px; border: 1px dashed #2d526e; border-radius: 12px; background: rgba(5, 16, 28, .48); text-align: center; cursor: pointer; transition: border-color .18s, background .18s; }
.upload-slot:hover { border-color: var(--signal); background: rgba(16, 49, 58, .5); }
.upload-slot input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-slot strong { color: #cfe2ef; font-size: 13px; overflow-wrap: anywhere; }
.upload-slot small { color: #6d899e; font-size: 10px; overflow-wrap: anywhere; }
.keyframe-slot { overflow: hidden; transition: min-height .22s ease, border-color .18s, background .18s; }
.keyframe-slot.has-preview { min-height: 245px; align-content: stretch; padding: 11px; border-style: solid; background: rgba(3, 12, 22, .78); }
.upload-preview { width: 100%; height: 185px; min-width: 0; min-height: 0; display: block; object-fit: contain; border: 1px solid rgba(76, 112, 140, .3); border-radius: 9px; background-color: #07111c; background-image: linear-gradient(45deg, rgba(109, 144, 168, .06) 25%, transparent 25%), linear-gradient(-45deg, rgba(109, 144, 168, .06) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(109, 144, 168, .06) 75%), linear-gradient(-45deg, transparent 75%, rgba(109, 144, 168, .06) 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.keyframe-slot.portrait-preview .upload-preview { height: 230px; }
.keyframe-slot.has-preview strong::after { content: " · 点击替换"; color: var(--signal); font: 9px var(--mono); }
.keyframe-slot.has-preview small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-slot.compact { min-height: 82px; padding: 13px; }
.reference-file-list { margin-top: 10px; display: grid; gap: 6px; }
.empty-reference { padding: 14px; color: #617c91; text-align: center; border: 1px solid rgba(42, 73, 98, .42); border-radius: 9px; font-size: 11px; }
.reference-file { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid rgba(44, 79, 105, .62); border-radius: 9px; background: rgba(7, 22, 35, .8); }
.reference-file-kind { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--signal); }
.reference-file-kind img, .reference-file-kind i { width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid rgba(68, 106, 135, .5); border-radius: 7px; background: #06101b; }
.reference-file-kind img { object-fit: contain; }
.reference-file-kind i { display: grid; place-items: center; color: #7f9caf; font: normal 9px var(--mono); }
.reference-file-kind b { min-width: 0; font: 9px var(--mono); white-space: nowrap; }
.reference-file > small { color: #9ab0c0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-file button { width: 27px; height: 27px; border: 1px solid #314c61; border-radius: 7px; background: transparent; color: #819aab; cursor: pointer; }
.reference-file button:hover { color: var(--red); border-color: #754547; }
.reference-file > .reference-file-actions { width: auto; display: flex; gap: 4px; color: inherit; font: inherit; }
.prompt-section textarea { width: 100%; min-height: 172px; resize: vertical; padding: 14px 15px; border: 1px solid #29435d; border-radius: 11px; background: rgba(3, 11, 21, .72); color: var(--text); font: 13px/1.7 var(--sans); transition: border-color .2s, box-shadow .2s; }
.prompt-section textarea:focus { outline: 0; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(104, 223, 194, .07); }
.studio-settings { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 20px 22px 9px; }
.studio-settings label { color: #7893a7; font: 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.studio-settings select, .studio-settings input { width: 100%; min-height: 42px; margin-top: 7px; padding: 9px 10px; border: 1px solid #29435d; border-radius: 8px; background: rgba(3, 11, 21, .78); color: var(--text); }
.studio-settings label > small { display: block; margin-top: 5px; color: #547084; font: 9px var(--sans); letter-spacing: 0; text-transform: none; }
#studioFormError { padding: 0 22px; }
.studio-submit { margin: 8px 22px 22px; min-height: 54px; display: flex; justify-content: space-between; align-items: center; border-radius: 10px; }
.studio-submit > span { font-size: 14px; }
.studio-submit > small { color: rgba(3, 23, 18, .68); font: 10px var(--mono); }
.studio-submit:disabled { opacity: .5; cursor: wait; }
.studio-result { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; scrollbar-color: #284a61 transparent; scrollbar-width: thin; }
.result-stage { min-height: 320px; aspect-ratio: 16 / 9; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); place-items: center; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 42%, rgba(52, 95, 138, .16), transparent 34%), #030912; border-bottom: 1px solid rgba(65, 103, 134, .2); }
.result-stage.portrait { height: clamp(420px, 58vh, 620px); min-height: 420px; aspect-ratio: auto; }
.result-stage.landscape { height: auto; aspect-ratio: 16 / 9; }
.result-stage::before { content: ""; position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(91, 143, 183, .13) 1px, transparent 1px), linear-gradient(90deg, rgba(91, 143, 183, .13) 1px, transparent 1px); background-size: 38px 38px; mask-image: radial-gradient(circle, #000, transparent 72%); }
.result-stage video { position: relative; z-index: 1; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; background: #000; }
.result-empty { position: relative; z-index: 1; display: grid; justify-items: center; gap: 9px; text-align: center; color: #637e93; }
.result-empty > span { width: 54px; height: 54px; display: grid; place-items: center; padding-left: 4px; border: 1px solid #294861; border-radius: 50%; color: var(--signal); background: rgba(14, 43, 58, .52); box-shadow: 0 0 34px rgba(104, 223, 194, .08); }
.result-empty strong { color: #a9bfce; font-size: 13px; }
.result-empty small { max-width: 260px; font-size: 10px; }
.result-progress { padding: 21px; }
.result-progress-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.result-progress-head span { display: block; color: #e2eef7; font-size: 13px; font-weight: 720; }
.result-progress-head code { display: block; margin-top: 5px; color: #5e7b91; font: 9px var(--mono); overflow-wrap: anywhere; }
.result-progress-head > strong { color: var(--signal); font: 18px var(--mono); }
.result-progress-rail { height: 5px; margin: 16px 0; border-radius: 99px; overflow: hidden; background: #132a3b; }
.result-progress-rail i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4bc9ae, #71aaff); transition: width .4s ease; box-shadow: 0 0 16px rgba(104,223,194,.3); }
.result-progress p { min-height: 38px; margin: 0; color: #7892a6; font-size: 12px; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.result-actions .btn { text-align: center; text-decoration: none; }
.studio-task-center { border-top: 1px solid rgba(65, 103, 134, .22); background: rgba(3, 12, 22, .46); }
.task-center-head { min-height: 62px; padding: 13px 17px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid rgba(65, 103, 134, .18); }
.task-center-head > div { display: grid; gap: 4px; }
.task-center-head strong { color: #dcebf6; font-size: 13px; }
.task-center-head small { color: #678399; font-size: 10px; }
.task-refresh { min-height: 31px; padding: 0 11px; border: 1px solid #28475e; border-radius: 7px; background: rgba(8, 25, 39, .76); color: #8eabba; font: 10px var(--mono); cursor: pointer; }
.task-refresh:hover { color: var(--signal); border-color: rgba(104, 223, 194, .5); }
.task-refresh:disabled { opacity: .45; cursor: wait; }
.studio-task-list { display: grid; gap: 8px; padding: 11px; }
.task-center-empty { padding: 27px 15px; border: 1px dashed rgba(54, 88, 113, .5); border-radius: 10px; color: #617d91; font-size: 11px; text-align: center; }
.studio-task-card { width: 100%; position: relative; display: grid; border: 1px solid rgba(47, 83, 109, .58); border-radius: 11px; background: linear-gradient(135deg, rgba(10, 28, 43, .86), rgba(5, 17, 29, .9)); color: inherit; text-align: left; transition: border-color .18s, background .18s, transform .18s; }
.studio-task-main { appearance: none; width: 100%; display: grid; gap: 9px; padding: 12px 13px; border: 0; border-radius: inherit; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.studio-task-main:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.task-delete { position: absolute; z-index: 1; top: 10px; right: 10px; min-width: 42px; min-height: 28px; padding: 4px 8px; border: 1px solid rgba(255,123,121,.26); border-radius: 7px; background: rgba(10,13,18,.86); color: #be8b8b; font: 10px var(--sans); cursor: pointer; opacity: .76; transition: color .16s, border-color .16s, background .16s, opacity .16s; }
.task-note-edit { position:absolute; z-index:1; top:10px; right:60px; min-width:48px; min-height:28px; padding:4px 8px; border:1px solid rgba(var(--blue-rgb),.3); border-radius:7px; background:rgba(10,13,18,.86); color:#91baff; font:10px var(--sans); cursor:pointer; opacity:.82; transition:color .16s,border-color .16s,background .16s,opacity .16s; }
.task-note-edit:hover { color:#d6e7ff; border-color:rgba(var(--blue-rgb),.62); background:rgba(var(--blue-rgb),.14); opacity:1; }
.task-note-edit:disabled { opacity:.35; cursor:wait; }
.task-delete:hover { color: #ffd0cf; border-color: rgba(255,123,121,.62); background: rgba(92,31,34,.56); opacity: 1; }
.task-delete:disabled { opacity: .35; cursor: wait; }
.task-card-head { padding-right: 112px; }
.studio-task-card:hover { transform: translateY(-1px); border-color: #3b647f; background: linear-gradient(135deg, rgba(13, 37, 53, .94), rgba(6, 20, 33, .94)); }
.studio-task-card.selected { border-color: rgba(104, 223, 194, .5); background: linear-gradient(135deg, rgba(15, 55, 59, .72), rgba(6, 25, 38, .94)); box-shadow: inset 3px 0 var(--signal), 0 8px 24px rgba(0,0,0,.12); }
.task-card-head, .task-card-meta, .task-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.task-card-head strong { color: #d8e9f4; font-size: 12px; }
.task-card-head .task-prompt { min-width: 0; display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.45; }
.task-mini-state { flex: 0 0 auto; padding: 3px 7px; border: 1px solid rgba(91, 126, 151, .28); border-radius: 999px; color: #8ba4b6; background: rgba(11, 29, 43, .8); font: 9px var(--mono); }
.task-mini-state.running, .task-mini-state.dispatching { color: #9bc8ff; border-color: rgba(113, 170, 255, .3); }
.task-mini-state.queued { color: #efc985; border-color: rgba(244, 184, 96, .3); }
.task-mini-state.completed { color: #9bf0d9; border-color: rgba(104, 223, 194, .3); }
.task-mini-state.failed, .task-mini-state.cancelled { color: #f0a3a4; border-color: rgba(238, 116, 119, .3); }
.task-card-meta { color: #668398; font: 9px var(--mono); }
.task-card-meta span:last-child { text-align: right; }
.task-mini-progress { height: 4px; overflow: hidden; border-radius: 99px; background: #142a3a; }
.task-mini-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4bc9ae, #71aaff); transition: width .4s ease; }
.task-card-foot { color: #7690a3; font-size: 10px; }
.task-card-foot span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-card-foot b { flex: 0 0 auto; color: #9fc3d7; font: 10px var(--mono); }
.call-task-cell { min-width: 290px; max-width: 430px; }
.call-prompt { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #e4f0f8; font-weight: 680; line-height: 1.5; overflow-wrap: anywhere; }
.call-task-meta { display: block; margin-top: 7px; color: #718da2; font-size: 11px; }
.call-task-meta code { color: #7fa8bd; font-size: 10px; }
.support-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 34px; padding: 30px; background: linear-gradient(120deg, rgba(12, 42, 58, .92), rgba(10, 24, 40, .96)); }
.support-copy { align-self: start; padding-top: 8px; }
.support-copy h2 { margin: 10px 0 8px; font-size: 28px; letter-spacing: -.035em; }
.support-copy p { margin: 0; max-width: 560px; color: var(--muted); }
.support-panel .community-trigger { justify-self: end; }
.status { display: inline-flex; align-items: center; gap: 7px; font: 11px var(--mono); text-transform: uppercase; padding: 5px 9px; border-radius: 999px; background: rgba(17, 37, 53, .68); border: 1px solid rgba(74, 111, 141, .22); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.completed::before, .status.active::before { background: var(--signal); }
.status.failed::before, .status.disabled::before { background: var(--red); }
.status.running::before, .status.dispatching::before { background: var(--blue); }
.status.queued::before, .status.pending::before { background: var(--amber); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: #6f8ba2; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .09em; text-align: left; padding: 14px 18px; background: rgba(5, 16, 27, .8); }
td { padding: 16px 18px; border-top: 1px solid rgba(62, 97, 126, .18); vertical-align: top; }
tr:hover td { background: rgba(17, 42, 62, .42); }
.empty { padding: 40px 18px; color: var(--muted); text-align: center; }

.notice { border: 1px solid rgba(244, 184, 96, .18); border-left: 3px solid var(--amber); border-radius: 0 10px 10px 0; background: rgba(49, 36, 15, .52); padding: 14px 16px; color: #e9c98f; margin-bottom: 18px; }
.notice.good { border-color: rgba(104, 223, 194, .16); border-left-color: var(--signal); background: rgba(7, 47, 45, .58); color: #a7e9d9; }
.code-block { margin: 0; padding: 18px; overflow-x: auto; background: #040b0f; color: #c9e7df; font: 12px/1.65 var(--mono); }
.docs-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .45fr); gap: 18px; }
.docs-copy { padding: 20px; }
.docs-copy h3 { margin: 24px 0 8px; }
.docs-copy h3:first-child { margin-top: 0; }
.docs-copy p, .docs-copy li { color: #afc1c7; }
.api-mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.api-mode-card { background: var(--panel); border: 1px solid var(--line); padding: 20px; }
.api-mode-card h3 { margin: 14px 0 6px; }
.api-mode-card p { margin: 0; color: var(--muted); font-size: 13px; }
.mode-token { display: inline-flex; border: 1px solid #246658; color: var(--signal); background: var(--signal-dark); padding: 4px 8px; font: 11px var(--mono); }
.docs-cta { padding: 22px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.docs-cta h2 { margin: 7px 0; }
.docs-cta p { margin: 0; max-width: 780px; }
.docs-loading { padding: 48px 0; color: var(--muted); font: 12px var(--mono); }
.embedded-reference { border-top: 1px solid var(--line); }
.embedded-reference .reference-main { padding: 0; }
.embedded-reference .reference-hero { padding: 42px 0 58px; }
.embedded-reference .reference-hero h1 { font-size: clamp(42px, 5vw, 68px); }
.key-card { padding: 18px; display: flex; justify-content: space-between; gap: 16px; align-items: center; border-top: 1px solid var(--line); }
.key-card:first-child { border-top: 0; }
.key-card code { color: var(--signal); font: 12px var(--mono); }

.modal { position: fixed; inset: 0; z-index: 30; background: rgba(1, 7, 10, .78); display: grid; place-items: center; padding: 20px; }
.modal-card { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line-strong); padding: 24px; box-shadow: 0 26px 90px #000; }
.community-modal { backdrop-filter: blur(16px); }
.community-card { width: min(420px, 100%); text-align: center; border-radius: 18px; position: relative; background: linear-gradient(150deg, #0c1c2c, #07111e); }
.community-card h2 { margin: 9px 0 5px; font-size: 27px; }
.community-card > p { margin: 0 auto 18px; max-width: 330px; }
.community-card a { display: block; width: min(280px, 100%); margin: 0 auto; line-height: 0; padding: 8px; background: #fff; border-radius: 12px; }
.community-card img { display: block; width: 100%; height: auto; border-radius: 7px; }
.community-card small { display: block; color: #617c91; margin-top: 14px; }
.modal-close { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: #0a1826; color: #a9becf; cursor: pointer; font-size: 20px; }
.modal-close:hover { border-color: var(--signal); color: var(--signal); }
.secret { background: #03090c; border: 1px dashed var(--signal); color: var(--signal); padding: 14px; word-break: break-all; font: 12px/1.6 var(--mono); }
.task-detail-modal-card { width: min(920px, 100%); max-height: calc(100vh - 40px); overflow: auto; position: relative; }
.task-detail-modal-card h2 { margin: 8px 0 4px; }
.prompt-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.prompt-detail-panel { min-width: 0; border: 1px solid var(--line); background: #03090c; }
.prompt-detail-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.prompt-detail-panel pre { min-height: 220px; max-height: 48vh; margin: 0; padding: 14px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font: 12px/1.65 var(--mono); }
.task-detail-actions { margin-top: 18px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 420px; padding: 12px 16px; background: var(--text); color: var(--paper); border-radius: 7px; box-shadow: 0 15px 45px #0008; }

/* Merchant-only API reference */
.docs-body { scroll-behavior: smooth; }
.docs-brand { color: var(--text); text-decoration: none; }
.docs-scope { color: var(--muted); font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.reference-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); max-width: 1600px; margin: 0 auto; }
.reference-nav { height: calc(100vh - 64px); position: sticky; top: 64px; padding: 28px 20px; border-right: 1px solid var(--line); background: #08141a; }
.reference-version { display: flex; justify-content: space-between; align-items: baseline; padding: 0 8px 20px; border-bottom: 1px solid var(--line); }
.reference-version span { color: var(--muted); font: 10px var(--mono); letter-spacing: .1em; }
.reference-version strong { color: var(--signal); font: 16px var(--mono); }
.reference-nav nav { display: grid; padding-top: 14px; }
.reference-nav a { color: var(--muted); text-decoration: none; padding: 8px; border-left: 2px solid transparent; font-size: 13px; }
.reference-nav a:hover, .reference-nav a:focus-visible { color: var(--signal); border-left-color: var(--signal); background: var(--signal-dark); }
.reference-main { min-width: 0; padding: 0 clamp(22px, 5vw, 74px) 70px; }
.reference-hero { padding: clamp(58px, 9vw, 112px) 0 58px; border-bottom: 1px solid var(--line); }
.reference-hero h1 { font-size: clamp(48px, 7vw, 88px); line-height: .98; letter-spacing: -.06em; margin: 20px 0 26px; max-width: 900px; }
.reference-hero > p { color: #b8c9ce; font-size: 18px; max-width: 760px; }
.reference-hero code, .section-copy code, .mode-section code { font-family: var(--mono); color: #c8e7df; }
.endpoint-line { margin-top: 30px; min-height: 58px; border: 1px solid var(--line-strong); display: flex; align-items: center; gap: 16px; background: #050d11; padding: 10px 12px; overflow-x: auto; }
.endpoint-line > span { color: #031712; background: var(--signal); padding: 6px 9px; font: 11px var(--mono); font-weight: 800; }
.endpoint-line code { flex: 1; white-space: nowrap; }
.copy-inline, .copy-code { color: var(--muted); background: transparent; border: 1px solid var(--line); padding: 5px 8px; cursor: pointer; font: 11px var(--mono); white-space: nowrap; }
.copy-inline:hover, .copy-code:hover { color: var(--signal); border-color: var(--signal); }
.quality-rail { margin-top: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.quality-rail > div { display: grid; grid-template-columns: 72px minmax(140px, .65fr) 1fr; align-items: center; gap: 14px; padding: 15px; }
.quality-rail > div + div { border-left: 1px solid var(--line); }
.quality-rail span { color: var(--signal); font: 18px var(--mono); }
.quality-rail strong { font: 12px var(--mono); }
.quality-rail small { color: var(--muted); }
.reference-section { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 24px; padding: 58px 0; border-bottom: 1px solid var(--line); }
.section-marker { color: var(--signal); font: 11px var(--mono); letter-spacing: .1em; padding-top: 8px; }
.section-copy h2, .mode-heading h2 { font-size: 30px; letter-spacing: -.035em; margin: 0 0 12px; }
.section-copy > p, .mode-heading p { color: var(--muted); max-width: 760px; }
.contract-list { border-top: 1px solid var(--line); margin: 24px 0 18px; }
.contract-list > div { display: grid; grid-template-columns: 190px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contract-list span { color: #aabec4; }
.contract-list strong { color: var(--amber); font-size: 11px; }
.api-table { margin-top: 22px; border: 1px solid var(--line); }
.api-table td:first-child { white-space: nowrap; }
.mode-section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.mode-heading { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 22px; }
.mode-heading .mode-token { justify-self: start; margin-top: 8px; }
.mode-heading p { margin: 0; }
.code-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.code-card { min-width: 0; border: 1px solid var(--line); background: #050d11; overflow: hidden; }
.code-card > header { min-height: 48px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); font: 11px var(--mono); color: #bfd1d6; }
.code-card .code-block { min-height: 100%; }
.quality-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; }
.quality-dot.q720 { background: var(--signal); }
.quality-dot.q1080 { background: var(--blue); }
.mode-note { display: grid; grid-template-columns: 180px 1fr; gap: 18px; border-left: 3px solid var(--signal); background: var(--signal-dark); padding: 14px 16px; margin: 14px 0; font-size: 13px; }
.mode-note span { color: #a9dacf; }
.mode-note.warning { border-left-color: var(--amber); background: #211a0e; }
.mode-note.warning span { color: #d8c19a; }
.reference-mapping { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; border: 1px solid var(--line); }
.reference-mapping > div { padding: 14px; border-right: 1px solid var(--line); display: grid; gap: 6px; font: 11px var(--mono); }
.reference-mapping > div:last-child { border-right: 0; }
.reference-mapping b { color: var(--signal); }
.full-code { margin-top: 20px; }
.endpoint-stack { border-top: 1px solid var(--line); margin: 24px 0 32px; }
.endpoint-stack > div { display: grid; grid-template-columns: 58px minmax(220px, .7fr) 1fr; gap: 14px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.endpoint-stack p { color: var(--muted); margin: 0; font-size: 13px; }
.method { justify-self: start; padding: 4px 6px; font: 10px var(--mono); color: var(--paper); font-weight: 800; }
.method.get { background: var(--blue); }
.method.post { background: var(--signal); }
.section-copy h3 { margin: 30px 0 10px; }
.billing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.billing-grid article { border: 1px solid var(--line); padding: 18px; background: var(--panel); }
.billing-grid span { color: var(--muted); font: 11px var(--mono); }
.billing-grid strong { display: block; color: var(--signal); font: 28px var(--mono); margin: 10px 0 5px; }
.billing-grid p { color: var(--muted); margin: 0; font-size: 12px; }
.rule-list { padding-left: 20px; color: #adc0c6; }
.rule-list li { margin: 8px 0; }
.docs-boundary { margin-top: 20px; border: 1px dashed var(--line-strong); padding: 18px; }
.docs-boundary p { color: var(--muted); margin: 6px 0 0; }
.reference-footer { display: flex; justify-content: space-between; padding: 26px 0; color: var(--muted); font: 11px var(--mono); }
.reference-footer a { color: var(--signal); }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 640px; padding: 58px 32px 24px; }
  .auth-copy h1 { font-size: clamp(64px, 15vw, 100px); }
  .bridge-stage { height: 460px; bottom: -18px; }
  .auth-panel { border-left: 0; border-top: 1px solid var(--line); padding: 50px 24px; }
  .auth-card { width: 100%; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .docs-grid { grid-template-columns: 1fr; }
  .api-mode-grid, .code-pair, .billing-grid { grid-template-columns: 1fr; }
  .reference-mapping { grid-template-columns: 1fr; }
  .reference-mapping > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .reference-mapping > div:last-child { border-bottom: 0; }
  .quality-rail { grid-template-columns: 1fr; }
  .quality-rail > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .studio-shell { grid-template-columns: 1fr; }
  .studio-result { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 700px) {
  .topbar { padding: 0 16px; }
  .brand-word { font-size: 21px; }
  .app-shell { grid-template-columns: 1fr; }
  .app-shell::before { inset: 128px 0 0; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; position: sticky; top: 64px; z-index: 8; }
  .identity { display: none; }
  .nav { display: flex; overflow-x: auto; }
  .nav button { white-space: nowrap; }
  .content { padding: 24px 14px 50px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 112px; padding: 15px; }
  .metric .number { font-size: 27px; }
  .page-head { align-items: start; flex-direction: column; }
  .auth-story { min-height: 540px; padding: 44px 20px 18px; }
  .auth-copy .eyebrow { letter-spacing: .27em; }
  .auth-copy h1 { font-size: clamp(54px, 20vw, 78px); }
  .auth-copy p { font-size: 15px; }
  .bridge-stage { left: -20%; right: -18%; height: 365px; bottom: -12px; }
  .auth-community { grid-template-columns: 1fr; }
  .auth-community .community-trigger { justify-self: start; }
  .api-mode-grid { grid-template-columns: 1fr; }
  .docs-cta { align-items: stretch; flex-direction: column; }
  .support-panel { grid-template-columns: 1fr; padding: 20px; }
  .support-panel .community-trigger { justify-self: start; }
  .reference-shell { grid-template-columns: 1fr; }
  .reference-nav { display: none; }
  .reference-main { padding: 0 16px 45px; }
  .reference-hero { padding-top: 54px; }
  .reference-section { grid-template-columns: 1fr; gap: 8px; }
  .mode-heading { grid-template-columns: 1fr; gap: 10px; }
  .mode-note, .contract-list > div, .endpoint-stack > div { grid-template-columns: 1fr; }
  .quality-rail > div { grid-template-columns: 58px 1fr; }
  .quality-rail small { grid-column: 1 / -1; }
  .docs-scope { display: none; }
  .studio-page-head { flex-direction: row; align-items: center; }
  .studio-page-head > div:first-child p { display: none; }
  .studio-balance { min-width: 138px; padding: 10px 12px; }
  .studio-balance strong { font-size: 21px; }
  .studio-section { padding: 17px 15px; }
  .studio-section-head { align-items: start; flex-direction: column; gap: 3px; }
  .studio-mode-tabs { grid-template-columns: 1fr; }
  .quality-choice, .upload-pair { grid-template-columns: 1fr; }
  .reference-upload-grid { grid-template-columns: repeat(3, 1fr); }
  .upload-slot.compact { min-height: 72px; padding: 9px 5px; }
  .studio-settings { grid-template-columns: 1fr 1fr; padding: 17px 15px 7px; }
  .studio-settings label:last-child { grid-column: 1 / -1; }
  #studioFormError { padding: 0 15px; }
  .studio-submit { margin: 8px 15px 17px; }
  .result-stage { min-height: 260px; }
  .result-stage.portrait { height: min(68vh, 560px); min-height: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* EQUAI monochrome glass system · visual baseline r31 */
:root {
  --bg: #0B0B0C;
  --bg2: #101012;
  --paper: #0B0B0C;
  --panel: rgba(30, 30, 33, .60);
  --panel2: rgba(18, 18, 20, .66);
  --line: rgba(255, 255, 255, .13);
  --line2: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .20);
  --text: #EDEDEB;
  --t2: rgba(255, 255, 255, .62);
  --t3: rgba(255, 255, 255, .40);
  --muted: rgba(255, 255, 255, .50);
  --blue: #254EFF;
  --blue-rgb: 37, 78, 255;
  --signal: #EDEDEB;
  --signal-dark: rgba(255, 255, 255, .06);
  --amber: rgba(255, 255, 255, .70);
  --red: rgba(255, 255, 255, .58);
  --violet: #EDEDEB;
  --motion: running;
  --grain: .28;
  --vid: .46;
  --ease: cubic-bezier(.2, .85, .2, 1);
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Plus Jakarta Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

html { min-width: 320px; background: var(--bg); }
body {
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  overflow-x: hidden;
}
body.auth-mode { background:transparent; }
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(rgba(11,11,12,.72), rgba(11,11,12,.90));
}
button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.visual-backdrop { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: var(--bg) url('/equai-bg-poster.webp') center/cover no-repeat; }
.ambient-video { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.06); opacity: var(--vid); animation: apSlow 36s ease-in-out infinite alternate; animation-play-state: var(--motion); }
.console-ambient-video { display:none; }
.login-ambient-video { opacity:.72; filter:grayscale(1) contrast(1.12) brightness(1.2); }
body:not(.auth-mode) .login-ambient-video { display:none; }
body:not(.auth-mode) .console-ambient-video { display:block; }
.auth-mode .ambient-shade { background:linear-gradient(rgba(11,11,12,.20),rgba(11,11,12,.44)); }
.ambient-shade { position: absolute; inset: 0; background: linear-gradient(rgba(11,11,12,.72), rgba(11,11,12,.90)); }
.ambient-glow { position: absolute; width: 48vw; height: 48vw; border-radius: 50%; opacity: .13; filter: blur(28px); pointer-events: none; animation-play-state: var(--motion); }
.glow-a { left: -18vw; bottom: -24vw; background: #aaa; animation: apDrift 28s ease-in-out infinite; }
.glow-b { right: -21vw; top: -26vw; background: #777; animation: apDrift2 34s ease-in-out infinite; }
.ambient-motes { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ambient-motes i { position: absolute; bottom: -12px; width: 2px; height: 2px; border-radius: 50%; background: rgba(255,255,255,.72); box-shadow: 0 0 8px rgba(255,255,255,.42); animation: apRise 20s linear infinite; animation-play-state: var(--motion); }
.ambient-motes i:nth-child(1) { left:4%; animation-duration:19s; animation-delay:-7s }.ambient-motes i:nth-child(2) { left:11%; animation-duration:23s; animation-delay:-14s }
.ambient-motes i:nth-child(3) { left:18%; animation-duration:16s; animation-delay:-4s }.ambient-motes i:nth-child(4) { left:27%; animation-duration:25s; animation-delay:-18s }
.ambient-motes i:nth-child(5) { left:33%; animation-duration:21s; animation-delay:-10s }.ambient-motes i:nth-child(6) { left:39%; animation-duration:18s; animation-delay:-2s }
.ambient-motes i:nth-child(7) { left:46%; animation-duration:26s; animation-delay:-21s }.ambient-motes i:nth-child(8) { left:53%; animation-duration:20s; animation-delay:-12s }
.ambient-motes i:nth-child(9) { left:59%; animation-duration:24s; animation-delay:-6s }.ambient-motes i:nth-child(10) { left:65%; animation-duration:17s; animation-delay:-13s }
.ambient-motes i:nth-child(11) { left:72%; animation-duration:22s; animation-delay:-17s }.ambient-motes i:nth-child(12) { left:78%; animation-duration:26s; animation-delay:-9s }
.ambient-motes i:nth-child(13) { left:84%; animation-duration:19s; animation-delay:-3s }.ambient-motes i:nth-child(14) { left:89%; animation-duration:23s; animation-delay:-20s }
.ambient-motes i:nth-child(15) { left:94%; animation-duration:18s; animation-delay:-11s }.ambient-motes i:nth-child(16) { left:98%; animation-duration:25s; animation-delay:-16s }
.film-grain { position:absolute; inset:-50%; opacity:var(--grain); pointer-events:none; background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.10'/%3E%3C/svg%3E"); }

.topbar {
  height: 68px;
  padding: 0 24px;
  border-color: var(--line2);
  background: var(--panel2);
  backdrop-filter: blur(30px);
  box-shadow: none;
}
.brand-wordmark { display:block; width:102px; height:auto; object-fit:contain; }
.brand-slogan { color:var(--t3); font:200 10px var(--sans); letter-spacing:.42em; white-space:nowrap; }
.btn {
  min-height: 40px;
  padding: 9px 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.035);
  transition: transform .27s var(--ease), border-color .27s, background .27s, color .27s;
}
.btn:hover { color:#fff; border-color:rgba(255,255,255,.32); background:rgba(255,255,255,.075); transform:translateY(-1px); }
.btn.primary { position:relative; overflow:hidden; color:#0B0B0C; border-color:#F2F2F0; background:linear-gradient(105deg,#F2F2F0 0 44%,#fff 49%,#F2F2F0 54% 100%); background-size:300% 100%; font-weight:800; animation:apShine 3.2s ease-in-out infinite; animation-play-state:var(--motion); }
.btn.primary:hover { color:#0B0B0C; border-color:#fff; background-color:#fff; }
.btn.ghost { background:rgba(255,255,255,.025); }
.btn.danger-btn { color:var(--t2); border-color:var(--line); }
.btn.small { min-height:34px; padding:6px 10px; font-size:12.5px; }

/* Login / register · approved 1d */
body.auth-mode .topbar { position:fixed; inset:0 0 auto; z-index:10; background:transparent; border:0; backdrop-filter:none; }
body.auth-mode .top-actions { display:none; }
body.auth-mode .brand-slogan { color:#b9d8ff; font-size:11px; font-weight:400; text-shadow:0 0 18px rgba(105,167,255,.34); }
.auth-shell { min-height:100vh; display:grid; grid-template-columns:1fr; place-items:center; padding:92px 20px 52px; overflow:hidden; background:transparent; }
.auth-shell::before { content:""; position:absolute; inset:0; background:radial-gradient(circle at 20% 45%,rgba(255,255,255,.075),transparent 26%),radial-gradient(circle at 80% 68%,rgba(255,255,255,.05),transparent 22%); animation:apDrift 28s ease-in-out infinite; animation-play-state:var(--motion); }
.auth-story { display:none; }
.auth-panel { width:100%; display:grid; place-items:center; padding:0; overflow:visible; border:0; background:transparent; backdrop-filter:none; }
.auth-panel::before { display:none; }
.auth-stack { width:min(500px,100%); display:grid; gap:0; animation:apIn .72s var(--ease) both; }
.auth-card { width:100%; padding:30px; border:1px solid var(--line); border-radius:20px; background:rgba(24,24,27,.66); box-shadow:0 34px 100px rgba(0,0,0,.52),inset 0 1px rgba(255,255,255,.055); backdrop-filter:blur(30px); }
.auth-card-brand { display:grid; justify-items:center; gap:12px; margin-bottom:14px; }
.auth-card-brand img { width:146px; height:auto; }
.auth-card-brand span { color:#b9d8ff; font:400 11px var(--sans); letter-spacing:.42em; text-shadow:0 0 16px rgba(105,167,255,.30); }
.switcher { margin:0 0 18px; border-bottom:1px solid var(--line2); }
.switcher button { min-height:44px; color:var(--t3); border-bottom:1px solid transparent; font-weight:600; }
.switcher button.active { color:var(--text); border-bottom-color:var(--text); text-shadow:none; }
.auth-card .eyebrow { display:none; }
.auth-card h2 { margin:4px 0 4px; font-size:18px; text-align:center; letter-spacing:-.02em; }
.form-intro { margin:0 0 18px; color:var(--t3); font-size:12px; text-align:center; }
.field { gap:7px; margin:14px 0; }
.field label { color:var(--t2); font-size:12px; font-weight:600; }
.field input,.field select { min-height:46px; padding:11px 13px; color:var(--text); border:1px solid var(--line); border-radius:12px; background:rgba(8,8,10,.72); }
.field input:hover { border-color:rgba(255,255,255,.26); }
.field input:focus { border-color:rgba(255,255,255,.72); background:rgba(8,8,10,.9); box-shadow:0 0 0 3px rgba(var(--blue-rgb),.13); }
.password-field button span { border-color:var(--t3); }
.password-field button.showing span { border-color:var(--blue); }
.password-field button.showing span::after { background:var(--blue); }
.form-error { min-height:20px; color:rgba(255,255,255,.72); font-size:12px; }
.auth-card .btn.primary { min-height:48px; border-radius:14px; color:#0B0B0C; border-color:#F2F2F0; background:linear-gradient(105deg,#F2F2F0 0 44%,#fff 49%,#F2F2F0 54% 100%); background-size:300% 100%; box-shadow:none; }
.auth-community { padding:14px 16px 0; display:flex; justify-content:center; border:0; }
.auth-community > div { display:none; }
.community-trigger { min-height:44px; padding:9px 14px; color:var(--t2); border:1px solid var(--line); border-radius:99px; background:rgba(18,18,20,.52); }
.community-trigger i { color:var(--blue); }
.community-trigger:hover { color:var(--text); border-color:rgba(255,255,255,.3); background:rgba(255,255,255,.06); }

/* Console shell */
body:not(.auth-mode) .topbar { position:fixed; top:0; left:232px; right:0; z-index:20; height:68px; justify-content:flex-end; }
body:not(.auth-mode) .topbar .brand, body:not(.auth-mode) .brand-slogan { display:none; }
.app-shell { min-height:100vh; grid-template-columns:232px minmax(0,1fr); background:transparent; }
.app-shell::before { display:none; }
.sidebar { position:sticky; top:0; height:100vh; z-index:21; display:flex; flex-direction:column; padding:24px 16px 18px; border-right:1px solid var(--line2); background:rgba(14,14,16,.72); backdrop-filter:blur(30px); }
.sidebar-brand { order:0; display:grid; gap:9px; padding:0 10px 25px; border-bottom:1px solid var(--line2); }
.sidebar-brand img { width:92px; height:auto; }
.sidebar-brand span { color:var(--t3); font:200 8px var(--sans); letter-spacing:.42em; white-space:nowrap; }
.nav { order:1; display:grid; gap:5px; padding-top:18px; }
.nav button { min-height:43px; padding:8px 11px; gap:9px; color:var(--t2); border:1px solid transparent; border-radius:12px; font-weight:600; }
.nav-symbol { width:9px; height:9px; overflow:hidden; border:0; border-radius:50%; color:transparent; background:rgba(255,255,255,.18); font-size:0; }
.nav button:hover { color:var(--text); border-color:var(--line2); background:rgba(255,255,255,.04); transform:none; }
.nav button.active { color:var(--text); border-color:var(--line2); background:rgba(255,255,255,.09); box-shadow:none; font-weight:700; }
.nav button.active .nav-symbol { background:#fff; box-shadow:none; }
.identity { order:2; margin:auto 0 0; padding:16px 14px; display:block; border:1px solid var(--line2); border-radius:14px; background:var(--panel); backdrop-filter:blur(26px); }
.identity > div { min-width:0; }
.identity span { display:block; color:var(--t3); font:500 10px var(--mono); letter-spacing:.1em; text-transform:uppercase; }
.identity strong { margin-top:8px; color:var(--text); font-size:14px; overflow:hidden; text-overflow:ellipsis; }
.identity code { margin-top:5px; color:var(--t3); font:10px var(--mono); overflow-wrap:anywhere; }
.app-launch-mark { border-color:transparent; background:transparent; }
.app-launch-mark img { display:block; width:100%; height:100%; object-fit:contain; }
.content { max-width:none; padding:96px 30px 80px; }
.page { animation:apIn .72s var(--ease) both; }
.page > * { animation:apIn .72s var(--ease) both; }
.page > *:nth-child(2) { animation-delay:.045s }.page > *:nth-child(3) { animation-delay:.09s }.page > *:nth-child(4) { animation-delay:.135s }
.page-head { min-height:50px; margin:0 0 26px; align-items:center; }
.page-head h1 { margin:0; color:var(--text); font-size:24px; letter-spacing:-.035em; }
.page-head .eyebrow { display:none; }
.page-head p { color:var(--t3); }
.status { min-height:30px; padding:5px 10px; gap:8px; color:var(--t2); border:1px solid var(--line); background:rgba(12,12,14,.58); font:500 10.5px var(--mono); }
.status::before { width:6px; height:6px; background:var(--t3); }
.status.running::before,.status.dispatching::before { position:relative; background:var(--blue); box-shadow:0 0 10px rgba(var(--blue-rgb),.8); animation:apBlink 1.6s linear infinite; animation-play-state:var(--motion); }
.status.running::after,.status.dispatching::after { content:""; position:absolute; left:7px; width:8px; height:8px; border:1px solid var(--blue); border-radius:50%; animation:apRing 2.2s ease-out infinite; animation-play-state:var(--motion); }
.status.completed::before,.status.active::before { background:#fff; }
.status.failed::before,.status.disabled::before,.status.queued::before,.status.pending::before { background:var(--t3); }

.metric-grid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.metric { min-height:136px; padding:22px; border:1px solid var(--line2); border-radius:18px; background:var(--panel); box-shadow:none; backdrop-filter:blur(26px); transition:transform .27s var(--ease),border-color .27s; }
.metric::before,.metric::after { display:none; }
.metric:hover { transform:translateY(-2px); border-color:var(--line); }
.metric .label { color:var(--t2); font:600 12.5px var(--sans); text-transform:none; }
.metric .number { margin-top:12px; color:var(--text); font:800 32px/1 var(--sans); letter-spacing:-.045em; }
.metric.primary-metric { border-color:var(--line2); background:var(--panel); }
.metric.primary-metric .number { color:var(--text); }
.credit-rail { height:3px; margin-top:20px; border-radius:99px; background:rgba(255,255,255,.11); }
.credit-rail span { background:#F2F2F0; box-shadow:none; }
.panel { margin-top:16px; overflow:hidden; border:1px solid var(--line2); border-radius:18px; background:var(--panel); box-shadow:none; backdrop-filter:blur(26px); }
.panel-head { min-height:60px; padding:14px 20px; border-bottom:1px solid var(--line2); }
.panel-head h2 { color:var(--text); font-size:15px; }
.overview-call-copy small { color:var(--t3); }
.overview-call-panel { scroll-margin-top:84px; }
.overview-call-panel .panel-head select { min-width:132px; }
.call-retention-note { border-bottom-color:var(--line2); color:var(--t3); background:rgba(255,255,255,.018); }
.notice { margin-bottom:16px; padding:14px 16px; color:var(--t2); border:1px solid var(--line2); border-left:2px solid var(--text); border-radius:0 12px 12px 0; background:rgba(255,255,255,.045); }
.notice.good { color:var(--t2); border-color:var(--line2); border-left-color:var(--text); background:rgba(255,255,255,.045); }
.support-panel { position:relative; grid-template-columns:minmax(0,1fr) auto; padding:26px; background:var(--panel); }
.support-panel::after { content:""; position:absolute; left:-18%; bottom:0; width:18%; height:1px; background:linear-gradient(90deg,transparent,#fff,transparent); animation:apSweepX 5.5s linear infinite; animation-play-state:var(--motion); }
.support-copy { padding:0; }
.support-copy .eyebrow { color:var(--t3); }
.support-copy h2 { margin:8px 0; color:var(--text); font-size:22px; }
.support-copy p { color:var(--t2); }

/* Video workspace */
.studio-page-head { align-items:center; }
.studio-page-head p { margin:5px 0 0; color:var(--t3); }
.studio-balance { min-width:158px; padding:11px 14px; border:1px solid var(--line); border-radius:14px; background:var(--panel); box-shadow:none; backdrop-filter:blur(26px); }
.studio-balance span { color:var(--t3); }
.studio-balance strong { color:var(--text); font:800 24px var(--sans); }
.studio-balance small { color:var(--t2); }
.studio-shell { grid-template-columns:minmax(420px,.9fr) minmax(430px,1.1fr); gap:16px; }
.studio-compose,.studio-result { border:1px solid var(--line2); border-radius:20px; background:var(--panel); box-shadow:none; backdrop-filter:blur(26px); }
.studio-compose form { display:grid; }
.studio-mode-section { order:1 }.studio-assets { order:2 }.prompt-section { order:3 }.studio-quality-section { order:4 }.studio-settings { order:5 }#studioFormError { order:6 }.studio-submit { order:7 }
.studio-section { padding:20px; border-bottom:1px solid var(--line2); }
.studio-section-head { margin-bottom:12px; }
.studio-section-head > span,.studio-section-head > label { color:var(--text); font-size:13px; }
.studio-section-head small { color:var(--t3); }
.studio-mode-tabs { gap:7px; padding:4px; border:1px solid var(--line); border-radius:12px; background:rgba(8,8,10,.55); }
.studio-mode-tabs button { min-height:42px; color:var(--t2); border:1px solid transparent; border-radius:9px; }
.studio-mode-tabs button:hover { color:var(--text); }
.studio-mode-tabs button.active { color:#0B0B0C; border-color:#F2F2F0; background:#F2F2F0; box-shadow:none; font-weight:700; }
.prompt-section textarea { min-height:150px; padding:15px; color:var(--text); border:1px solid var(--line); border-radius:12px; background:rgba(8,8,10,.64); line-height:1.65; caret-color:#fff; }
.prompt-section textarea:focus { border-color:rgba(255,255,255,.7); box-shadow:0 0 0 3px rgba(var(--blue-rgb),.12); }
.quality-choice { grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; }
.quality-choice label > span { min-height:92px; padding:15px; border:1px solid var(--line); border-radius:12px; background:rgba(8,8,10,.5); }
.quality-choice label:hover > span { border-color:rgba(255,255,255,.3); }
.quality-choice b { color:var(--text); font:700 20px var(--sans); }
.quality-choice em { color:var(--t2); font:500 11px var(--mono); }
.quality-choice small { color:var(--t3); }
.quality-choice input:checked + span { border:1.5px solid rgba(255,255,255,.72); background:rgba(255,255,255,.09); box-shadow:none; }
.quality-choice input:focus-visible + span { outline-color:var(--blue); }
.upload-pair,.reference-upload-grid { gap:9px; }
.upload-slot { min-height:100px; padding:16px; border:1px dashed var(--line); border-radius:12px; background:rgba(8,8,10,.45); }
.upload-slot:hover { border-color:rgba(255,255,255,.35); background:rgba(255,255,255,.045); }
.upload-slot strong { color:var(--text); }
.upload-slot small { color:var(--t3); }
.keyframe-slot.has-preview { min-height:238px; background:#08080A; }
.upload-preview { object-fit:contain; }
.reference-file { border-color:var(--line2); background:rgba(8,8,10,.46); }
.reference-file-preview { background:#08080A; }
.studio-settings { padding:18px 20px 8px; gap:9px; }
.studio-settings label { color:var(--t3); }
.studio-settings select,.studio-settings input { min-height:42px; border:1px solid var(--line); border-radius:9px; background:rgba(8,8,10,.68); color:var(--text); }
.studio-settings label > small { color:var(--t3); }
#studioFormError { padding:0 20px; }
.studio-submit { min-height:52px; margin:8px 20px 20px; border-radius:14px; }
.studio-submit > small { color:rgba(11,11,12,.62); }
.studio-result { position:sticky; top:84px; max-height:calc(100vh - 104px); scrollbar-color:rgba(255,255,255,.16) transparent; }
.result-stage { position:relative; min-height:340px; border-bottom:1px solid var(--line2); background:#08080A; isolation:isolate; }
.result-stage::before { content:""; position:absolute; inset:0; z-index:3; padding:1px; pointer-events:none; border-radius:inherit; opacity:0; background:conic-gradient(from 0deg,transparent 0 72%,rgba(255,255,255,.78) 80%,var(--blue) 86%,transparent 92%); -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask-composite:exclude; animation:apRot 7s linear infinite; animation-play-state:var(--motion); }
.result-stage.is-generating::before { opacity:.7; }
.result-stage.is-generating::after { content:""; position:absolute; left:0; right:0; top:-20%; z-index:2; height:24%; pointer-events:none; background:linear-gradient(180deg,transparent,rgba(255,255,255,.1),transparent); animation:apScan 3.8s linear infinite; animation-play-state:var(--motion); }
.result-stage.is-complete { box-shadow:inset 0 0 0 1px rgba(255,255,255,.24); }
.result-stage video { width:100%; height:100%; object-fit:contain; background:#08080A; }
.result-stage.portrait { height:min(64vh,650px); }
.result-stage.landscape { aspect-ratio:16/9; min-height:0; }
.result-empty { color:var(--t2); }
.result-empty span { color:var(--t2); border-color:var(--line); background:rgba(255,255,255,.04); }
.result-empty small { color:var(--t3); }
.result-progress { padding:18px; background:rgba(16,16,18,.72); }
.result-progress-head code { color:var(--t3); }
.result-progress-head strong { color:var(--text); }
.result-progress-rail,.task-mini-progress { background:rgba(255,255,255,.09); }
.result-progress-rail i,.task-mini-progress i { background:repeating-linear-gradient(115deg,#F2F2F0 0 11px,rgba(255,255,255,.54) 11px 22px); background-size:44px 100%; animation:apStripe 1.1s linear infinite; animation-play-state:var(--motion); }
.result-progress p { color:var(--t2); }
.studio-task-center { border-top:1px solid var(--line2); background:rgba(12,12,14,.48); }
.task-center-head { border-bottom:1px solid var(--line2); }
.task-center-head strong { color:var(--text); }
.task-center-head small { color:var(--t3); }
.task-refresh { min-height:34px; color:var(--t2); border:1px solid var(--line); border-radius:9px; background:rgba(255,255,255,.03); }
.task-refresh:hover { color:var(--text); border-color:rgba(255,255,255,.3); }
.task-center-empty { color:var(--t3); border-color:var(--line); }
.studio-task-card { border:1px solid var(--line2); border-radius:12px; background:rgba(255,255,255,.035); transition:transform .27s var(--ease),border-color .27s,background .27s; }
.studio-task-card:hover { transform:translateY(-2px); border-color:var(--line); background:rgba(255,255,255,.055); }
.studio-task-card.selected { border-color:rgba(255,255,255,.34); background:rgba(255,255,255,.08); box-shadow:inset 2px 0 #fff; }
.task-card-head strong { color:var(--text); }
.task-mini-state { color:var(--t2); border-color:var(--line2); background:rgba(8,8,10,.72); }
.task-mini-state.running,.task-mini-state.dispatching { color:#fff; border-color:rgba(var(--blue-rgb),.5); }
.task-mini-state.completed,.task-mini-state.queued,.task-mini-state.failed,.task-mini-state.cancelled { color:var(--t2); border-color:var(--line); }
.task-card-meta,.task-card-foot { color:var(--t3); }
.task-card-foot b { color:var(--text); }
.studio-task-card.is-complete { border-color:rgba(var(--blue-rgb),.38); background:linear-gradient(105deg,rgba(var(--blue-rgb),.12),rgba(255,255,255,.035) 52%); }
.studio-task-card.is-complete:hover { border-color:rgba(var(--blue-rgb),.64); background:linear-gradient(105deg,rgba(var(--blue-rgb),.18),rgba(255,255,255,.055) 55%); }
.studio-task-card.is-complete.selected { border-color:rgba(var(--blue-rgb),.72); box-shadow:inset 2px 0 var(--blue); }
.studio-task-card.is-complete .task-mini-state.completed { color:#9ac7ff; border-color:rgba(var(--blue-rgb),.48); background:rgba(var(--blue-rgb),.1); }
.studio-task-card.is-complete .task-mini-progress i,
.studio-result.is-complete .result-progress-rail i { background:linear-gradient(90deg,#347fe8,#72b5ff); animation:none; box-shadow:0 0 16px rgba(var(--blue-rgb),.32); }
.studio-task-card.is-complete .task-card-foot b,
.studio-result.is-complete .result-progress-head strong { color:#83baff; }
.studio-task-card.is-running,.studio-task-card.is-dispatching { border-color:rgba(var(--amber-rgb),.68); background:linear-gradient(105deg,rgba(var(--amber-rgb),.12),rgba(255,255,255,.035) 52%); }
.studio-task-card.is-running:hover,.studio-task-card.is-dispatching:hover { border-color:rgba(var(--amber-rgb),.82); background:linear-gradient(105deg,rgba(var(--amber-rgb),.17),rgba(255,255,255,.055) 55%); }
.studio-task-card.is-running.selected,.studio-task-card.is-dispatching.selected { box-shadow:inset 2px 0 #fff; }
.studio-task-card.is-running .task-mini-state,.studio-task-card.is-dispatching .task-mini-state { color:var(--amber); border-color:rgba(var(--amber-rgb),.62); background:rgba(var(--amber-rgb),.1); }
.studio-task-card.is-running .task-mini-progress i,.studio-task-card.is-dispatching .task-mini-progress i { background:var(--amber); animation:none; box-shadow:0 0 12px rgba(var(--amber-rgb),.28); }
.studio-task-card.is-running .task-card-foot b,.studio-task-card.is-dispatching .task-card-foot b { color:var(--amber); }
.result-stage.is-complete { box-shadow:inset 0 0 0 1px rgba(var(--blue-rgb),.55),0 0 28px rgba(var(--blue-rgb),.08); }
.studio-note-section { padding-top:14px; }
.studio-note-section input { width:100%; min-height:42px; padding:10px 12px; border:1px solid var(--line); border-radius:9px; background:rgba(8,8,10,.68); color:var(--text); }
.studio-note-section input::placeholder { color:var(--t3); }
.studio-note-section input:focus { outline:0; border-color:rgba(var(--blue-rgb),.62); box-shadow:0 0 0 3px rgba(var(--blue-rgb),.11); }

/* Tables, keys, modal and merchant docs */
.table-wrap { overflow-x:auto; }
table { font-size:12.5px; }
th { padding:13px 16px; color:var(--t3); background:rgba(8,8,10,.58); font:500 10.5px var(--mono); }
td { padding:15px 16px; color:var(--t2); border-top:1px solid var(--line2); }
tr:hover td { background:rgba(255,255,255,.035); }
.call-prompt { color:var(--text); }
.call-task-meta,.call-task-meta code { color:var(--t3); }
.call-result-cell { min-width:210px; }
.call-result-expiry { display:block; margin-bottom:9px; color:var(--t3); }
.call-result-actions { display:flex; align-items:center; gap:7px; flex-wrap:nowrap; }
.call-result-actions .btn { white-space:nowrap; }
.call-result-actions .btn.primary { animation:none; }
.call-result-actions .btn:disabled { cursor:not-allowed; opacity:.35; transform:none; }
.key-card { border-color:var(--line2); }
.key-card code { color:var(--text); }
.empty { color:var(--t3); }
.danger,.signal { color:var(--t2); }
.modal { background:rgba(5,5,6,.82); backdrop-filter:blur(16px); }
.modal-card { border:1px solid var(--line); border-radius:18px; background:rgba(24,24,27,.9); box-shadow:0 28px 90px rgba(0,0,0,.65); backdrop-filter:blur(30px); }
.community-card { background:rgba(24,24,27,.92); }
.community-card .eyebrow { color:var(--t3); }
.community-card a { background:#fff; }
.modal-close { color:var(--t2); border-color:var(--line); background:rgba(8,8,10,.75); }
.modal-close:hover { color:var(--text); border-color:rgba(255,255,255,.34); }
.secret { color:var(--text); border:1px dashed var(--line-strong); border-radius:12px; background:#08080A; }
.prompt-detail-panel { border-color:var(--line); border-radius:12px; background:#08080A; overflow:hidden; }
.prompt-detail-panel header { border-color:var(--line2); }
.toast { left:50%; right:auto; bottom:34px; transform:translateX(-50%); max-width:min(420px,calc(100vw - 28px)); padding:13px 20px; color:var(--text); border:1px solid var(--line); border-radius:14px; background:rgba(18,18,20,.92); box-shadow:0 20px 60px rgba(0,0,0,.6); backdrop-filter:blur(26px); animation:apToast .4s var(--ease) both; }
.code-block { color:#C9C9C6; background:#08080A; }
.embedded-reference { border-top:1px solid var(--line2); }
.embedded-reference .reference-hero { padding-top:28px; }
.reference-shell { max-width:1600px; }
.docs-body { background:var(--bg) url('/equai-bg-poster.webp') center/cover fixed no-repeat; }
.reference-nav { border-color:var(--line2); background:var(--panel2); backdrop-filter:blur(30px); }
.reference-nav a { color:var(--t2); }
.reference-nav a:hover,.reference-nav a:focus-visible { color:var(--text); border-left-color:var(--text); background:rgba(255,255,255,.05); }

@media (max-width: 760px) {
  .prompt-detail-grid { grid-template-columns: 1fr; }
  .prompt-detail-panel pre { min-height: 150px; max-height: 30vh; }
}
.reference-version,.reference-hero,.reference-section,.mode-section,.contract-list,.contract-list > div,.endpoint-stack,.endpoint-stack > div { border-color:var(--line2); }
.reference-version span,.reference-hero > p,.section-copy > p,.mode-heading p,.contract-list span,.endpoint-stack p,.rule-list,.docs-boundary p { color:var(--t2); }
.reference-version strong,.section-marker,.reference-hero code,.section-copy code,.mode-section code { color:var(--text); }
.endpoint-line,.code-card { border-color:var(--line); background:#08080A; }
.endpoint-line > span,.method.post,.method.get { color:#0B0B0C; background:#F2F2F0; }
.copy-inline,.copy-code { color:var(--t2); border-color:var(--line); }
.copy-inline:hover,.copy-code:hover { color:var(--text); border-color:rgba(255,255,255,.35); }
.quality-rail,.api-table,.reference-mapping,.billing-grid article,.docs-boundary { border-color:var(--line); }
.quality-rail > div + div,.reference-mapping > div { border-color:var(--line2); }
.quality-rail span,.billing-grid strong,.reference-mapping b { color:var(--text); }
.quality-rail small,.billing-grid span,.billing-grid p { color:var(--t3); }
.mode-token { color:var(--text); border-color:var(--line); background:rgba(255,255,255,.055); }
.mode-note,.mode-note.warning { color:var(--t2); border-left-color:var(--text); background:rgba(255,255,255,.05); }
.mode-note span,.mode-note.warning span { color:var(--t2); }
.contract-list strong { color:var(--text); }
.quality-dot.q720,.quality-dot.q1080 { background:var(--text); }

@keyframes apIn { 0% { opacity:0; transform:translateY(16px) scale(.985); filter:blur(8px) } 100% { opacity:1; transform:none; filter:blur(0) } }
@keyframes apDrift { 0%,100% { transform:translate3d(0,0,0) scale(1) } 50% { transform:translate3d(3%,-4%,0) scale(1.14) } }
@keyframes apDrift2 { 0%,100% { transform:translate3d(0,0,0) scale(1.12) } 50% { transform:translate3d(-5%,3%,0) scale(1) } }
@keyframes apRise { 0% { transform:translateY(0); opacity:0 } 14% { opacity:.8 } 100% { transform:translateY(-100vh); opacity:0 } }
@keyframes apShine { 0% { background-position:0 50% } 100% { background-position:300% 50% } }
@keyframes apStripe { 0% { background-position:0 0 } 100% { background-position:44px 0 } }
@keyframes apRot { to { transform:rotate(360deg) } }
@keyframes apBlink { 0%,45% { opacity:1 } 50%,100% { opacity:.18 } }
@keyframes apRing { 0% { transform:scale(.7); opacity:.5 } 100% { transform:scale(2.2); opacity:0 } }
@keyframes apScan { 0% { transform:translateY(-30%); opacity:0 } 16%,84% { opacity:1 } 100% { transform:translateY(500%); opacity:0 } }
@keyframes apSlow { 0% { transform:scale(1.05) } 100% { transform:scale(1.14) } }
@keyframes apSweepX { 0% { left:-18%; opacity:0 } 12%,88% { opacity:1 } 100% { left:102%; opacity:0 } }
@keyframes apToast { from { opacity:0; transform:translate(-50%,26px) } to { opacity:1; transform:translate(-50%,0) } }

@media (max-width: 1024px) {
  body:not(.auth-mode) .topbar { left:210px; }
  .app-shell { grid-template-columns:210px minmax(0,1fr); }
  .content { padding-inline:20px; }
  .metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .studio-shell { grid-template-columns:1fr; }
  .studio-result { position:static; max-height:none; overflow:visible; }
}

@media (max-width: 768px) {
  :root { --vid:.40; --grain:.16; }
  .ambient-video,body:not(.auth-mode) .console-ambient-video { display:none; }
  .ambient-glow { filter:blur(20px); }
  body:not(.auth-mode) .topbar { left:0; height:58px; padding:0 14px; background:rgba(12,12,14,.84); }
  .app-shell { display:block; padding-top:58px; }
  .sidebar { position:sticky; top:58px; width:100%; height:auto; padding:8px 10px; border:0; border-bottom:1px solid var(--line2); background:rgba(14,14,16,.88); }
  .sidebar-brand,.identity { display:none; }
  .nav { display:flex; gap:5px; padding:0; overflow-x:auto; scrollbar-width:none; }
  .nav::-webkit-scrollbar { display:none; }
  .nav button { min-width:max-content; min-height:44px; padding:8px 12px; }
  .nav-symbol { display:none; }
  .content { padding:26px 14px 56px; }
  .page-head { align-items:flex-start; }
  .studio-page-head { align-items:center; }
  .studio-page-head > div:first-child p { display:none; }
  .studio-balance { min-width:136px; }
  .support-panel { grid-template-columns:1fr; }
  .support-panel .community-trigger { justify-self:start; }
  .reference-shell { grid-template-columns:1fr; }
  .reference-nav { display:none; }
  .reference-main { padding:0 16px 45px; }
}

@media (max-width: 520px) {
  .topbar { padding:0 16px; }
  .brand-wordmark { width:86px; }
  .brand-slogan { font-size:8px; letter-spacing:.28em; }
  .auth-shell { padding:78px 14px 36px; }
  .auth-card { padding:22px 18px; border-radius:18px; }
  .auth-card-brand img { width:126px; }
  .auth-card-brand span { font-size:8px; letter-spacing:.32em; }
  .metric-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .metric { min-height:108px; padding:15px; border-radius:14px; }
  .metric .number { font-size:24px; }
  .page-head h1 { font-size:22px; }
  .overview-call-panel .panel-head { align-items:flex-start; }
  .overview-call-panel .panel-head select { min-width:118px; padding-inline:9px; }
  .studio-section { padding:16px 14px; }
  .studio-section-head { align-items:flex-start; flex-direction:column; gap:3px; }
  .studio-mode-tabs { grid-template-columns:1fr; }
  .quality-choice,.upload-pair { grid-template-columns:1fr; }
  .reference-upload-grid { grid-template-columns:repeat(3,1fr); }
  .upload-slot.compact { min-height:72px; padding:9px 5px; }
  .studio-settings { grid-template-columns:1fr 1fr; padding:16px 14px 7px; }
  .studio-settings label:last-child { grid-column:1/-1; }
  #studioFormError { padding:0 14px; }
  .studio-submit { margin:8px 14px 16px; }
  .result-stage { min-height:260px; }
  .result-stage.portrait { height:min(68vh,560px); min-height:360px; }
  .support-panel { padding:20px; }
  .community-card { padding:22px 16px; }
  .quality-rail > div { grid-template-columns:58px 1fr; }
  .quality-rail small { grid-column:1/-1; }
  .reference-section,.mode-heading,.mode-note,.contract-list > div,.endpoint-stack > div { grid-template-columns:1fr; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion:paused; }
  .ambient-video,body:not(.auth-mode) .console-ambient-video { display:none; }
  *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; animation-play-state:paused !important; }
}

/* Console information architecture: account, creative tools, and API access. */
.nav { gap:19px; }
.nav-group { display:grid; gap:5px; }
.nav-group-label { padding:0 11px 3px; color:var(--t3); font:600 9px var(--mono); letter-spacing:.13em; text-transform:uppercase; }
.overview-ledger-panel { scroll-margin-top:84px; }
.overview-ledger-panel .panel-head { align-items:center; }
.ledger-period { color:var(--t3); font:10px var(--mono); }
.ledger-more-wrap { display:flex; justify-content:center; padding:12px; border-top:1px solid var(--line2); }
.ledger-more-wrap:has(button.hidden) { display:none; }
.page-back { display:inline-flex; align-items:center; gap:6px; margin:0 0 10px; padding:0; border:0; color:var(--t2); background:transparent; font:600 11px var(--sans); cursor:pointer; transition:color .18s, transform .18s; }
.page-back:hover { color:var(--text); transform:translateX(-2px); }
.page-back:focus-visible { outline:2px solid var(--text); outline-offset:4px; border-radius:3px; }
.apps-page-head { margin-bottom:24px; }
.apps-page-head p,.api-page-head p { margin:8px 0 0; color:var(--t3); font-size:13px; }
.apps-count { padding:7px 10px; color:var(--t2); border-left:2px solid var(--text); font:10px var(--mono); }
.app-launch-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; max-width:1080px; }
.app-launch-card { min-height:145px; display:grid; grid-template-columns:42px minmax(0,1fr) 20px; align-items:start; gap:16px; padding:22px; border:1px solid var(--line2); border-radius:16px; color:var(--text); background:linear-gradient(135deg,rgba(255,255,255,.055),rgba(255,255,255,.018) 70%); text-align:left; cursor:pointer; transition:transform .22s var(--ease),border-color .22s,background .22s; }
.app-launch-card:hover { transform:translateY(-3px); border-color:rgba(255,255,255,.32); background:linear-gradient(135deg,rgba(255,255,255,.095),rgba(255,255,255,.035) 70%); }
.app-launch-card:focus-visible { outline:2px solid var(--text); outline-offset:3px; }
.app-launch-featured { min-height:166px; grid-column:1/-1; grid-template-columns:52px minmax(0,1fr) 22px; align-items:center; border-color:rgba(255,255,255,.25); background:linear-gradient(112deg,rgba(255,255,255,.105),rgba(255,255,255,.03) 58%,rgba(255,255,255,.012)); }
.app-launch-mark { width:42px; height:42px; display:grid; place-items:center; border:1px solid var(--line); border-radius:12px; color:var(--text); background:rgba(255,255,255,.07); font:16px var(--mono); }
.app-launch-featured .app-launch-mark { width:52px; height:52px; border-color:rgba(255,255,255,.3); font-size:19px; }
.app-launch-copy { display:grid; justify-items:start; gap:7px; }
.app-launch-copy small { color:var(--t3); font:9px var(--mono); letter-spacing:.13em; }
.app-launch-copy strong { color:var(--text); font-size:17px; letter-spacing:-.025em; }
.app-launch-featured .app-launch-copy strong { font-size:22px; }
.app-launch-copy > span { color:var(--t2); font-size:12px; line-height:1.65; }
.app-launch-arrow { align-self:center; color:var(--t3); font:18px var(--mono); transition:transform .2s,color .2s; }
.app-launch-card:hover .app-launch-arrow { color:var(--text); transform:translate(2px,-2px); }
.api-page-head { margin-bottom:17px; }
.api-tabs { display:flex; width:max-content; max-width:100%; gap:4px; margin-bottom:22px; padding:4px; border:1px solid var(--line2); border-radius:12px; background:rgba(255,255,255,.025); }
.api-tabs button { min-height:37px; padding:8px 15px; border:1px solid transparent; border-radius:8px; color:var(--t2); background:transparent; font:600 12px var(--sans); cursor:pointer; transition:color .18s,background .18s,border-color .18s; }
.api-tabs button:hover { color:var(--text); }
.api-tabs button.active { color:#111113; border-color:#F2F2F0; background:#F2F2F0; }
.api-tabs button:focus-visible { outline:2px solid var(--text); outline-offset:3px; }
.api-section-head { min-height:0; margin:0 0 14px; }
.api-section-head h2 { margin:0; color:var(--text); font-size:18px; letter-spacing:-.025em; }
.api-section-head p { margin:6px 0 0; color:var(--t3); font-size:12px; }
.api-section > .notice { margin-bottom:14px; }
.api-section > .panel { margin-top:0; }
.api-section .embedded-reference { border:1px solid var(--line2); border-radius:16px; overflow:hidden; background:var(--panel); }

@media (max-width:768px) {
  .nav { align-items:stretch; gap:12px; }
  .nav-group { display:flex; align-items:center; gap:4px; flex:none; }
  .nav-group + .nav-group { padding-left:10px; border-left:1px solid var(--line2); }
  .nav-group-label { padding:0 4px; font-size:8px; letter-spacing:.06em; }
  .nav button { min-width:max-content; }
  .app-launch-card { min-height:132px; padding:17px; }
  .app-launch-featured { min-height:145px; }
  .api-section-head { align-items:center; }
}

@media (max-width:520px) {
  .nav { gap:8px; }
  .nav-group { gap:2px; }
  .nav-group + .nav-group { padding-left:7px; }
  .nav-group-label { display:none; }
  .app-launch-grid { grid-template-columns:1fr; gap:9px; }
  .app-launch-featured { grid-column:auto; }
  .app-launch-card,.app-launch-featured { min-height:116px; grid-template-columns:42px minmax(0,1fr) 18px; gap:12px; padding:15px; }
  .app-launch-featured .app-launch-mark { width:42px; height:42px; font-size:16px; }
  .app-launch-featured .app-launch-copy strong { font-size:18px; }
  .app-launch-copy > span { font-size:11px; }
  .apps-count { padding-inline:7px; font-size:9px; }
  .api-tabs { width:100%; }
  .api-tabs button { flex:1; }
}

/* Theme control: dark by default; the selected palette is remembered locally. */
.theme-toggle { min-height:36px; display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:7px 12px; border:1px solid var(--line); border-radius:999px; color:var(--t2); background:rgba(255,255,255,.035); font:600 11px var(--sans); cursor:pointer; transition:background .18s,border-color .18s,color .18s,transform .18s; }
.theme-toggle:hover { color:var(--text); border-color:var(--line-strong); background:rgba(255,255,255,.08); transform:translateY(-1px); }
.theme-toggle svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.theme-toggle:focus-visible { outline:2px solid var(--blue); outline-offset:3px; }

html[data-theme="light"] {
  color-scheme:light; --bg:#F3F5F8; --bg2:#E9EEF5; --paper:#F4F6F9;
  --panel:#FFFFFF; --panel2:rgba(255,255,255,.92);
  --line:rgba(26,43,65,.16); --line2:rgba(26,43,65,.09); --line-strong:rgba(26,43,65,.24);
  --text:#182433; --t2:rgba(24,36,51,.76); --t3:rgba(24,36,51,.55); --muted:rgba(24,36,51,.62);
  --blue:#315FD8; --blue-rgb:49,95,216; --signal:#315FD8; --signal-dark:rgba(49,95,216,.09);
  --amber:#95661A; --amber-rgb:149,102,26; --red:#B7353B; --violet:#644EB0; --grain:0; --vid:0;
}
html[data-theme="light"],html[data-theme="light"] body { color:var(--text); background:var(--paper); }
html[data-theme="light"] body::after { display:none; }
html[data-theme="light"] .visual-backdrop { background:radial-gradient(circle at 70% 0%,#E7EEFC 0,transparent 36%),linear-gradient(145deg,#F8FAFD,#EEF2F7); }
html[data-theme="light"] .visual-backdrop > .ambient-video,
html[data-theme="light"] .visual-backdrop > .ambient-shade,
html[data-theme="light"] .visual-backdrop > .ambient-glow,
html[data-theme="light"] .visual-backdrop > .ambient-motes,
html[data-theme="light"] .visual-backdrop > .film-grain { display:none; }
html[data-theme="light"] .topbar { border-color:var(--line2); background:rgba(255,255,255,.86); }
html[data-theme="light"] .brand-wordmark,html[data-theme="light"] .sidebar-brand > img,html[data-theme="light"] .auth-card-brand img { filter:brightness(0) saturate(100%); }
html[data-theme="light"] .brand-slogan,html[data-theme="light"] body.auth-mode .brand-slogan,html[data-theme="light"] .auth-card-brand span { color:#40516A; text-shadow:none; }
html[data-theme="light"] .auth-shell { background:transparent; }
html[data-theme="light"] .auth-shell::before { opacity:.38; }
html[data-theme="light"] .auth-card { border-color:var(--line); background:rgba(255,255,255,.92); box-shadow:0 28px 80px rgba(28,45,70,.13),inset 0 1px rgba(255,255,255,.9); }
html[data-theme="light"] .auth-card h2,html[data-theme="light"] .field label { color:var(--text); }
html[data-theme="light"] .field input,html[data-theme="light"] .field select,
html[data-theme="light"] .creative-page textarea,html[data-theme="light"] .creative-page select,
html[data-theme="light"] .creative-page .field input { color:var(--text); border-color:var(--line); background:#FFFFFF; }
html[data-theme="light"] .field input:hover { border-color:var(--line-strong); }
html[data-theme="light"] .field input:focus { border-color:var(--blue); background:#FFFFFF; }
html[data-theme="light"] .form-error { color:#A43137; }
html[data-theme="light"] .community-trigger { color:var(--t2); border-color:var(--line); background:rgba(255,255,255,.84); }
html[data-theme="light"] .community-trigger:hover { color:var(--text); border-color:var(--line-strong); background:#FFFFFF; }
html[data-theme="light"] .btn.primary,html[data-theme="light"] .auth-card .btn.primary { color:#FFFFFF; border-color:#315FD8; background:#315FD8; box-shadow:0 8px 22px rgba(49,95,216,.16); animation:none; }
html[data-theme="light"] .btn.primary:hover,html[data-theme="light"] .auth-card .btn.primary:hover { color:#FFFFFF; border-color:#244DB8; background:#244DB8; }

html[data-theme="light"] .sidebar { border-color:var(--line2); background:rgba(255,255,255,.84); }
html[data-theme="light"] .nav button:hover { color:var(--text); border-color:var(--line2); background:rgba(49,95,216,.045); }
html[data-theme="light"] .nav button.active { color:var(--text); border-color:rgba(49,95,216,.18); background:rgba(49,95,216,.085); }
html[data-theme="light"] .nav button.active .nav-symbol { background:var(--blue); }
html[data-theme="light"] .identity { border-color:var(--line2); background:#FFFFFF; }
html[data-theme="light"] .identity strong { color:var(--text); }
html[data-theme="light"] .status { color:var(--t2); border-color:var(--line); background:rgba(255,255,255,.78); }
html[data-theme="light"] .status.completed::before,html[data-theme="light"] .status.active::before { background:var(--blue); }
html[data-theme="light"] .metric,html[data-theme="light"] .metric.primary-metric { background:#FFFFFF; }
html[data-theme="light"] .credit-rail { background:#E5EAF1; }
html[data-theme="light"] .credit-rail span { background:var(--blue); }
html[data-theme="light"] .panel { border-color:var(--line2); background:#FFFFFF; box-shadow:0 12px 32px rgba(25,42,66,.045); }
html[data-theme="light"] .call-retention-note { color:var(--t3); background:#F7F9FC; }
html[data-theme="light"] .notice { color:#4D5260; border-color:var(--line2); border-left-color:var(--blue); background:#F1F5FC; }
html[data-theme="light"] .notice.good { color:#2B5C50; border-color:rgba(36,130,95,.16); border-left-color:#25825F; background:#EEF8F2; }
html[data-theme="light"] .app-launch-card { border-color:var(--line2); background:linear-gradient(135deg,#FFFFFF,#F6F8FB 72%); box-shadow:0 12px 30px rgba(24,38,58,.04); }
html[data-theme="light"] .app-launch-card:hover { border-color:rgba(49,95,216,.35); background:linear-gradient(135deg,#FFFFFF,#F0F4FC 72%); }
html[data-theme="light"] .app-launch-mark,html[data-theme="light"] .app-launch-featured .app-launch-mark { border-color:transparent; background:transparent; }
html[data-theme="light"] .app-launch-copy strong { color:var(--text); }
html[data-theme="light"] .app-launch-copy > span { color:var(--t2); }
html[data-theme="light"] .api-tabs { border-color:var(--line2); background:#EDF1F6; }
html[data-theme="light"] .api-tabs button { color:var(--t2); }
html[data-theme="light"] .api-tabs button.active { color:#FFFFFF; border-color:var(--blue); background:var(--blue); }
html[data-theme="light"] .api-section .embedded-reference { border-color:var(--line2); background:#FFFFFF; }

html[data-theme="light"] .studio-balance,html[data-theme="light"] .studio-compose,html[data-theme="light"] .studio-result { border-color:var(--line2); background:#FFFFFF; }
html[data-theme="light"] .studio-mode-tabs,html[data-theme="light"] .quality-choice label > span,
html[data-theme="light"] .upload-slot,html[data-theme="light"] .studio-settings select,
html[data-theme="light"] .studio-settings input,html[data-theme="light"] .studio-note-section input { color:var(--text); border-color:var(--line); background:#F7F9FC; }
html[data-theme="light"] .studio-section-head > span,html[data-theme="light"] .studio-section-head > label,
html[data-theme="light"] .quality-choice b,html[data-theme="light"] .upload-slot strong { color:var(--text); }
html[data-theme="light"] .studio-mode-tabs button.active { color:#FFFFFF; border-color:var(--blue); background:var(--blue); }
html[data-theme="light"] .quality-choice input:checked + span { border-color:var(--blue); background:#EEF3FF; }
html[data-theme="light"] .upload-slot:hover { border-color:var(--blue); background:#F0F5FF; }
html[data-theme="light"] .studio-task-center { border-color:var(--line2); background:#F6F8FB; }
html[data-theme="light"] .studio-task-card,html[data-theme="light"] .task-mini-state,html[data-theme="light"] .task-refresh { color:var(--t2); border-color:var(--line2); background:#FFFFFF; }
html[data-theme="light"] .studio-task-card:hover { background:#F4F7FC; }
html[data-theme="light"] .studio-task-card.selected { border-color:rgba(49,95,216,.36); background:#EEF3FF; box-shadow:inset 2px 0 var(--blue); }
html[data-theme="light"] .studio-task-card.is-complete .task-mini-state.completed { color:#2854B6; }
html[data-theme="light"] .modal { background:rgba(22,31,44,.34); }
html[data-theme="light"] .modal-card { border-color:var(--line); background:rgba(255,255,255,.96); box-shadow:0 28px 90px rgba(23,38,60,.22); }
html[data-theme="light"] .community-card { background:#FFFFFF; }
html[data-theme="light"] .modal-close { color:var(--t2); border-color:var(--line); background:#F6F8FB; }
html[data-theme="light"] .secret,html[data-theme="light"] .prompt-detail-panel,html[data-theme="light"] .code-block { color:var(--text); border-color:var(--line); background:#F4F6F9; }
html[data-theme="light"] .toast { color:var(--text); border-color:var(--line); background:rgba(255,255,255,.96); box-shadow:0 16px 48px rgba(23,38,60,.18); }
html[data-theme="light"] th { color:var(--t3); background:#F0F3F7; }
html[data-theme="light"] td { color:var(--t2); }
html[data-theme="light"] tr:hover td { background:#F7F9FC; }

html[data-theme="light"] .creative-page { --creative-blue:#315FD8; --creative-line:#D5DDE8; }
html[data-theme="light"] .creative-form,html[data-theme="light"] .creative-results,html[data-theme="light"] .creative-task { color:var(--text); border-color:var(--line2); background:#FFFFFF; }
html[data-theme="light"] .creative-source-preview,html[data-theme="light"] .creative-role,html[data-theme="light"] .creative-project-overview { border-color:var(--line2); background:#F4F6F9; }
html[data-theme="light"] .creative-page input[type=file] { color:var(--text); }
html[data-theme="light"] .creative-page input::file-selector-button { color:var(--text); border-color:var(--line); background:#EDF1F6; }
html[data-theme="light"] #editorReferences figure { border-color:var(--line); background:#F5F7FA; }
html[data-theme="light"] #editorReferences img { background:#EEF1F5; }
html[data-theme="light"] #editorReferences figcaption,html[data-theme="light"] .creative-image-previews figcaption { color:var(--t2); }
html[data-theme="light"] .creative-result-media video,html[data-theme="light"] .creative-result-media img { background:#E9EDF3; }
html[data-theme="light"] .theme-toggle { color:var(--t2); border-color:var(--line); background:rgba(255,255,255,.8); }
html[data-theme="light"] .theme-toggle:hover { color:var(--text); background:#FFFFFF; }

.overview-record-switch { display:inline-flex; gap:4px; margin:0 0 14px; padding:4px; border:1px solid var(--line2); border-radius:12px; background:var(--panel); }
.overview-record-switch button { min-height:36px; padding:7px 15px; border:0; border-radius:8px; color:var(--t3); background:transparent; font:600 12px var(--sans); cursor:pointer; }
.overview-record-switch button:hover { color:var(--text); }
.overview-record-switch button.active { color:var(--text); background:var(--bg2); box-shadow:0 1px 3px rgba(0,0,0,.12); }
.overview-record-switch button:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
html[data-theme="light"] .overview-record-switch { background:#EDF1F6; }
html[data-theme="light"] .overview-record-switch button.active { color:#FFFFFF; background:#315FD8; box-shadow:0 2px 7px rgba(49,95,216,.2); }

/* Admin data views: keep the operations page compact and switch one dataset
   at a time instead of stacking three long tables vertically. */
.admin-data-tabs { display:flex; align-items:center; gap:5px; margin:18px 0 14px; padding:4px; width:max-content; max-width:100%; overflow:auto; border:1px solid var(--line2); border-radius:12px; background:var(--panel); }
.admin-data-tab { min-height:36px; padding:7px 17px; border:0; border-radius:8px; color:var(--t3); background:transparent; font:600 12px var(--sans); white-space:nowrap; cursor:pointer; transition:color .16s,background .16s,box-shadow .16s; }
.admin-data-tab:hover { color:var(--text); }
.admin-data-tab.active { color:var(--text); background:var(--bg2); box-shadow:0 1px 3px rgba(0,0,0,.14); }
.admin-data-tab:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.admin-data-panel { min-height:220px; }
html[data-theme="light"] .admin-data-tabs { background:#EDF1F6; }
html[data-theme="light"] .admin-data-tab.active { color:#FFFFFF; background:#315FD8; box-shadow:0 2px 7px rgba(49,95,216,.2); }
@media (max-width:700px) { .admin-data-tabs { width:100%; } .admin-data-tab { flex:1 0 auto; } }

@media (max-width:600px) {
  .theme-toggle { width:36px; min-width:36px; padding:0; }
  .theme-toggle span { display:none; }
}

/* Match the UI9 login canvas while preserving the legacy login layout and form. */
body.auth-mode,
body.auth-mode .auth-shell,
body.auth-mode .visual-backdrop {
  background: #000;
}
body.auth-mode::after,
body.auth-mode .auth-shell::before,
body.auth-mode .visual-backdrop > .ambient-video,
body.auth-mode .visual-backdrop > .ambient-shade,
body.auth-mode .visual-backdrop > .ambient-glow,
body.auth-mode .visual-backdrop > .ambient-motes,
body.auth-mode .visual-backdrop > .film-grain {
  display: none;
}

/* UI9-style entry cover for the legacy console; the existing auth forms remain intact. */
body.auth-mode.landing-active .topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}
body.auth-mode.landing-active .brand-slogan,
body.auth-mode.landing-active #themeToggle {
  display: none;
}
.login-landing {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: #000;
  color: #f4f2ef;
}
#loginOrbitMount { position: absolute; inset: 0; }
.login-landing #orbit-stage {
  --orbit-card-radius: clamp(12px, 1.2vw, 22px);
  position: fixed;
  inset: 0;
  min-height: 0;
  margin: 0;
  perspective: var(--persp, 1150px);
  perspective-origin: 50% 50%;
  overflow: hidden;
  touch-action: none;
  isolation: isolate;
  z-index: 5;
  background: #000;
  color: #f4f2ef;
  user-select: none;
}
.login-landing #orbit-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  background: radial-gradient(ellipse 88% 92% at 50% 50%, transparent 48%, rgba(0,0,0,.26) 80%, rgba(0,0,0,.72) 100%);
}
.login-landing .orbit-world {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.login-landing #orb {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}
.login-landing .orbit-card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--cw, 220px);
  height: calc(var(--cw, 220px) / 1.5);
  margin: calc(var(--cw, 220px) / -3) 0 0 calc(var(--cw, 220px) / -2);
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  color: inherit;
  cursor: grab;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
}
.login-landing .orbit-card.tall {
  height: calc(var(--cw, 220px) * 1.25);
  margin-top: calc(var(--cw, 220px) * -.625);
}
.login-landing .orbit-card figure {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: var(--orbit-card-radius);
  background: #0a0a0a;
  box-shadow: 0 20px 70px rgba(0,0,0,.28);
  transition: transform .5s ease;
}
.login-landing .orbit-card:hover figure { transform: scale(1.045); }
.login-landing .orbit-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.login-landing .orbit-card figure::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0,0,0,var(--shade,0));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
  pointer-events: none;
}
.login-landing .scene-access {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 15;
  width: calc(280px * var(--access-scale, 1));
  transform-origin: 0 0;
  transform: translate(-50%,-50%);
  text-align: center;
  color: #f4f2ef;
}
.login-landing .scene-access-logo {
  display: block;
  width: calc(220px * var(--access-scale, 1));
  height: auto;
  margin: 0 auto;
  user-select: none;
  pointer-events: none;
}
.login-landing .scene-buttons {
  position: absolute;
  top: calc(100% + 28px * var(--access-scale, 1));
  left: 50%;
  display: flex;
  gap: calc(14px * var(--access-scale, 1));
  transform: translateX(-50%);
  white-space: nowrap;
}
.login-landing .scene-buttons button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: calc(132px * var(--access-scale, 1));
  min-height: calc(48px * var(--access-scale, 1));
  padding: calc(14px * var(--access-scale, 1)) calc(20px * var(--access-scale, 1));
  border: 1px solid #b5b1ab;
  border-radius: 15px;
  background: rgba(0,0,0,.65);
  color: #f4f2ef;
  font: 400 13px/1.2 var(--sans, Arial, sans-serif);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: color .2s, background .2s, transform .2s;
}
.login-landing .scene-buttons button:first-child {
  border-color: #f4f2ef;
  background: #f4f2ef;
  color: #111;
}
.login-landing .scene-buttons button:hover { background: #d2cec8; color: #111; }
.login-landing .scene-buttons button:focus-visible { outline: 2px solid #f4f2ef; outline-offset: 5px; }
.login-cover-footer {
  position: fixed;
  z-index: 35;
  right: 34px;
  bottom: max(48px, calc(env(safe-area-inset-bottom) + 24px));
  left: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(244,242,239,.64);
  font-size: 14px;
  pointer-events: none;
}
.login-cover-footer button { pointer-events: auto; }
.login-cover-footer-left { display: flex; align-items: flex-end; }
.login-cover-footer-copy { display: grid; padding-bottom: 2px; }
.about-open {
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(244,242,239,.6);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.about-open:hover { color: #fff; }
.about-open:focus-visible { outline: 2px solid #f4f2ef; outline-offset: 5px; }
.about-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(420px, calc(100vw - 36px));
  max-width: none;
  max-height: min(92dvh, 900px);
  margin: 0;
  padding: 34px 34px 30px;
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  background: rgba(20,20,21,.94);
  color: #f4f2ef;
  text-align: center;
  box-shadow: 0 24px 90px rgba(0,0,0,.58);
  backdrop-filter: blur(20px);
}
.about-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.about-dialog[open] { animation: about-dialog-in .22s ease-out both; }
@keyframes about-dialog-in {
  from { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: 0 0; }
}
.about-dialog-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(244,242,239,.66);
  font: 300 30px/1 Arial, sans-serif;
  cursor: pointer;
}
.about-dialog-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.about-tagline { margin: 8px 24px 20px; font-size: clamp(18px, 4vw, 22px); line-height: 1.5; letter-spacing: .03em; }
.about-divider { width: 44px; height: 1px; margin: 0 auto 18px; background: rgba(255,255,255,.28); }
.about-dialog h2 { margin: 0 0 12px; color: rgba(244,242,239,.82); font-size: 14px; font-weight: 500; letter-spacing: .12em; }
.about-qr { display: block; width: min(100%, 300px); height: auto; margin: 0 auto; border-radius: 8px; background: #fff; }
.login-cover-footer .bgm-control {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #c7c3bc;
  font-size: 21px;
  cursor: pointer;
  transition: color .2s, transform .2s;
}
.login-cover-footer .bgm-control:hover { color: #fff; transform: scale(1.08); }
.login-cover-footer .bgm-control.is-playing { color: #fff; text-shadow: 0 0 16px rgba(255,255,255,.55); }
.auth-home-return {
  position: absolute;
  z-index: 40;
  top: 78px;
  left: 22px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(0,0,0,.42);
  color: var(--muted);
  cursor: pointer;
}
.auth-home-return:hover { color: var(--text); border-color: rgba(255,255,255,.46); }
body.auth-form-active #loginLanding { position: fixed; inset: 0; z-index: 5; min-height: 0; }
body.auth-form-active #loginLanding #orbit-stage::after {
  background: linear-gradient(rgba(0,0,0,.34),rgba(0,0,0,.42)), radial-gradient(ellipse 88% 92% at 50% 50%, transparent 40%, rgba(0,0,0,.25) 82%, rgba(0,0,0,.68) 100%);
}
body.auth-form-active #loginLanding .scene-access,
body.auth-form-active #loginLanding .login-cover-footer { display: none; }
body.auth-form-active #authView {
  position: fixed;
  inset: 0;
  z-index: 20;
  min-height: 100dvh;
  padding: 92px 20px 52px;
  overflow: auto;
  background: transparent;
}
@media (max-width: 640px) {
  .login-landing .scene-buttons { gap: 10px; }
  .login-landing .scene-buttons button { min-width: 116px; padding: 12px 15px; }
  .login-cover-footer { right: 20px; bottom: max(40px, calc(env(safe-area-inset-bottom) + 24px)); left: 20px; }
  .about-dialog { padding: 32px 22px 22px; border-radius: 18px; }
  .about-qr { width: min(100%, 270px); }
}
@media (prefers-reduced-motion: reduce) {
  .login-landing .orbit-card figure,
  .login-cover-footer .bgm-control { transition: none; }
}

/* 忘记密码 entry under the login button */
.auth-forgot { margin:14px 0 0; text-align:center; }
.text-button { padding:4px 6px; color:var(--t3, rgba(255,255,255,.6)); font-size:12px; background:none; border:0; cursor:pointer; }
.text-button:hover, .text-button:focus-visible { color:var(--text, #fff); text-decoration:underline; }

/* 「导出为 Markdown」 at the top of the API reference */
.docs-export { display:flex; justify-content:flex-end; margin:0 0 12px; }
.docs-body .docs-export { padding-top:84px; margin-bottom:-60px; position:relative; z-index:2; }
