:root { --radius: 13px; }

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font: 14px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg)
}

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

button,
a,
input,
textarea,
select {
    outline-offset: 4px
}

button {
    cursor: pointer;
    border: 1px solid var(--line);
    background: var(--surface-control);
    color: var(--text);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 550;
    transition: background .15s, transform .15s
}

button:hover {
    background: var(--surface-hover)
}

button:disabled {
    opacity: .4;
    cursor: not-allowed
}

a {
    color: inherit;
    text-decoration: none
}

a:hover {
    color: var(--accent)
}

h1,
h2,
h3,
p {
    margin: 0
}

h1 {
    font-size: 30px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -1px
}

h2 {
    font-size: 19px;
    font-weight: 570;
    letter-spacing: -.35px
}

h3 {
    font-size: 15px;
    font-weight: 600
}

.muted {
    color: var(--muted)
}

.small {
    font-size: 12px
}

.primary {
    background: var(--accent);
    color: var(--text-on-accent);
    border-color: transparent
}

.primary:hover {
    background: var(--accent-hover)
}

.secondary {
    background: transparent
}

.ghost {
    background: none;
    border-color: transparent
}

.danger {
    color: var(--red)
}

.icon-btn {
    width: 34px;
    height: 34px;
    padding: 4px;
    font-size: 19px
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    padding: 9px 15px;
    border-radius: 8px;
    background: var(--panel2)
}

.sidebar {
    width: 235px;
    position: fixed;
    inset: 0 auto 0 0;
    border-right: 1px solid var(--line);
    background: var(--surface-base);
    padding: 32px 20px 18px;
    display: flex;
    flex-direction: column;
    z-index: 20
}

.brand {
    display: flex;
    gap: 11px;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.5px;
    white-space: nowrap
}

.brand-symbol {
    display: grid;
    place-items: center;
    background: var(--accent-primary);
    color: var(--text-on-accent);
    width: 37px;
    height: 39px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 27px;
    position: relative;
    transform: rotate(-5deg)
}

.brand-symbol span {
    position: absolute;
    font-size: 17px;
    top: -10px;
    right: -7px;
    color: var(--accent-text)
}

.brand-light {
    font-weight: 400;
    color: var(--text-secondary)
}

.brand small {
    display: block;
    letter-spacing: 1.65px;
    font-size: 7px;
    color: var(--text-muted);
    margin-top: 2px
}

.new-short {
    margin: 33px 0 30px;
    width: 100%;
    text-align: left;
    display: flex;
    gap: 10px;
    align-items: center
}

.new-short>span {
    font-size: 22px;
    line-height: 1
}

.new-short kbd {
    margin-left: auto;
    font: 10px inherit;
    background: var(--accent-primary);
    padding: 1px 5px;
    border-radius: 4px
}

.nav-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 0 13px 10px
}

nav a,
.sidebar-bottom>a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    color: var(--text-muted);
    font-size: 13px;
    border-radius: 7px;
    margin: 4px 0
}

.nav-icon {
    font-size: 20px;
    width: 22px;
    text-align: center;
    line-height: 1;
    color: var(--text-muted)
}

nav a.active,
.sidebar-bottom>a.active {
    background: var(--surface-raised);
    color: var(--accent-text)
}

nav a.active .nav-icon {
    color: var(--accent-text)
}

.nav-count {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-secondary);
    background: var(--surface-hover);
    border-radius: 5px;
    padding: 1px 6px
}

.sidebar-bottom {
    margin-top: auto
}

.local-status {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding: 21px 7px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px
}

.local-status small {
    display: block;
    color: var(--text-muted);
    font-size: 10px
}

.live-dot,
.review-pill i {
    width: 6px;
    height: 6px;
    display: inline-block;
    background: var(--success);
    border-radius: 50%
}

.local-lock {
    margin-left: auto;
    font-size: 21px;
    color: var(--text-muted)
}

.workspace {
    margin-left: 235px
}

.topbar {
    height: 77px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    font-size: 12px;
    color: var(--text-secondary)
}

.topbar #breadcrumb>span {
    margin: 0 13px;
    color: var(--text-faint)
}

.topbar-right {
    display: flex;
    gap: 23px;
    align-items: center
}

