:root {
    --background: #fafafa;
    --surface: #f5f5f5;
    --surface-elevated: #eeeeee;
    --surface-pure: #ffffff;
    --border-subtle: #e0e0e0;
    --border-strong: #cfcfcf;
    --text-primary: #111111;
    --text-secondary: #6a6a6a;
    --text-tertiary: #8a8a8a;
    --success: #8fd6a2;
    --success-surface: #e6f4ea;
    --error: #f3a0a0;
    --error-surface: #fdeaea;
    --shadow: rgba(0, 0, 0, 0.08);
    --space-0: 0;
    --space-4: 4px;
    --space-6: 6px;
    --space-8: 8px;
    --space-10: 10px;
    --space-12: 12px;
    --space-14: 14px;
    --space-16: 16px;
    --space-18: 18px;
    --space-20: 20px;
    --space-24: 24px;
    --space-28: 28px;
    --space-32: 32px;
    --space-40: 40px;
    --radius: 16px;
    --radius-small: 12px;
    color-scheme: light;
    --color-base-100: #ffffff;
    --color-base-200: #fafafa;
    --color-base-300: #f5f5f5;
    --color-base-content: #111111;
    --color-primary: #111111;
    --color-primary-content: #ffffff;
    --color-secondary: #4a4a4a;
    --color-secondary-content: #ffffff;
    --color-accent: #2b2b2b;
    --color-accent-content: #ffffff;
    --color-neutral: #2b2b2b;
    --color-neutral-content: #ffffff;
    --color-info: #6a6a6a;
    --color-info-content: #ffffff;
    --color-success: #8fd6a2;
    --color-success-content: #111111;
    --color-warning: #bdbdbd;
    --color-warning-content: #111111;
    --color-error: #f3a0a0;
    --color-error-content: #111111;
    --radius-selector: 999px;
    --radius-field: 12px;
    --radius-box: 16px;
    --size-selector: 0.25rem;
    --size-field: 0.25rem;
    --border: 1px;
    --depth: 0;
    --noise: 0;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    word-break: break-word;
}

img {
    display: block;
    max-width: 100%;
}

.page-shell {
    width: min(calc(100% - 40px), 1560px);
    margin: 0 auto;
    padding: var(--space-24) 0 var(--space-40);
}

.page-header {
    margin-bottom: var(--space-28);
}

.page-header-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-16);
    align-items: center;
    padding: var(--space-24) var(--space-28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 247, 247, 0.96));
}

.page-header-copy {
    display: grid;
    gap: var(--space-8);
}

.eyebrow {
    margin: 0 0 var(--space-8);
    color: var(--text-secondary);
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-header h1,
.section-heading h2,
.state-card h2,
.movement-card h3 {
    margin: 0;
    font-family: "Young Serif", Georgia, serif;
    font-weight: 400;
}

.page-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
}

.page-subtitle {
    margin: 0;
    max-width: 68ch;
    color: var(--text-secondary);
    font-size: 1rem;
}

.tab-nav-shell {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: var(--space-16);
    width: 100%;
    flex-wrap: wrap;
}

.tab-nav {
    display: flex;
    gap: var(--space-8);
    flex-wrap: wrap;
    padding: var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 70%, var(--surface-pure));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.tab-nav-right {
    margin-left: auto;
}

.global-status-strip.history-toolbar {
    width: 100%;
    margin-bottom: 0;
    padding-top: var(--space-16);
    border-top: 1px solid var(--border-subtle);
}

.page-header.page-header-shell.panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.page-header.page-header-shell.panel > .tab-nav-shell,
.page-header.page-header-shell.panel > .global-status-strip {
    flex: 0 0 auto;
    width: 100%;
}

.tab-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--space-16);
    color: var(--text-secondary);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.tab-nav .tab {
    border-radius: 999px;
    border: 0;
    font-size: 0.95rem;
}

.tab-nav .tab:focus-visible,
.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible,
.checkbox:focus-visible {
    outline: 2px solid rgba(17, 17, 17, 0.18);
    outline-offset: 2px;
}

.tab-link.is-active {
    color: var(--surface-pure);
}

.tab-nav .tab.tab-active {
    background: var(--text-primary);
    color: var(--surface-pure);
    box-shadow: none;
}

.page-content {
    display: grid;
    gap: var(--space-28);
}

.general-workspace {
    display: grid;
    grid-template-columns: minmax(420px, 0.92fr) minmax(620px, 1.38fr);
    gap: var(--space-24);
    align-items: stretch;
}

.create-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: var(--space-24);
    align-items: start;
}

.panel {
    background: var(--surface-pure);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(17, 17, 17, 0.04);
    padding: var(--space-24);
}

.surface-panel {
    background: color-mix(in srgb, var(--surface) 68%, var(--surface-pure));
}

.btn {
    border-radius: 14px;
    font-weight: 600;
    letter-spacing: 0;
    box-shadow: none;
}

.btn.btn-sm {
    min-height: 2.35rem;
}

.btn.btn-neutral,
.btn.btn-primary,
.btn.btn-secondary,
.btn.btn-accent,
.btn.btn-error,
.btn.btn-success {
    color: var(--surface-pure);
}

.btn.btn-outline,
.btn.btn-ghost {
    color: var(--text-primary);
}

.btn.btn-outline {
    background: var(--surface-pure);
}

.input,
.select,
.textarea {
    background: rgba(255, 255, 255, 0.82);
    border-color: var(--border-subtle);
    box-shadow: none;
}

.checkbox {
    border-color: var(--border-strong);
}

.workspace-panel {
    display: flex;
    flex-direction: column;
    height: clamp(620px, calc(100vh - 220px), 1100px);
    min-height: 0;
}

.workspace-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-right: var(--space-8);
}

.browse-workspace-body {
    overflow: auto;
}

.detail-workspace-body {
    overflow: hidden;
}

.workspace-footer {
    display: grid;
    gap: var(--space-12);
    padding-top: var(--space-16);
    margin-top: var(--space-16);
    border-top: 1px solid var(--border-subtle);
}

.search-form {
    display: grid;
    gap: var(--space-18);
}

.toolbar-header,
.panel-header,
.pagination-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-16);
}

.panel-header {
    margin-bottom: var(--space-18);
    align-items: end;
}

.page-meta {
    display: flex;
    gap: var(--space-12);
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.panel-caption,
.section-kicker {
    margin: 0;
    color: var(--text-secondary);
}

.panel-caption {
    max-width: 60ch;
    line-height: 1.5;
}

.section-kicker {
    margin-bottom: var(--space-4);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel-header h2 {
    margin: 0;
    font-family: "Young Serif", Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 2vw, 1.8rem);
    line-height: 1.12;
}

.field-block label {
    display: inline-block;
    margin-bottom: var(--space-6);
    font-family: "Young Serif", Georgia, serif;
    font-size: 1.4rem;
    line-height: 1.1;
}

.field-help,
.empty-copy,
.form-hint,
.image-fallback {
    margin: 0;
    color: var(--text-secondary);
}

.field-help,
.form-hint,
.form-field small,
.asset-browser-note,
.asset-preview-subtitle,
.create-source-preview-description,
.create-source-preview-subtitle {
    line-height: 1.45;
}

.search-controls {
    display: grid;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) 140px;
    gap: var(--space-12);
    align-items: end;
}

.search-field {
    display: grid;
    gap: var(--space-4);
}

.search-field span {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.search-controls input,
.search-controls button {
    min-height: 48px;
    font: inherit;
}

.search-controls input {
    width: 100%;
}

.search-controls button {
    align-self: end;
}

.table-shell {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: var(--surface-pure);
}

.artwork-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.artwork-table th,
.artwork-table td {
    padding: var(--space-12) var(--space-16);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-subtle);
}

.artwork-table thead th {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--surface) 78%, var(--surface-pure));
    position: sticky;
    top: 0;
    z-index: 1;
}

.artwork-table tbody tr:last-child td {
    border-bottom: 0;
}

.table-row-link {
    cursor: pointer;
    transition: background-color 140ms ease, box-shadow 140ms ease;
}

.table-row-link:hover,
.table-row-link:focus-within {
    background: color-mix(in srgb, var(--surface) 74%, var(--surface-pure));
}

