/* Music, video and image pages. Loaded after portal.css. */
.wrap { max-width: 560px; margin: 0 auto; padding: 24px 20px 80px; }
h1 { font-size: 22px; margin: 14px 0 4px; display: flex; align-items: center; gap: 10px; }
.logo { width: 40px; height: 40px; border-radius: 10px; }
h2 { font-size: 16px; margin: 28px 0 10px; }
.back { display: inline-flex; align-items: center; min-height: 44px; }
.notice { background: #fff8e6; border: 1px solid #b45309; border-radius: 6px; padding: 10px 12px; font-size: 13px; margin: 0 0 16px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
label, .label { font-size: 14px; font-weight: 600; display: block; margin: 14px 0 6px; }
label:first-child, .label:first-child { margin-top: 0; }
input[type=text], textarea, select { width: 100%; padding: 11px 12px; border: 1px solid #8a8a90; border-radius: 6px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
textarea { resize: vertical; min-height: 110px; }
.field-error { border-color: var(--err) !important; }
.count { color: var(--muted); text-align: right; margin-top: 3px; }
.count.over { color: var(--err); }
.hint { color: var(--muted); margin-top: 6px; }
.hint a { white-space: nowrap; }

button { cursor: pointer; border: none; border-radius: 6px; font: inherit; font-size: 15px; font-weight: 600; padding: 11px 16px; }
button:disabled { cursor: default; }
.btn-primary { width: 100%; margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary:disabled { opacity: .55; }
.btn-primary.loading::before { content: ""; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-light { background: var(--bg); border: 1px solid #8a8a90; color: var(--ink); font-size: 14px; padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border-radius: 6px; font-weight: 600; }
a.btn-light { min-height: 44px; }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 14px 0 0; font-weight: 400; min-height: 44px; }
.check input { margin: 0; }
.check.need { outline: 2px solid var(--err); outline-offset: 2px; border-radius: 4px; }

/* Choice groups (radio inputs styled as buttons / tabs): keyboard and screen reader get real radios. */
.seg, .tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs { margin-bottom: 16px; gap: 8px; }
.seg label, .tabs label { flex: 1; margin: 0; position: relative; min-width: 0; }
.seg input, .tabs input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.seg span, .tabs span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 9px 8px; border: 1px solid #8a8a90; border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 600; }
.tabs span { flex-direction: column; align-items: flex-start; text-align: left; padding: 10px 12px; }
.seg input:checked + span, .tabs input:checked + span { background: #fff; border: 2px solid var(--brand); color: var(--brand-ink); }
.seg input:checked + span::before, .tabs input:checked + span::before { content: "\2713\00a0"; }
.seg input:focus-visible + span, .tabs input:focus-visible + span { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.seg input:disabled + span { opacity: .5; }
.seg input:disabled { cursor: default; }

.duration { display: flex; align-items: center; gap: 12px; }
.duration input { flex: 1; accent-color: var(--brand-ink); height: 44px; margin: 0; }
.duration output { min-width: 56px; text-align: right; font-size: 15px; font-weight: 700; }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 80px; height: 80px; border-radius: 6px; overflow: hidden; background: var(--bg); border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb span { position: absolute; left: 4px; bottom: 3px; font-size: 12px; color: #fff; background: rgba(0,0,0,.7); padding: 0 4px; border-radius: 3px; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%; background: rgba(0,0,0,.75); color: #fff; font-size: 18px; line-height: 32px; }
.thumb.busy { opacity: .5; }
.voice-row { display: flex; gap: 8px; }
.voice-row select { flex: 1; }

details.adv { margin-top: 14px; border-top: 1px solid var(--border); }
details.adv > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--brand-ink); }

.price { margin-top: 14px; font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.price b { color: var(--brand-ink); font-size: 17px; text-align: right; }
.msg { font-size: 14px; margin: 10px 0 0; }
.banner { background: #fff8e6; border: 1px dashed #b45309; border-radius: 6px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }

.job { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.job-prompt { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.job-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.job-head b { font-size: 15px; }
.job-meta { color: var(--muted); margin-top: 3px; }
.job-inputs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.job-inputs img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--bg); }
.job-wait { font-size: 14px; color: var(--muted); margin-top: 10px; }
.job-err { font-size: 14px; margin-top: 10px; }
.job-expired { font-size: 14px; color: var(--muted); font-style: italic; margin-top: 10px; }
.job-ttl { font-size: 13px; color: var(--muted); margin-top: 8px; }
.job-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.job-redo { display: flex; justify-content: flex-end; margin-top: 10px; }
.job-new { animation: pulse .9s 2; border-color: var(--brand); }
.empty { font-size: 14px; color: var(--muted); }

/* Waiting placeholder: same footprint as the result so the page does not jump when it lands. */
.skel { margin-top: 10px; border-radius: 6px; background: linear-gradient(90deg, #e9eaec, #f4f5f6, #e9eaec); animation: pulse 1.4s ease-in-out infinite; width: 100%; }
.skel.audio { height: 72px; }
.skel-text { display: flex; align-items: center; gap: 8px; }
.skel-text::before { content: ""; width: 14px; height: 14px; flex: none; border: 2px solid #c9cacd; border-top-color: var(--brand-ink); border-radius: 50%; animation: spin .8s linear infinite; }

.job-out { display: block; max-width: 100%; max-height: 70vh; margin: 10px auto 0; border-radius: 6px; background: var(--bg); }
.job-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.job-grid .job-out { width: 100%; max-height: none; }
.job video { display: block; max-width: 100%; max-height: 60vh; margin: 10px auto 0; border-radius: 6px; background: #000; }

.clip { display: flex; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.clip img, .clip .noimg { width: 72px; height: 72px; border-radius: 8px; flex: none; object-fit: cover; background: var(--bg); }
.clip-body { flex: 1; min-width: 0; }
.clip-body b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.clip audio { width: 100%; margin-top: 8px; height: 40px; }
.clip-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 14px; }
.lyrics { white-space: pre-wrap; font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.55; }
details summary { cursor: pointer; font-size: 14px; color: var(--brand-ink); font-weight: 600; min-height: 44px; display: flex; align-items: center; }

.custom-only { display: none; }
.is-custom .custom-only { display: block; }
.is-custom .simple-only { display: none; }