.review-pill {
    color: var(--text-muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px
}

.review-pill i {
    width: 5px;
    height: 5px
}

.provider-pill {
    font-size: 11px;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    padding: 5px 10px;
    border-radius: 6px
}

.avatar {
    width: 29px;
    height: 29px;
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--accent-text);
    font-size: 11px
}

main {
    padding: 37px 40px 60px;
    max-width: 1700px;
    margin: auto
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 29px
}

.page-heading p {
    margin-top: 9px;
    color: var(--muted);
    font-size: 13px
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--accent-text);
    margin-bottom: 15px
}

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

.wrap {
    flex-wrap: wrap
}

.between {
    justify-content: space-between
}

.gap20 {
    gap: 20px
}

.hero {
    border: 1px solid var(--border-default);
    background: radial-gradient(ellipse at 75% 70%, var(--surface-raised) 0, transparent 52%), linear-gradient(110deg, var(--surface-raised), var(--surface-raised));
    min-height: 260px;
    border-radius: 15px;
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    overflow: hidden;
    position: relative;
    margin-bottom: 24px
}

.hero-copy {
    padding: 33px 34px;
    z-index: 1
}

.hero h2 {
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -.9px;
    font-weight: 550;
    max-width: 460px
}

.hero h2 em {
    color: var(--accent-text);
    font-style: normal
}

.hero p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 14px 0 24px;
    max-width: 420px;
    line-height: 1.7
}

.hero button {
    padding: 10px 17px;
    font-size: 12px
}

.hero-art {
    position: relative;
    min-height: 260px;
    overflow: hidden
}

.orbital {
    position: absolute;
    width: 300px;
    height: 300px;
    border: 1px solid color-mix(in srgb, var(--border-strong) 40.00%, transparent);
    border-radius: 50%;
    top: -25px;
    left: 35px;
    transform: rotate(-15deg)
}

.orbital:after {
    content: "";
    position: absolute;
    inset: 35px;
    border: 1px dashed color-mix(in srgb, var(--accent-border) 33.33%, transparent);
    border-radius: 50%
}

.hero-card {
    position: absolute;
    width: 113px;
    height: 182px;
    border-radius: 12px;
    background: var(--surface-control);
    box-shadow: 0 16px 45px color-mix(in srgb, var(--shadow-color) 40.00%, transparent);
    overflow: hidden;
    border: 3px solid var(--border-strong);
    top: 48px;
    left: 36px;
    transform: rotate(-12deg)
}

.hero-card.two {
    background: var(--surface-active);
    left: 135px;
    top: 30px;
    transform: rotate(3deg);
    z-index: 2;
    border-color: var(--accent-border)
}

.hero-card.three {
    background: var(--warning-soft);
    left: 232px;
    top: 61px;
    transform: rotate(15deg);
    border-color: var(--danger);
    z-index: 3
}

.hero-card svg {
    width: 100%;
    height: 100%
}

.hero-card-label {
    position: absolute;
    bottom: 10px;
    left: 8px;
    right: 8px;
    background: color-mix(in srgb, var(--media-surface) 75%, transparent);
    padding: 5px;
    border-radius: 4px;
    font-size: 7px;
    letter-spacing: 1px;
    color: var(--text-primary);
    text-align: center;
    backdrop-filter: blur(6px)
}

.sparkle {
    position: absolute;
    color: var(--accent-text);
    font-size: 27px;
    top: 23px;
    left: 273px
}

.sparkle.last {
    top: 218px;
    left: 90px;
    font-size: 18px
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 36px
}

.stat {
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-control);
    padding: 17px 20px
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted)
}

.stat-icon {
    font-size: 16px;
    color: var(--accent-text)
}

.stat strong {
    display: block;
    margin-top: 6px;
    font-size: 25px;
    font-weight: 550;
    letter-spacing: -1px
}

.stat small {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0;
    margin-left: 9px;
    color: var(--text-muted)
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 17px;
    gap: 14px
}

.section-heading p {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px
}

.text-link {
    font-size: 11px;
    color: var(--accent-text)
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px
}

.preset-tile {
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 18px;
    background: var(--surface-control);
    text-align: left;
    display: flex;
    gap: 14px;
    align-items: center;
    cursor: pointer
}

.preset-tile:hover {
    border-color: var(--border-strong);
    background: var(--surface-raised)
}

.preset-glyph {
    height: 44px;
    width: 44px;
    flex-shrink: 0;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 24px;
    color: var(--tile-color);
    background: color-mix(in srgb, var(--tile-color) 11%, transparent)
}