.table-row-link.is-selected {
    background: color-mix(in srgb, var(--surface-elevated) 85%, var(--surface-pure));
    box-shadow: inset 3px 0 0 var(--text-primary);
}

.row-title-link {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
}

.row-title-link:hover {
    text-decoration: underline;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.status-pill-ready {
    color: var(--text-primary);
}

.pagination-bar {
    margin-top: var(--space-16);
    align-items: end;
}

.pagination-actions {
    display: flex;
    gap: var(--space-12);
    flex-wrap: wrap;
    align-items: center;
}

.browse-controls-block {
    display: grid;
    gap: var(--space-12);
    padding: var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
}

.browse-controls-form {
    display: flex;
    align-items: end;
    gap: var(--space-12);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.browse-control {
    display: grid;
    gap: var(--space-4);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.browse-control input,
.browse-control select {
    min-height: 44px;
    font: inherit;
}

.browse-control input {
    width: 120px;
}

.browse-control select {
    min-width: 100px;
}

.browse-apply-button {
    min-height: 44px;
    font: inherit;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    text-decoration: none;
}

.pagination-link.is-disabled {
    color: var(--text-tertiary);
    opacity: 0.55;
    pointer-events: none;
}

.result-shell {
    min-height: 240px;
}

.create-form-panel,
.create-result-panel {
    display: grid;
    gap: var(--space-20);
}

.create-form {
    display: grid;
    gap: var(--space-20);
}

.script-switcher-form {
    margin-bottom: var(--space-20);
}

.create-panel-header {
    align-items: baseline;
}

.create-form-layout,
.create-result-grid {
    display: grid;
    gap: var(--space-20);
}

.create-form-layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}

.create-result-panel {
    position: sticky;
    top: var(--space-24);
}

.create-section {
    display: grid;
    gap: var(--space-16);
    background: color-mix(in srgb, var(--surface) 72%, var(--surface-pure));
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: var(--space-20);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.create-section-source {
    gap: var(--space-18);
}

.create-section-wide {
    grid-column: 1 / -1;
}

.create-section-header {
    display: grid;
    gap: var(--space-4);
}

.create-section-header h3 {
    margin: 0;
    font-family: "Young Serif", Georgia, serif;
    font-weight: 400;
    font-size: 1.375rem;
}

.create-section-header p {
    margin: 0;
    color: var(--text-secondary);
    max-width: 60ch;
}

.create-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-16);
}

.create-source-layout {
    display: grid;
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: var(--space-24);
    align-items: start;
}

.create-source-controls {
    display: grid;
    gap: var(--space-16);
    align-content: start;
    min-width: 0;
}

.create-source-preview-shell {
    min-width: 0;
}

.create-source-preview-card {
    display: grid;
    gap: var(--space-16);
    min-height: 100%;
    padding: var(--space-20);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: var(--surface-pure);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    align-content: start;
}

.create-source-preview-card-muted {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 245, 245, 0.96));
}

.create-source-preview-card-error {
    background: var(--error-surface);
    border-color: var(--error);
}

.create-source-preview-header,
.create-source-preview-copy {
    display: grid;
    gap: var(--space-8);
}

.create-source-preview-header {
    align-content: start;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.create-source-preview-header h4 {
    margin: 0;
    font-family: "Young Serif", Georgia, serif;
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.2;
}

.create-source-preview-subtitle,
.create-source-preview-description {
    margin: 0;
}

.create-source-preview-subtitle {
    color: var(--text-secondary);
    font-weight: 600;
}

.create-source-preview-description {
    color: var(--text-secondary);
    max-width: 48ch;
}

.create-source-preview-badges {
    display: flex;
    gap: var(--space-8);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.create-source-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-16);
}

.create-source-media-grid.is-single {
    grid-template-columns: minmax(0, 1fr);
}

.create-media-warning {
    margin-bottom: var(--space-16);
}

.create-media-unavailable {
    display: grid;
    min-height: 180px;
    place-items: center;
    align-content: center;
    gap: var(--space-8);
    padding: var(--space-16);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-small);
    background: var(--surface);
    color: var(--text-secondary);
    text-align: center;
}

.create-media-unavailable figcaption {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.create-source-media-card {
    display: grid;
    gap: var(--space-8);
    margin: 0;
    align-content: start;
}

.create-source-media-frame {
    display: grid;
    place-items: center;
    aspect-ratio: 5 / 4;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfbfb, #f2f2f2);
}

.create-source-media-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.create-source-media-fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: var(--space-20);
    color: var(--text-secondary);
    text-align: center;
}

.create-source-media-fallback p,
.create-source-media-meta strong,
.create-source-media-meta span {
    margin: 0;
}

.create-source-media-meta {
    display: grid;
    gap: var(--space-4);
}

.create-source-media-meta strong {
    font-size: 0.9375rem;
}

.create-source-media-meta span {
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.create-source-meta-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-12) var(--space-16);
    margin: 0;
}

.create-source-meta-list div {
    display: grid;
    gap: var(--space-4);
}

.create-source-meta-list dt,
.create-source-meta-list dd {
    margin: 0;
}

.create-source-meta-list dt {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.create-source-meta-list dd {
    font-size: 0.9375rem;
    font-weight: 600;
}

.create-source-preview-actions {
    display: flex;
    gap: var(--space-12);
    flex-wrap: wrap;
    padding-top: var(--space-12);
    border-top: 1px solid var(--border-subtle);
}

.create-template-stack {
    display: grid;
    gap: var(--space-16);
}

.create-field-shell.is-hidden {
    display: none;
}

.form-field {
    display: grid;
    gap: var(--space-8);
}

.form-field.form-field-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    min-height: 48px;
}

.form-field span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-field.form-field-checkbox span {
    margin: 0;
}

.form-field .label-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.form-field.form-field-checkbox .label-text {
    font-size: 0.95rem;
}

.form-field small {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    font: inherit;
}

.form-field textarea {
    min-height: 132px;
    resize: vertical;
}

.form-field input[type="color"] {
    min-height: 48px;
    min-width: 100%;
}

.form-field.form-field-checkbox input[type="checkbox"] {
    width: 1.2rem;
    min-width: 1.2rem;
    height: 1.2rem;
    margin: 0;
}

.theme-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-10);
}

.theme-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    min-height: 56px;
    padding: var(--space-10) var(--space-12);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-small);
    background: var(--surface-pure);
}

.theme-setting-name {
    min-width: 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.theme-setting-control {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: var(--space-6);
    color: var(--text-secondary);
}

.theme-setting-control input {
    width: 74px;
}

/* Settings has several unrelated admin workflows, so keep the page structured
   with clear bands instead of reusing the denser Create console layout. */
.settings-workspace {
    width: min(100%, 1180px);
    margin: 0 auto;
}

.settings-panel {
    display: grid;
    gap: 0;
    padding: clamp(var(--space-20), 3vw, var(--space-32));
}

.settings-page-header,
.settings-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-20);
}

.settings-page-header {
    padding-bottom: var(--space-28);
}

.settings-page-heading {
    display: grid;
    gap: var(--space-8);
    min-width: 0;
}

.settings-page-heading h1,
.settings-section-header h2 {
    margin: 0;
    font-family: "Young Serif", Georgia, serif;
    font-weight: 400;
    line-height: 1.15;
}

.settings-page-heading h1 {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
}

.settings-section-header h2 {
    font-size: 1.45rem;
}

.settings-page-description,
.settings-section-description,
.settings-danger-copy {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
}

.settings-page-description {
    max-width: 66ch;
}

.settings-copy-wide {
    max-width: 78ch;
}

.settings-section {
    display: grid;
    gap: var(--space-18);
    min-width: 0;
    padding: var(--space-28) 0;
    border-top: 1px solid var(--border-subtle);
}

.settings-section .alert {
    margin: 0;
}

.settings-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-10);
    margin: 0;
}

.settings-overview-item {
    display: grid;
    align-content: start;
    gap: var(--space-6);
    min-width: 0;
    min-height: 76px;
    padding: var(--space-12);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-small);
    background: rgba(255, 255, 255, 0.68);
}

.settings-overview-item dt {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.3;
    text-transform: uppercase;
}

