:root {
    color-scheme: light;
    --bg: #f3f6f8;
    --panel: #ffffff;
    --ink: #111827;
    --muted: #667085;
    --line: #d9e0e7;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --accent-soft: #e6f4f1;
    --blue: #2563eb;
    --blue-soft: #eaf1ff;
    --gold: #d97706;
    --gold-soft: #fff4df;
    --warn: #b54708;
    --danger: #b42318;
    --shadow: 0 22px 70px rgba(15, 23, 42, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, #eef4f6 0, var(--bg) 320px),
        var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.marketing-body {
    background: #f7f8f5;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px clamp(16px, 4vw, 48px);
    border-bottom: 1px solid rgba(217, 224, 231, 0.88);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
}

.site-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.site-menu a,
.site-footer a {
    color: var(--muted);
    font-weight: 850;
    text-decoration: none;
}

.site-menu a {
    padding: 10px 12px;
    border-radius: 8px;
}

.site-menu a:hover,
.site-footer a:hover {
    color: var(--ink);
}

.site-menu .menu-button {
    color: #ffffff;
    background: var(--ink);
}

.marketing-hero {
    width: min(1280px, calc(100% - 32px));
    min-height: calc(100vh - 70px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
    align-items: center;
    gap: 34px;
    padding: 44px 0 28px;
}

.marketing-copy {
    display: grid;
    gap: 20px;
}

.marketing-copy h1 {
    max-width: 820px;
    font-size: clamp(2.7rem, 6.5vw, 6rem);
}

.marketing-copy .lede {
    max-width: 760px;
    color: #475467;
    font-size: clamp(1rem, 1.5vw, 1.22rem);
    line-height: 1.62;
}

.showcase-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.showcase-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.showcase-head h2 {
    font-size: 1.2rem;
}

.showcase-controls {
    display: flex;
    gap: 8px;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 900;
}

.icon-button:hover {
    background: #eef2f6;
}

.showcase-slider {
    position: relative;
    min-height: 520px;
    background: #101816;
}

.showcase-slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.showcase-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.showcase-slide video {
    width: 100%;
    height: 100%;
    min-height: 440px;
    object-fit: contain;
    background: #101816;
}

.showcase-caption {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    color: #ffffff;
    background: #101816;
}

.showcase-caption span {
    color: #cbd5e1;
    font-size: 0.92rem;
    font-weight: 750;
}

.showcase-empty {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.showcase-empty .hero-media {
    min-height: 360px;
}

.showcase-empty span {
    color: var(--muted);
}

.content-band,
.cta-band {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 76px 0;
}

.band-head {
    max-width: 720px;
    margin-bottom: 26px;
}

.band-head h2,
.split-band h2,
.cta-band h2 {
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.05;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.feature-grid article,
.template-metrics div {
    display: grid;
    gap: 10px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.05);
}

.feature-grid span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-weight: 900;
}

.feature-grid p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.split-band {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
    align-items: start;
    gap: 28px;
}

.template-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.template-metrics div:first-child {
    grid-column: span 2;
}

.template-metrics strong {
    color: var(--gold);
    font-size: 2rem;
}

.template-metrics span {
    color: var(--muted);
    font-weight: 850;
}

.cta-band {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.cta-band p {
    max-width: 620px;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.55;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 28px clamp(16px, 4vw, 48px);
    border-top: 1px solid var(--line);
    background: #ffffff;
}

.site-footer div,
.site-footer nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.site-footer span {
    color: var(--muted);
}

.topbar {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    padding: 14px clamp(16px, 4vw, 42px);
    border-bottom: 1px solid rgba(217, 224, 231, 0.86);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
}

.brand-mark,
.top-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    min-width: max-content;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--ink);
    font-weight: 900;
}

.brand-mark strong {
    font-size: 0.96rem;
}

.top-nav {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.top-nav a {
    padding: 9px 11px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.top-nav a:hover {
    color: var(--ink);
    background: #eef2f6;
}

.studio-shell {
    padding-bottom: 36px;
}

.studio-hero {
    width: min(1240px, calc(100% - 32px));
    min-height: clamp(440px, 58vh, 640px);
    margin: 26px auto 0;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
    align-items: center;
    gap: 32px;
}

.hero-copy {
    display: grid;
    align-content: center;
    gap: 20px;
    padding: 22px 0;
}

.hero-copy h1 {
    max-width: 760px;
    font-size: clamp(2.5rem, 6vw, 5.7rem);
}

.hero-copy .lede {
    max-width: 700px;
    color: #475467;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    line-height: 1.58;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-media {
    min-height: clamp(360px, 52vh, 560px);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(17, 24, 39, 0.1), rgba(17, 24, 39, 0)),
        url("hero-studio.png") center / cover no-repeat;
    box-shadow: var(--shadow);
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

.shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
}

.page-title {
    font-size: clamp(1.7rem, 3vw, 2.45rem);
}

.single-shell {
    grid-template-columns: minmax(0, 760px);
    justify-content: center;
}

.upload-only-panel {
    width: 100%;
}

.job-shell {
    align-items: start;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.generator-panel,
.job-panel {
    padding: 28px;
}

.recent-panel {
    padding: 20px;
    position: sticky;
    top: 20px;
}

.page-head,
.head-actions,
.section-title,
.progress-meta,
.status-line,
.result-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-head {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.lede {
    margin: 10px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

h2 {
    margin-bottom: 0;
    font-size: 1rem;
}

h3 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--accent-dark);
}

.quiet-link {
    color: var(--accent-dark);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.quiet-link:hover {
    text-decoration: underline;
}

.generator-form {
    display: grid;
    gap: 18px;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.batch-section[hidden] {
    display: none;
}

.upload-grid.is-single {
    grid-template-columns: 1fr;
}

.step-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.step-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-head span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-size: 0.82rem;
    font-weight: 900;
}

.step-head h2 {
    font-size: 1.08rem;
}

.mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef2f6;
}

.mode-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mode-toggle span {
    display: grid;
    place-items: center;
    min-height: 42px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
}

.mode-toggle input:checked + span {
    color: #ffffff;
    background: var(--ink);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.18);
}

.upload-card {
    display: grid;
    gap: 14px;
    min-height: 270px;
    padding: 16px;
    border: 1px dashed #aebdcc;
    border-radius: 8px;
    background: #fbfcfb;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.upload-card:hover,
.upload-card:focus-within {
    border-color: var(--accent);
    background: #f7fbfa;
    transform: translateY(-1px);
}

.upload-card input {
    width: 100%;
}

.upload-card.is-hidden {
    display: none;
}

.upload-copy {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.upload-copy strong {
    color: var(--ink);
}

.preview-wrap {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    min-height: 190px;
    border-radius: 6px;
    background: #eef3ef;
}

.preview-wrap img,
.preview-wrap video {
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: contain;
    display: block;
}

.preview-empty {
    color: #7c8982;
    font-weight: 700;
}

.upload-hint {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.45;
}

.batch-upload {
    min-height: 260px;
}

.batch-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 10px;
    align-items: stretch;
    min-height: 180px;
}

.batch-thumb {
    position: relative;
    overflow: hidden;
    min-height: 122px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef3ef;
}

.batch-thumb img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.batch-thumb small {
    position: absolute;
    top: 6px;
    left: 6px;
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(17, 24, 39, 0.82);
    font-weight: 900;
}

.batch-thumb em {
    display: block;
    padding: 7px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(180, 35, 24, 0.92);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1;
}

.batch-remove:hover {
    background: #b42318;
}

.batch-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.batch-selection-meta {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.second-reference {
    min-height: 230px;
}

.control-block {
    display: grid;
    gap: 12px;
}

.template-groups {
    display: grid;
    gap: 14px;
}

.selector-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.template-controls {
    display: grid;
    gap: 12px;
}

.template-controls[hidden] {
    display: none;
}

.select-field {
    display: grid;
    gap: 7px;
}

.select-field span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.select-field select {
    width: 100%;
    min-height: 48px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    font-weight: 800;
}

.select-field select:focus {
    outline: 2px solid #b7dfd7;
    outline-offset: 2px;
}

.template-preview {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.template-preview strong {
    color: var(--ink);
}

.template-preview span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.custom-section {
    display: none;
}

.custom-section.is-visible {
    display: grid;
}

.template-category {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfb;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.choice-button,
.secondary-button,
.primary-button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
}

.choice-button {
    display: grid;
    align-content: start;
    gap: 4px;
    min-height: 74px;
    padding: 10px 12px;
    text-align: left;
    color: var(--ink);
    background: #eef3ef;
}

.choice-button small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
}

.choice-title {
    line-height: 1.15;
}

.choice-button.is-active {
    color: #ffffff;
    background: var(--accent);
}

.choice-button.is-active small {
    color: #e6fffb;
}

.custom-choice {
    min-height: 52px;
    align-content: center;
}

.custom-prompt {
    width: 100%;
    resize: vertical;
    min-height: 340px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
    line-height: 1.55;
}

.speech-text {
    width: 100%;
    resize: vertical;
    min-height: 110px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
}

.speech-text:focus {
    outline: 2px solid #b7dfd7;
    outline-offset: 2px;
}

.duration-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.duration-control {
    display: grid;
    gap: 7px;
}

.duration-control > span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.duration-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.duration-pill span {
    display: grid;
    place-items: center;
    min-height: 46px;
    border-radius: 8px;
    background: #eef2f6;
    font-weight: 900;
    cursor: pointer;
}

.duration-pill input:checked + span {
    color: #ffffff;
    background: var(--blue);
}

.primary-button,
.secondary-button {
    display: inline-grid;
    place-items: center;
    min-height: 50px;
    padding: 0 18px;
}

.inline-button {
    width: auto;
    min-width: 160px;
}

.folder-button {
    margin-top: 16px;
}

.primary-button.compact {
    width: auto;
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.9rem;
}

.secondary-button.compact {
    min-height: 38px;
    padding: 0 14px;
}

.primary-button {
    width: 100%;
    color: #ffffff;
    background: var(--blue);
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
}

.primary-button:hover {
    background: #1d4ed8;
}

.primary-button:disabled {
    cursor: progress;
    background: #8db8b2;
}

.secondary-button {
    color: var(--accent-dark);
    background: var(--accent-soft);
}

.danger-button {
    color: var(--danger);
    background: #fef2f2;
}

.progress-box,
.status-card,
.job-summary {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.progress-box {
    display: grid;
    gap: 10px;
}

.progress-box[hidden],
.select-field[hidden],
.video-result[hidden],
.alert[hidden] {
    display: none;
}

.progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #dce5df;
}

.progress-track.large {
    height: 14px;
}

.progress-track span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
    transition: width 220ms ease;
}

.alert {
    padding: 12px 14px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: var(--warn);
    background: #fff7ed;
    font-weight: 700;
}

.health-status {
    margin: -10px 0 22px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #fbfcfb;
    font-weight: 800;
}

.health-status[hidden] {
    display: none;
}

.health-status.is-ok {
    color: var(--accent-dark);
    border-color: #b7dfd7;
    background: var(--accent-soft);
}

.health-status.is-error {
    color: var(--danger);
    border-color: #fecaca;
    background: #fef2f2;
}

.alert.is-error {
    border-color: #fecaca;
    color: var(--danger);
    background: #fef2f2;
}

.job-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.job-summary span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.job-summary strong {
    overflow-wrap: anywhere;
}

.status-card {
    display: grid;
    gap: 14px;
}

.status-badge {
    display: inline-grid;
    place-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-weight: 900;
}

.status-badge.is-failed {
    color: var(--danger);
    background: #fef2f2;
}

.muted {
    margin-bottom: 0;
    color: var(--muted);
}

.video-result {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.video-result video {
    width: 100%;
    max-height: 520px;
    border-radius: 8px;
    background: #101816;
}

.recent-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.recent-title {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.studio-stats {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.studio-stats div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.studio-stats strong {
    color: var(--gold);
    font-size: 1.35rem;
}

.studio-stats span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
    text-align: right;
}

.batch-progress {
    margin-bottom: 16px;
}

.batch-jobs,
.download-grid {
    display: grid;
    gap: 12px;
}

.batch-job,
.download-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.batch-job strong,
.download-card h2 {
    display: block;
    overflow-wrap: anywhere;
}

.batch-job span:not(.status-badge),
.download-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.batch-actions,
.download-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.download-card {
    grid-template-columns: minmax(0, 1fr) auto;
}

.download-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.commander-shell {
    width: min(1440px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 38px;
}

.commander-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.commander-head h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

.commander-message {
    width: min(1440px, 100%);
    margin: 0 auto 14px;
}

.commander-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.commander-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.commander-panel-head,
.commander-head-actions,
.commander-tabs,
.commander-path,
.remote-tools,
.commander-actions,
.move-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.commander-panel-head {
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.commander-panel-head h2 {
    font-size: 1.1rem;
}

.commander-panel-head span,
.commander-path span {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.commander-head-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.commander-tabs {
    flex-wrap: wrap;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    background: #f7faf9;
}

.commander-tabs a {
    padding: 9px 10px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 900;
    text-decoration: none;
}

.commander-tabs a.is-active {
    color: #ffffff;
    background: var(--ink);
}

.commander-path {
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfd;
}

.commander-path span {
    max-width: 65%;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.commander-list {
    min-height: 430px;
    max-height: 62vh;
    overflow: auto;
}

.commander-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 120px 130px;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 9px 14px;
    border-bottom: 1px solid #edf1f5;
    color: var(--ink);
    text-decoration: none;
}

.commander-row:hover {
    background: #f7faf9;
}

.commander-row input {
    width: 18px;
    height: 18px;
}

.commander-row a,
.commander-row strong {
    overflow: hidden;
    color: var(--ink);
    font-weight: 850;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.commander-row a:hover {
    text-decoration: underline;
}

.commander-row em,
.commander-row small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.commander-dir {
    background: #fbfcfd;
}

.commander-dir a,
.commander-dir strong {
    color: var(--accent-dark);
}

.commander-empty {
    padding: 22px;
    color: var(--muted);
    font-weight: 800;
}

.ftp-connect-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

.full-field {
    grid-column: 1 / -1;
}

.remote-tools {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfd;
}

.remote-tools input {
    min-width: 0;
    flex: 1;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.commander-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.move-toggle {
    color: var(--muted);
    font-weight: 850;
}

.move-toggle input {
    width: 18px;
    height: 18px;
}

.download-card h2 {
    margin: 6px 0 0;
    font-size: 1.02rem;
}

.download-index {
    display: inline-grid;
    place-items: center;
    min-height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    font-size: 0.76rem;
    font-weight: 900;
}

.empty-downloads {
    display: grid;
    justify-items: start;
    gap: 10px;
    padding: 28px;
    border: 1px dashed #aebdcc;
    border-radius: 8px;
    background: #fbfcfd;
}

.empty-downloads span {
    color: var(--muted);
}

.login-body {
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(180deg, rgba(15, 118, 110, 0.12), rgba(37, 99, 235, 0.08)),
        var(--bg);
}

.login-shell {
    width: min(1050px, 100%);
}

.login-panel {
    display: grid;
    grid-template-columns: minmax(360px, 0.95fr) minmax(320px, 1.05fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.login-art {
    min-height: 620px;
    background:
        linear-gradient(180deg, rgba(17, 24, 39, 0.12), rgba(17, 24, 39, 0.42)),
        url("hero-studio.png") center / cover no-repeat;
}

.login-form {
    display: grid;
    align-content: center;
    gap: 18px;
    padding: clamp(24px, 5vw, 56px);
}

.text-field {
    display: grid;
    gap: 7px;
}

.text-field span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 800;
}

.text-field input {
    width: 100%;
    min-height: 50px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #ffffff;
}

.text-field input:focus,
.custom-prompt:focus {
    outline: 2px solid #b7dfd7;
    outline-offset: 2px;
}

.auth-switch {
    margin: 0;
    color: var(--muted);
    text-align: center;
    font-weight: 750;
}

.auth-switch a {
    color: var(--accent-dark);
    font-weight: 900;
}

.recent-item {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    text-decoration: none;
    background: #fbfcfd;
}

.recent-item:hover {
    border-color: var(--accent);
}

.recent-item strong {
    overflow-wrap: anywhere;
}

.recent-item span {
    color: var(--muted);
    font-size: 0.85rem;
}

.empty-state {
    color: var(--muted);
}

@media (max-width: 900px) {
    .site-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .marketing-hero,
    .split-band {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .commander-grid {
        grid-template-columns: 1fr;
    }

    .showcase-slider {
        min-height: 440px;
    }

    .showcase-slide video {
        min-height: 360px;
    }

    .topbar,
    .top-nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .studio-hero,
    .login-panel {
        grid-template-columns: 1fr;
    }

    .hero-media,
    .login-art {
        min-height: 320px;
    }

    .shell {
        grid-template-columns: 1fr;
        padding: 24px 0;
    }

    .recent-panel {
        position: static;
    }

    .button-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .marketing-hero,
    .content-band,
    .cta-band {
        width: min(100% - 20px, 1180px);
    }

    .marketing-hero {
        min-height: auto;
        padding-top: 28px;
    }

    .site-menu {
        justify-content: flex-start;
    }

    .feature-grid,
    .template-metrics,
    .ftp-connect-grid {
        grid-template-columns: 1fr;
    }

    .template-metrics div:first-child {
        grid-column: span 1;
    }

    .showcase-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .showcase-slider {
        min-height: 370px;
    }

    .showcase-slide video {
        min-height: 290px;
    }

    .studio-hero {
        width: min(100% - 20px, 1180px);
        min-height: auto;
        margin-top: 16px;
        gap: 18px;
    }

    .hero-actions,
    .batch-actions,
    .download-actions {
        flex-direction: column;
    }

    .inline-button,
    .batch-actions .primary-button,
    .batch-actions .secondary-button,
    .download-actions .primary-button,
    .download-actions .secondary-button {
        width: 100%;
    }

    .shell {
        width: min(100% - 20px, 1180px);
    }

    .generator-panel,
    .job-panel {
        padding: 18px;
    }

    .page-head,
    .head-actions,
    .upload-copy,
    .result-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .upload-grid,
    .selector-grid,
    .duration-row,
    .job-summary,
    .batch-job,
    .download-card,
    .commander-actions {
        grid-template-columns: 1fr;
    }

    .commander-panel-head,
    .commander-path,
    .remote-tools,
    .commander-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .commander-row {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .commander-row em,
    .commander-row small {
        grid-column: 2;
    }

    .button-grid {
        grid-template-columns: 1fr;
    }
}