.preset-tile h3 {
    font-size: 12px
}

.preset-tile p {
    font-size: 10px;
    color: var(--muted);
    margin-top: 3px
}

.arrow {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 17px
}

.workflow-strip {
    display: flex;
    justify-content: center;
    gap: 15px;
    color: var(--text-muted);
    font-size: 10px;
    border-top: 1px solid var(--line);
    padding-top: 24px;
    margin-top: 33px;
    flex-wrap: wrap
}

.workflow-strip span:first-child {
    color: var(--accent-text)
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin: 22px 0
}

.filters {
    display: flex;
    gap: 5px;
    flex-wrap: wrap
}

.filter {
    font-size: 11px;
    padding: 7px 12px;
    background: transparent;
    border-color: transparent;
    color: var(--text-muted)
}

.filter.active {
    background: var(--surface-raised);
    color: var(--accent-text);
    border-color: var(--border-strong)
}

.search {
    position: relative;
    max-width: 280px;
    flex: 1
}

.search input {
    padding: 9px 12px 9px 32px;
    font-size: 11px
}

.search:before {
    content: '⌕';
    position: absolute;
    left: 11px;
    top: 5px;
    font-size: 20px;
    color: var(--text-muted)
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px
}

.project-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    overflow: hidden;
    cursor: pointer;
    transition: transform .2s, border .2s;
    position: relative
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong)
}

.project-card.is-selected { border-color: var(--accent, var(--accent-border)); }
.project-card-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -3px; border-radius: 12px; }
.project-card-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 18px; border-top:1px solid var(--line); cursor:default; }
.project-card-actions label { display:flex; align-items:center; gap:8px; cursor:pointer; font-size:13px; }
.project-card-actions input { width:16px; height:16px; margin:0; accent-color:var(--focus-ring); }
.project-selection-controls { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:0 0 20px; }
.project-load-more { display:flex; flex-direction:column; align-items:center; gap:14px; padding:24px 0; }
.project-delete-list { max-height:200px; overflow:auto; margin-bottom:14px; }
.project-delete-list p { overflow-wrap:anywhere; margin:5px 0; }

.project-visual {
    height: 170px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, color-mix(in srgb, var(--tile-color) 25%, var(--surface-canvas)), var(--surface-raised));
    display: flex;
    align-items: center;
    justify-content: center
}

.project-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.project-visual svg {
    height: 150px;
    width: 220px;
    opacity: .85
}

.project-visual .badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: color-mix(in srgb, var(--surface-base) 78.82%, transparent);
    backdrop-filter: blur(6px);
    color: var(--text-primary);
    border: 1px solid color-mix(in srgb, var(--text-primary) 7.06%, transparent)
}

.duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: color-mix(in srgb, var(--surface-base) 78.82%, transparent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px
}

.project-copy {
    padding: 17px
}

.project-copy h3 {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 9px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--text-muted)
}

.project-progress {
    display: flex;
    gap: 4px;
    margin-top: 16px
}

.project-progress i {
    height: 3px;
    flex: 1;
    background: var(--surface-hover);
    border-radius: 3px
}

.project-progress i.done {
    background: var(--accent-primary)
}

.empty {
    border: 1px dashed var(--border-default);
    border-radius: 12px;
    padding: 37px 22px;
    text-align: center;
    color: var(--muted);
    background: linear-gradient(135deg, var(--surface-panel), var(--surface-base))
}

.empty .empty-icon {
    font-size: 25px;
    color: var(--accent-text);
    margin-bottom: 9px
}

.empty h3 {
    color: var(--text-secondary);
    margin-bottom: 7px;
    font-size: 14px
}

.empty p {
    font-size: 12px;
    max-width: 460px;
    margin: 0 auto 19px
}

.empty.compact {
    padding: 25px
}

.badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--surface-raised);
    color: var(--accent-text);
    white-space: nowrap
}

.badge.green {
    background: var(--success-soft);
    color: var(--success)
}

.badge.red {
    background: var(--danger-soft);
    color: var(--danger)
}

.badge.amber {
    background: var(--warning-soft);
    color: var(--warning)
}

.badge.blue {
    background: var(--surface-control);
    color: var(--info)
}

.panel {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 23px;
    background: var(--panel);
    margin-bottom: 20px
}

.panel>h2 {
    margin-bottom: 7px
}