.settings-overview-item dd {
    min-width: 0;
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.settings-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
    max-width: 100%;
    line-height: 1.35;
}

.settings-status::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.settings-status-ok {
    color: #267a3f;
}

.settings-status-error {
    color: #a23838;
}

.settings-status-muted {
    color: var(--text-secondary);
}

.settings-form {
    display: grid;
    gap: var(--space-20);
}

.settings-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-12);
    flex-wrap: wrap;
    padding-top: var(--space-16);
    border-top: 1px solid var(--border-subtle);
}

.settings-inline-form {
    display: block;
    margin: 0;
}

.settings-callout {
    display: grid;
    gap: var(--space-8);
    max-width: 82ch;
    padding: var(--space-14) var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-small);
    background: rgba(255, 255, 255, 0.62);
}

.settings-callout p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.settings-callout code,
.settings-danger-copy code {
    overflow-wrap: anywhere;
}

.deployment-settings {
    align-content: start;
}

.deployment-setup {
    display: grid;
    gap: var(--space-18);
    max-width: 900px;
    padding: var(--space-18);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-small);
    background: rgba(255, 255, 255, 0.58);
}

.deployment-setup[hidden],
.deployment-details[hidden] {
    display: none;
}

.deployment-setup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-14);
}

.deployment-setup-header > div {
    display: grid;
    gap: var(--space-6);
}

.deployment-setup-header strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.deployment-setup-header p,
.deployment-vps-status p,
.deployment-setup-guidance p {
    max-width: 68ch;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.deployment-readiness-groups {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
    gap: var(--space-12);
}

.deployment-readiness-group {
    min-width: 0;
    padding: var(--space-14);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-small);
    background: rgba(255, 255, 255, 0.72);
}

.deployment-readiness-group h3 {
    margin: 0 0 var(--space-12);
    color: var(--text-primary);
    font-size: 0.82rem;
}

.deployment-readiness-list {
    display: grid;
    gap: var(--space-10);
    padding: 0;
    margin: 0;
    list-style: none;
}

.deployment-readiness-list li,
.deployment-vps-status {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: var(--space-8);
}

.deployment-readiness-list li > span:last-child {
    display: grid;
    gap: 2px;
}

.deployment-readiness-list strong {
    color: var(--text-primary);
    font-size: 0.82rem;
}

.deployment-readiness-list small {
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.deployment-readiness-mark {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

.deployment-readiness-list li[data-state="ready"] .deployment-readiness-mark {
    color: #267a3f;
}

.deployment-readiness-list li[data-state="error"] .deployment-readiness-mark {
    color: #a23838;
}

.deployment-setup-guidance {
    display: grid;
    gap: var(--space-8);
    padding-top: var(--space-14);
    border-top: 1px solid var(--border-subtle);
}

.deployment-setup-guidance > strong {
    color: var(--text-primary);
    font-size: 0.84rem;
}

.deployment-setup-guidance ol {
    display: grid;
    gap: var(--space-6);
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

.deployment-setup-guidance code {
    overflow-wrap: anywhere;
}

.deployment-setup-actions {
    display: flex;
    justify-content: flex-start;
}

.deployment-setup-actions [hidden] {
    display: none;
}

.deployment-details {
    display: grid;
    gap: var(--space-16);
}

.deployment-version-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(2, minmax(120px, 0.7fr)) 1.5fr;
    gap: var(--space-10);
}

.deployment-version-card {
    display: grid;
    align-content: start;
    gap: var(--space-6);
    min-width: 0;
    min-height: 92px;
    padding: var(--space-14);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-small);
    background: rgba(255, 255, 255, 0.62);
}

.deployment-version-card strong {
    color: var(--text-primary);
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.deployment-version-card > span:last-child {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.deployment-version-label {
    color: var(--text-tertiary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.deployment-summary-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
    gap: var(--space-10);
}

.deployment-summary-row > div {
    display: grid;
    gap: var(--space-6);
    min-width: 0;
    padding: var(--space-12) var(--space-14);
    border-left: 2px solid var(--text-primary);
    background: rgba(255, 255, 255, 0.48);
}

.deployment-actions {
    display: flex;
    align-items: center;
    gap: var(--space-10);
    flex-wrap: wrap;
}

.deployment-check-feedback {
    flex: 1 1 260px;
    min-width: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.4;
}

.deployment-check-feedback:empty {
    display: none;
}

.deployment-check-feedback[data-state="success"] {
    color: #2f6f42;
}

.deployment-check-feedback[data-state="error"] {
    color: #9b3434;
}

.deployment-console {
    overflow: hidden;
    border: 1px solid #2c2c2c;
    border-radius: var(--radius-small);
    background: #151515;
    color: #f4f4f4;
}

.deployment-console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-10) var(--space-14);
    border-bottom: 1px solid #343434;
    color: #d5d5d5;
    font-size: 0.75rem;
    font-weight: 700;
}

.deployment-console-heading,
.deployment-console-meta {
    display: flex;
    align-items: center;
    gap: var(--space-10);
}

.deployment-console-heading > div {
    display: grid;
    gap: 1px;
}

.deployment-console-heading small {
    color: #929292;
    font-size: 0.68rem;
    font-weight: 500;
}

.deployment-console-meta {
    color: #a7a7a7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 500;
}

.deployment-console-activity {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: #777;
}

.deployment-console-activity[data-state="requesting"],
.deployment-console-activity[data-state="queued"],
.deployment-console-activity[data-state="in_progress"] {
    background: #e0bd57;
    box-shadow: 0 0 0 0 rgba(224, 189, 87, 0.5);
    animation: deployment-pulse 1.5s ease-out infinite;
}

.deployment-console-activity[data-state="success"] {
    background: #74ca8a;
}

.deployment-console-activity[data-state="failure"] {
    background: #ee8d8d;
}

.deployment-console-progress {
    height: 2px;
    overflow: hidden;
    background: #303030;
}

.deployment-console-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: #e0bd57;
    transition: width 500ms ease;
}

.deployment-console[data-state="success"] .deployment-console-progress span {
    background: #74ca8a;
}

.deployment-console[data-state="failure"] .deployment-console-progress span {
    background: #ee8d8d;
}

.deployment-console-header a {
    color: #fff;
}

.deployment-console-output {
    display: grid;
    gap: 3px;
    max-height: 260px;
    padding: var(--space-12) var(--space-14);
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.76rem;
    line-height: 1.5;
}

.deployment-console-line {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: var(--space-10);
}

.deployment-console-line.is-current {
    color: #fff;
}

.deployment-console-line.is-current span::before {
    display: inline-block;
    animation: deployment-step-blink 1s steps(2, end) infinite;
}

.deployment-console-line time {
    color: #898989;
}

.deployment-console-success span::before {
    content: "✓ ";
    color: #74ca8a;
}

.deployment-console-failure span::before {
    content: "× ";
    color: #ee8d8d;
}

.deployment-console-pending span::before {
    content: "· ";
    color: #d7bd70;
}

@keyframes deployment-pulse {
    70% { box-shadow: 0 0 0 7px rgba(224, 189, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(224, 189, 87, 0); }
}

@keyframes deployment-step-blink {
    50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    .deployment-console-activity,
    .deployment-console-line.is-current span::before {
        animation: none;
    }

    .deployment-console-progress span {
        transition: none;
    }
}

.settings-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-16);
}

@media (max-width: 980px) {
    .deployment-version-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .deployment-readiness-groups {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .deployment-version-grid,
    .deployment-summary-row {
        grid-template-columns: 1fr;
    }

    .deployment-actions .btn {
        width: 100%;
    }

    .deployment-check-feedback {
        flex-basis: 100%;
    }

    .deployment-console-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .deployment-setup-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

.settings-field {
    display: grid;
    align-content: start;
    gap: var(--space-8);
    min-width: 0;
}

.settings-field > span {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
}

.settings-field small {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.settings-field input {
    width: 100%;
    min-width: 0;
    font: inherit;
}

.settings-danger-zone {
    margin-top: var(--space-8);
    padding: var(--space-20);
    border: 1px solid color-mix(in srgb, var(--error) 62%, var(--border-subtle));
    border-radius: var(--radius-small);
    background: color-mix(in srgb, var(--error-surface) 62%, var(--surface-pure));
}

.preformatted-value {
    white-space: pre-line;
}

.script-description-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-16);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: var(--space-16);
}

.script-description-card h3 {
    margin: 0;
    font-family: "Young Serif", Georgia, serif;
    font-weight: 400;
}

.script-description-card p {
    margin: 0;
    color: var(--text-secondary);
}

.script-switcher-row {
    display: flex;
    align-items: end;
    gap: var(--space-16);
}

.script-switcher-row .form-field {
    flex: 1;
}

.script-visibility-list {
    display: grid;
    gap: var(--space-10);
    margin-top: var(--space-12);
}

.script-visibility-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-16);
    padding: var(--space-14) var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: var(--surface-pure);
}

