:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --bg-2: #101218;
  --panel: #151820;
  --panel-2: #1b1f29;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f5f3ee;
  --muted: #969cab;
  --muted-2: #6d7382;
  --accent: #ff8b5d;
  --accent-2: #ffcc78;
  --pink: #ff6f91;
  --green: #7be1b1;
  --danger: #ff7b7b;
  --radius: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .38);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background:
    radial-gradient(1100px 700px at 92% -5%, rgba(255, 128, 78, .13), transparent 55%),
    radial-gradient(900px 700px at 5% 100%, rgba(255, 111, 145, .08), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 14px/1.55 Inter, "SF Pro Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  letter-spacing: -.01em;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow { display: inline-block; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  color: #1a0d07; font-weight: 900; font-size: 21px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent) 52%, var(--pink));
  box-shadow: 0 10px 30px rgba(255, 121, 76, .3);
}
.logo-mark { position: relative; overflow: hidden; background: #0b0c10; border: 1px solid rgba(255,255,255,.14); box-shadow: none; padding: 0; }
html[data-logo-theme="light"] .logo-mark { background: #fff; border-color: rgba(0,0,0,.14); }
.brand-logo { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-fallback { display: none; width: 100%; height: 100%; place-items: center; color: #1a0d07; font-size: 21px; font-weight: 900; background: linear-gradient(145deg, var(--accent-2), var(--accent) 52%, var(--pink)); }
.logo-mark.no-logo .brand-logo { display: none; }
.logo-mark.no-logo .brand-fallback { display: grid; }
.logo-theme-btn { width: 27px; height: 27px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 8px; background: #151922; color: var(--accent-2); font-size: 13px; cursor: pointer; display: grid; place-items: center; }
.logo-theme-btn:hover { border-color: rgba(255,139,93,.4); }
.side-brand-row { display: flex; align-items: center; gap: 6px; padding: 0 4px 22px 0; }
.side-brand-row .side-brand { flex: 1; min-width: 0; }
button.side-brand { border: 0; background: transparent; text-align: left; cursor: pointer; width: 100%; padding: 0 8px 0 4px; }
button.side-brand:hover strong { color: var(--accent-2); }

/* ---------- auth ---------- */
.auth-shell { min-height: 100svh; display: grid; place-items: center; position: relative; overflow: hidden; padding: 24px; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.auth-orb-one { width: 430px; height: 430px; top: -180px; left: -110px; background: radial-gradient(circle, rgba(255, 137, 82, .22), transparent 68%); }
.auth-orb-two { width: 520px; height: 520px; right: -210px; bottom: -240px; background: radial-gradient(circle, rgba(255, 92, 136, .16), transparent 65%); }
.auth-wrap { position: relative; width: min(100%, 420px); z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin: 0 0 24px 4px; }
.auth-brand div { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand strong { font-size: 18px; letter-spacing: -.04em; }
.auth-brand > div span { color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.auth-brand .logo-theme-btn { margin-left: auto; }
.auth-card { background: rgba(21, 24, 32, .82); border: 1px solid var(--line); border-radius: 26px; padding: 30px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.auth-card h1 { margin: 8px 0 8px; font-size: clamp(34px, 8vw, 44px); line-height: .98; letter-spacing: -.07em; font-weight: 850; }
.auth-copy { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.stack { display: flex; flex-direction: column; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span, .control-label { color: #c7cbd4; font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #0e1016;
  color: var(--text); outline: none; padding: 12px 13px; transition: border .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus { border-color: rgba(255, 139, 93, .7); box-shadow: 0 0 0 3px rgba(255, 139, 93, .11); }
.field input::placeholder, .field textarea::placeholder { color: #5e6471; }
.primary-btn {
  width: 100%; border: 0; border-radius: 12px; padding: 13px 16px; cursor: pointer;
  color: #1b0e08; font-weight: 850; background: linear-gradient(110deg, var(--accent-2), var(--accent) 55%, var(--pink));
  transition: transform .14s, filter .14s;
}
.primary-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.primary-btn:disabled { opacity: .5; cursor: wait; }
.auth-row { display: flex; justify-content: center; gap: 6px; color: var(--muted); font-size: 12px; margin-top: 18px; }
.text-btn { border: 0; background: none; color: var(--accent-2); font-weight: 800; cursor: pointer; padding: 0; }
.text-btn:hover { text-decoration: underline; }
.text-btn.small { font-size: 11px; }
.password-help { margin: 16px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 11px; text-align: center; }
.password-help b { color: #b9bec9; }
.auth-foot { margin: 18px 0 0; text-align: center; color: #5d6370; font-size: 10px; letter-spacing: .06em; }
.form-error { border: 1px solid rgba(255, 107, 107, .24); background: rgba(255, 87, 87, .08); color: #ff9d9d; border-radius: 10px; padding: 9px 11px; font-size: 12px; }

/* ---------- app shell ---------- */
.app-shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100svh; }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; padding: 22px 14px 16px; border-right: 1px solid var(--line); background: rgba(12, 14, 19, .72); backdrop-filter: blur(14px); }
.side-brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 22px; }
.side-brand div { display: flex; flex-direction: column; line-height: 1.15; }
.side-brand strong { letter-spacing: -.05em; font-size: 17px; }
.side-brand > div span { color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .14em; }
.side-label { color: #555b69; font-size: 9px; letter-spacing: .16em; font-weight: 800; padding: 0 10px 9px; }
.service-list { display: flex; flex-direction: column; gap: 5px; }
.service-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: 10px; cursor: pointer; transition: background .15s, border .15s; }
.service-item.active { background: linear-gradient(115deg, rgba(255, 139, 93, .15), rgba(255, 111, 145, .05)); border-color: rgba(255, 139, 93, .22); }
.service-item.disabled { opacity: .45; cursor: default; }
.service-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #0d0f15; border: 1px solid var(--line); color: var(--accent-2); font-size: 14px; }
.service-item span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.service-item b { font-size: 12.5px; }
.service-item small { color: var(--muted-2); font-size: 10px; margin-top: 2px; }
.service-caret { margin-left: auto; color: var(--muted-2); font-size: 10px; transition: transform .15s; }
.service-item[aria-expanded="true"] .service-caret { transform: rotate(180deg); color: var(--accent-2); }
.service-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(123, 225, 177, .08); }
.side-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: 9px; padding: 0 6px 12px; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg, #293040, #151923); border: 1px solid var(--line); color: var(--accent-2); font-size: 11px; font-weight: 900; }
.side-user div { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.side-user b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.side-user small { color: var(--muted-2); font-size: 10px; }
.side-logout { border: 0; background: none; color: var(--muted-2); font-size: 11px; cursor: pointer; padding: 5px 6px; }
.side-logout:hover { color: var(--danger); }
.side-withdraw { display: block; border: 0; background: none; color: #6d7382; font-size: 10px; cursor: pointer; padding: 3px 6px; }
.side-withdraw:hover { color: var(--danger); }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(2,3,6,.58); backdrop-filter: blur(2px); }
.main { min-width: 0; padding: 0 34px 64px; }
.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1160px; margin: 0 auto; }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 3px 0 0; font-size: 21px; letter-spacing: -.04em; }
.mobile-menu { display: none; font-size: 20px; color: var(--muted); cursor: pointer; }
.ghost-btn { border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: #d8dbe3; border-radius: 10px; padding: 9px 13px; font-size: 11px; font-weight: 750; cursor: pointer; transition: background .15s, border .15s; }
.ghost-btn:hover { background: rgba(255, 255, 255, .06); border-color: var(--line-strong); }
.workspace { max-width: 1160px; margin: 0 auto; }
.hero-copy { padding: 26px 0 30px; }
.hero-copy h2 { margin: 8px 0 12px; font-size: clamp(34px, 5vw, 58px); line-height: .97; letter-spacing: -.075em; font-weight: 850; }
.hero-copy h2 span { color: var(--accent); }
.hero-copy p { max-width: 640px; margin: 0; color: var(--muted); font-size: 13.5px; word-break: keep-all; text-wrap: pretty; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head h3 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.template-card { position: relative; text-align: left; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(27, 31, 41, .8), rgba(17, 19, 26, .8)); border-radius: 18px; padding: 19px; cursor: pointer; overflow: hidden; transition: border .16s, transform .16s, background .16s; }
.template-card:hover { transform: translateY(-2px); border-color: rgba(255, 139, 93, .32); }
.template-card.active { border-color: rgba(255, 139, 93, .62); background: linear-gradient(145deg, rgba(255, 139, 93, .12), rgba(20, 22, 30, .9) 58%); }
.template-card::after { content: ""; position: absolute; right: -32px; top: -45px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 139, 93, .12), transparent 68%); pointer-events: none; }
.template-card .t-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #0c0e13; border: 1px solid var(--line); font-size: 16px; margin-bottom: 14px; }
.template-card h4 { margin: 0; font-size: 15px; letter-spacing: -.03em; }
.template-card p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.template-card .t-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 12px; }
.tag { display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; color: #a9afbb; font-size: 9.5px; background: rgba(255, 255, 255, .025); }
.template-card .select-mark { position: absolute; right: 14px; top: 14px; width: 17px; height: 17px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; color: transparent; font-size: 10px; }
.template-card.active .select-mark { background: var(--accent); border-color: var(--accent); color: #1c0d06; }

.preset-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: linear-gradient(120deg, rgba(255, 139, 93, .055), rgba(20, 23, 31, .58) 55%, rgba(255, 111, 145, .035)); }
.preset-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.preset-head h3 { margin: 4px 0 0; font-size: 16px; letter-spacing: -.03em; }
.lock-chip { color: #c9a689; background: rgba(255, 139, 93, .08); border: 1px solid rgba(255, 139, 93, .18); border-radius: 999px; padding: 4px 9px; font-size: 9.5px; white-space: nowrap; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.preset-chip { display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--line); background: #0d0f14; border-radius: 9px; padding: 7px 10px; min-width: 82px; }
.preset-chip small { color: var(--muted-2); font-size: 8.5px; letter-spacing: .04em; text-transform: uppercase; }
.preset-chip b { color: #d9dce4; font-size: 11px; font-weight: 700; }
.preset-note { margin: 11px 0 0; color: var(--muted-2); font-size: 10.5px; }

.composer { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(18, 21, 28, .72); box-shadow: 0 16px 60px rgba(0, 0, 0, .18); overflow: hidden; }
.composer-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); }
.composer-left { padding: 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 17px; }
.composer-right { padding: 20px; display: flex; flex-direction: column; }
.control-group { display: flex; flex-direction: column; gap: 8px; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.label-row b { color: var(--accent-2); font-size: 11px; }
.segmented { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); background: #0c0e13; border-radius: 11px; }
.segmented button { flex: 1; border: 0; border-radius: 8px; background: transparent; color: #8e95a3; padding: 8px 7px; font-size: 11px; font-weight: 700; cursor: pointer; transition: background .14s, color .14s; }
.segmented button small { display: block; font-size: 8.5px; font-weight: 500; color: #626977; margin-top: 1px; }
.segmented button.active { background: #242a36; color: var(--text); box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.segmented button.active small { color: #b9c0ce; }
.ratio-switch button { letter-spacing: .02em; }
.range { -webkit-appearance: none; width: 100%; height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--range, 0%), #2a2e39 var(--range, 0%), #2a2e39 100%); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--accent-2); border: 3px solid #1b1510; box-shadow: 0 0 0 3px rgba(255, 139, 93, .15); cursor: pointer; }
.range::-moz-range-thumb { width: 12px; height: 12px; border: 3px solid #1b1510; border-radius: 50%; background: var(--accent-2); cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; color: #5e6471; font-size: 9px; margin-top: -3px; }
.drop-image { min-height: 108px; border: 1px dashed rgba(255, 255, 255, .15); border-radius: 12px; display: grid; place-items: center; overflow: hidden; cursor: pointer; position: relative; background: #0d0f14; transition: border .15s, background .15s; }
.drop-image:hover { border-color: rgba(255, 139, 93, .44); background: #11141b; }
.drop-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.drop-image.has-image #drop-copy { opacity: 0; }
#drop-copy { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 14px; text-align: center; }
#drop-copy b { font-size: 11.5px; }
#drop-copy small { color: var(--muted-2); font-size: 9.5px; }
.drop-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--accent-2); font-size: 16px; margin-bottom: 2px; }
.upscale-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: #0d0f14; border-radius: 12px; padding: 11px; cursor: pointer; transition: border .15s, background .15s; }
.upscale-btn:hover { border-color: rgba(255, 139, 93, .35); }
.upscale-btn[aria-pressed="true"] { border-color: rgba(255, 139, 93, .5); background: rgba(255, 139, 93, .07); }
.upscale-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: #1a1e27; color: var(--accent-2); font-size: 14px; }
.upscale-btn span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.upscale-btn b { font-size: 11.5px; }
.upscale-btn small { color: var(--muted-2); font-size: 9.5px; }
.toggle { width: 28px; height: 16px; border-radius: 999px; background: #2c313d; position: relative; transition: background .15s; }
.toggle::after { content: ""; position: absolute; width: 12px; height: 12px; top: 2px; left: 2px; border-radius: 50%; background: #8c94a2; transition: transform .15s, background .15s; }
.upscale-btn[aria-pressed="true"] .toggle { background: var(--accent); }
.upscale-btn[aria-pressed="true"] .toggle::after { transform: translateX(12px); background: #2b140a; }

.prompt-field { flex: 1; }
.prompt-field textarea { resize: vertical; min-height: 175px; line-height: 1.6; background: #0c0e13; }
.prompt-meta { display: flex; justify-content: space-between; color: #5e6471; font-size: 9.5px; margin: 7px 0 12px; }
.generate-btn { border: 0; border-radius: 12px; padding: 14px; cursor: pointer; color: #241007; font-weight: 850; font-size: 13px; line-height: 1.45; background: linear-gradient(110deg, var(--accent-2), var(--accent) 55%, var(--pink)); box-shadow: 0 12px 36px rgba(255, 117, 74, .17); transition: transform .14s, filter .14s; }
.generate-btn:disabled { font-size: 11.5px; }
.optimize-btn { display: block; width: 100%; border: 1px solid rgba(122, 167, 255, .38); border-radius: 12px; padding: 13px; margin-bottom: 8px; cursor: pointer; color: #0b1a24; font-weight: 850; font-size: 13px; background: linear-gradient(110deg, #8fe3cf, #74c8ef 55%, #9f9cff); box-shadow: 0 12px 36px rgba(87, 165, 220, .14); transition: transform .14s, filter .14s; }
.optimize-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.optimize-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.optimize-modal-actions { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
html[data-theme="light"] .optimize-btn { border-color: rgba(70, 130, 190, .28); color: #10303a; background: linear-gradient(110deg, #a9e7d5, #9ad7ee 55%, #b9b4ff); }
.generate-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.generate-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.composer-note { color: #5e6471; font-size: 9.5px; text-align: center; margin: 9px 0 0; }
.generate-note { color: #7d8290; font-size: 9.5px; text-align: center; margin: 7px 0 0; line-height: 1.5; }
html[data-theme="light"] .generate-note { color: #777c88; }

/* progress */
.progress-card { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); background: rgba(8, 10, 14, .45); }
.video-frame { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #1b202b, #0b0d12 75%); border: 1px solid var(--line); margin: 0 auto 12px; display: grid; place-items: center; }
.video-frame.ratio-16-9 { aspect-ratio: 16 / 9; max-width: 720px; }
.video-frame.ratio-1-1 { aspect-ratio: 1 / 1; max-width: 470px; }
.video-frame.ratio-9-16 { aspect-ratio: 9 / 16; max-width: 300px; }
.preview-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 20px; }
.preview-empty strong { font-size: 13px; letter-spacing: -.02em; }
.preview-empty small { color: var(--muted-2); font-size: 10px; }
.preview-icon { color: rgba(255, 255, 255, .15); font-size: 24px; margin-bottom: 2px; }
.pulse-ring { position: absolute; width: 74px; height: 74px; border: 1px solid rgba(255, 139, 93, .35); border-radius: 50%; animation: pulse 2s ease-out infinite; }
.pulse-ring::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255, 139, 93, .2); border-radius: 50%; }
@keyframes pulse { 0% { transform: scale(.75); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
.step-preview, .result-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #050608; }
.result-video { object-fit: contain; }
.progress-badge { position: absolute; top: 10px; left: 10px; color: #ffd0b8; background: rgba(10, 10, 12, .7); border: 1px solid rgba(255, 139, 93, .25); border-radius: 999px; padding: 4px 9px; font-size: 9.5px; backdrop-filter: blur(8px); }
.progress-row { display: flex; align-items: center; gap: 9px; max-width: 720px; margin: 0 auto; }
.progress-track { height: 4px; flex: 1; border-radius: 999px; background: #252a35; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--pink)); transition: width .25s; }
#progress-pct { color: var(--muted); font-size: 9.5px; width: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.progress-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 720px; margin: 9px auto 0; }
.progress-actions .muted { font-size: 10px; }
.download-btn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 139, 93, .35); border-radius: 9px; padding: 7px 11px; color: #ffc4a5; font-size: 10.5px; font-weight: 800; background: rgba(255, 139, 93, .08); white-space: nowrap; }
.download-btn.disabled { opacity: .35; pointer-events: none; }
.download-btn:not(.disabled):hover { background: rgba(255, 139, 93, .15); }

/* modals */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(3, 4, 7, .76); backdrop-filter: blur(8px); overflow-y: auto; }
.modal { width: min(680px, 100%); max-height: min(88svh, 760px); overflow: auto; background: #12151c; border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.small-modal { width: min(390px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.055em; }
.modal-close { border: 1px solid var(--line); background: #0d0f14; color: var(--muted); border-radius: 9px; width: 30px; height: 30px; cursor: pointer; font-size: 12px; }
.modal-close:hover { color: var(--text); }
.modal-copy { color: var(--muted); font-size: 12px; margin: 0 0 17px; }
.history-modal { width: min(900px, 100%); }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-empty { color: var(--muted-2); text-align: center; padding: 50px 10px; font-size: 12px; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; border: 1px solid var(--line); background: #0d0f14; border-radius: 11px; padding: 11px 12px; }
.y2-history-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.history-row .h-main { min-width: 0; }
.history-row .h-title { font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-row .h-meta { color: var(--muted-2); font-size: 9.5px; margin-top: 3px; }
.history-row .h-cat { color: #b6bcc8; font-size: 10px; white-space: nowrap; }
.history-row .h-num { color: var(--accent-2); font-family: ui-monospace, monospace; font-size: 10px; }
.history-row .h-actions { display: flex; gap: 5px; }
.mini-btn { border: 1px solid var(--line); background: #171b23; color: #c7ccd7; border-radius: 7px; padding: 5px 8px; font-size: 9.5px; cursor: pointer; text-decoration: none; }
.mini-btn:hover { border-color: var(--line-strong); background: #202530; }
.mini-btn.primary { color: #ffc7aa; border-color: rgba(255, 139, 93, .28); }
.mini-btn.disabled { opacity: .3; pointer-events: none; }
.view-modal { width: min(760px, 100%); }
.view-video { width: 100%; max-height: 62svh; background: #000; border-radius: 12px; margin-top: 4px; }
.view-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.view-prompt { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.view-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; margin-bottom: 7px; }
.view-prompt-actions { display: flex; gap: 5px; }
.view-prompt-text { margin: 0; white-space: pre-wrap; word-break: break-word; color: #c8ccd5; font-size: 11.5px; line-height: 1.65; background: #0d0f14; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.view-prompt-text.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
html[data-theme="light"] .view-prompt-text { background: #fbf8f2; color: #3f434d; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 22px; transform: translateX(-50%); background: #202531; border: 1px solid var(--line-strong); color: #e9ebf0; border-radius: 10px; padding: 10px 14px; font-size: 11.5px; box-shadow: var(--shadow); max-width: min(90vw, 480px); }

/* responsive */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 238px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 0 16px 52px; }
  .topbar { height: 76px; }
  .mobile-menu { display: block; }
  .composer-grid { grid-template-columns: 1fr; }
  .composer-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .history-row { grid-template-columns: minmax(0, 1fr) auto; }
  .history-row .h-cat, .history-row .h-num { display: none; }
}
@media (max-width: 560px) {
  .auth-card { padding: 24px 20px; }
  .template-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 14px 0 22px; }
  .hero-copy h2 { font-size: 38px; }
  .preset-panel, .composer { border-radius: 16px; }
  .preset-panel { padding: 16px; }
  .composer-left, .composer-right { padding: 15px; }
  .topbar h1 { font-size: 18px; }
  .ghost-btn { font-size: 10px; padding: 8px 10px; }
  .progress-actions { align-items: flex-start; flex-direction: column; }
  .download-btn { width: 100%; }
  .history-row { padding: 10px; }
  .modal { padding: 17px; border-radius: 16px; }
  .view-video { max-height: 52svh; }
}

/* ---------- Dalchoo World additions ---------- */
.ghost-btn.small { padding: 7px 10px; font-size: 10px; }
.service-submenu { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px 17px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.08); }
.service-submenu button { display: flex; align-items: center; gap: 7px; border: 0; background: transparent; color: #8f96a4; font-size: 11px; text-align: left; padding: 6px 8px; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.service-submenu button span { color: var(--accent-2); font-size: 10px; }
.service-submenu button:hover { background: rgba(255,255,255,.04); color: #d4d8e0; }
.service-submenu button.active { background: rgba(255,139,93,.1); color: #ffd6bf; }
.service-item { cursor: pointer; }
.section-sub { margin: 3px 0 0; color: var(--muted-2); font-size: 10.5px; }
.template-card { min-height: 162px; display: flex; flex-direction: column; }
.template-card p { max-width: 78%; }
.template-open { margin-top: auto; padding-top: 15px; color: var(--muted-2); font-size: 10px; font-weight: 700; }
.template-open b { color: var(--accent-2); font-size: 13px; margin-left: 2px; }
.template-card.active .template-open { color: #ffc4a5; }

.gpu-board-section { margin-top: 26px; }
.gpu-board { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: rgba(18,21,28,.6); }
.gpu-loading, .gpu-error { color: var(--muted-2); font-size: 11px; padding: 20px; text-align: center; }
.gpu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gpu-card { border: 1px solid var(--line); border-radius: 13px; padding: 13px; background: #0d0f14; }
.gpu-card.available { border-color: rgba(123,225,177,.22); background: linear-gradient(145deg, rgba(123,225,177,.07), #0d0f14 70%); }
.gpu-card.busy { border-color: rgba(255,139,93,.16); }
.gpu-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gpu-name { font-family: ui-monospace, monospace; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.gpu-status { border-radius: 999px; padding: 3px 7px; font-size: 9px; font-weight: 800; background: rgba(255,255,255,.05); color: var(--muted); }
.gpu-card.available .gpu-status { color: #9df0c9; background: rgba(123,225,177,.12); }
.gpu-card.busy .gpu-status { color: #ffb897; background: rgba(255,139,93,.1); }
.gpu-detail { margin-top: 8px; color: var(--muted); font-size: 10.5px; min-height: 30px; }
.gpu-bar { height: 3px; border-radius: 99px; background: #222733; overflow: hidden; margin-top: 9px; }
.gpu-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--pink)); border-radius: inherit; }
.gpu-card.available .gpu-bar span { background: var(--green); }
.gpu-alert { margin-top: 10px; border: 1px solid rgba(255,139,93,.22); background: rgba(255,139,93,.06); border-radius: 12px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 11.5px; }
.gpu-alert.ok { border-color: rgba(123,225,177,.2); background: rgba(123,225,177,.055); }
.gpu-alert.full { border-color: rgba(255,139,93,.28); }
.gpu-alert-sub { margin-top: 3px; color: var(--muted); font-size: 10px; }
.gpu-eta { color: #ffc4a5; font-weight: 800; }
.gpu-alert-actions { display: flex; gap: 5px; flex-shrink: 0; }
.svc-status-list { display: flex; flex-direction: column; gap: 8px; }
.svc-status-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 11px; background: #0d0f14; padding: 11px 13px; }
.svc-status-row.available { border-color: rgba(123,225,177,.24); background: linear-gradient(120deg, rgba(123,225,177,.07), #0d0f14 64%); }
.svc-status-row.busy { border-color: rgba(255,139,93,.22); }
.svc-status-main { min-width: 0; }
.svc-status-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.svc-status-name { font-family: ui-monospace, monospace; font-size: 13px; font-weight: 900; letter-spacing: .04em; }
.svc-status-value { border-radius: 999px; padding: 3px 8px; font-size: 9.5px; font-weight: 800; background: rgba(255,255,255,.05); color: var(--muted); }
.svc-status-row.available .svc-status-value { color: #9df0c9; background: rgba(123,225,177,.13); }
.svc-status-row.busy .svc-status-value { color: #ffb897; background: rgba(255,139,93,.11); }
.svc-status-note { margin-top: 4px; color: var(--muted-2); font-size: 10px; }
.svc-request-btn { white-space: nowrap; flex-shrink: 0; font-size: 10px; }
.svc-request-btn:disabled { opacity: .35; cursor: not-allowed; }
.svc-summary-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; flex-wrap: wrap; }
html[data-theme="light"] .svc-status-row { background: #fbf8f2; border-color: var(--line); }
html[data-theme="light"] .svc-status-row.available { border-color: rgba(88,128,104,.22); background: linear-gradient(120deg, rgba(106,150,122,.09), #fff 68%); }
html[data-theme="light"] .svc-status-row.busy { border-color: rgba(255,139,93,.3); }
html[data-theme="light"] .svc-status-row.available .svc-status-value { color: #3f7358; background: rgba(106,150,122,.12); }
html[data-theme="light"] .svc-status-row.busy .svc-status-value { color: #b84d24; background: rgba(255,139,93,.13); }
@media (max-width: 700px) {
  .svc-status-row { align-items: flex-start; flex-direction: column; }
  .svc-request-btn { width: 100%; }
}

/* ---------- admin ---------- */
.admin-item { margin-top: 4px; border-color: rgba(255,139,93,.18); }
.admin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 0 14px; }
.admin-head h2 { margin: 5px 0 0; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.065em; line-height: 1; }
.admin-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.admin-tabs { display: flex; gap: 4px; border: 1px solid var(--line); background: #0c0e13; border-radius: 11px; padding: 3px; margin-bottom: 14px; overflow-x: auto; }
.admin-tabs button { border: 0; background: transparent; color: #8e95a3; border-radius: 8px; padding: 8px 11px; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.admin-tabs button.active { background: #242a36; color: var(--text); }
.admin-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 13px; }
.admin-stat { border: 1px solid var(--line); border-radius: 12px; background: #0d0f14; padding: 13px 14px; display: flex; flex-direction: column; gap: 3px; }
.admin-stat span { color: var(--muted-2); font-size: 9.5px; letter-spacing: .04em; }
.admin-stat b { font-size: clamp(19px, 1.8vw, 25px); letter-spacing: -.04em; }
.admin-stat small { color: var(--muted-2); font-size: 9.5px; }
.admin-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.admin-user-list, .admin-job-list { display: flex; flex-direction: column; gap: 5px; }
.admin-user-row, .admin-job-row, .admin-ip-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: #0d0f14; padding: 7px 9px; min-width: 0; }
.admin-user-row .avatar { width: 28px; height: 28px; border-radius: 8px; }
.admin-user-main, .admin-job-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-user-main b, .admin-job-main b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-main small, .admin-job-main small { color: var(--muted-2); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-mini-meta { color: var(--muted-2); font-size: 9px; white-space: nowrap; }
.admin-pill { border-radius: 999px; padding: 2px 6px; font-size: 8px; font-weight: 800; }
.admin-pill.admin { color: #ffd0b8; background: rgba(255,139,93,.13); border: 1px solid rgba(255,139,93,.25); }
.admin-pill.blocked { color: #ff9d9d; background: rgba(255,90,90,.09); border: 1px solid rgba(255,90,90,.2); }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.admin-signup-card { border: 1px solid var(--line); border-radius: 12px; background: #0d0f14; padding: 12px; margin-bottom: 12px; }
.admin-signup-head, .admin-invite-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.admin-signup-head > div, .admin-invite-head > div { display: flex; flex-direction: column; gap: 2px; }
.admin-signup-head b, .admin-invite-head b { font-size: 12px; }
.admin-signup-head small, .admin-invite-head small { color: var(--muted-2); font-size: 9.5px; }
.admin-signup-head small.ok { color: #8fe3b8; }
.admin-signup-head small.danger { color: #ffadad; }
.admin-invite-head { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.admin-invite-list { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.admin-invite-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: #11141b; padding: 8px 9px; }
.admin-invite-row.inactive { opacity: .55; }
.admin-invite-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-invite-main b { font-size: 10.5px; }
.admin-invite-main small { color: var(--muted-2); font-size: 9px; }
.admin-invite-main code { color: #ffd0b8; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px; }
.admin-invite-actions { display: flex; gap: 4px; flex-shrink: 0; }
html[data-theme="light"] .admin-signup-card, html[data-theme="light"] .admin-invite-row { background: #fbf8f2; border-color: var(--line); }
html[data-theme="light"] .admin-signup-head small.ok { color: #227a54; }
html[data-theme="light"] .admin-signup-head small.danger { color: #b63d3d; }
html[data-theme="light"] .admin-invite-main code { color: #a94a22; }
.admin-toolbar .y2-search { width: min(400px, 100%); }
.admin-user-card { border: 1px solid var(--line); border-radius: 11px; background: #0d0f14; padding: 11px; margin-bottom: 7px; }
.admin-user-card.blocked { border-color: rgba(255,90,90,.22); background: rgba(255,90,90,.035); }
.admin-user-card-head { display: flex; align-items: flex-start; gap: 9px; }
.admin-user-card-head .avatar { width: 34px; height: 34px; }
.admin-user-stats { display: flex; flex-wrap: wrap; gap: 4px; margin: 9px 0 8px 43px; }
.admin-user-stats span { color: var(--muted-2); font-size: 9px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; }
.admin-user-stats b { color: var(--text); }
.admin-user-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-left: 43px; }
.admin-level-select { display: flex; align-items: center; gap: 5px; color: var(--muted-2); font-size: 9px; }
.admin-level-select select { border: 1px solid var(--line); border-radius: 7px; background: #11141b; color: var(--text); padding: 4px 6px; font-size: 10px; }
.admin-level-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.admin-level-card { border: 1px solid var(--line); border-radius: 12px; background: #0d0f14; padding: 12px; }
.admin-level-head { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.admin-level-head b { font-size: 12px; }
.admin-level-num { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: rgba(255,139,93,.12); color: var(--accent-2); font-size: 10px; font-weight: 900; }
.admin-menu-checks { display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 9px 0; }
.admin-ip-add { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.admin-ip-add .y2-search { flex: 1; min-width: 160px; }
.admin-ip-row { justify-content: space-between; }
.admin-ip-row div { display: flex; flex-direction: column; gap: 2px; }
.admin-ip-row small { color: var(--muted-2); font-size: 9px; }
.admin-bars { display: flex; align-items: flex-end; gap: 6px; min-height: 150px; padding-top: 10px; overflow-x: auto; }
.admin-bar-row { flex: 1; min-width: 24px; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 140px; justify-content: flex-end; }
.admin-bar-label { color: var(--muted-2); font-size: 8px; white-space: nowrap; }
.admin-bar-track { width: 100%; max-width: 30px; height: 100px; display: flex; align-items: flex-end; border-radius: 5px; background: #181c24; overflow: hidden; }
.admin-bar-track span { width: 100%; background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-radius: 5px 5px 0 0; }
.admin-bar-row b { color: var(--text); font-size: 9px; }
.admin-bar-row small { color: var(--muted-2); font-size: 7.5px; }
.admin-path-list { display: flex; flex-direction: column; gap: 4px; }
.admin-path-row { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; font-size: 10px; }
.admin-path-row b { color: var(--accent-2); }
html[data-theme="light"] .admin-tabs { background: #f4eee2; }
html[data-theme="light"] .admin-tabs button { color: #747987; }
html[data-theme="light"] .admin-tabs button.active { background: #fff; color: var(--text); }
html[data-theme="light"] .admin-stat, html[data-theme="light"] .admin-user-row, html[data-theme="light"] .admin-job-row, html[data-theme="light"] .admin-ip-row, html[data-theme="light"] .admin-user-card, html[data-theme="light"] .admin-level-card { background: #fff; border-color: var(--line); }
html[data-theme="light"] .admin-user-card.blocked { background: rgba(255,90,90,.04); }
html[data-theme="light"] .admin-level-select select { background: #f7f2e8; color: var(--text); }
html[data-theme="light"] .admin-bar-track { background: #ece5d8; }
@media (max-width: 900px) {
  .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-two, .admin-level-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .admin-stat-grid { grid-template-columns: 1fr; }
  .admin-head { flex-direction: column; }
  .admin-user-stats, .admin-user-actions { margin-left: 0; }
}

.back-btn { border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 0 0 10px; cursor: pointer; }
.back-btn:hover { color: var(--accent-2); }
.maker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 8px 0 16px; }
.maker-head h2 { margin: 5px 0 0; font-size: clamp(26px, 4vw, 40px); letter-spacing: -.065em; line-height: 1; }
.maker-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.maker-chip { border: 1px solid rgba(255,139,93,.22); background: rgba(255,139,93,.08); color: #ffc4a5; border-radius: 999px; padding: 5px 11px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.prompt-shell { border: 1px solid var(--line); border-radius: 13px; background: #0c0e13; padding: 11px 12px 0; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.prompt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.prompt-tools { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.helper-settings-btn { border: 1px solid var(--line); background: #151922; color: #b7bdc9; border-radius: 7px; padding: 5px 8px; font-size: 9.5px; cursor: pointer; }
.helper-settings-btn:hover { border-color: rgba(255,139,93,.32); color: #ffd2ba; }
.assist-btn { border: 1px solid rgba(255,139,93,.35); background: rgba(255,139,93,.11); color: #ffd0b8; border-radius: 7px; padding: 5px 8px; font-size: 9.5px; font-weight: 800; cursor: pointer; }
.assist-btn:hover { background: rgba(255,139,93,.18); }
.assist-btn:disabled { opacity: .5; cursor: wait; }
.prompt-field textarea, #prompt { width: 100%; border: 0; background: transparent; color: var(--text); outline: none; resize: vertical; min-height: 168px; line-height: 1.6; padding: 0 0 10px; flex: 1 1 auto; }
#prompt::placeholder { color: #5e6471; }
.prompt-helper-note { border-top: 1px solid var(--line); color: #8e95a3; font-size: 9.5px; padding: 7px 0 8px; }
.anime-preset-row { margin-top: 9px; }
.preset-toggle { width: 100%; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #0d0f14; border-radius: 11px; padding: 10px 11px; cursor: pointer; text-align: left; transition: border .15s, background .15s; }
.preset-toggle:hover { border-color: rgba(255,139,93,.35); }
.preset-toggle.active { border-color: rgba(255,139,93,.5); background: rgba(255,139,93,.08); }
.preset-star { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #1a1e27; color: var(--accent-2); flex-shrink: 0; }
.preset-toggle span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.preset-toggle b { font-size: 11.5px; }
.preset-toggle small { color: var(--muted-2); font-size: 9.5px; }
.preset-check { width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; color: transparent; font-size: 10px; flex-shrink: 0; }
.preset-toggle.active .preset-check { background: var(--accent); border-color: var(--accent); color: #1c0d06; }

.yue2-view { max-width: 1160px; }
.yue2-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 0 14px; }
.yue2-head h2 { margin: 6px 0 0; font-size: clamp(25px, 4vw, 38px); letter-spacing: -.06em; line-height: 1.02; }
.yue2-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.yue2-actions { display: flex; gap: 6px; flex-shrink: 0; }
.yue2-frame-wrap { position: relative; height: calc(100svh - 190px); min-height: 560px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #080a0e; }
#yue2-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.yue2-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; padding: 20px; background: radial-gradient(circle at 50% 40%, #1b202b, #0b0d12 75%); }
.yue2-empty strong { font-size: 13px; }
.yue2-empty small { color: var(--muted-2); font-size: 10px; }

.helper-modal, .wait-modal { width: min(500px, 100%); }
.prompt-guide-modal { width: min(820px, 100%); display: flex; flex-direction: column; max-height: 88svh; overflow: hidden; }
.prompt-guide-modal .modal-head, .prompt-guide-modal .modal-copy, .prompt-guide-modal .guide-tabs, .prompt-guide-modal .guide-callout, .prompt-guide-modal .guide-foot { flex-shrink: 0; }
.guide-tabs { display: flex; gap: 4px; border: 1px solid var(--line); background: #0c0e13; border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.guide-tabs button { flex: 1; border: 0; background: transparent; color: #8e95a3; border-radius: 7px; padding: 8px; font-size: 11px; font-weight: 800; cursor: pointer; }
.guide-tabs button.active { background: #242a36; color: var(--text); }
.guide-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; padding-right: 4px; color: #c7cbd4; font-size: 11.5px; line-height: 1.7; }
.guide-body h3 { margin: 16px 0 6px; color: var(--text); font-size: 13px; letter-spacing: -.02em; }
.guide-body h3:first-child { margin-top: 0; }
.guide-body p { margin: 5px 0; }
.guide-body ul { margin: 5px 0; padding-left: 18px; }
.guide-body li { margin: 3px 0; }
.guide-body pre { margin: 7px 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #0b0d12; color: #ffd0b8; font: 10.5px/1.6 ui-monospace, monospace; white-space: pre-wrap; word-break: break-word; }
.guide-callout { margin-top: 10px; border: 1px solid rgba(255,139,93,.2); border-radius: 9px; background: rgba(255,139,93,.05); padding: 9px 11px; font-size: 11px; }
.guide-callout b { color: #ffd0b8; }
.guide-callout p { margin: 3px 0 0; color: var(--muted); }
.guide-callout a, .guide-foot a { color: var(--accent-2); text-decoration: underline; }
.guide-foot { margin-top: 12px; text-align: right; font-size: 10.5px; }
html[data-theme="light"] .guide-tabs { background: #f4eee2; }
html[data-theme="light"] .guide-tabs button { color: #747987; }
html[data-theme="light"] .guide-tabs button.active { background: #fff; color: var(--text); }
html[data-theme="light"] .guide-body { color: #4b4f59; }
html[data-theme="light"] .guide-body pre { background: #fbf8f2; color: #a94a22; }
html[data-theme="light"] .guide-callout { background: rgba(255,139,93,.07); }
.helper-model-label { color: #c7cbd4; font-size: 11px; font-weight: 700; margin: 2px 0 7px; }
.helper-models { display: flex; gap: 5px; margin-bottom: 14px; }
.helper-models button { flex: 1; border: 1px solid var(--line); background: #0d0f14; color: #8e95a3; border-radius: 9px; padding: 9px 6px; font-size: 10.5px; font-weight: 800; cursor: pointer; transition: border .15s, background .15s, color .15s; }
.helper-models button:hover { border-color: var(--line-strong); color: #d4d8e0; }
.helper-models button.active { border-color: rgba(255,139,93,.55); background: rgba(255,139,93,.1); color: #ffd0b8; }
.helper-current { color: var(--muted-2); font-size: 10.5px; margin: -2px 0 8px; }
.helper-modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9.5px; }
.wait-service { border: 1px solid var(--line); background: #0d0f14; border-radius: 9px; padding: 9px 10px; color: #d8dbe3; font-size: 11px; font-weight: 700; margin: 0 0 10px; }
.wait-channel { margin-bottom: 13px; }
.wait-list { margin-top: 14px; }
.wait-list-title { color: var(--muted-2); font-size: 9.5px; font-weight: 800; letter-spacing: .1em; margin-bottom: 5px; }
.wait-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #0d0f14; border-radius: 8px; padding: 7px 9px; margin-top: 5px; font-size: 10px; }
.wait-row span { flex: 1; color: var(--muted); }
.wait-row b { color: var(--accent-2); font-size: 9px; }
.wait-empty { color: var(--muted-2); font-size: 10.5px; }

@media (max-width: 900px) {
  .gpu-grid { grid-template-columns: 1fr; }
  .gpu-alert { align-items: flex-start; flex-direction: column; }
  .yue2-head { align-items: flex-start; flex-direction: column; }
  .yue2-frame-wrap { height: calc(100svh - 240px); min-height: 480px; }
}
@media (max-width: 560px) {
  .prompt-head { flex-direction: column; }
  .prompt-tools { width: 100%; justify-content: flex-start; }
  .creator-head, .maker-head { flex-direction: column; }
  .gpu-alert-actions { width: 100%; }
  .gpu-alert-actions .mini-btn { flex: 1; }
  .helper-models { flex-direction: column; }
  .yue2-actions { width: 100%; }
  .yue2-actions .ghost-btn { flex: 1; text-align: center; }
  .yue2-frame-wrap { min-height: 420px; }
}

/* ---------- image crop / references ---------- */
.image-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 18px; }
.image-foot .text-btn { margin-left: auto; }
.drop-image.i2v-preview { border-style: solid; border-color: rgba(255,139,93,.35); min-height: 0; width: 100%; max-height: 390px; }
.drop-image.i2v-preview #drop-copy { display: none; }
.drop-image.ref-mode { min-height: 82px; border-style: dashed; }
.drop-image.ref-mode.compact { min-height: 58px; }
.drop-image.ref-mode.compact #drop-copy { flex-direction: row; padding: 9px; gap: 6px; }
.drop-image.ref-mode.compact #drop-copy small { display: none; }
.drop-image.ref-mode.compact .drop-icon { margin: 0; width: 21px; height: 21px; font-size: 13px; }
.ref-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.ref-hint { margin-top: 7px; color: var(--muted-2); font-size: 9.5px; line-height: 1.5; }
.ref-thumb { position: relative; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #0b0d12; aspect-ratio: 1; }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb span { position: absolute; left: 5px; bottom: 5px; padding: 3px 6px; border-radius: 5px; background: rgba(7,8,11,.8); color: #ffd0b8; font-family: ui-monospace, monospace; font-size: clamp(10.5px, 1.05vw, 13px); font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
.ref-thumb button { position: absolute; right: 4px; top: 4px; width: 19px; height: 19px; border: 0; border-radius: 50%; background: rgba(7,8,11,.8); color: #fff; font-size: 10px; cursor: pointer; }
.crop-modal { width: min(720px, 100%); }
.crop-stage { position: relative; width: 100%; max-height: 54svh; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #050608; touch-action: none; cursor: grab; margin: 4px auto 12px; }
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; transform-origin: top left; user-select: none; pointer-events: none; }
.crop-frame { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.35); pointer-events: none; box-shadow: inset 0 0 0 9999px rgba(0,0,0,.12); }
.crop-controls { display: flex; align-items: center; gap: 12px; }
.crop-zoom { display: flex; align-items: center; gap: 9px; flex: 1; color: var(--muted); font-size: 10px; }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
.crop-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 14px; }
.crop-save { width: auto; padding: 10px 16px; }

/* ---------- Yue2 landing / forms ---------- */
.yue2-menu-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.yue2-menu-card { text-align: left; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(27,31,41,.8), rgba(17,19,26,.8)); border-radius: 15px; padding: 14px; cursor: pointer; transition: border .15s, transform .15s; display: flex; flex-direction: column; gap: 4px; min-height: 140px; }
.yue2-menu-card:hover { border-color: rgba(255,139,93,.35); transform: translateY(-2px); }
.yue2-menu-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: #0c0e13; color: var(--accent-2); margin-bottom: 5px; }
.yue2-menu-card b { font-size: 12.5px; letter-spacing: -.02em; }
.yue2-menu-card small { color: var(--muted-2); font-size: 10px; line-height: 1.4; }
.y2-status-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: #0d0f14; margin-top: 14px; }
.y2-status-card.available { border-color: rgba(123,225,177,.22); background: linear-gradient(145deg, rgba(123,225,177,.06), #0d0f14 70%); }
.y2-status-card.busy { border-color: rgba(255,139,93,.22); }
.y2-status-main { min-width: 0; }
.y2-status-head { display: flex; align-items: center; gap: 8px; }
.y2-status-main p { margin: 6px 0 0; color: #c7cbd4; font-size: 11px; }
.y2-status-meta { margin-top: 4px; color: var(--muted-2); font-size: 10px; }
.y2-status-actions { display: flex; gap: 5px; flex-shrink: 0; }
.y2-server-note { margin-top: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; color: var(--muted); font-size: 10.5px; background: rgba(255,255,255,.02); }
.y2-create-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 8px 0 16px; }
.y2-create-head h2 { margin: 5px 0 0; font-size: clamp(25px, 4vw, 38px); letter-spacing: -.06em; line-height: 1.02; }
.y2-create-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.y2-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.y2-form-main, .y2-form-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.y2-panel { border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: rgba(18,21,28,.62); }
.y2-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.y2-panel-head h3 { margin: 0; font-size: 13px; letter-spacing: -.02em; }
.y2-panel .field { margin-top: 11px; }
.y2-panel .field:first-of-type { margin-top: 0; }
.y2-panel .field small { display: block; margin-top: 3px; line-height: 1.4; }
.y2-panel input:not([type]), .y2-panel input[type=text], .y2-panel input[type=number], .y2-panel select, .y2-panel textarea, .y2-search {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #0c0e13; color: var(--text); padding: 9px 10px; outline: none; font-size: 11px;
}
.y2-panel input:focus, .y2-panel select:focus, .y2-panel textarea:focus, .y2-search:focus { border-color: rgba(255,139,93,.65); box-shadow: 0 0 0 3px rgba(255,139,93,.09); }
.y2-panel textarea { resize: vertical; line-height: 1.55; }
.y2-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.y2-duration-presets { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 7px; }
.y2-duration-presets button { border: 1px solid var(--line); background: #0d0f14; color: #aeb4c0; border-radius: 7px; padding: 5px 9px; font-size: 10px; cursor: pointer; }
.y2-duration-presets button:hover { border-color: rgba(255,139,93,.35); color: #ffd0b8; }
.y2-cover-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 11px; }
.y2-cover-box { min-height: 116px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; text-align: left; border: 1px dashed var(--line-strong); border-radius: 11px; background: #0d0f14; padding: 12px; cursor: pointer; color: var(--text); }
.y2-cover-box:hover { border-color: rgba(255,139,93,.5); background: #11141b; }
.y2-cover-box b { font-size: 12.5px; }
.y2-cover-box small { color: var(--muted-2); font-size: 10px; line-height: 1.4; }
.y2-cover-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: #151922; color: var(--accent-2); margin-bottom: 4px; }
.y2-cover-status { border: 1px solid var(--line); border-radius: 9px; background: #0d0f14; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; margin-bottom: 10px; }
.y2-cover-status span { color: var(--muted-2); font-size: 9.5px; }
.y2-cover-song-list { display: flex; flex-direction: column; gap: 5px; max-height: 48svh; overflow: auto; }
.y2-cover-song { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: #0d0f14; padding: 7px 9px; text-align: left; cursor: pointer; color: var(--text); }
.y2-cover-song:hover { border-color: rgba(255,139,93,.4); }
.y2-cover-song > span { width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; overflow: hidden; background: #1a1e27; color: var(--accent-2); font-size: 14px; grid-row: span 2; }
.y2-cover-song img { width: 100%; height: 100%; object-fit: cover; }
.y2-cover-song b { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.y2-cover-song small { color: var(--muted-2); font-size: 9px; }
.y2-help-modal { width: min(560px, 100%); }
.y2-help-body { color: #c7cbd4; font-size: 12.5px; line-height: 1.7; }
.y2-help-body p { margin: 0; }
.y2-inline { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.y2-inline input { flex: 1; }
.y2-inline-end { justify-content: flex-end; }
.y2-help-btn { border: 0; background: none; color: var(--muted-2); font-size: 9px; cursor: pointer; text-decoration: underline; white-space: nowrap; }
.y2-help-btn:hover { color: var(--accent-2); }
.y2-help { margin: -2px 0 10px; padding: 8px 10px; border-left: 2px solid rgba(255,139,93,.35); background: rgba(255,139,93,.04); color: var(--muted); font-size: 10px; line-height: 1.5; }
.y2-section-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.y2-section-tags button { border: 1px solid var(--line); background: #0d0f14; color: #aeb4c0; border-radius: 6px; padding: 4px 6px; font-size: 8.5px; cursor: pointer; }
.y2-section-tags button:hover { border-color: rgba(255,139,93,.35); color: #ffd0b8; }
.y2-lyrics { min-height: 240px; font-family: inherit; }
.y2-abc { min-height: 130px; font-family: ui-monospace, monospace; font-size: 10px; }
.y2-adapters { display: flex; flex-direction: column; gap: 6px; margin-bottom: 9px; }
.y2-adapter-row { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--line); background: #0d0f14; border-radius: 8px; padding: 7px 8px; }
.y2-adapter-name { flex: 0 0 130px; min-width: 0; display: flex; flex-direction: column; padding-top: 2px; }
.y2-adapter-name b { font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.y2-adapter-name small { color: var(--muted-2); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.y2-adapter-scales { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.y2-adapter-scale-line { display: flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 9.5px; }
.y2-adapter-scale-line span { flex: 0 0 76px; font-size: 9.5px; }
.y2-adapter-scale-line input[type=range] { flex: 1; min-width: 50px; width: auto; accent-color: var(--accent); }
.y2-adapter-scale-line b { flex: 0 0 34px; text-align: right; color: var(--accent-2); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.y2-adapter-row > .mini-btn { flex-shrink: 0; }
.y2-check { display: flex; align-items: center; gap: 7px; color: #c3c8d2; font-size: 10.5px; margin-top: 7px; cursor: pointer; }
.y2-check input { accent-color: var(--accent); }
#y2-advanced summary { cursor: pointer; color: var(--muted); font-size: 10px; font-weight: 700; margin-top: 10px; }
.y2-job-status { margin-top: 10px; border: 1px solid var(--line); border-radius: 11px; background: #0d0f14; padding: 11px; }
.y2-legal-note { margin: 9px 0 0; color: #7d8290; font-size: clamp(9.5px, .68vw, 10.5px); line-height: 1.55; text-align: center; border-top: 1px solid var(--line); padding-top: 9px; }
.y2-stem-groups { display: flex; flex-direction: column; gap: 10px; }
.y2-stem-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; flex-wrap: wrap; }
.y2-stem-group { border: 1px solid var(--line); border-radius: 12px; background: #0d0f14; padding: 12px; }
.y2-stem-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.y2-stem-group-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.y2-stem-group-title b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.y2-stem-group-title small { color: var(--muted-2); font-size: 9.5px; }
.y2-stem-list { display: flex; flex-direction: column; gap: 6px; }
.y2-stem-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: #11141b; padding: 8px 9px; }
.y2-stem-name { display: flex; flex-direction: column; gap: 1px; width: 96px; flex-shrink: 0; }
.y2-stem-name b { font-size: 11.5px; text-transform: capitalize; }
.y2-stem-name small { color: var(--muted-2); font-size: 9px; }
.y2-stem-row audio { flex: 1; min-width: 0; height: 34px; }
.y2-stem-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.y2-stem-result-head div { display: flex; flex-direction: column; gap: 2px; }
.y2-stem-result-head small { color: var(--muted-2); font-size: 9.5px; }
.y2-stem-result-list { display: flex; flex-direction: column; gap: 6px; }
.y2-stem-result-row { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; background: #11141b; padding: 7px 9px; }
.y2-stem-result-name { width: 86px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1px; }
.y2-stem-result-name b { font-size: 11px; text-transform: capitalize; }
.y2-stem-result-name small { color: var(--muted-2); font-size: 8.5px; }
.y2-stem-result-row audio { flex: 1; min-width: 0; height: 32px; }
html[data-theme="light"] .y2-stem-group, html[data-theme="light"] .y2-stem-row, html[data-theme="light"] .y2-stem-result-row { background: #fff; border-color: var(--line); }
@media (max-width: 700px) {
  .y2-stem-group-head, .y2-stem-result-head { align-items: flex-start; flex-direction: column; }
  .y2-stem-row, .y2-stem-result-row { flex-wrap: wrap; }
  .y2-stem-row audio, .y2-stem-result-row audio { flex: 1 1 100%; }
  .y2-stem-name, .y2-stem-result-name { width: auto; }
}
html[data-theme="light"] .y2-legal-note { color: #777c88; }
.y2-job-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; margin-bottom: 7px; }
.y2-job-head span { color: var(--muted-2); font-size: 9px; }

/* ---------- Yue2 library ---------- */
.y2-library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.y2-tabs { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); background: #0c0e13; border-radius: 10px; flex-wrap: wrap; }
.y2-tabs button { border: 0; background: transparent; color: #8e95a3; border-radius: 7px; padding: 7px 10px; font-size: 10px; font-weight: 700; cursor: pointer; }
.y2-tabs button.active { background: #242a36; color: var(--text); }
.y2-search { width: 220px; max-width: 100%; }
.y2-playlist-bar { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 9px; }
.y2-song-list { display: flex; flex-direction: column; gap: 6px; }
.y2-song-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: #0d0f14; padding: 8px 10px; min-width: 0; }
.y2-song-row:hover { border-color: var(--line-strong); background: #11141b; }
.y2-song-index { width: 24px; flex-shrink: 0; color: var(--muted-2); font-family: ui-monospace, monospace; font-size: 9px; text-align: right; }
.y2-song-cover { position: relative; width: 42px; height: 42px; flex-shrink: 0; border: 0; border-radius: 8px; overflow: hidden; background: linear-gradient(145deg, #332a2b, #171b23); color: var(--accent-2); font-weight: 900; cursor: pointer; display: grid; place-items: center; }
.y2-song-cover img { width: 100%; height: 100%; object-fit: cover; }
.y2-song-cover i { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); color: #fff; font-style: normal; font-size: 12px; opacity: 0; transition: opacity .15s; }
.y2-song-cover:hover i { opacity: 1; }
.y2-song-main { flex: 1; min-width: 0; }
.y2-song-title { display: block; max-width: 100%; border: 0; background: none; color: var(--text); font-size: 11.5px; font-weight: 700; text-align: left; padding: 0; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.y2-song-title:hover { color: var(--accent-2); }
.y2-song-tags { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.y2-song-tags span { color: var(--muted-2); font-size: 8.5px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 5px; }
.y2-song-tags small { color: #5e6471; font-size: 8.5px; }
.y2-song-actions { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.y2-empty { color: var(--muted-2); text-align: center; padding: 44px 10px; font-size: 11px; border: 1px dashed var(--line); border-radius: 12px; }
.y2-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.y2-pagination .mini-btn:disabled { opacity: .3; pointer-events: none; }
.y2-import { border: 1px dashed var(--line); border-radius: 12px; padding: 16px; background: #0d0f14; margin-bottom: 12px; }
.y2-import input { margin: 9px 0; color: var(--muted); font-size: 10px; }
.y2-more-btn { font-size: 14px; line-height: 1; padding: 4px 7px; }
.y2-song-menu { position: fixed; z-index: 90; width: 210px; border: 1px solid var(--line-strong); border-radius: 11px; background: #141821; box-shadow: var(--shadow); padding: 5px; }
.y2-song-menu button { width: 100%; border: 0; background: transparent; color: #d7dbe4; border-radius: 7px; padding: 6px 8px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.y2-song-menu button:hover { background: rgba(255,255,255,.06); }
.y2-song-menu button small { color: var(--muted-2); font-size: 8.5px; }
.y2-song-menu button.danger { color: #ff9d9d; }
.y2-song-menu button.danger:hover { background: rgba(255,90,90,.1); }

/* ---------- Yue2 player / details ---------- */
.yue2-player { position: fixed; z-index: 70; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(860px, calc(100vw - 28px)); display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(16,19,26,.94); backdrop-filter: blur(16px); padding: 8px 10px; box-shadow: var(--shadow); }
.yue2-player-cover { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.yue2-player-main { flex: 1; min-width: 0; }
.yue2-player-title { font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yue2-player-sub { color: var(--muted-2); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yue2-player-progress { height: 3px; border-radius: 99px; background: #262b36; overflow: hidden; margin-top: 5px; }
.yue2-player-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--pink)); }
.yue2-player-btn { border: 1px solid var(--line); background: #1c202a; color: var(--text); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; flex-shrink: 0; }
.yue2-player-btn:hover { border-color: var(--line-strong); }
.y2-detail { display: flex; flex-direction: column; gap: 9px; }
.y2-detail-cover { width: 100%; max-height: 300px; object-fit: cover; border-radius: 12px; }
.y2-detail-meta { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.y2-detail-meta span { color: var(--muted); font-size: 10px; }
.y2-detail-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.y2-pre { max-height: 56svh; overflow: auto; white-space: pre-wrap; word-break: break-word; border: 1px solid var(--line); border-radius: 10px; background: #0b0d12; padding: 12px; color: #d6d9e1; font: 11px/1.65 ui-monospace, "SFMono-Regular", monospace; }
.y2-abc-view { font-size: 10px; }
.y2-playlist-pick { display: flex; flex-direction: column; gap: 5px; }
.y2-playlist-pick .mini-btn { text-align: left; }

/* ---------- Yue2 tools ---------- */
.y2-tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.y2-tool-card { min-height: 128px; }
.y2-song-select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #0c0e13; color: var(--text); padding: 6px; font-size: 10px; margin-top: 6px; }
.y2-checks { display: flex; flex-wrap: wrap; gap: 12px; margin: 11px 0; }
.y2-process-options { display: flex; flex-direction: column; gap: 6px; margin: 11px 0; }
.y2-process-option { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: #0d0f14; padding: 9px 10px; cursor: pointer; }
.y2-process-option input { margin-top: 2px; accent-color: var(--accent); }
.y2-process-option span { display: flex; flex-direction: column; gap: 2px; }
.y2-process-option b { font-size: 10.5px; }
.y2-process-option small { color: var(--muted-2); font-size: 9px; line-height: 1.4; }
.y2-suboption { border: 1px solid var(--line); border-radius: 9px; background: #0d0f14; padding: 6px 10px 9px; }
.y2-vst-list { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.y2-vst-list .y2-check { margin-top: 2px; }
#y2-process-status audio { width: 100%; margin-top: 8px; }
.genre-modal { width: min(640px, 100%); display: flex; flex-direction: column; max-height: 88svh; overflow: hidden; }
.genre-modal .modal-head, .genre-modal .modal-copy, .genre-modal .crop-actions { flex-shrink: 0; }
.genre-list { display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; padding-right: 4px; }
.genre-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: #0d0f14; padding: 8px 10px; }
.genre-check { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; cursor: pointer; padding-top: 1px; }
.genre-check span { display: flex; flex-direction: column; min-width: 0; }
.genre-check b { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.genre-check small { color: var(--muted-2); font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.genre-scales { display: flex; flex-direction: column; gap: 3px; width: 168px; flex-shrink: 0; }
.genre-scale-line { display: flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 9.5px; }
.genre-scale-line span { flex: 0 0 60px; font-size: 9px; text-transform: uppercase; letter-spacing: .02em; }
.genre-scale-line input { flex: 1; min-width: 50px; width: auto; accent-color: var(--accent); }
.genre-scale-line b { flex: 0 0 32px; text-align: right; color: var(--accent-2); font-size: 9.5px; font-variant-numeric: tabular-nums; }

@media (max-width: 1050px) {
  .yue2-menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .y2-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .y2-form-grid { grid-template-columns: minmax(0, 1fr); }
  .y2-form-side { order: -1; }
}
@media (max-width: 700px) {
  .yue2-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yue2-menu-card { min-height: 122px; }
  .y2-status-card { align-items: flex-start; flex-direction: column; }
  .y2-status-actions { width: 100%; }
  .y2-status-actions .mini-btn { flex: 1; }
  .y2-tools-grid { grid-template-columns: 1fr; }
  .y2-song-row { align-items: flex-start; flex-wrap: wrap; }
  .y2-song-main { flex: 1 1 calc(100% - 60px); }
  .y2-song-actions { width: 100%; justify-content: flex-start; padding-left: 52px; }
  .y2-library-toolbar { align-items: stretch; flex-direction: column; }
  .y2-search { width: 100%; }
  .y2-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .y2-tabs button { white-space: nowrap; }
  .yue2-player { bottom: 8px; gap: 7px; }
  .yue2-player .ghost-btn { display: none; }
  .y2-two { grid-template-columns: 1fr; }
  .genre-row { align-items: flex-start; flex-direction: column; }
  .genre-scales { width: 100%; }
  .genre-scale-line span { flex: 0 0 74px; }
  .genre-scale-line input { flex: 1; }
}

/* ---------- light theme (day) ---------- */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f1e7;
  --bg-2: #fffdf8;
  --panel: #ffffff;
  --panel-2: #f4efe4;
  --line: rgba(28, 26, 22, .12);
  --line-strong: rgba(28, 26, 22, .22);
  --text: #181a1f;
  --muted: #5f6472;
  --muted-2: #858a98;
  --shadow: 0 24px 70px rgba(60, 44, 20, .14);
}
html[data-theme="light"] body {
  background:
    radial-gradient(1000px 650px at 94% -5%, rgba(255, 142, 84, .16), transparent 56%),
    radial-gradient(900px 700px at 2% 100%, rgba(255, 111, 145, .08), transparent 58%),
    var(--bg);
  color: var(--text);
}
html[data-theme="light"] .muted { color: var(--muted); }
html[data-theme="light"] .eyebrow { color: #d96632; }
html[data-theme="light"] .sidebar { background: rgba(255, 252, 245, .88); border-right-color: var(--line); }
html[data-theme="light"] .side-brand strong { color: var(--text); }
html[data-theme="light"] .service-item.active { background: linear-gradient(115deg, rgba(255, 139, 93, .18), rgba(255, 111, 145, .05)); border-color: rgba(255, 139, 93, .34); }
html[data-theme="light"] .service-icon { background: #fff; border-color: var(--line); color: #d96632; }
html[data-theme="light"] .service-submenu { border-left-color: var(--line); }
html[data-theme="light"] .service-submenu button { color: #5f6472; }
html[data-theme="light"] .service-submenu button:hover { background: #f4efe4; color: var(--text); }
html[data-theme="light"] .service-submenu button.active { background: rgba(255,139,93,.14); color: #b84d24; }
html[data-theme="light"] .side-bottom { border-top-color: var(--line); }
html[data-theme="light"] .avatar { background: #fff; border-color: var(--line); color: #b84d24; }
html[data-theme="light"] .side-logout, html[data-theme="light"] .side-withdraw { color: #747987; }
html[data-theme="light"] .topbar h1 { color: var(--text); }
html[data-theme="light"] .ghost-btn { background: #fff; border-color: var(--line); color: #3f434d; }
html[data-theme="light"] .ghost-btn:hover { background: #f7f2e8; border-color: var(--line-strong); }
html[data-theme="light"] .auth-card { background: rgba(255, 254, 250, .9); border-color: var(--line); }
html[data-theme="light"] .field input, html[data-theme="light"] .field textarea,
html[data-theme="light"] .y2-panel input, html[data-theme="light"] .y2-panel select, html[data-theme="light"] .y2-panel textarea,
html[data-theme="light"] .y2-search { background: #fff; color: var(--text); border-color: var(--line); }
html[data-theme="light"] .field input::placeholder, html[data-theme="light"] .field textarea::placeholder,
html[data-theme="light"] .y2-panel input::placeholder, html[data-theme="light"] .y2-panel textarea::placeholder { color: #9a9eaa; }
html[data-theme="light"] .template-card { background: linear-gradient(145deg, #fff, #fbf7ef); border-color: var(--line); box-shadow: 0 12px 32px rgba(55, 38, 15, .05); }
html[data-theme="light"] .template-card:hover { border-color: rgba(255,139,93,.42); }
html[data-theme="light"] .template-card.active { background: linear-gradient(145deg, rgba(255,139,93,.16), #fff 62%); border-color: rgba(255,139,93,.62); }
html[data-theme="light"] .template-card .t-icon { background: #f7f1e5; border-color: var(--line); color: #b84d24; }
html[data-theme="light"] .preset-panel, html[data-theme="light"] .composer, html[data-theme="light"] .gpu-board { background: #fff; border-color: var(--line); box-shadow: 0 14px 40px rgba(55, 38, 15, .05); }
html[data-theme="light"] .composer-left { border-right-color: var(--line); }
html[data-theme="light"] .control-label, html[data-theme="light"] .field > span { color: #4b4f59; }
html[data-theme="light"] .segmented { background: #f4eee2; border-color: var(--line); }
html[data-theme="light"] .segmented button { color: #707583; }
html[data-theme="light"] .segmented button.active { background: #fff; color: var(--text); box-shadow: 0 3px 10px rgba(55,38,15,.08); }
html[data-theme="light"] .drop-image { background: #fbf8f1; border-color: rgba(28,26,22,.18); }
html[data-theme="light"] .drop-image:hover { background: #fff; border-color: rgba(255,139,93,.48); }
html[data-theme="light"] .upscale-btn, html[data-theme="light"] .prompt-shell { background: #fff; border-color: var(--line); }
html[data-theme="light"] .upscale-icon { background: #f4eee2; color: #b84d24; }
html[data-theme="light"] .helper-settings-btn { background: #f7f2e8; border-color: var(--line); color: #5f6472; }
html[data-theme="light"] .prompt-helper-note { border-top-color: var(--line); color: #6b707d; }
html[data-theme="light"] .preset-toggle { background: #fff; border-color: var(--line); }
html[data-theme="light"] .preset-toggle.active { background: rgba(255,139,93,.1); border-color: rgba(255,139,93,.45); }
html[data-theme="light"] .preset-star { background: #f4eee2; }
html[data-theme="light"] .progress-card { background: #fbf8f2; border-bottom-color: var(--line); }
html[data-theme="light"] .video-frame { background: radial-gradient(circle at 50% 40%, #f4eee2, #fff 75%); border-color: var(--line); }
html[data-theme="light"] .progress-track { background: #e6dece; }
html[data-theme="light"] .gpu-card { background: #fbf8f1; border-color: var(--line); }
html[data-theme="light"] .gpu-card.available { background: linear-gradient(145deg, rgba(106,150,122,.13), #fff 72%); }
html[data-theme="light"] .gpu-alert { background: rgba(255,139,93,.08); }
html[data-theme="light"] .gpu-alert.ok { border-color: rgba(88,128,104,.2); background: rgba(106,150,122,.08); }
html[data-theme="light"] .y2-server-note { background: #fff; border-color: var(--line); }
html[data-theme="light"] .modal { background: #fff; border-color: var(--line); }
html[data-theme="light"] .modal-close { background: #f7f2e8; }
html[data-theme="light"] .history-row { background: #fbf8f2; border-color: var(--line); }
html[data-theme="light"] .mini-btn { background: #f7f2e8; border-color: var(--line); color: #4f535d; }
html[data-theme="light"] .mini-btn:hover { background: #fff; border-color: var(--line-strong); }
html[data-theme="light"] .toast { background: #fff; color: var(--text); border-color: var(--line-strong); }
html[data-theme="light"] .yue2-menu-card { background: linear-gradient(145deg, #fff, #fbf7ef); border-color: var(--line); }
html[data-theme="light"] .yue2-menu-icon { background: #f7f1e5; color: #b84d24; }
html[data-theme="light"] .y2-status-card, html[data-theme="light"] .y2-panel { background: #fff; border-color: var(--line); }
html[data-theme="light"] .side-label { color: #8b909c; }
html[data-theme="light"] .prompt-meta, html[data-theme="light"] .range-ends, html[data-theme="light"] .composer-note, html[data-theme="light"] .template-open { color: #7a7f8b; }
html[data-theme="light"] .range { background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--range, 0%), #e3dbcb var(--range, 0%), #e3dbcb 100%); }
html[data-theme="light"] .toggle { background: #ded6c7; }
html[data-theme="light"] .ref-thumb, html[data-theme="light"] .y2-section-tags button, html[data-theme="light"] .y2-song-select { background: #fbf8f2; border-color: var(--line); }
html[data-theme="light"] .crop-stage { background: #f4efe4; border-color: var(--line); }
html[data-theme="light"] .helper-model-label { color: #4b4f59; }
html[data-theme="light"] .helper-models button { background: #f7f2e8; border-color: var(--line); color: #6b707d; }
html[data-theme="light"] .helper-models button.active { background: rgba(255,139,93,.12); color: #b84d24; }
html[data-theme="light"] .wait-service { background: #fbf8f2; border-color: var(--line); color: var(--text); }
html[data-theme="light"] .y2-check { color: #4b4f59; }
html[data-theme="light"] .y2-adapter-row { background: #fbf8f2; border-color: var(--line); }
html[data-theme="light"] .y2-song-cover { background: linear-gradient(145deg, #f4eee2, #fff); color: #b84d24; }
html[data-theme="light"] .y2-cover-song > span { background: #f4eee2; }
html[data-theme="light"] .y2-cover-box, html[data-theme="light"] .y2-cover-status, html[data-theme="light"] .y2-cover-song { background: #fbf8f2; border-color: var(--line); }
html[data-theme="light"] .y2-cover-box:hover { background: #fff; }
html[data-theme="light"] .y2-cover-icon { background: #f4eee2; }
html[data-theme="light"] .y2-duration-presets button { background: #f7f2e8; color: #5f6472; }
html[data-theme="light"] .y2-help-body { color: #4b4f59; }
html[data-theme="light"] .y2-tabs { background: #f4eee2; border-color: var(--line); }
html[data-theme="light"] .y2-tabs button { color: #747987; }
html[data-theme="light"] .y2-tabs button.active { background: #fff; color: var(--text); }
html[data-theme="light"] .y2-song-row { background: #fff; border-color: var(--line); }
html[data-theme="light"] .y2-song-row:hover { background: #fbf8f2; }
html[data-theme="light"] .y2-song-menu { background: #fff; border-color: var(--line-strong); }
html[data-theme="light"] .y2-song-menu button { color: #3f434d; }
html[data-theme="light"] .y2-song-menu button:hover { background: #f7f2e8; }
html[data-theme="light"] .y2-song-menu button.danger { color: #c53d3d; }
html[data-theme="light"] .yue2-player { background: rgba(255,255,255,.96); border-color: var(--line-strong); }
html[data-theme="light"] .yue2-player-btn { background: #f7f2e8; color: var(--text); }
html[data-theme="light"] .y2-pre { background: #fbf8f2; color: #30343d; border-color: var(--line); }
html[data-theme="light"] .y2-job-status, html[data-theme="light"] .genre-row, html[data-theme="light"] .y2-process-option, html[data-theme="light"] .y2-suboption, html[data-theme="light"] .wait-row { background: #fbf8f2; border-color: var(--line); }
html[data-theme="light"] .y2-import { background: #fbf8f2; }
html[data-theme="light"] .y2-help { background: rgba(255,139,93,.06); }
html[data-theme="light"] .y2-panel-head h3, html[data-theme="light"] .y2-create-head h2 { color: var(--text); }

/* ---------- larger, flexible Yue2 typography ---------- */
.y2-panel .field > span, .y2-panel .control-label { font-size: clamp(12px, .86vw, 13px); }
.y2-panel input:not([type]), .y2-panel input[type=text], .y2-panel input[type=number],
.y2-panel select, .y2-panel textarea, .y2-search { font-size: clamp(12.5px, .92vw, 14px); }
.y2-panel-head h3 { font-size: clamp(14px, 1vw, 15px); }
.yue2-menu-card b { font-size: clamp(13px, .95vw, 14.5px); }
.yue2-menu-card small { font-size: clamp(10.5px, .78vw, 12px); }
.y2-adapter-name b { font-size: clamp(12.5px, .92vw, 14px); }
.y2-adapter-name small { font-size: clamp(9.5px, .7vw, 10.5px); }
.genre-check b { font-size: clamp(13px, .95vw, 14.5px); }
.genre-check small { font-size: clamp(9.5px, .7vw, 10.5px); }
.y2-song-title { font-size: clamp(12.5px, .92vw, 14px); }
.y2-song-tags span, .y2-song-tags small { font-size: clamp(9.5px, .68vw, 10.5px); }
.y2-panel .field small, .y2-help, .y2-help-btn { font-size: clamp(10.5px, .75vw, 12px); }
.y2-song-actions .mini-btn { font-size: clamp(10px, .7vw, 11px); }
.y2-adapter-value { font-size: clamp(9.5px, .7vw, 10.5px); }
.y2-two { align-items: stretch; }
.y2-two .field { margin-top: 0; }
.y2-two select, .y2-two input { height: 39px; }

/* Quality must stay at the bottom on narrow screens */
@media (max-width: 1050px) {
  .y2-form-side { order: 2; }
}

/* ---------- final typography pass (match YuE2 Studio scale) ---------- */
body { font-size: 15px; }
.eyebrow { font-size: 11px; }
.field > span, .control-label { font-size: 12.5px; }
.auth-copy { font-size: 14px; }
.service-item b { font-size: 13.5px; }
.service-item small { font-size: 11px; }
.service-submenu button { font-size: 12px; }
.section-head h3 { font-size: 15px; }
.section-sub, .hero-copy p { font-size: 14px; }
.template-card h4 { font-size: 16px; }
.template-card p { font-size: 12.5px; }
.template-open { font-size: 11px; }
.tag { font-size: 10.5px; }
.mini-btn { font-size: 10.5px; }
.history-row .h-title { font-size: 12.5px; }
.history-row .h-meta, .history-row .h-cat, .history-row .h-num { font-size: 10.5px; }
.modal-copy { font-size: 13px; }
.gpu-loading, .gpu-error { font-size: 12px; }
.prompt-meta, .range-ends, .composer-note, .generate-note { font-size: 10.5px; }
.svc-status-name { font-size: 14px; }
.svc-status-value { font-size: 10.5px; }
.svc-status-note { font-size: 11px; }
.svc-request-btn { font-size: 10.5px; }
.admin-tabs button { font-size: 12px; }
.admin-stat span, .admin-stat small { font-size: 10.5px; }
.admin-user-main b, .admin-job-main b { font-size: 12px; }
.admin-user-main small, .admin-job-main small, .admin-mini-meta { font-size: 10px; }
.admin-user-stats span { font-size: 10px; }
.y2-adapter-scale-line span, .y2-adapter-scale-line b { font-size: 10px; }
.genre-scale-line span, .genre-scale-line b { font-size: 10px; }
@media (max-width: 560px) {
  body { font-size: 14px; }
  .section-sub, .hero-copy p { font-size: 13px; }
}