.panel>p {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 20px
}

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

.grid3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px
}

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

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

label.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12px;
    color: var(--text-secondary)
}

input,
textarea,
select {
    border: 1px solid var(--border-default);
    border-radius: 7px;
    background: var(--surface-base);
    color: var(--text);
    padding: 10px 12px;
    width: 100%;
    min-width: 0
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-border);
    outline: 2px solid color-mix(in srgb, var(--focus-ring) 14.51%, transparent)
}

textarea {
    resize: vertical;
    line-height: 1.7;
    min-height: 90px
}

input::placeholder,
textarea::placeholder {
    color: var(--text-faint)
}

input[type=checkbox] {
    width: 15px;
    height: 15px;
    accent-color: var(--focus-ring)
}

input[type=range] {
    padding: 0;
    accent-color: var(--focus-ring)
}

input[type=file] {
    font-size: 11px;
    padding: 8px
}

label small,
.help {
    font-size: 10px;
    color: var(--text-muted)
}

.form-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line)
}

.callout {
    font-size: 12px;
    background: var(--surface-raised);
    border: 1px solid var(--border-default);
    padding: 13px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    margin: 15px 0;
    line-height: 1.7
}

.callout.warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: var(--warning)
}

.callout.error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger)
}

.job-error, .callout.error {
    overflow-wrap: anywhere;
}

.job-error {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
}

.style-picker {
    min-width: 0;
}

.custom-style {
    margin-top: 12px;
}

.project-audio-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.project-audio-controls > div {
    flex: 1 1 240px;
}

.project-audio-controls h3 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.project-audio-controls p {
    margin-bottom: 0;
}

.media-upload-preview {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: contain;
    background: var(--surface-sunken);
    margin: 16px 0;
    border-radius: 8px;
}

.scene-image video, .asset-card > video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-card > video {
    height: 180px;
}

[hidden] {
    display: none !important;
}

.callout.success {
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--success)
}

dialog {
    color: var(--text);
    background: var(--surface-panel);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    padding: 0;
    width: min(690px, calc(100vw - 30px));
    max-height: 90vh;
    box-shadow: 0 30px 130px color-mix(in srgb, var(--shadow-color) 60.00%, transparent)
}

dialog::backdrop {
    background: color-mix(in srgb, var(--scrim-color) 80.00%, transparent);
    backdrop-filter: blur(5px)
}

.dialog-header {
    padding: 25px 27px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: flex-start
}

.dialog-header h2 {
    font-size: 23px
}

.dialog-header p {
    font-size: 12px;
    color: var(--muted);
    margin-top: 5px
}

.dialog-body {
    padding: 23px 27px 27px
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
    overflow-x: auto
}

.tabs button {
    border: 0;
    background: transparent;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 12px;
    padding: 12px 17px;
    color: var(--text-muted);
    white-space: nowrap
}

.tabs button.active {
    color: var(--accent-text);
    border-bottom-color: var(--accent-border)
}

.create-tabs {
    display: flex;
    background: var(--surface-base);
    border: 1px solid var(--line);
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 20px
}

.create-tabs button {
    flex: 1;
    border: 0;
    background: none;
    font-size: 12px;
    color: var(--text-muted)
}

.create-tabs button.active {
    background: var(--surface-active);
    color: var(--accent-text)
}

.import-zone {
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px;
    margin: 13px 0;
    font-size: 12px;
    color: var(--accent-text);
    background: var(--surface-raised)
}

.import-zone input {
    width: 200px
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: auto;
    background: var(--panel)
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap
}

th {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: .4px;
    background: var(--surface-raised);
    padding: 13px 17px
}

td {
    padding: 17px;
    font-size: 12px;
    border-top: 1px solid var(--border-default);
    color: var(--text-secondary)
}

td.topic {
    font-weight: 550;
    max-width: 330px;
    white-space: normal;
    color: var(--text);
    cursor: pointer
}

td.topic:hover {
    color: var(--accent)
}

.table-check {
    width: 35px;
    padding-right: 0
}

.stage-dot {
    font-size: 10px;
    color: var(--text-muted);
    display: inline-flex;
    gap: 5px;
    align-items: center
}

.stage-dot.done {
    color: var(--success)
}

.stage-dot.review {
    color: var(--warning)
}

.batch-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin: 17px 0
}