.script-visibility-disclosure {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    padding: var(--space-8) var(--space-10);
}

.script-voice-disclosure {
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    padding: var(--space-8) var(--space-10);
}

.script-visibility-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    list-style: none;
}

.script-visibility-disclosure > summary::-webkit-details-marker {
    display: none;
}

.script-voice-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    list-style: none;
}

.script-voice-disclosure > summary::-webkit-details-marker {
    display: none;
}

.script-voice-form {
    display: grid;
    gap: var(--space-12);
    margin-top: var(--space-12);
}

.script-voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-12);
}

.script-voice-actions {
    display: flex;
    justify-content: flex-end;
}

.script-visibility-row.is-off {
    opacity: 0.78;
}

.script-visibility-meta {
    display: grid;
    gap: var(--space-8);
    min-width: 0;
}

.script-visibility-headline {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    flex-wrap: wrap;
}

.script-visibility-headline h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
}

.script-visibility-meta p {
    margin: 0;
    color: var(--text-secondary);
}

.script-visibility-toggle-form {
    flex-shrink: 0;
}

.script-visibility-state {
    min-width: 2.2rem;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success);
}

.script-visibility-state.is-off {
    color: var(--error);
}

.script-output-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 var(--space-12);
    border-radius: 999px;
    background: var(--surface-pure);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.placeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-12);
}

.placeholder-card {
    display: grid;
    gap: var(--space-8);
    min-height: 120px;
    padding: var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: var(--surface-pure);
}

.placeholder-card code {
    font-size: 0.95rem;
    font-weight: 700;
}

.placeholder-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.create-actions {
    display: flex;
    gap: var(--space-12);
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    padding-top: var(--space-12);
    border-top: 1px solid var(--border-subtle);
}

.create-outline-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    min-height: 32px;
    padding: 0 var(--space-8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-field);
    background: var(--surface-pure);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.create-console-panel {
    display: grid;
    gap: var(--space-12);
    padding: var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: var(--surface-pure);
}

.create-console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
}

.create-console-status {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.create-console-activity {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.create-console-output {
    margin: 0;
    min-height: 150px;
    max-height: 260px;
    overflow: auto;
    padding: var(--space-16);
    border-radius: 14px;
    background: #111111;
    color: #f6f6f6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.8375rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.create-run-button,
.download-button,
.create-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    font: inherit;
    text-decoration: none;
}

.create-run-button {
    width: fit-content;
    min-width: 140px;
}

.create-secondary-button {
    white-space: nowrap;
}

.create-preview-panel,
.create-metadata-panel {
    height: 100%;
}

.create-metadata-panel {
    display: grid;
    gap: var(--space-16);
}

.create-social-copy-block {
    display: grid;
    gap: var(--space-8);
}

.create-social-copy-label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.metadata-list-divider {
    height: 1px;
    background: var(--border-subtle);
}

.create-preview-frame {
    display: grid;
    place-items: center;
    min-height: 420px;
    margin-bottom: var(--space-20);
    padding: var(--space-16);
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    background: var(--surface-pure);
}

.create-preview-frame img {
    width: min(100%, 340px);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
}

.create-preview-frame video {
    width: min(100%, 340px);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
    background: #000;
}

.bulk-script-picker-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-12);
    padding: var(--space-12);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: var(--surface-pure);
    cursor: pointer;
    list-style: none;
}

.bulk-script-picker-summary::-webkit-details-marker {
    display: none;
}

.bulk-script-picker-summary::after {
    content: "Hide";
    flex: 0 0 auto;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bulk-script-picker:not([open]) .bulk-script-picker-summary::after {
    content: "Show";
}

.bulk-script-picker-title {
    display: grid;
    gap: var(--space-4);
}

.bulk-script-picker[open] .bulk-script-picker-summary {
    margin-bottom: var(--space-16);
}

.bulk-count-actions {
    margin-top: var(--space-16);
}

.bulk-review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-20);
    align-items: start;
}

.bulk-review-card {
    min-width: 0;
}

.bulk-review-card.is-muted {
    opacity: 0.64;
}

.bulk-review-preview {
    min-height: 360px;
    margin-bottom: 0;
}

.bulk-review-preview img,
.bulk-review-preview video {
    width: min(100%, 260px);
}

.state-card {
    display: grid;
    gap: var(--space-12);
    background: color-mix(in srgb, var(--surface) 74%, var(--surface-pure));
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: var(--space-20);
}

.state-card h2 {
    font-size: 1.45rem;
    line-height: 1.12;
}

.state-card p {
    margin: 0;
    color: var(--text-secondary);
}

.state-card-error {
    background: var(--error-surface);
    border-color: var(--error);
}

.state-card-success {
    background: var(--success-surface);
    border-color: var(--success);
}

.state-card-warning {
    background: var(--surface-elevated);
    border-color: var(--border-strong);
}

.warning-list {
    margin: 0;
    padding-left: 20px;
}

.result-grid {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: var(--space-24);
    align-items: start;
}

.detail-grid {
    height: 100%;
    min-height: 0;
}

.detail-summary-panel {
    position: sticky;
    top: 0;
    align-self: start;
}

.detail-content-panel {
    height: 100%;
    min-height: 0;
    overflow: auto;
}

.image-panel {
    align-self: start;
}

.image-frame,
.image-placeholder {
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    background: var(--surface-pure);
    overflow: hidden;
    margin-bottom: var(--space-20);
}

.image-frame {
    padding: var(--space-14);
    background: linear-gradient(180deg, #fbfbfb, #f2f2f2);
}

.image-frame img {
    width: 100%;
    height: auto;
    background: var(--surface-elevated);
    border-radius: 14px;
}

.image-placeholder {
    display: grid;
    place-items: center;
    min-height: 320px;
    padding: var(--space-24);
    color: var(--text-secondary);
    text-align: center;
}

.assets-workspace {
    display: grid;
    gap: var(--space-20);
}

.assets-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-20);
    align-items: end;
    padding: var(--space-22) var(--space-24);
}

.assets-hero-copy h2 {
    margin: 0;
    font-family: "Young Serif", Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.75rem, 2.4vw, 2.125rem);
}

.assets-hero-copy .panel-caption {
    max-width: 60ch;
    margin-top: var(--space-8);
}

.assets-summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-12);
}

.assets-summary-card {
    min-width: 124px;
    padding: var(--space-12) var(--space-14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
}

.assets-summary-card .stat-title,
.assets-summary-card .stat-desc {
    color: var(--text-secondary);
}

.assets-summary-card .stat-value {
    font-family: "Young Serif", Georgia, serif;
    font-weight: 400;
    font-size: 2rem;
    line-height: 1;
}

.assets-toolbar-panel {
    display: grid;
    gap: var(--space-14);
    padding: var(--space-18) var(--space-20);
}

.assets-toolbar-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-16);
}

.assets-toolbar-head h3 {
    margin: 0;
    font-size: 1rem;
}

.assets-toolbar-head p {
    margin: var(--space-4) 0 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.assets-toolbar {
    display: grid;
    gap: var(--space-12);
}

.assets-search-row {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) auto;
    gap: var(--space-12);
    align-items: end;
}

.assets-filter-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-12);
    align-items: end;
}

.assets-toolbar-actions {
    display: flex;
    gap: var(--space-10);
    align-items: center;
    flex-wrap: wrap;
}

.assets-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-16);
    padding-top: var(--space-8);
    border-top: 1px solid var(--border-subtle);
}

