.seedance-shell { min-height: 100vh; padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.studio-header { display: grid; grid-template-columns: minmax(280px, 1fr) auto auto; gap: 14px; align-items: center; }
.compact-brand { box-shadow: none; }
.studio-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tab-btn, .chip, .small { background: rgba(255,255,255,.035); border: 1px solid var(--line); color: var(--muted); border-radius: 14px; padding: 10px 13px; font-size: 13px; }
.tab-btn.active, .chip.active { color: var(--text); border-color: var(--accent-2); background: rgba(240,179,106,.10); }
.studio-grid { display: grid; grid-template-columns: 480px minmax(420px, 1fr); gap: 18px; align-items: start; }
.form-panel { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 126px); overflow-y: auto; }
.results-column { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--accent-2); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
select, input, textarea { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); border-radius: 14px; padding: 12px 13px; outline: none; resize: vertical; box-sizing: border-box; }
select:focus, input:focus, textarea:focus { border-color: rgba(240,179,106,.8); box-shadow: 0 0 0 4px rgba(240,179,106,.08); }
select option { background: #11100f; color: var(--text); }
summary { cursor: pointer; color: var(--accent-2); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; padding: 8px 0; }
details { border-top: 1px solid var(--line); padding-top: 8px; }
details > * + * { margin-top: 10px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkbox { color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 600; flex-direction: row; align-items: center; }
.checkbox input { width: auto; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.micro { font-size: 12px; line-height: 1.45; }
pre { overflow: auto; max-height: 360px; white-space: pre-wrap; color: #c9d4ea; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 16px; padding: 14px; font-size: 12px; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.toast-host { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.toast { background: #11100f; border: 1px solid var(--line); color: var(--text); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); max-width: 420px; }
.toast.ok { border-color: rgba(67,209,139,.5); }
.toast.err { border-color: rgba(255,107,107,.6); }

.seedream-control-card { gap: 7px; padding: 8px; border-radius: 24px; background: linear-gradient(180deg, rgba(20,22,30,.86), rgba(10,12,18,.82)); box-shadow: 0 24px 80px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.055); }
.media-upload-card, .prompt-compact-card, .model-compact-card, .mode-switch-card, .spec-pill { border: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.035); box-shadow: inset 0 1px rgba(255,255,255,.045), 0 10px 28px rgba(0,0,0,.18); }
.media-upload-card { min-height: 84px; border-radius: 20px; padding: 10px 14px 8px; text-align: center; position: relative; overflow: visible; cursor: default; }
.media-upload-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% -10%, rgba(255,255,255,.10), transparent 45%); pointer-events: none; }
.media-icon-row { position: relative; display: flex; justify-content: center; margin-bottom: 6px; }
.round-media-btn { width: 34px; height: 34px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); color: rgba(238,242,250,.92); background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.045)); box-shadow: 0 8px 22px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.10); cursor: pointer; font-weight: 900; }
.round-media-btn:hover { color: #FFB86B; border-color: rgba(255,184,107,.45); transform: translateY(-1px); }
.upload-title { position: relative; color: rgba(235,239,247,.72); font-size: 14px; font-weight: 950; }
.media-upload-card p { position: relative; margin: 3px 0 0; color: rgba(255,255,255,.88); font-size: 12px; font-weight: 800; }
.media-upload-card.dragover { border-color: rgba(255,184,107,.62); background: rgba(255,184,107,.075); box-shadow: 0 0 0 1px rgba(255,184,107,.28), 0 18px 44px rgba(255,184,107,.16), inset 0 1px rgba(255,255,255,.08); }
.drop-help { color: rgba(255,184,107,.78) !important; font-size: 11px !important; font-weight: 850 !important; }
.asset-token-strip { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 9px; }
.asset-token-strip:empty { display: none; }
.reference-chip, .asset-token-mini { border: 1px solid rgba(255,184,107,.26); border-radius: 999px; padding: 5px 8px; color: #fff2cf; background: rgba(255,184,107,.10); font-size: 11px; font-weight: 950; }
.reference-chip button { margin-left: 8px; padding: 2px 6px; border-radius: 999px; }
.upload-count-row { position: relative; margin-top: 12px; padding-inline: 3px; color: rgba(235,239,247,.58); font-size: 11px; }
.mode-switch-card { border-radius: 18px; padding: 9px 12px; display: flex; flex-direction: column; gap: 5px; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-tab { min-height: 34px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; color: rgba(245,248,255,.74); background: rgba(0,0,0,.28); font-weight: 950; cursor: pointer; }
.mode-tab.active { color: #15120b; background: linear-gradient(180deg, #f5c67d, #f0b36a); border-color: rgba(240,179,106,.8); }
.prompt-compact-card { min-height: 88px; border-radius: 18px; padding: 11px 12px; display: flex; flex-direction: column; gap: 6px; }
.compact-field-label { display: block; color: rgba(235,239,247,.72); font-size: 13px; font-weight: 950; letter-spacing: 0; text-transform: none; }
.prompt-compact-card textarea { min-height: 50px; border: 0; padding: 0; background: transparent; color: var(--text); font-size: 14px; line-height: 1.35; box-shadow: none; }
.prompt-compact-card textarea:focus { border: 0; box-shadow: none; }
.prompt-compact-card textarea::placeholder { color: rgba(235,239,247,.45); }
.prompt-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.mini-chip { min-height: 30px; border: 1px solid rgba(255,255,255,.07); border-radius: 10px; padding: 7px 10px; color: rgba(245,248,255,.92); background: rgba(0,0,0,.30); font-weight: 950; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.mode-panel { display: none; }
.mode-panel.active { display: flex; }
.auto-preview { border-top: 1px solid rgba(255,255,255,.06); padding-top: 8px; }
.model-compact-card { border-radius: 15px; padding: 13px 14px; }
.model-select-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.model-select-row select, .quick-spec-row select, .quick-spec-row input { border: 0; padding: 0; background: transparent; color: var(--text); outline: none; font-weight: 950; font-size: 14px; box-shadow: none; }
.model-select-row select:focus, .quick-spec-row select:focus, .quick-spec-row input:focus { border: 0; box-shadow: none; }
.model-select-row span { color: rgba(235,239,247,.55); font-size: 24px; line-height: 1; }
.quick-spec-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.spec-pill { min-height: 40px; border-radius: 12px; padding: 0 11px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: var(--text); text-transform: none; letter-spacing: 0; }
.spec-pill span { color: rgba(240,179,106,.9); }
.sticky-action-row { position: sticky; bottom: -8px; z-index: 4; margin: 0 -8px -8px; padding: 10px 8px 8px; background: linear-gradient(180deg, rgba(10,12,18,.30), rgba(10,12,18,.96) 42%); border-radius: 0 0 22px 22px; backdrop-filter: blur(16px); }
.generate-compact-btn { min-height: 48px; border-radius: 16px; margin-top: 0; font-size: 15px; font-weight: 950; }
.generated-images-list, .task-list { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 240px); overflow: auto; }
.character-card { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: rgba(255,255,255,.035); }
.character-card img { width: 100%; display: block; border-radius: 14px; background: #05060a; margin-top: 10px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(5,7,12,.75); display: flex; align-items: center; justify-content: center; z-index: 30; padding: 24px; }
.modal-backdrop.hidden { display: none; }
.modal-card { background: #11100f; border: 1px solid var(--line); border-radius: 18px; padding: 18px; max-width: 520px; width: 100%; max-height: 80vh; overflow: auto; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.modal-list { display: flex; flex-direction: column; gap: 8px; }
.modal-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.row.gap { gap: 8px; }
@media (max-width: 1080px) { .studio-grid { grid-template-columns: 1fr; } .studio-header { grid-template-columns: 1fr; } .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .field-grid, .quick-spec-row, .gallery-grid { grid-template-columns: 1fr; } }

/* Mobile: once the studio grid stacks, drop the nested 100vh scroll boxes so
   the page scrolls as one (no scroll-within-scroll), and tighten density. */
@media (max-width: 1080px) {
  .form-panel { max-height: none; overflow: visible; }
  .generated-images-list, .task-list { max-height: none; overflow: visible; }
}
@media (max-width: 680px) {
  .seedance-shell { padding: 12px; gap: 12px; }
  .gallery-grid { grid-template-columns: 1fr; }
  pre { max-height: 260px; }
}