.batch-actions button {
    font-size: 11px;
    padding: 8px 11px
}

.batch-card {
    padding: 24px;
    cursor: pointer
}

.batch-card:hover {
    border-color: var(--border-strong)
}

.batch-card h2 {
    margin: 14px 0 6px
}

.batch-card .progress-bar {
    margin-top: 20px
}

.progress-bar {
    height: 5px;
    background: var(--surface-active);
    border-radius: 4px;
    overflow: hidden
}

.progress-bar span {
    height: 100%;
    display: block;
    background: var(--accent-primary);
    transition: width .3s
}

.project-title {
    max-width: 800px
}

.project-title h1 {
    font-size: 27px;
    line-height: 1.35
}

.back-link {
    font-size: 11px;
    color: var(--accent-text);
    display: inline-block;
    margin-bottom: 14px
}

.review-steps {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    padding: 16px 23px;
    margin-bottom: 25px;
    gap: 12px;
    justify-content: space-between
}

.review-step {
    display: flex;
    gap: 9px;
    align-items: center;
    color: var(--accent-text);
    font-size: 11px
}

.review-step span {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-default);
    border-radius: 50%;
    font-size: 10px
}

.review-step.done {
    color: var(--text-secondary)
}

.review-step.done span {
    background: var(--success-soft);
    border-color: var(--success);
    color: var(--success)
}

.review-step-line {
    flex: 1;
    height: 1px;
    background: var(--surface-active);
    align-self: center;
    max-width: 80px
}

.editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(240px, .8fr);
    gap: 23px
}

.script-text {
    min-height: 380px;
    font-size: 15px;
    padding: 20px;
    line-height: 1.9
}

.script-details {
    padding: 21px
}

.script-details h3 {
    font-size: 12px;
    margin: 0 0 9px
}

.script-details p {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 20px;
    line-height: 1.8
}

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

.design-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 16px; }
.design-tile { text-align: left; white-space: normal; padding: 16px; }
.design-tile strong, .design-tile span { display: block; }
.design-tile span { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 8px; }
.design-tile:nth-child(1) { border-top: 3px solid var(--warning); }
.design-tile:nth-child(2) { border-top: 3px solid var(--warning); }
.design-tile:nth-child(3) { border-top: 3px solid var(--success); }
.design-tile:nth-child(4) { border-top: 3px solid var(--danger); }

.scene-card {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 12px;
    overflow: hidden;
    position: relative
}

.scene-delete {
    position: absolute;
    z-index: 3;
    top: 8px;
    right: 8px;
    background: color-mix(in srgb, var(--surface-base) 82.00%, transparent);
    border-color: color-mix(in srgb, var(--text-primary) 12.00%, transparent)
}

.scene-delete:hover {
    background: color-mix(in srgb, var(--danger) 92.00%, transparent)
}

.scene-delete svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round
}

.scene-fields > .flex.between {
    padding-right: 32px;
    min-height: 26px
}

.scene-top {
    display: grid;
    grid-template-columns: 135px 1fr;
    gap: 17px;
    padding: 18px
}

.scene-image {
    aspect-ratio: 9/16;
    background: var(--surface-raised);
    border-radius: 8px;
    overflow: hidden;
    display: grid;
    place-items: center;
    position: relative
}

.scene-image>img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.scene-image .scene-placeholder {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    padding: 10px
}

.scene-image .scene-placeholder b {
    display: block;
    font-size: 28px;
    font-weight: 300;
    color: var(--accent-text);
    margin-bottom: 7px
}

.scene-fields {
    display: flex;
    flex-direction: column;
    gap: 11px;
    min-width: 0
}

.scene-fields textarea {
    font-size: 11px;
    padding: 8px;
    min-height: 80px
}

.scene-fields label {
    font-size: 10px
}

.scene-footer {
    border-top: 1px solid var(--line);
    padding: 11px 17px;
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap
}

.scene-footer button {
    font-size: 10px;
    padding: 7px 9px
}

.scene-footer audio {
    width: 100%;
    height: 30px;
    margin-top: 7px
}

.scene-extra {
    padding: 0 18px 16px
}

.scene-extra summary {
    font-size: 11px;
    color: var(--accent-text);
    cursor: pointer;
    margin-bottom: 12px
}

.scene-extra .form-grid {
    gap: 10px
}

.scene-extra textarea {
    font-size: 11px;
    min-height: 60px
}