.assets-results-count {
    margin: 0;
    font-weight: 600;
}

.assets-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
    margin-top: var(--space-12);
}

.asset-filter-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 var(--space-10);
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.assets-checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    min-height: 48px;
    color: var(--text-secondary);
}

.assets-checkbox-field input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.assets-checkbox-tile {
    min-height: 48px;
    padding: 0 var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-small);
    background: var(--surface-pure);
}

.assets-content {
    display: grid;
}

.asset-browser-panel {
    display: grid;
    gap: var(--space-18);
    min-width: 0;
    padding: var(--space-18) var(--space-20);
}

.asset-browser-topline {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-16);
}

.asset-browser-topline h3 {
    margin: 0;
    font-size: 1rem;
}

.asset-browser-note {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-18);
}

.asset-card {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 0;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: var(--surface-pure);
    overflow: hidden;
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.asset-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 10px 24px var(--shadow);
    transform: translateY(-1px);
}

.asset-card.is-selected {
    border-color: var(--border-strong);
    box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.06), 0 10px 20px var(--shadow);
}

.asset-card-media {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    padding: var(--space-10);
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, #fbfbfb, #f1f1f1);
    text-decoration: none;
    overflow: hidden;
}

.asset-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--surface-pure);
}

.asset-card-media-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: center;
}

.asset-card-body {
    display: grid;
    gap: var(--space-12);
    padding: var(--space-16);
}

.asset-card-metahead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-12);
}

.asset-card-badges,
.asset-preview-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
}

.asset-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    font-size: 0.75rem;
    font-weight: 600;
}

.asset-badge-kept {
    color: var(--text-primary);
}

.asset-badge-warning {
    color: var(--text-primary);
}

.asset-card-timestamp {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    text-align: right;
    line-height: 1.25;
}

.asset-card-heading h3 {
    margin: 0;
    font-size: 0.9875rem;
    line-height: 1.28;
}

.asset-card-heading h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.asset-card-heading h3 a:hover {
    text-decoration: underline;
}

.asset-card-heading p {
    margin: var(--space-4) 0 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.35;
}

.asset-card-secondary {
    display: grid;
    gap: var(--space-4);
    min-width: 0;
}

.asset-card-secondary p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.35;
}

.asset-card-actions {
    display: grid;
    gap: var(--space-8);
    margin-top: auto;
    padding-top: var(--space-10);
    border-top: 1px solid var(--border-subtle);
}

.asset-card-utility-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-10);
    flex-wrap: wrap;
}

.asset-card-actions form,
.asset-preview-actions form,
.asset-delete-confirmation-actions form {
    margin: 0;
}

.asset-primary-link,
.asset-secondary-link,
.asset-delete-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    text-decoration: none;
    font-size: 0.8125rem;
}

.asset-primary-link {
    font-weight: 600;
}

.asset-primary-link-block {
    width: 100%;
}

.asset-secondary-link {
    color: var(--text-secondary);
}

.asset-inline-link {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-decoration: none;
}

.asset-inline-link:hover {
    text-decoration: underline;
}

.asset-quiet-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    font: inherit;
    font-size: 0.8125rem;
}

.asset-delete-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    color: var(--text-secondary);
    text-decoration: none;
}

.asset-delete-link-strong {
    color: var(--error);
}

.asset-preview-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    z-index: 40;
}

.asset-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.28);
}

.asset-preview-panel {
    position: relative;
    display: grid;
    gap: var(--space-18);
    width: min(1040px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    padding: var(--space-24);
    overflow: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    z-index: 2;
    border-radius: 24px;
}

.asset-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-16);
}

.asset-preview-header h2 {
    margin: 0;
    font-family: "Young Serif", Georgia, serif;
    font-weight: 400;
    font-size: 1.625rem;
    line-height: 1.15;
}

.asset-preview-subtitle {
    margin: var(--space-8) 0 0;
    color: var(--text-secondary);
}

.asset-preview-body {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: var(--space-24);
    align-items: start;
}

.asset-close-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}

.asset-close-link:hover {
    text-decoration: underline;
}

.asset-preview-media-frame {
    display: grid;
    place-items: center;
    min-height: 520px;
    padding: var(--space-20);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    background: linear-gradient(180deg, #fbfbfb, #f2f2f2);
}

.asset-preview-media-frame img {
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    border-radius: 16px;
    background: var(--surface-pure);
}

.asset-preview-sidebar {
    display: grid;
    gap: var(--space-16);
}

.asset-preview-missing-state {
    display: grid;
    gap: var(--space-8);
    color: var(--text-secondary);
    text-align: center;
}

.asset-preview-missing-state h3,
.asset-delete-confirmation h3 {
    margin: 0;
    font-family: "Young Serif", Georgia, serif;
    font-weight: 400;
}

.asset-preview-missing-state p,
.asset-delete-confirmation p {
    margin: 0;
}

.asset-preview-meta-shell {
    display: grid;
    gap: var(--space-16);
}

.asset-preview-section {
    display: grid;
    gap: var(--space-12);
    padding-top: var(--space-16);
    border-top: 1px solid var(--border-subtle);
}

.asset-preview-section h3 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
}

.asset-preview-metadata {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-12);
}

.asset-preview-actions {
    display: flex;
    gap: var(--space-12);
    flex-wrap: wrap;
}

.asset-delete-confirmation {
    display: grid;
    gap: var(--space-16);
    padding: var(--space-20);
    border: 1px solid var(--error);
    border-radius: var(--radius-small);
    background: var(--error-surface);
}

.asset-delete-confirmation-actions {
    display: flex;
    gap: var(--space-12);
    flex-wrap: wrap;
}

.asset-delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    font: inherit;
}

.assets-empty-state {
    justify-items: start;
}

.content-section + .content-section {
    margin-top: var(--space-24);
    padding-top: var(--space-24);
    border-top: 1px solid var(--border-subtle);
}

.section-heading {
    margin-bottom: var(--space-16);
}

.section-heading h2 {
    font-size: 1.55rem;
    line-height: 1.12;
}

.metadata-list,
.compact-list {
    display: grid;
    gap: var(--space-12);
    margin: 0;
}

.metadata-list div,
.compact-list div {
    display: grid;
    gap: var(--space-4);
}

.metadata-list dt,
.compact-list dt {
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.metadata-list dd,
.compact-list dd {
    margin: 0;
    line-height: 1.52;
}

.detail-primary-metadata {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-copy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-16);
}

.detail-copy-card {
    display: grid;
    gap: var(--space-10);
    padding: var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 74%, var(--surface-pure));
}

.detail-copy-card h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-copy-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.65;
}

.movement-list {
    display: grid;
    gap: var(--space-16);
}

.movement-card {
    background: color-mix(in srgb, var(--surface) 72%, var(--surface-pure));
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: var(--space-18);
}

.movement-card h3 {
    margin-bottom: var(--space-12);
    font-size: 1.125rem;
}

.placeholder-list {
    margin: 0;
    padding-left: 20px;
}

.create-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-12);
    align-items: center;
}

.published-workspace {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: var(--space-16);
    height: calc(100vh - 12rem);
    height: calc(100dvh - 12rem);
    min-height: 0;
}

.published-notice-pill {
    display: inline-flex;
    align-self: start;
    margin: 0;
    padding: 0.45rem 0.75rem;
    border: 1px solid color-mix(in srgb, var(--success) 72%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--success-surface) 82%, var(--surface));
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.published-table-shell {
    position: relative;
    min-height: 0;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    background: var(--surface);
}

.published-table {
    min-width: 1180px;
    border-collapse: separate;
    border-spacing: 0;
}

.published-table thead {
    position: sticky;
    top: 0;
    z-index: 4;
}

.published-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: color-mix(in srgb, var(--surface) 82%, var(--surface-pure));
    box-shadow: inset 0 -1px 0 var(--border-subtle), 0 8px 16px rgba(17, 17, 17, 0.06);
}

.published-table th:nth-child(2),
.published-table td:nth-child(2) {
    width: 196px;
    min-width: 196px;
}

.published-table tr.is-selected {
    background: color-mix(in srgb, var(--surface-elevated) 84%, var(--surface));
}

.published-platform-cell.is-target {
    background: color-mix(in srgb, var(--success-surface) 72%, var(--surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 72%, transparent);
}

.published-platform-cell.is-target.is-focused-target {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--success) 88%, transparent), 0 0 0 3px rgba(143, 214, 162, 0.22);
}

.published-platform-cell.is-target .checkbox {
    outline: 2px solid color-mix(in srgb, var(--success) 70%, transparent);
    outline-offset: 3px;
}

.published-table tr[id] {
    scroll-margin-top: 140px;
}

.published-creative-cell {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: var(--space-16);
    align-items: start;
    min-width: 280px;
}

.published-creative-thumb,
.published-missing-thumb {
    width: 96px;
    height: 128px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
}

.published-creative-thumb img,
.published-creative-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.published-carousel-thumb-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
}

.published-carousel-thumb-grid a {
    display: block;
    min-width: 0;
}

.published-carousel-thumb-grid img {
    aspect-ratio: 9 / 16;
    object-fit: cover;
}

.published-preview-media-frame {
    position: relative;
}

.published-preview-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
}

.published-preview-nav-prev { left: 12px; }
.published-preview-nav-next { right: 12px; }

.published-preview-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.published-missing-thumb {
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    font: var(--font-caption);
    text-align: center;
    padding: var(--space-8);
}

.published-creative-copy {
    display: grid;
    gap: var(--space-8);
}

.published-creative-id {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.published-creative-copy h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

.published-creative-copy p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.published-creative-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.45;
    white-space: pre-line;
    word-break: break-word;
}

.published-copy-trigger {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: copy;
    transition: opacity 120ms ease, color 120ms ease;
}

.published-copy-trigger:hover {
    color: var(--text-primary);
}

.published-copy-trigger.is-copied {
    color: var(--success);
}

.published-creative-badges,
.published-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
    align-items: center;
}

.published-actions form {
    margin: 0;
}

.published-preview-dialog {
    width: min(440px, calc(100vw - 32px));
    max-width: 440px;
    padding: 0;
    border: 0;
    background: transparent;
}

.published-preview-dialog::backdrop {
    background: rgba(17, 17, 17, 0.24);
}

.published-preview-panel {
    display: grid;
    gap: var(--space-16);
    padding: var(--space-18);
    max-height: calc(100vh - 32px);
    overflow: auto;
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(17, 17, 17, 0.18);
}

.published-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-12);
}

.published-preview-header h2 {
    margin: 0;
    font: var(--font-section);
    color: var(--text-primary);
}

.published-preview-media-frame {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: var(--space-10);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: linear-gradient(180deg, #fafafa, #f1f1f1);
}

.published-preview-media-frame img,
.published-preview-media-frame video {
    width: auto;
    height: min(70vh, 500px);
    max-width: 100%;
    max-height: min(70vh, 500px);
    object-fit: contain;
    border-radius: 12px;
    background: #000;
}

.published-preview-description-shell {
    display: grid;
    gap: var(--space-8);
}

.published-preview-description {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-line;
}

.published-metadata-stack {
    display: grid;
    gap: 6px;
    align-content: start;
}

.published-metadata-stack p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.4;
}

.published-script-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 0;
    height: auto;
    max-width: 100%;
    padding: 8px 14px;
    border-radius: 999px;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    word-break: keep-all;
}

.published-checkbox-form {
    display: flex;
    justify-content: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-12);
}

.stat-card {
    display: grid;
    gap: var(--space-8);
    padding: var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: var(--surface);
}

.stat-label {
    margin: 0;
    color: var(--text-secondary);
    font: var(--font-caption);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    margin: 0;
    color: var(--text-primary);
    font: var(--font-section);
}

.history-workspace {
    display: grid;
}

.history-panel {
    gap: var(--space-24);
}

.history-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--space-16);
    flex-wrap: wrap;
    margin-bottom: var(--space-10);
}

.history-recommendation-section {
    display: grid;
    gap: var(--space-8);
    min-width: 0;
}

.history-recommendation-label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
}

.history-recommendation-line {
    display: flex;
    align-items: center;
    gap: var(--space-10);
    flex-wrap: wrap;
}

.history-recommendation-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 var(--space-12);
    gap: var(--space-8);
    font: inherit;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.history-recommendation-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    color: var(--text-primary);
    font-weight: 700;
}

.history-today-section {
    display: grid;
    gap: var(--space-6);
    justify-items: end;
    margin-left: auto;
}

.history-today-label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.history-today-line {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.history-today-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-6);
    min-height: 28px;
    padding: 0 var(--space-10);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: lowercase;
}

.history-today-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--error);
    flex: 0 0 auto;
}

.history-today-chip.is-posted {
    color: var(--text-primary);
}

.history-today-chip.is-posted .history-today-dot {
    background: var(--success);
}

.history-metrics-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(70px, 1fr)) auto;
    gap: var(--space-8);
    align-items: end;
    min-width: 420px;
}

.history-metrics-field {
    display: grid;
    gap: var(--space-4);
}

.history-metrics-field span {
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.history-metrics-field input {
    min-height: 34px;
    width: 100%;
}

.history-recommendation-dialog {
    width: min(460px, calc(100vw - 32px));
    border: 0;
    padding: 0;
    background: transparent;
}

.history-recommendation-dialog::backdrop {
    background: rgba(17, 17, 17, 0.24);
}

.history-recommendation-panel {
    display: grid;
    gap: var(--space-16);
}

.history-recommendation-panel-header,
.history-recommendation-panel-meta,
.history-recommendation-panel-body,
.history-recommendation-panel-actions {
    display: grid;
    gap: var(--space-10);
}

.history-recommendation-panel-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.history-recommendation-panel-header h2,
.history-recommendation-panel-body p {
    margin: 0;
}

.history-recommendation-panel-body p {
    color: var(--text-secondary);
}

.history-recommendation-panel-meta {
    display: flex;
    gap: var(--space-8);
    flex-wrap: wrap;
}

.history-table-shell {
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    background: var(--surface);
}

.history-table {
    min-width: 1160px;
}

.history-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
    width: 156px;
    min-width: 156px;
}

.history-creative-cell {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: var(--space-16);
    align-items: start;
    min-width: 320px;
}

.history-creative-thumb {
    width: 96px;
    height: 128px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
}

.history-creative-thumb img,
.history-creative-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.history-event-copy,
.history-metadata-stack {
    display: grid;
    gap: var(--space-8);
}

.history-event-copy h3,
.history-event-copy p,
.history-metadata-stack p {
    margin: 0;
}

.history-event-copy h3 {
    font: var(--font-section);
    color: var(--text-primary);
}

.history-event-copy p,
.history-metadata-stack p {
    color: var(--text-secondary);
}

.history-script-badge {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
}

@media (max-width: 1180px) {
    .general-workspace {
        grid-template-columns: 1fr;
    }

    .create-workspace,
    .create-result-grid {
        grid-template-columns: 1fr;
    }

    .create-form-layout,
    .detail-copy-grid {
        grid-template-columns: 1fr;
    }

    .history-toolbar {
        align-items: start;
    }

    .history-recommendation-line {
        gap: var(--space-8);
    }

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

    .workspace-panel {
        height: auto;
    }

    .workspace-body {
        overflow: visible;
        padding-right: 0;
    }

    .workspace-footer {
        margin-top: var(--space-12);
        padding-top: var(--space-12);
    }

    .create-result-panel {
        position: static;
    }

    .published-table {
        min-width: 980px;
    }

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

    .history-table {
        min-width: 980px;
    }

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

    .asset-preview-body {
        grid-template-columns: 1fr;
    }

    .asset-preview-media-frame {
        min-height: 420px;
    }
}