.scene-extra select {
    font-size: 11px;
    padding: 8px
}

.preview-layout {
    display: grid;
    grid-template-columns: minmax(230px, 400px) 1fr;
    gap: 30px;
    align-items: start
}

.preview-frame {
    container-type: inline-size;
    aspect-ratio: 9/16;
    background: var(--surface-sunken);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-default);
    margin: auto;
    width: 100%;
    max-height: 650px
}

.caption-settings {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    min-width: 0;
}
.caption-settings legend { padding: 0 8px; }
.caption-settings .form-grid { margin: 16px 0; }
.caption-toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.caption-toggle input { width: auto; }
input[type="color"] { height: 40px; padding: 4px; cursor: pointer; }

.preview-frame>img,
.preview-frame>video {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.preview-frame .preview-placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    text-align: center;
    padding: 30px;
    color: var(--text-muted)
}

.preview-caption {
    white-space: pre;
    position: absolute;
    bottom: 16%;
    left: 8%;
    right: 8%;
    text-align: center;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    text-shadow: 0 2px 3px var(--shadow-color), -1px -1px 0 var(--shadow-color), 1px 1px 0 var(--shadow-color);
    pointer-events: none
}

.preview-caption.minimal {
    font-weight: 500;
    font-size: 17px
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px
}

.preview-controls input {
    width: 100%
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer
}

.timeline-item.active {
    border-color: var(--accent-border);
    background: var(--surface-raised)
}

.timeline-item>span {
    color: var(--accent-text);
    font-size: 11px
}

.timeline-item p {
    font-size: 12px;
    flex: 1;
    color: var(--text-secondary)
}

.timeline-item small {
    color: var(--text-muted);
    white-space: nowrap;
    font-size: 10px
}

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

.asset-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden
}

.asset-card img {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: cover
}

.asset-card .asset-body {
    flex: 1;
    padding: 15px
}

.asset-card > img, .asset-card > video, .asset-card > .asset-audio-art {
    flex-shrink: 0
}

.asset-card .project-card-actions {
    margin-top: auto;
    flex-shrink: 0
}

.asset-card h3, .asset-card p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden
}

.asset-card p {
    font-size: 11px;
    color: var(--muted);
    margin: 6px 0
}

.asset-card h3 {
    font-size: 12px;
    margin-top: 10px;
    overflow-wrap: anywhere
}

.asset-card.is-selected { border-color: var(--accent, var(--accent-border)); }
.asset-audio-art { padding:35px; text-align:center; font-size:40px; color:var(--accent-text); }
.asset-card .asset-body { min-width:0; }
.asset-card p { overflow-wrap:anywhere; }

.asset-card audio {
    width: 100%;
    height: 32px
}

.ref-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px
}

.ref-option {
    display: flex;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: 11px;
    align-items: center;
    cursor: pointer
}

.ref-option img {
    width: 40px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px
}

.ref-option input {
    flex-shrink: 0
}

.preset-large {
    display: block;
    min-height: 220px;
    padding: 24px
}

.preset-large .preset-glyph {
    margin-bottom: 22px
}

.preset-large h3 {
    font-size: 17px
}

.preset-large p {
    font-size: 12px;
    margin: 8px 0 18px
}

.preset-structure {
    font-size: 11px;
    color: var(--text-secondary)
}

.job-item {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    margin: 10px 0
}

.job-item>div:nth-child(2) {
    flex: 1;
    min-width: 0
}

.job-item h3 {
    font-size: 13px
}

.job-item p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
    overflow-wrap: anywhere
}

.job-item .job-icon {
    font-size: 23px;
    color: var(--accent-text)
}

.job-item small {
    font-size: 10px;
    color: var(--text-muted)
}

.job-item button {
    font-size: 10px;
    padding: 6px 9px
}

#toasts {
    position: fixed;
    bottom: 25px;
    right: 27px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    z-index: 100
}

.toast {
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 14px 20px;
    box-shadow: 0 10px 40px color-mix(in srgb, var(--shadow-color) 53.33%, transparent);
    max-width: 440px;
    font-size: 12px;
    animation: enter .2s ease
}

.toast.error {
    border-color: var(--danger);
    background: var(--danger-soft)
}

.toast.success {
    border-color: var(--success)
}

.note-list {
    list-style: none;
    padding: 0;
    margin: 20px 0
}