@media (max-width: 960px) {
    .page-header-shell,
    .assets-hero {
        grid-template-columns: 1fr;
    }

    .tab-nav-shell {
        align-items: stretch;
    }

    .tab-nav,
    .tab-nav-right {
        margin-left: 0;
        justify-self: start;
    }

    .search-controls {
        grid-template-columns: 1fr;
    }

    .assets-search-row,
    .assets-filter-row {
        grid-template-columns: 1fr;
    }

    .assets-results-bar {
        flex-direction: column;
    }

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

    .history-today-section,
    .history-today-line {
        justify-items: start;
        justify-content: flex-start;
    }

    .script-switcher-row,
    .script-description-card,
    .script-visibility-row {
        flex-direction: column;
        align-items: stretch;
    }

    .create-source-layout {
        grid-template-columns: 1fr;
    }

    .create-source-preview-header {
        grid-template-columns: 1fr;
    }

    .create-source-preview-badges {
        justify-content: flex-start;
    }

    .create-source-media-grid,
    .create-source-meta-list {
        grid-template-columns: 1fr;
    }

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

    .published-creative-cell {
        grid-template-columns: 84px 1fr;
        min-width: 240px;
    }

    .history-creative-cell {
        grid-template-columns: 84px 1fr;
        min-width: 260px;
    }

    .published-creative-thumb,
    .published-missing-thumb {
        width: 84px;
        height: 112px;
    }

    .history-creative-thumb {
        width: 84px;
        height: 112px;
    }

    .detail-primary-metadata {
        grid-template-columns: 1fr;
    }

    .detail-workspace-body,
    .detail-content-panel {
        overflow: visible;
    }

    .detail-summary-panel {
        position: static;
    }

    .settings-overview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 24px, 1120px);
        padding-top: var(--space-24);
    }

    .panel {
        padding: var(--space-16);
    }

    .search-controls {
        grid-template-columns: 1fr;
    }

    .create-field-grid,
    .create-form-layout {
        grid-template-columns: 1fr;
    }

    .toolbar-header,
    .panel-header,
    .pagination-bar {
        flex-direction: column;
    }

    .browse-controls-form {
        width: 100%;
    }

    .assets-summary-grid {
        width: 100%;
    }

    .assets-summary-card {
        min-width: 0;
        flex: 1 1 0;
    }

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

    .asset-browser-topline {
        flex-direction: column;
        align-items: stretch;
    }

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

    .asset-preview-metadata {
        grid-template-columns: 1fr;
    }

    .asset-card-utility-actions,
    .asset-preview-actions,
    .asset-delete-confirmation-actions,
    .assets-toolbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .create-source-preview-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .create-result-actions,
    .published-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-page-header,
    .settings-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-overview-grid,
    .settings-fields-grid,
    .theme-settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-panel {
        padding: var(--space-16);
    }

    .settings-section {
        padding: var(--space-24) 0;
    }

    .settings-danger-zone {
        padding: var(--space-16);
    }

    .settings-actions,
    .settings-actions form,
    .settings-actions a,
    .settings-actions button {
        width: 100%;
    }

    .settings-actions {
        align-items: stretch;
    }

    .asset-preview-overlay {
        padding: 12px;
    }

    .asset-preview-panel {
        width: min(100vw - 24px, 720px);
        max-height: calc(100vh - 24px);
    }
}

@media (max-width: 520px) {
    .asset-grid {
        grid-template-columns: 1fr;
    }
}

.schedule-workspace {
    display: grid;
    gap: 18px;
}

.schedule-header-panel,
.schedule-posts-panel {
    padding: 22px;
}

.schedule-header-panel,
.schedule-month-nav,
.schedule-post-row,
.schedule-post-row > div {
    display: flex;
    align-items: center;
}

.schedule-header-panel,
.schedule-post-row {
    justify-content: space-between;
    gap: 16px;
}

.schedule-subtitle,
.schedule-help {
    color: color-mix(in srgb, currentColor 65%, transparent);
    font-size: 0.86rem;
    line-height: 1.5;
}

.schedule-status-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(220px, 1.5fr);
    gap: 10px;
}

.schedule-status-card {
    display: grid;
    gap: 3px;
    min-height: 86px;
    padding: 14px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--surface);
}

.schedule-status-card strong {
    font-size: 1.45rem;
    line-height: 1;
}

.schedule-status-card > span:last-child {
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.schedule-status-label {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.schedule-status-card.is-warning {
    border-color: color-mix(in srgb, #dc2626 35%, var(--border-subtle));
    background: color-mix(in srgb, #dc2626 6%, var(--surface));
}

.schedule-status-card-note {
    align-content: center;
}

.schedule-month-nav {
    gap: 8px;
}

.schedule-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.schedule-calendar-panel {
    overflow: hidden;
    min-width: 0;
    padding: 0;
}

.schedule-weekdays,
.schedule-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.schedule-calendar-grid {
    overflow: hidden;
    border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    border-left: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    background: color-mix(in srgb, currentColor 16%, transparent);
}

.schedule-weekdays {
    padding: 13px 16px;
    background: color-mix(in srgb, var(--color-base-200) 70%, transparent);
    color: color-mix(in srgb, currentColor 60%, transparent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.schedule-weekdays span {
    padding-right: 2px;
    text-align: right;
}

.schedule-day {
    appearance: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 376px;
    min-width: 0;
    padding: 11px;
    border: 0;
    border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
    border-right: 1px solid color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 0;
    background: var(--color-base-100);
    color: inherit;
    font: inherit;
    text-align: left;
    transition: background 120ms ease, box-shadow 120ms ease;
}

button.schedule-day {
    cursor: pointer;
}

button.schedule-day:hover,
button.schedule-day:focus-visible {
    position: relative;
    z-index: 1;
    background: color-mix(in srgb, var(--color-base-200) 62%, transparent);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, currentColor 32%, transparent);
    outline: none;
}

.schedule-day:nth-child(7n) {
    border-right: 0;
}

.schedule-calendar-grid > .schedule-day:nth-child(-n + 7) {
    border-top: 0;
}

.schedule-day.is-outside {
    background: color-mix(in srgb, var(--color-base-200) 45%, transparent);
}

.schedule-day.is-today {
    background: color-mix(in srgb, var(--color-primary) 6%, var(--color-base-100));
    box-shadow: inset 0 3px 0 var(--color-primary);
}

.schedule-day-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 24px;
    gap: 8px;
}

.schedule-day-number {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.schedule-day.is-today .schedule-day-number {
    background: var(--color-primary);
    color: var(--color-primary-content);
}

.schedule-today-label {
    margin-left: auto;
    color: var(--color-primary);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.schedule-day-events {
    display: grid;
    align-content: start;
    gap: 5px;
    margin-top: 10px;
}

.schedule-now-divider {
    display: grid;
    grid-template-columns: minmax(8px, 1fr) auto minmax(8px, 1fr);
    align-items: center;
    gap: 7px;
    min-width: 0;
    margin: 5px 0;
    color: #111111;
    font-size: 0.64rem;
    font-variant-numeric: tabular-nums;
}

.schedule-now-divider i {
    display: block;
    height: 1px;
    background: color-mix(in srgb, #111111 70%, transparent);
}

.schedule-now-divider strong {
    font-weight: 800;
    white-space: nowrap;
}

.schedule-event {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 6px;
    min-width: 0;
    padding: 7px 8px;
    border-left: 3px solid currentColor;
    border-radius: 3px;
    background: color-mix(in srgb, currentColor 9%, transparent);
    font-size: 0.7rem;
    line-height: 1.2;
}

.schedule-planned-event {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
    padding: 5px 3px 4px;
    border: 1px solid color-mix(in srgb, #15803d 30%, transparent);
    border-left: 3px solid #15803d;
    border-radius: 4px;
    background: color-mix(in srgb, #15803d 9%, transparent);
    color: #166534;
    font-size: 0.68rem;
    line-height: 1.2;
}

.schedule-planned-badge {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 4px;
    background: #15803d;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
}

.schedule-planned-event .schedule-event-time {
    color: #166534;
}

.schedule-planned-badge.is-publication {
    background: #2563eb;
}

.schedule-planned-event:has(.schedule-planned-badge.is-publication) {
    border-color: color-mix(in srgb, #2563eb 30%, transparent);
    border-left-color: #2563eb;
    background: color-mix(in srgb, #2563eb 8%, transparent);
    color: #1d4ed8;
}

.schedule-planned-event:has(.schedule-planned-badge.is-publication) .schedule-event-time {
    color: #1d4ed8;
}

.schedule-planned-event.is-completed {
    border-color: color-mix(in srgb, #64748b 30%, transparent);
    border-left-color: #64748b;
    background: color-mix(in srgb, #64748b 8%, transparent);
    color: #64748b;
}

.schedule-planned-event.is-completed .schedule-planned-badge {
    background: #64748b;
}

.schedule-planned-event.is-completed .schedule-event-time {
    color: #64748b;
}

.schedule-event-time {
    font-variant-numeric: tabular-nums;
    font-weight: 750;
}

.schedule-event-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-event-status {
    grid-column: 2;
    color: color-mix(in srgb, currentColor 62%, transparent);
    font-size: 0.64rem;
    text-transform: capitalize;
}

.schedule-more-events,
.schedule-empty-day {
    color: color-mix(in srgb, currentColor 55%, transparent);
    font-size: 0.68rem;
}

.schedule-more-events {
    font-weight: 700;
}

.schedule-event-scheduled { color: #2563eb; }
.schedule-event-published { color: #64748b; }
.schedule-event-failed { color: #dc2626; }
.schedule-event-cancelled { color: #64748b; }

.schedule-sidebar {
    display: grid;
    gap: 12px;
    padding: 22px;
}

.schedule-manual-panel {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 72%, var(--surface-pure));
}

.schedule-manual-panel summary {
    padding: 12px 14px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    list-style-position: inside;
}

.schedule-manual-content {
    display: grid;
    gap: 12px;
    padding: 0 14px 14px;
    border-top: 1px solid var(--border-subtle);
}

.schedule-manual-content > .schedule-help {
    margin-bottom: 0;
}

.schedule-manual-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(180px, 1fr) minmax(190px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.schedule-manual-form .btn {
    white-space: nowrap;
}

.schedule-posts-panel {
    display: grid;
    gap: 14px;
}

.schedule-post-list {
    display: grid;
    gap: 8px;
}

.schedule-post-row {
    padding: 12px 0;
    border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.schedule-post-row > div {
    min-width: 0;
    flex: 1;
    gap: 10px;
    flex-wrap: wrap;
}

.schedule-post-primary {
    display: grid;
    gap: 4px;
}

.schedule-post-primary strong {
    font-size: 0.92rem;
}

.schedule-post-primary small {
    color: var(--text-tertiary, #777);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.schedule-post-primary p {
    max-width: 720px;
    margin: 2px 0 0;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.4;
}

.schedule-post-row span:not(.badge) {
    color: color-mix(in srgb, currentColor 60%, transparent);
    font-size: 0.82rem;
}

.schedule-status-failed { color: #dc2626; }
.schedule-status-scheduled { color: #2563eb; }
.schedule-status-published { color: #64748b; }
.schedule-error { color: #dc2626; font-size: 0.78rem; }

.schedule-day-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(760px, calc(100vw - 32px));
    height: min(760px, calc(100vh - 32px));
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    box-shadow: 0 24px 80px color-mix(in srgb, #000 30%, transparent);
}

.schedule-day-dialog::backdrop {
    background: color-mix(in srgb, #000 46%, transparent);
    backdrop-filter: blur(2px);
}

.schedule-day-dialog-card {
    display: grid;
    align-content: start;
    gap: 18px;
    height: 100%;
    box-sizing: border-box;
    overflow: auto;
    padding: 22px;
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    border-radius: 8px;
    background: var(--color-base-100);
}

.schedule-day-dialog-header,
.schedule-detail-event-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.schedule-day-dialog-header {
    justify-content: space-between;
}

.schedule-day-dialog-content {
    display: grid;
    align-content: start;
    gap: 10px;
}

.schedule-detail-event {
    display: grid;
    gap: 9px;
    padding: 13px;
    border: 1px solid color-mix(in srgb, currentColor 13%, transparent);
    border-left: 3px solid var(--color-primary);
    border-radius: 5px;
    background: color-mix(in srgb, var(--color-base-200) 48%, transparent);
}

.schedule-detail-event-planned {
    gap: 6px;
    padding: 9px 11px;
    border-left-color: #15803d;
    background: color-mix(in srgb, #15803d 7%, transparent);
}

.schedule-detail-event-planned.is-completed {
    border-left-color: #64748b;
    background: color-mix(in srgb, #64748b 7%, transparent);
}

.schedule-detail-event-planned.is-completed .schedule-planned-badge {
    background: #64748b;
}

.schedule-detail-event-header span:not(.badge) {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: color-mix(in srgb, currentColor 68%, transparent);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-detail-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent);
}

.schedule-detail-actions form {
    margin: 0;
}

.schedule-publication-remove-form {
    margin: 0;
}

.schedule-publication-remove {
    justify-self: start;
    padding: 0 6px;
    color: #b91c1c;
}

.schedule-automation-complete {
    margin: 0;
    font-size: 0.76rem;
}

.schedule-detail-caption {
    margin: 0;
    color: color-mix(in srgb, currentColor 75%, transparent);
    font-size: 0.83rem;
    line-height: 1.5;
    white-space: pre-line;
}

.schedule-detail-caption-label {
    margin-top: 2px;
    color: color-mix(in srgb, currentColor 52%, transparent);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.schedule-detail-media {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.schedule-detail-media img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 4px;
    background: var(--color-base-200);
}

.schedule-detail-caption-preview {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.schedule-automation-form {
    display: grid;
    gap: 8px;
    padding-top: 2px;
}

.schedule-automation-form.is-hidden {
    display: none;
}

.schedule-automation-add {
    justify-self: start;
    min-width: 28px;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

.schedule-automation-publication-row,
.schedule-automation-add-fields {
    display: grid;
    gap: 10px;
}

.schedule-automation-form-content {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.schedule-automation-form-title {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 750;
}

.schedule-automation-timing-row,
.schedule-automation-destination-row {
    display: grid;
    align-items: end;
    gap: 10px;
    min-width: 0;
}

.schedule-automation-timing-row {
    grid-template-columns: minmax(150px, 1.3fr) minmax(120px, 1fr) minmax(120px, 1fr);
}

.schedule-automation-destination-row {
    grid-template-columns: minmax(130px, 0.8fr) minmax(180px, 1.2fr) auto;
}

.schedule-automation-field,
.schedule-automation-time-field {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 750;
}

.schedule-automation-field select,
.schedule-automation-time-field input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.schedule-automation-time-field {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding-bottom: 1px;
}

.schedule-automation-time-field input {
    min-height: 38px;
}

.schedule-detail-event details {
    color: color-mix(in srgb, currentColor 72%, transparent);
    font-size: 0.78rem;
}

.schedule-detail-event summary {
    cursor: pointer;
    font-weight: 700;
}

@media (max-width: 920px) {
    .schedule-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .schedule-layout {
        grid-template-columns: 1fr;
    }

    .schedule-manual-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .schedule-status-strip {
        grid-template-columns: 1fr 1fr;
    }

    .schedule-status-card-note {
        grid-column: 1 / -1;
    }

    .schedule-manual-form {
        grid-template-columns: 1fr;
    }

    .schedule-header-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .schedule-day {
        min-height: 224px;
        padding: 6px;
    }

    .schedule-day-heading {
        min-height: 20px;
    }

    .schedule-day-number {
        width: 24px;
        height: 24px;
        font-size: 0.72rem;
    }

    .schedule-today-label,
    .schedule-event-status,
    .schedule-empty-day {
        display: none;
    }

    .schedule-event {
        grid-template-columns: 1fr;
        gap: 2px;
        padding: 5px;
        font-size: 0.62rem;
    }

    .schedule-planned-event {
        gap: 4px;
        padding: 4px 2px 3px;
        font-size: 0.62rem;
    }

    .schedule-event-time {
        font-size: 0.6rem;
    }

    .schedule-event-status,
    .schedule-planned-event .schedule-event-status {
        grid-column: 1;
    }

    .schedule-day-dialog {
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
    }

    .schedule-day-dialog-card {
        padding: 16px;
    }

    .schedule-automation-timing-row,
    .schedule-automation-destination-row {
        grid-template-columns: 1fr;
    }

    .schedule-automation-destination-row .btn {
        width: 100%;
    }

    .schedule-detail-media {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
.settings-test-marker {
  margin: 24px 0 0;
  color: #777;
  font-size: 12px;
  text-align: center;
}