.note-list li {
    font-size: 12px;
    margin: 12px 0;
    color: var(--text-secondary)
}

.note-list li:before {
    content: '✓';
    color: var(--success);
    margin-right: 10px
}

.source-row {
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
    display: flex;
    gap: 10px;
    font-size: 12px;
    align-items: center
}

.source-row a {
    color: var(--accent);
    flex: 1;
    overflow-wrap: anywhere
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent-border);
    border-radius: 50%;
    animation: spin 1s linear infinite
}

.loading {
    text-align: center;
    color: var(--accent-text);
    padding: 70px
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center
}

.header-actions button,
.header-actions a {
    font-size: 11px
}

.inline-notice {
    font-size: 11px;
    color: var(--text-muted);
    margin: 15px 0
}

.mobile-name {
    display: none
}

.estimate-number {
    font-size: 38px;
    letter-spacing: -1px;
    color: var(--accent-text);
    margin-bottom: 3px
}

.estimate-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    gap: 12px;
    margin: 22px 0
}

.estimate-grid small {
    font-size: 11px;
    color: var(--text-muted)
}

.hidden {
    display: none !important
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

@keyframes enter {
    from {
        transform: translateY(10px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

@media(min-width:1550px) {
    .hero-art {
        margin-left: 60px
    }

    .hero h2 {
        font-size: 37px
    }

    .project-visual {
        height: 205px
    }
}

@media(max-width:1180px) {
    .sidebar {
        width: 205px;
        padding-left: 15px;
        padding-right: 15px
    }

    .workspace {
        margin-left: 205px
    }

    .brand {
        font-size: 16px
    }

    main {
        padding: 28px
    }

    .topbar {
        padding: 0 28px
    }

    .hero-art {
        transform: scale(.87);
        transform-origin: left center
    }

    .hero h2 {
        font-size: 28px
    }

    .scene-grid {
        grid-template-columns: 1fr
    }

    .project-grid {
        gap: 12px
    }

    .preset-grid {
        gap: 10px
    }

    .preset-tile {
        padding: 14px
    }

    .preset-glyph {
        width: 35px;
        height: 38px
    }

    .asset-grid {
        grid-template-columns: repeat(3, 1fr)
    }
}

@media(max-width:900px) {
    .sidebar {
        width: 74px;
        padding: 26px 10px
    }

    .brand>span:last-child,
    .new-short kbd,
    .nav-label,
    .local-status,
    .sidebar a:not(.brand),
    .sidebar .new-short {
        font-size: 0
    }

    .brand-symbol {
        font-size: 26px
    }

    .brand {
        justify-content: center
    }

    .sidebar a:not(.brand) {
        padding: 14px 10px
    }

    .sidebar .nav-icon {
        font-size: 22px
    }

    .sidebar .nav-count {
        font-size: 8px;
        position: absolute;
        right: 3px
    }

    .new-short {
        justify-content: center;
        padding: 9px;
        margin: 30px 0 20px
    }

    .new-short>span {
        font-size: 24px
    }

    .workspace {
        margin-left: 74px
    }

    .topbar {
        height: 66px;
        padding: 0 24px
    }

    .topbar-right {
        gap: 12px
    }

    .review-pill {
        display: none
    }

    main {
        padding: 25px 24px
    }

    .hero-copy {
        padding: 28px
    }

    .hero-art {
        transform: scale(.7);
        transform-origin: left center;
        width: 300px
    }

    .hero {
        grid-template-columns: 1.25fr .8fr
    }

    .hero h2 {
        font-size: 26px
    }

    .hero p {
        font-size: 12px
    }

    .stats {
        gap: 10px
    }

    .stat {
        padding: 14px
    }

    .stat small {
        display: none
    }

    .project-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .preset-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .editor-grid {
        grid-template-columns: 1fr
    }

    .asset-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .review-step {
        font-size: 0
    }

    .review-step span {
        font-size: 11px
    }

    .review-step-line {
        max-width: none
    }

    .preview-layout {
        grid-template-columns: minmax(200px, 300px) 1fr;
        gap: 20px
    }

    .preview-caption {
        font-size: 17px
    }
}

@media(max-width:640px) {
    .sidebar {
        width: 59px;
        padding-left: 5px;
        padding-right: 5px
    }

    .workspace {
        margin-left: 59px
    }

    .sidebar a:not(.brand) {
        padding: 13px 10px
    }

    .sidebar .nav-count {
        display: none
    }

    .brand-symbol {
        width: 31px;
        height: 33px;
        font-size: 23px
    }

    .topbar {
        padding: 0 16px;
        height: 59px
    }

    .topbar-right .avatar {
        display: none
    }

    .topbar #breadcrumb {
        font-size: 10px
    }

    .provider-pill {
        font-size: 9px;
        padding: 4px 6px
    }

    .topbar #breadcrumb>span {
        margin: 0 6px
    }

    main {
        padding: 22px 16px
    }

    .page-heading {
        align-items: flex-start;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 20px
    }

    h1 {
        font-size: 25px
    }

    .page-heading p {
        font-size: 12px
    }

    .hero {
        grid-template-columns: 1fr;
        min-height: unset
    }

    .hero-copy {
        padding: 25px
    }

    .hero-art {
        display: none
    }

    .hero h2 {
        font-size: 27px
    }

    .hero p {
        margin-bottom: 20px
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        margin-bottom: 26px
    }

    .stat strong {
        font-size: 24px
    }

    .stat-top {
        font-size: 10px
    }

    .preset-grid {
        grid-template-columns: 1fr
    }

    .preset-tile {
        padding: 16px
    }

    .preset-glyph {
        width: 40px;
        height: 40px
    }

    .project-grid {
        grid-template-columns: 1fr
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch
    }

    .search {
        max-width: none
    }

    .form-grid,
    .grid2,
    .grid3 {
        grid-template-columns: 1fr
    }

    .full {
        grid-column: auto
    }

    .dialog-body {
        padding: 19px
    }

    .dialog-header {
        padding: 20px
    }

    .dialog-header h2 {
        font-size: 21px
    }

    .scene-top {
        grid-template-columns: 90px 1fr;
        padding: 13px;
        gap: 12px
    }

    .scene-fields textarea {
        min-height: 96px
    }

    .scene-image {
        max-height: 230px
    }

    .scene-footer {
        padding: 10px
    }

    .review-steps {
        padding: 12px;
        gap: 6px
    }

    .preview-layout {
        grid-template-columns: 1fr
    }

    .preview-frame {
        max-width: 280px
    }

    .asset-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px
    }

    .asset-card img {
        height: 120px
    }

    .ref-picker {
        grid-template-columns: 1fr 1fr
    }

    .project-title h1 {
        font-size: 23px
    }

    .panel {
        padding: 18px
    }

    .job-item {
        padding: 13px;
        gap: 10px
    }

    .job-item .job-icon {
        display: none
    }

    .job-item h3 {
        font-size: 12px
    }

    .header-actions {
        flex-wrap: wrap
    }

    .topbar-right {
        gap: 0
    }

    .workflow-strip {
        gap: 9px
    }

    .section-heading {
        align-items: flex-start
    }

    .section-heading h2 {
        font-size: 18px
    }

    #toasts {
        right: 15px;
        left: 74px;
        bottom: 15px
    }

    .toast {
        max-width: none
    }

    .estimate-number {
        font-size: 29px
    }
}
@media(max-width:900px){.brand>span:last-child,.new-short kbd,.nav-label,.local-status{display:none}.brand{width:100%}.sidebar-bottom{padding-bottom:5px}.new-short{gap:0}}

#preview-transition {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
#preview-transition[hidden] { display: none; }
#preview-transition img, #preview-transition video {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

.deletion-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.trash-list { display:grid; gap:12px; }
.trash-item { display:flex; align-items:center; gap:16px; padding:18px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.trash-item-copy { flex:1; min-width:0; }
.trash-item-copy h3 { overflow-wrap:anywhere; margin:5px 0 8px; }
.trash-item input,.trash-ack input { width:16px; height:16px; accent-color:var(--focus-ring); }
.trash-ack { display:flex; align-items:flex-start; gap:10px; margin-top:14px; }
@media(max-width:760px) { .trash-item { flex-wrap:wrap; } .trash-item .deletion-actions { width:100%; padding-left:32px; } }

.preview-frame.preview-buffering::after {
  content: 'Loading clip…';
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 100; padding: 6px 10px; border-radius: 6px;
  background: color-mix(in srgb,var(--media-surface) 87%,transparent); color: var(--media-text); font: 12px/1.4 sans-serif; pointer-events: none;
}
