:root {
    --bg: #050506;
    --panel: rgba(13, 14, 18, .62);
    --panel-strong: rgba(17, 18, 23, .78);
    --line: rgba(198, 207, 218, .16);
    --line-bright: rgba(210, 224, 236, .36);
    --text: #edf4ff;
    --muted: #9aa5b5;
    --muted-strong: #c9d0da;
    --primary: #8c98a8;
    --primary-dark: #5f6876;
    --primary-soft: rgba(134, 156, 178, .16);
    --cyan: #d8e0ea;
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .12);
    --shadow: 0 22px 72px rgba(0, 0, 0, .32);
    --dynamic-bg-brightness: 1.16;
    --dynamic-bg-blur: 7px;
}

/* Cinema black-glass theme normalization */
:root {
    --primary: #8c98a8;
    --primary-dark: #5f6876;
    --primary-soft: rgba(218, 228, 238, .12);
    --cyan: #d8e0ea;
    --panel: rgba(10, 11, 14, .58);
    --panel-strong: rgba(15, 16, 20, .78);
    --line: rgba(204, 214, 224, .16);
    --line-bright: rgba(232, 238, 246, .34);
}

button,
input,
textarea,
select {
    accent-color: #d8e0ea;
}

.primary {
    border-color: rgba(232, 238, 246, .34);
    background: rgba(3, 4, 6, .56);
    color: #f8fbff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .24),
        inset 0 -10px 20px rgba(0, 0, 0, .18),
        0 15px 34px rgba(0, 0, 0, .22);
}

.primary:hover {
    background: rgba(7, 8, 11, .64);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .3),
        0 18px 42px rgba(0, 0, 0, .28);
}

.ghost,
.success,
.launch-pill,
.grid-card-btn,
.ref-add-btn,
.history-row-actions button,
.agent-reference-actions .ghost,
.agent-reference-actions .primary,
.agent-reference-actions .danger {
    border-color: rgba(204, 214, 224, .2);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025)),
        rgba(7, 8, 11, .5);
    color: #dce5ef;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055);
}

.ghost:hover,
.success:hover,
.launch-pill:hover,
.grid-card-btn:hover,
.ref-add-btn:hover,
.history-row-actions button:hover {
    border-color: rgba(232, 238, 246, .34);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .035)),
        rgba(10, 11, 14, .58);
    color: #f8fbff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 10px 24px rgba(0, 0, 0, .16);
}

.danger {
    border-color: rgba(248, 113, 113, .42);
    background:
        linear-gradient(180deg, rgba(248, 113, 113, .16), rgba(127, 29, 29, .2)),
        rgba(10, 11, 14, .5);
}

.modal {
    background: rgba(3, 4, 6, .72);
    -webkit-backdrop-filter: blur(22px) saturate(1.02);
    backdrop-filter: blur(22px) saturate(1.02);
}

.modal-card,
.auth-modal-card,
.character-modal-card,
.asset-modal-card,
.project-modal-card,
.picker-modal-card,
.image-history-modal-card,
.agent-modal-card,
.agent-shot-settings-modal,
.admin-modal-card {
    border-color: rgba(204, 214, 224, .18);
    background:
        linear-gradient(180deg, rgba(18, 19, 24, .88), rgba(6, 7, 10, .92)),
        rgba(255, 255, 255, .035);
    -webkit-backdrop-filter: blur(22px) saturate(1.02);
    backdrop-filter: blur(22px) saturate(1.02);
    box-shadow: 0 30px 96px rgba(0, 0, 0, .56), inset 0 1px 0 rgba(255, 255, 255, .08);
    scrollbar-color: rgba(205, 214, 224, .34) rgba(3, 4, 6, .24);
}

.modal-card::-webkit-scrollbar-track,
.character-modal-layout::-webkit-scrollbar-track,
.agent-panel::-webkit-scrollbar-track,
.agent-asset-grid::-webkit-scrollbar-track,
.agent-shot-list::-webkit-scrollbar-track {
    background: rgba(3, 4, 6, .24);
}

.modal-card::-webkit-scrollbar-thumb,
.character-modal-layout::-webkit-scrollbar-thumb,
.agent-panel::-webkit-scrollbar-thumb,
.agent-asset-grid::-webkit-scrollbar-thumb,
.agent-shot-list::-webkit-scrollbar-thumb {
    border-color: rgba(3, 4, 6, .42);
    background: linear-gradient(180deg, rgba(220, 226, 233, .48), rgba(98, 108, 121, .34));
}

.modal-head,
.modal-footer,
.agent-task-editor-head,
.agent-panel-head,
.agent-shot-card-head,
.agent-task-list-head,
.image-form-head,
.video-toolbar,
.admin-panel-head {
    border-color: rgba(204, 214, 224, .12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018)),
        rgba(8, 9, 12, .36);
}

.asset-list-card,
.character-grid-card,
.card,
.project-card,
.image-form-column,
.image-output-column,
.image-reference-box,
.image-output-empty-card,
.image-history-table,
.image-history-thumb,
.shot-card,
.agent-task-list-panel,
.agent-task-main,
.agent-task-welcome,
.agent-asset-card,
.agent-shot-card,
.agent-finish,
.agent-shot-bulkbar,
.history-row,
.picker-item {
    border-color: rgba(204, 214, 224, .15);
    background:
        linear-gradient(180deg, rgba(13, 14, 18, .56), rgba(5, 6, 9, .68)),
        rgba(255, 255, 255, .025);
    -webkit-backdrop-filter: blur(16px) saturate(1.02);
    backdrop-filter: blur(16px) saturate(1.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 18px 52px rgba(0, 0, 0, .18);
}

.asset-list-card:hover,
.character-grid-card:hover,
.card:hover,
.project-card:hover,
.picker-item:hover,
.picker-item.selected,
.history-row.current {
    border-color: rgba(232, 238, 246, .28);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .026)),
        rgba(8, 9, 12, .54);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 22px 60px rgba(0, 0, 0, .24);
}

.asset-form-input,
.asset-form-textarea,
.image-form-column select,
.image-form-column input,
.image-form-column textarea,
.modal-card input,
.modal-card textarea,
.modal-card select,
.auth-modal-body input,
.project-modal-body input,
.project-modal-body select,
.project-modal-body textarea,
.asset-modal-card textarea,
.character-modal-layout input,
.character-modal-layout textarea,
.agent-script-settings input,
.agent-script-settings select,
.agent-asset-card input,
.agent-asset-card textarea,
.agent-shot-card input,
.agent-shot-card textarea,
.agent-shot-card select,
.agent-shot-param-grid select,
.agent-shot-param-grid input,
.agent-shot-settings-form input,
.agent-shot-settings-form select,
.picker-list,
.captcha-image {
    border-color: rgba(204, 214, 224, .17);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .014)),
        rgba(4, 5, 7, .56);
    color: #edf4ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.asset-form-input:focus,
.asset-form-textarea:focus,
.image-form-column select:focus,
.image-form-column input:focus,
.image-form-column textarea:focus,
.modal-card input:focus,
.modal-card textarea:focus,
.modal-card select:focus,
.project-modal-body input:focus,
.project-modal-body select:focus,
.project-modal-body textarea:focus,
.agent-script-settings input:focus,
.agent-script-settings select:focus,
.agent-asset-card input:focus,
.agent-asset-card textarea:focus,
.agent-shot-card input:focus,
.agent-shot-card textarea:focus,
.agent-shot-card select:focus,
.agent-shot-param-grid select:focus,
.agent-shot-param-grid input:focus,
.agent-shot-settings-form input:focus,
.agent-shot-settings-form select:focus,
.ref-replace-select:focus {
    border-color: rgba(232, 238, 246, .34);
    box-shadow: 0 0 0 4px rgba(232, 238, 246, .08);
}

.empty,
.results-empty,
.video-empty-state,
.image-empty-state,
.agent-empty-state,
.history-empty,
.history-unavailable,
.picker-empty {
    border-color: rgba(204, 214, 224, .18);
    background: rgba(8, 9, 12, .34);
    color: #c9d0da;
}

.asset-card-index,
.grid-card-badge,
.grid-card-real-badge,
.user-group-tag,
.nav strong,
.video-toolbar-title,
.shot-number-badge,
.shot-code-label,
.agent-shot-code,
.agent-task-card.active,
.agent-task-steps button,
.agent-step,
.agent-toggle-pill,
.ref-tag,
.rich-ref-token,
.image-mode-tabs button,
.image-history-pager span,
.admin-session {
    border-color: rgba(204, 214, 224, .18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .024)),
        rgba(8, 9, 12, .45);
    color: #dce5ef;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055);
}

.video-toolbar-title::before,
.asset-status-dot,
.dashboard-dot {
    background: #d8e0ea;
    box-shadow: 0 0 12px rgba(216, 224, 234, .34);
}

.thumb,
.grid-card-image,
.asset-image-preview,
.character-modal-side .character-upload-area,
.character-modal-side .upload-placeholder,
.character-modal-side .upload-preview,
.agent-reference-slot,
.agent-reference-preview,
.video-preview-box,
.rich-shot-description,
.audio-trim-panel,
.audio-trim-range-wrap {
    border-color: rgba(204, 214, 224, .17);
    background:
        linear-gradient(135deg, rgba(12, 13, 17, .58), rgba(5, 6, 9, .68)),
        rgba(255, 255, 255, .025);
}

.agent-entry-overlay {
    background: rgba(3, 4, 6, .72);
    -webkit-backdrop-filter: blur(26px) saturate(1.02);
    backdrop-filter: blur(26px) saturate(1.02);
}

.agent-entry-card {
    border-color: rgba(204, 214, 224, .18);
    background:
        linear-gradient(180deg, rgba(18, 19, 24, .82), rgba(6, 7, 10, .9)),
        rgba(255, 255, 255, .035);
}

.agent-entry-orbit::before {
    border-color: rgba(204, 214, 224, .28);
    border-top-color: rgba(232, 238, 246, .86);
}

.agent-entry-orbit::after {
    background: radial-gradient(circle, rgba(232, 238, 246, .14), transparent 62%);
}

.agent-entry-face {
    background: linear-gradient(135deg, rgba(232, 238, 246, .92), rgba(112, 124, 138, .82));
    color: #050608;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.agent-entry-face::before,
.agent-entry-face::after {
    background: #050608;
}

.agent-entry-face span {
    border-bottom-color: #050608;
}

.agent-entry-progress {
    background: rgba(232, 238, 246, .12);
}

.agent-entry-progress span {
    background: linear-gradient(90deg, #8c98a8, #d8e0ea, #fbbf24);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    height: 100%;
}

body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    color: var(--text);
    background:
        radial-gradient(circle at 18% -8%, rgba(154, 130, 105, .16), transparent 30%),
        radial-gradient(circle at 88% 10%, rgba(91, 105, 120, .14), transparent 28%),
        linear-gradient(135deg, #050506 0%, #08090c 52%, #030305 100%);
    letter-spacing: 0;
}

.site-dynamic-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    opacity: .7;
    pointer-events: none;
    contain: layout paint size;
    transform: translateZ(0);
}

body.launch-active .site-dynamic-bg,
.user-app-booting .site-dynamic-bg {
    opacity: 0;
}

.site-dynamic-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(var(--dynamic-bg-blur, 8px)) saturate(.95) brightness(var(--dynamic-bg-brightness, 1.16)) contrast(1.04);
    transform: scale(1.045);
    will-change: transform, filter;
    backface-visibility: hidden;
}

.site-dynamic-bg span {
    position: absolute;
    inset: 0;
    transform: translateZ(0);
    background:
        radial-gradient(circle at 76% 8%, rgba(102, 122, 140, .08), transparent 30%),
        radial-gradient(circle at 10% 42%, rgba(142, 100, 68, .08), transparent 32%),
        linear-gradient(180deg, rgba(3, 4, 6, .22), rgba(3, 4, 6, .42) 72%, rgba(3, 4, 6, .58)),
        linear-gradient(90deg, rgba(3, 4, 6, .46), rgba(3, 4, 6, .16) 48%, rgba(3, 4, 6, .42));
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(205, 214, 224, .34) rgba(3, 4, 6, .24);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: rgba(3, 8, 20, .24);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    border: 2px solid rgba(3, 4, 6, .42);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(220, 226, 233, .48), rgba(98, 108, 121, .34));
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(238, 242, 247, .62), rgba(132, 144, 158, .46));
}

.user-app-booting .shell {
    opacity: 0;
    pointer-events: none;
}

body.launch-active {
    background: #050505;
}

body.launch-active .shell {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

body:not(.launch-active) .launch-screen {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.launch-screen {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background: #050505;
    transition: opacity .28s ease, visibility .28s ease;
}

.launch-video,
.launch-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.launch-video {
    object-fit: cover;
    transform: scale(1.01);
}

.launch-shade {
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .08), transparent 34%),
        linear-gradient(180deg, rgba(0, 0, 0, .48), rgba(0, 0, 0, .22) 38%, #050505 100%),
        linear-gradient(90deg, rgba(0, 0, 0, .76), transparent 24%, transparent 76%, rgba(0, 0, 0, .72));
}

.launch-topbar {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    right: 0;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(18px, 3vw, 42px);
}

.launch-brand,
.launch-auth,
.launch-user {
    display: flex;
    align-items: center;
}

.launch-brand {
    gap: 10px;
    min-width: 0;
}

.launch-brand strong {
    font-size: clamp(17px, 1.5vw, 22px);
    line-height: 1;
    font-weight: 760;
    letter-spacing: 0;
    color: rgba(255, 255, 255, .9);
    text-shadow: 0 10px 28px rgba(0, 0, 0, .38);
}

.launch-logo {
    width: clamp(26px, 2vw, 34px);
    height: clamp(26px, 2vw, 34px);
    border: 1px solid rgba(255, 255, 255, .46);
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
    background: rgba(255, 255, 255, .06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}

.launch-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.launch-auth,
.launch-user {
    gap: 12px;
}

.launch-account-pill {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 9px 4px 5px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(8, 8, 10, .34);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    backdrop-filter: blur(18px) saturate(1.25);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 10px 26px rgba(0, 0, 0, .14);
}

.launch-user span {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, .88);
    font-weight: 700;
}

.launch-pill {
    min-width: 86px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    color: rgba(255, 255, 255, .92);
    background: rgba(8, 8, 10, .34);
    backdrop-filter: blur(18px) saturate(1.25);
    font-size: 15px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.launch-pill:hover {
    border-color: rgba(255, 255, 255, .34);
    background: rgba(255, 255, 255, .1);
}

.launch-pill-bright {
    background: rgba(255, 255, 255, .12);
}

.launch-center {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100vw - 36px));
    margin-top: 7vh;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.launch-kicker {
    margin-bottom: 18px;
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .18em;
}

.launch-center h1 {
    margin: 0;
    font-size: clamp(52px, 8vw, 142px);
    line-height: .96;
    font-weight: 900;
    letter-spacing: 0;
    color: transparent;
    background:
        linear-gradient(180deg, #ffffff 0%, #eef3f8 26%, #c9d0d8 58%, #f9fbff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 22px 74px rgba(0, 0, 0, .46);
}

.launch-center p {
    width: min(980px, 92vw);
    margin-top: clamp(22px, 3vw, 36px);
    color: rgba(232, 238, 246, .84);
    font-size: clamp(14px, 1.35vw, 19px);
    line-height: 1.5;
    white-space: nowrap;
    text-shadow: 0 10px 34px rgba(0, 0, 0, .52);
}

.launch-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: clamp(34px, 4.4vw, 60px);
    flex-wrap: wrap;
}

.launch-action {
    min-width: min(280px, calc(50vw - 28px));
    height: 70px;
    border-radius: 999px;
    padding: 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    font-size: clamp(17px, 1.7vw, 24px);
    font-weight: 850;
    border: 1px solid rgba(255, 255, 255, .24);
    backdrop-filter: blur(22px) saturate(1.2);
    box-shadow: 0 18px 56px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.launch-action b {
    font-size: 28px;
    line-height: 1;
}

.launch-action-ghost {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.launch-action-primary {
    color: #070707;
    background: #ffffff;
    border-color: #ffffff;
}

.launch-action:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
}

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

button {
    cursor: pointer;
}

.shell {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: grid;
    grid-template-columns: 236px 1fr;
    grid-template-rows: 64px 1fr;
    overflow: hidden;
}

.shell.sidebar-collapsed {
    grid-template-columns: 76px 1fr;
}

.topbar {
    position: relative;
    grid-column: 1 / 3;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    background: rgba(8, 9, 12, .52);
    -webkit-backdrop-filter: blur(24px) saturate(1.04);
    backdrop-filter: blur(24px) saturate(1.04);
    border-bottom: 1px solid rgba(198, 207, 218, .12);
    box-shadow: 0 14px 44px rgba(0, 0, 0, .24);
    overflow: hidden;
}

.topbar::after {
    content: none;
}

.topbar > * {
    position: relative;
    z-index: 1;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 11px;
}

.theme-control-btn {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    position: relative;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(186, 209, 232, .11);
    border-radius: 9px;
    color: rgba(184, 199, 216, .74);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)),
        rgba(7, 18, 32, .24);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .07),
        0 6px 16px rgba(0, 0, 0, .1);
    opacity: .72;
    transition: opacity .16s ease, transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.theme-control-btn::before,
.theme-control-btn::after,
.theme-control-btn span {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.theme-control-btn::before {
    width: 14px;
    height: 8px;
    border: 1px solid rgba(190, 211, 232, .28);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015)),
        rgba(4, 12, 22, .34);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 0 6px rgba(160, 194, 226, .05);
}

.theme-control-btn span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(199, 213, 227, .82);
    box-shadow: 0 0 4px rgba(184, 205, 226, .12);
    transform: translate(-5px, -50%);
    transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.theme-control-btn::after {
    width: 1px;
    height: 9px;
    left: calc(50% + 6px);
    border-radius: 999px;
    background: rgba(190, 211, 232, .18);
    box-shadow: -12px 0 0 rgba(190, 211, 232, .1);
}

.theme-control-btn:hover,
.theme-control-btn.active {
    opacity: 1;
    border-color: rgba(210, 229, 247, .2);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .026)),
        rgba(10, 24, 42, .36);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .1),
        0 8px 18px rgba(0, 0, 0, .16),
        0 0 8px rgba(159, 195, 228, .06);
    transform: translateY(-1px);
}

.theme-control-btn.active span {
    background: rgba(226, 237, 248, .92);
    box-shadow: 0 0 5px rgba(188, 214, 238, .18);
    transform: translate(1px, -50%);
}

.theme-popover {
    position: fixed;
    top: 72px;
    left: 22px;
    z-index: 1400;
    width: 260px;
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(232, 238, 246, .22);
    border-radius: 14px;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .10), transparent 38%),
        rgba(8, 9, 13, .58);
    -webkit-backdrop-filter: blur(26px) saturate(1.12) brightness(1.08);
    backdrop-filter: blur(26px) saturate(1.12) brightness(1.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .16),
        0 24px 70px rgba(0, 0, 0, .34);
}

.theme-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.theme-popover-head strong {
    color: #f7fbff;
    font-size: 14px;
    font-weight: 760;
}

.theme-popover-head button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(232, 238, 246, .16);
    border-radius: 9px;
    color: rgba(237, 244, 255, .82);
    background: rgba(4, 5, 8, .24);
}

.theme-popover label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    color: rgba(226, 233, 242, .78);
    font-size: 12px;
}

.theme-popover output {
    color: #f4f8fc;
    font-size: 12px;
    font-weight: 720;
}

.theme-popover input[type="range"] {
    grid-column: 1 / -1;
    width: 100%;
    accent-color: #eef3f8;
}

.theme-popover .ghost {
    justify-self: end;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(206, 218, 230, .36);
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #ffffff;
    font-weight: 700;
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .52), transparent 23%),
        linear-gradient(145deg, rgba(220, 230, 238, .32), rgba(75, 88, 103, .32)),
        rgba(255, 255, 255, .06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .28),
        0 14px 34px rgba(0, 0, 0, .22);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.brand {
    font-size: 14px;
    font-weight: 650;
    letter-spacing: .01em;
}

.subtitle {
    color: var(--muted);
    font-size: 10px;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.sidebar {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 12px;
    background: rgba(7, 8, 11, .52);
    -webkit-backdrop-filter: blur(24px) saturate(1.02);
    backdrop-filter: blur(24px) saturate(1.02);
    border-right: 1px solid rgba(198, 207, 218, .12);
    display: flex;
    flex-direction: column;
    transition: width .18s ease, padding .18s ease;
}

.sidebar-title {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .1em;
    margin: 0 10px 10px;
}

.nav {
    width: 100%;
    height: 40px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted-strong);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-radius: 12px;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 520;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.nav-label {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.nav-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-icon,
.collapse-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    display: inline-block;
    position: relative;
    color: currentColor;
}

.nav-icon::before,
.nav-icon::after,
.collapse-icon::before,
.collapse-icon::after {
    content: "";
    position: absolute;
    box-sizing: border-box;
}

.icon-user::before {
    left: 6px;
    top: 2px;
    width: 6px;
    height: 6px;
    border: 1.6px solid currentColor;
    border-radius: 50%;
}

.icon-user::after {
    left: 3px;
    bottom: 2px;
    width: 12px;
    height: 7px;
    border: 1.6px solid currentColor;
    border-radius: 8px 8px 3px 3px;
}

.icon-scene::before {
    inset: 3px 2px;
    border: 1.6px solid currentColor;
    border-radius: 4px;
}

.icon-scene::after {
    left: 5px;
    right: 5px;
    bottom: 5px;
    height: 6px;
    background: linear-gradient(135deg, transparent 0 36%, currentColor 37% 64%, transparent 65%);
}

.icon-object::before {
    left: 3px;
    top: 4px;
    width: 12px;
    height: 10px;
    border: 1.6px solid currentColor;
    border-radius: 3px;
    transform: rotate(-8deg);
}

.icon-object::after {
    left: 6px;
    top: 2px;
    width: 7px;
    height: 7px;
    border-top: 1.6px solid currentColor;
    border-right: 1.6px solid currentColor;
    transform: rotate(8deg);
}

.icon-video::before {
    left: 2px;
    top: 4px;
    width: 11px;
    height: 10px;
    border: 1.6px solid currentColor;
    border-radius: 4px;
}

.icon-video::after {
    right: 1px;
    top: 6px;
    border-left: 6px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.icon-agent::before {
    left: 3px;
    top: 4px;
    width: 12px;
    height: 11px;
    border: 1.6px solid currentColor;
    border-radius: 5px;
}

.icon-agent::after {
    left: 6px;
    top: 7px;
    width: 2.5px;
    height: 2.5px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 5px 0 0 currentColor, 2.5px 4px 0 -1px currentColor;
}

.icon-membership::before {
    left: 3px;
    top: 4px;
    width: 12px;
    height: 10px;
    border: 1.6px solid currentColor;
    border-radius: 3px;
    transform: skewX(-10deg);
}

.icon-membership::after {
    left: 6px;
    top: 2px;
    width: 6px;
    height: 6px;
    border-top: 1.6px solid currentColor;
    border-right: 1.6px solid currentColor;
    transform: rotate(-45deg);
}

.agent-nav.is-entering {
    color: var(--text);
    border-color: rgba(210, 224, 236, .32);
    background: rgba(255, 255, 255, .09);
}

.icon-group::before {
    left: 2px;
    top: 6px;
    width: 6px;
    height: 6px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
}

.icon-group::after {
    right: 2px;
    top: 3px;
    width: 8px;
    height: 8px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    box-shadow: -6px 8px 0 -4px currentColor, 1px 9px 0 -4px currentColor;
}

.icon-api::before {
    left: 2px;
    top: 7px;
    width: 14px;
    height: 4px;
    border-top: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
}

.icon-api::after {
    left: 4px;
    top: 2px;
    width: 10px;
    height: 14px;
    border-left: 1.6px solid currentColor;
    border-right: 1.6px solid currentColor;
}

.icon-project::before {
    left: 2px;
    top: 4px;
    width: 14px;
    height: 11px;
    border: 1.6px solid currentColor;
    border-radius: 3px;
}

.icon-project::after {
    left: 4px;
    top: 2px;
    width: 6px;
    height: 4px;
    border: 1.6px solid currentColor;
    border-bottom: 0;
    border-radius: 3px 3px 0 0;
}

.icon-detail::before {
    inset: 2px 3px;
    border: 1.6px solid currentColor;
    border-radius: 3px;
}

.icon-detail::after {
    left: 6px;
    top: 6px;
    width: 7px;
    height: 1.6px;
    background: currentColor;
    box-shadow: 0 4px 0 currentColor;
}

.icon-record::before {
    left: 4px;
    top: 2px;
    width: 10px;
    height: 14px;
    border: 1.6px solid currentColor;
    border-radius: 3px;
}

.icon-record::after {
    left: 7px;
    top: 6px;
    width: 4px;
    height: 4px;
    border-right: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(-45deg);
}

.icon-user-cost::before {
    left: 2px;
    top: 2px;
    width: 8px;
    height: 8px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
}

.icon-user-cost::after,
.icon-group-cost::after {
    right: 1px;
    bottom: 1px;
    width: 8px;
    height: 8px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .04);
}

.icon-group-cost::before {
    left: 1px;
    top: 4px;
    width: 10px;
    height: 8px;
    border-left: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    border-radius: 6px;
}

.nav:hover,
.nav.active {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .115), rgba(255, 255, 255, .04)),
        rgba(7, 8, 11, .2);
    border-color: rgba(210, 224, 236, .24);
    color: #ffffff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .11),
        0 10px 28px rgba(0, 0, 0, .16);
}

.nav:hover {
    transform: translateY(-1px);
}

.nav strong {
    min-width: 24px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
    color: #dce5ef;
    font-size: 11px;
    border: 1px solid rgba(210, 224, 236, .18);
}

.nav-divider {
    height: 1px;
    margin: 10px 8px;
    background: rgba(198, 207, 218, .12);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(198, 207, 218, .12);
}

.sidebar-collapse-btn {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(148, 190, 236, .2);
    border-radius: 12px;
    padding: 0 12px;
    color: var(--muted-strong);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025));
}

.sidebar-collapse-btn:hover {
    color: #ffffff;
    border-color: rgba(210, 224, 236, .28);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04)),
        rgba(255, 255, 255, .04);
}

.collapse-icon::before {
    left: 3px;
    top: 3px;
    width: 12px;
    height: 12px;
    border: 1.6px solid currentColor;
    border-radius: 4px;
}

.collapse-icon::after {
    left: 7px;
    top: 6px;
    width: 5px;
    height: 5px;
    border-left: 1.6px solid currentColor;
    border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg);
}

.shell.sidebar-collapsed .sidebar {
    padding: 18px 10px;
}

.shell.sidebar-collapsed .sidebar-title,
.shell.sidebar-collapsed .nav-text,
.shell.sidebar-collapsed .nav strong {
    display: none;
}

.shell.sidebar-collapsed .nav,
.shell.sidebar-collapsed .sidebar-collapse-btn {
    justify-content: center;
    padding: 0;
}

.shell.sidebar-collapsed .nav-label {
    gap: 0;
}

.shell.sidebar-collapsed .collapse-icon::after {
    left: 5px;
    transform: rotate(225deg);
}

.content {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
    overflow: auto;
}

body.image-page-active .content {
    overflow: hidden;
}

body.agent-page-active .shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

body.canvas-page-active .shell {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

body.agent-page-active .topbar,
body.canvas-page-active .topbar {
    position: fixed;
    top: 14px;
    right: 18px;
    left: auto;
    z-index: 80;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
    border: 0 !important;
    border-bottom: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.agent-page-active .topbar > :not(#userBox),
body.canvas-page-active .topbar > :not(#userBox) {
    display: none !important;
}

body.agent-page-active #userBox,
body.canvas-page-active #userBox {
    min-height: 44px;
    padding: 4px 9px 4px 5px !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 999px;
    background: rgba(8, 8, 10, .34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 10px 26px rgba(0, 0, 0, .14) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
    backdrop-filter: blur(18px) saturate(1.25) !important;
    gap: 10px;
}

body.agent-page-active #userBox:hover,
body.canvas-page-active #userBox:hover {
    border-color: rgba(255, 255, 255, .34) !important;
    background: rgba(255, 255, 255, .10) !important;
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .12),
        0 14px 30px rgba(0, 0, 0, .18) !important;
}

body.agent-page-active #userBox .user-credit-tag,
body.canvas-page-active #userBox .user-credit-tag {
    min-height: 30px;
    padding: 0 12px;
    border-color: rgba(74, 222, 128, .28);
    color: #bbf7d0 !important;
    background: rgba(22, 101, 52, .20) !important;
}

body.agent-page-active .sidebar,
body.canvas-page-active .sidebar {
    display: none;
}

body.agent-page-active .content,
body.canvas-page-active .content {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    padding: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at 72% 8%, rgba(112, 122, 134, .1), transparent 34%),
        linear-gradient(135deg, rgba(4, 5, 7, .78), rgba(8, 9, 12, .7));
}

body.agent-page-active .content::before,
body.canvas-page-active .content::before {
    content: "";
    position: absolute;
    inset: -34px;
    z-index: 0;
    background:
        radial-gradient(circle at 74% 12%, rgba(135, 145, 156, .1), transparent 34%),
        linear-gradient(180deg, rgba(4, 5, 7, .14), rgba(4, 5, 7, .4) 78%),
        linear-gradient(90deg, rgba(4, 5, 7, .36), rgba(4, 5, 7, .08) 52%, rgba(4, 5, 7, .32));
    pointer-events: none;
}

body.agent-page-active .content > *,
body.canvas-page-active .content > * {
    position: relative;
    z-index: 1;
}

.hero-panel {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    min-height: 96px;
    border: 1px solid rgba(198, 207, 218, .16);
    border-radius: 16px;
    padding: 18px 22px;
    background:
        radial-gradient(circle at 12% 12%, rgba(255, 255, 255, .045), transparent 26%),
        linear-gradient(118deg, rgba(180, 188, 196, .065), transparent 38%),
        linear-gradient(135deg, rgba(12, 13, 17, .76), rgba(7, 8, 11, .5)),
        rgba(255, 255, 255, .03);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
    overflow: hidden;
}

.hero-panel::after {
    content: none;
}

.hero-panel > * {
    position: relative;
    z-index: 1;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 22px;
    margin-bottom: 6px;
    line-height: 1.15;
    font-weight: 650;
}

.hero-panel p {
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.55;
}

.eyebrow {
    color: #d8e0ea;
    font-size: 10px;
    letter-spacing: .12em;
    margin-bottom: 8px;
    font-weight: 650;
}

.primary,
.ghost,
.danger,
.success {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 14px;
    border: 1px solid transparent;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, filter .16s ease;
}

.primary {
    background: rgba(3, 4, 6, .56);
    color: #fff;
    border-color: rgba(232, 238, 246, .5);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .32),
        inset 0 -10px 20px rgba(15, 23, 42, .14),
        0 15px 34px rgba(92, 102, 116, .24);
}

.primary:hover {
    background: rgba(7, 8, 11, .64);
    transform: translateY(-1px);
    filter: saturate(1.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .36),
        0 18px 42px rgba(92, 102, 116, .3);
}

.primary:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.primary.is-loading,
.ghost.is-loading,
.danger.is-loading,
.success.is-loading {
    gap: 8px;
    opacity: .82;
    cursor: wait;
}

.primary.is-loading::before,
.ghost.is-loading::before,
.danger.is-loading::before,
.success.is-loading::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, .42);
    border-top-color: rgba(255, 255, 255, .96);
    flex: 0 0 auto;
    animation: buttonSpin .76s linear infinite;
}

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

.ghost {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035));
    border-color: rgba(148, 190, 236, .24);
    color: #d9e7fb;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.ghost:hover {
    transform: translateY(-1px);
    border-color: rgba(218, 228, 238, .42);
    background:
        linear-gradient(135deg, rgba(218, 228, 238, .12), rgba(112, 124, 138, .08)),
        rgba(255, 255, 255, .06);
}

.danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(248, 113, 113, .3);
}

.danger:hover {
    transform: translateY(-1px);
    background: rgba(248, 113, 113, .18);
}

.success {
    color: #dcfce7;
    border-color: rgba(74, 222, 128, .38);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, .26), rgba(16, 185, 129, .16)),
        rgba(255, 255, 255, .04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}

.success:hover {
    transform: translateY(-1px);
    border-color: rgba(134, 239, 172, .56);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, .34), rgba(16, 185, 129, .22)),
        rgba(255, 255, 255, .06);
}

.wide {
    width: 100%;
}

.user-pill,
.auth-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-pill span {
    font-weight: 560;
    font-size: 13px;
    color: #eaf2ff;
}

.user-avatar-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 auto;
    border: 1px solid rgba(232, 238, 246, .28);
    border-radius: 50%;
    padding: 0;
    color: #f8fafc;
    background:
        radial-gradient(circle at 32% 18%, rgba(255, 255, 255, .58), transparent 28%),
        linear-gradient(135deg, rgba(56, 189, 248, .84), rgba(139, 92, 246, .82));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .22),
        0 8px 22px rgba(0, 0, 0, .22);
    cursor: pointer;
}

.user-avatar-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .48);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .26),
        0 12px 28px rgba(82, 128, 220, .22);
}

.user-avatar-btn img,
.profile-avatar-large img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.user-avatar-btn span {
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

.launch-avatar-btn {
    width: 36px;
    height: 36px;
}

.avatar-menu {
    position: fixed;
    z-index: 1200;
    width: 164px;
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(232, 238, 246, .16);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(29, 35, 48, .96), rgba(12, 16, 25, .96));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 18px 44px rgba(0, 0, 0, .34);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.avatar-menu button {
    min-height: 36px;
    justify-content: flex-start;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #dbeafe;
    background: transparent;
    font-size: 13px;
    font-weight: 760;
    cursor: pointer;
}

.avatar-menu button:hover {
    border-color: rgba(145, 199, 255, .22);
    background: rgba(96, 165, 250, .12);
}

.avatar-menu button[data-avatar-menu-action="logout"] {
    color: #fecaca;
}

.avatar-menu button[data-avatar-menu-action="logout"]:hover {
    border-color: rgba(248, 113, 113, .24);
    background: rgba(127, 29, 29, .18);
}

#userName {
    cursor: pointer;
}

.user-credit-tag {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgba(74, 222, 128, .28);
    border-radius: 999px;
    color: #dcfce7 !important;
    background: rgba(22, 163, 74, .14) !important;
    font-size: 12px !important;
    font-weight: 680 !important;
    white-space: nowrap;
}

.user-group-tag {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid rgba(218, 228, 238, .34);
    border-radius: 999px;
    color: #bfe7ff;
    font-size: 12px;
    font-weight: 620;
    background:
        radial-gradient(circle at 24% 12%, rgba(255, 255, 255, .24), transparent 28%),
        linear-gradient(135deg, rgba(218, 228, 238, .13), rgba(92, 102, 116, .11)),
        rgba(255, 255, 255, .035);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .12),
        0 10px 26px rgba(92, 102, 116, .12);
}

.profile-modal-card {
    width: min(920px, calc(100vw - 32px));
}

.profile-modal-card .modal-head {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(232, 238, 246, .10);
}

.profile-modal-body {
    display: grid;
    gap: 12px;
}

.profile-modal-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .86fr);
    gap: 12px;
    align-items: start;
}

.profile-modal-left,
.profile-modal-right {
    min-width: 0;
    display: grid;
    gap: 12px;
}

.profile-identity {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(232, 238, 246, .14);
    border-radius: 20px;
    background:
        radial-gradient(circle at 0% 0%, rgba(96, 165, 250, .16), transparent 36%),
        rgba(255, 255, 255, .038);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.profile-avatar-large {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(232, 238, 246, .26);
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 32% 18%, rgba(255, 255, 255, .58), transparent 28%),
        linear-gradient(135deg, rgba(56, 189, 248, .84), rgba(139, 92, 246, .82));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .24),
        0 16px 34px rgba(0, 0, 0, .24);
    font-size: 32px;
    font-weight: 840;
}

.profile-identity-main {
    min-width: 0;
}

.profile-eyebrow {
    display: inline-flex !important;
    margin: 0 0 7px !important;
    min-height: 22px;
    align-items: center;
    padding: 0 8px;
    border: 1px solid rgba(145, 199, 255, .20);
    border-radius: 999px;
    color: #91c7ff !important;
    background: rgba(37, 99, 235, .10);
    font-size: 10.5px !important;
    font-weight: 820 !important;
}

.profile-identity strong {
    display: block;
    color: #f8fafc;
    font-size: 22px;
    font-weight: 860;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-identity span {
    display: block;
    margin-top: 4px;
    color: #aebccc;
    font-size: 12.5px;
    font-weight: 620;
}

.profile-avatar-upload {
    width: fit-content;
}

.profile-identity-actions {
    display: flex;
    justify-content: flex-end;
}

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

.profile-stat-grid span {
    min-height: 82px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 14px;
    border: 1px solid rgba(232, 238, 246, .14);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .052), rgba(255, 255, 255, .026));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

.profile-stat-grid small {
    color: #aebccc;
    font-size: 11.5px;
    font-weight: 680;
}

.profile-stat-grid strong {
    color: #dcfce7;
    font-size: 20px;
    font-weight: 860;
}

.profile-membership-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(232, 238, 246, .14);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(148, 163, 184, .12), rgba(255, 255, 255, .025));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.profile-membership-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.profile-membership-card.blue {
    border-color: rgba(96, 165, 250, .24);
    background:
        radial-gradient(circle at 90% 0%, rgba(59, 130, 246, .22), transparent 42%),
        linear-gradient(135deg, rgba(37, 99, 235, .16), rgba(255, 255, 255, .03));
}

.profile-membership-card.gold {
    border-color: rgba(250, 204, 21, .28);
    background:
        radial-gradient(circle at 92% 0%, rgba(250, 204, 21, .24), transparent 42%),
        linear-gradient(135deg, rgba(146, 64, 14, .18), rgba(255, 255, 255, .03));
}

.profile-membership-card small {
    display: block;
    color: #aebccc;
    font-size: 11.5px;
    font-weight: 720;
}

.profile-membership-card strong {
    display: block;
    margin-top: 5px;
    color: #f8fafc;
    font-size: 22px;
    font-weight: 860;
}

.profile-membership-main > div > span {
    display: block;
    margin-top: 6px;
    color: #b7c6d7;
    font-size: 12.5px;
    font-weight: 620;
}

.profile-membership-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-membership-benefits span {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgba(232, 238, 246, .14);
    border-radius: 999px;
    color: #dcecff;
    background: rgba(255, 255, 255, .055);
    font-size: 12px;
    font-weight: 720;
}

.profile-membership-entry {
    width: fit-content;
    white-space: nowrap;
    flex: 0 0 auto;
}

.profile-history-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(232, 238, 246, .14);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .040), rgba(255, 255, 255, .022));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.profile-section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.profile-section-title strong {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 820;
}

.profile-section-title span {
    color: #93a4b8;
    font-size: 12px;
    font-weight: 650;
}

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

.profile-history-grid button {
    min-height: 38px;
    justify-content: center;
}

.profile-history-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.profile-history-tabs button {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(232, 238, 246, .12);
    border-radius: 12px;
    color: #b8c7d8;
    background: rgba(255, 255, 255, .035);
    font-size: 12px;
    font-weight: 760;
    cursor: pointer;
}

.profile-history-tabs button:hover,
.profile-history-tabs button.active {
    color: #eef6ff;
    border-color: rgba(96, 165, 250, .34);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .24), rgba(96, 165, 250, .10)),
        rgba(255, 255, 255, .045);
}

.profile-history-list {
    min-height: 246px;
    display: grid;
    gap: 8px;
    align-content: start;
}

.profile-history-row {
    min-height: 42px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(232, 238, 246, .10);
    border-radius: 12px;
    background: rgba(255, 255, 255, .026);
}

.profile-history-row strong {
    display: block;
    overflow: hidden;
    color: #f8fafc;
    font-size: 13px;
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-history-row span {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: #93a4b8;
    font-size: 11.5px;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-history-row small {
    color: #dcfce7;
    font-size: 12px;
    font-weight: 820;
    white-space: nowrap;
}

.profile-history-empty {
    min-height: 160px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(232, 238, 246, .14);
    border-radius: 14px;
    color: #8fa0b2;
    background: rgba(255, 255, 255, .018);
    font-size: 13px;
    font-weight: 700;
}

.profile-history-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.profile-history-pager span {
    min-width: 52px;
    color: #9fb0c3;
    font-size: 12px;
    font-weight: 760;
    text-align: center;
}

.membership-workspace {
    min-width: 0;
}

.membership-dashboard {
    display: grid;
    gap: 18px;
}

.membership-current,
.membership-section {
    border: 1px solid rgba(232, 238, 246, .13);
    border-radius: 22px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025)),
        rgba(8, 12, 22, .52);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 20px 54px rgba(0, 0, 0, .20);
}

.membership-current {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
    gap: 18px;
    align-items: center;
    padding: 24px;
    overflow: hidden;
}

.membership-current.blue {
    border-color: rgba(96, 165, 250, .24);
    background:
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, .24), transparent 44%),
        linear-gradient(135deg, rgba(37, 99, 235, .16), rgba(255, 255, 255, .035)),
        rgba(8, 12, 22, .52);
}

.membership-current.gold {
    border-color: rgba(250, 204, 21, .28);
    background:
        radial-gradient(circle at 100% 0%, rgba(250, 204, 21, .25), transparent 44%),
        linear-gradient(135deg, rgba(146, 64, 14, .18), rgba(255, 255, 255, .035)),
        rgba(8, 12, 22, .52);
}

.membership-kicker {
    color: #91c7ff;
    font-size: 11px;
    font-weight: 840;
    letter-spacing: 0;
}

.membership-current h2 {
    margin: 8px 0 8px;
    color: #f8fafc;
    font-size: 30px;
    font-weight: 880;
}

.membership-current p,
.membership-section-head p {
    margin: 0;
    color: #aebccc;
    font-size: 13px;
    line-height: 1.7;
}

.membership-balance {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.membership-balance span {
    min-height: 82px;
    display: grid;
    align-content: center;
    gap: 7px;
    padding: 14px;
    border: 1px solid rgba(232, 238, 246, .13);
    border-radius: 18px;
    background: rgba(255, 255, 255, .052);
}

.membership-balance small {
    color: #aebccc;
    font-size: 11.5px;
    font-weight: 720;
}

.membership-balance strong {
    color: #dcfce7;
    font-size: 22px;
    font-weight: 860;
}

.membership-section {
    padding: 18px;
}

.membership-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.membership-section-head h3 {
    margin: 0 0 5px;
    color: #f8fafc;
    font-size: 30px;
    font-weight: 840;
}

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

.membership-plan-card {
    min-height: 280px;
    display: grid;
    align-content: space-between;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(232, 238, 246, .14);
    border-radius: 20px;
    background: rgba(255, 255, 255, .035);
}

.membership-plan-card.blue {
    border-color: rgba(96, 165, 250, .24);
    background:
        radial-gradient(circle at 92% 0%, rgba(59, 130, 246, .18), transparent 40%),
        rgba(255, 255, 255, .04);
}

.membership-plan-card.gold {
    border-color: rgba(250, 204, 21, .30);
    background:
        radial-gradient(circle at 92% 0%, rgba(250, 204, 21, .24), transparent 42%),
        rgba(255, 255, 255, .04);
}

.membership-plan-card.active {
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .10),
        0 18px 44px rgba(64, 117, 214, .14);
}

.membership-plan-top span {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 0 9px;
    border: 1px solid rgba(232, 238, 246, .14);
    border-radius: 999px;
    color: #b8c8dc;
    background: rgba(255, 255, 255, .052);
    font-size: 11.5px;
    font-weight: 760;
}

.membership-plan-top strong {
    display: block;
    margin-top: 12px;
    color: #f8fafc;
    font-size: 22px;
    font-weight: 860;
}

.membership-plan-card ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.membership-plan-card li {
    color: #cbd7e8;
    font-size: 13px;
    line-height: 1.55;
}

.membership-credit-benefit {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 1px;
    padding: 0 10px;
    border: 1px solid rgba(134, 239, 172, .24);
    border-radius: 999px;
    color: #d9fbe7;
    background:
        linear-gradient(135deg, rgba(34, 197, 94, .14), rgba(14, 165, 233, .08)),
        rgba(3, 8, 20, .32);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .10),
        0 12px 30px rgba(0, 0, 0, .14);
}

.membership-credit-benefit span {
    color: rgba(220, 252, 231, .82);
    font-size: 11.5px;
    font-weight: 760;
}

.membership-credit-benefit strong {
    color: #ffe000;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0;
    white-space: nowrap;
    /* -webkit-text-stroke: .8px rgb(255 255 255 / 78%); */
    text-shadow:
        0 1px 0 rgba(0, 0, 0, .95),
        1px 0 0 rgba(0, 0, 0, .76),
        -1px 0 0 rgba(0, 0, 0, .76),
        0 0 14px rgba(250, 204, 21, .22);
}

.membership-plan-card.gold .membership-credit-benefit {
    border-color: rgba(250, 204, 21, .34);
    color: #fef9c3;
    background:
        linear-gradient(135deg, rgba(250, 204, 21, .16), rgba(34, 197, 94, .10)),
        rgba(3, 8, 20, .30);
}

.membership-plan-card.gold .membership-credit-benefit span {
    color: rgba(254, 249, 195, .82);
}

.membership-plan-card.gold .membership-credit-benefit strong {
    color: #facc15;
}

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

.payment-product-card {
    min-height: 178px;
    display: grid;
    align-content: space-between;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(232, 238, 246, .13);
    border-radius: 18px;
    background:
        radial-gradient(circle at 94% 0%, rgba(34, 197, 94, .16), transparent 40%),
        rgba(255, 255, 255, .036);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.payment-product-card span {
    color: #86efac;
    font-size: 11.5px;
    font-weight: 820;
}

.payment-product-card strong {
    display: block;
    margin-top: 8px;
    color: #f8fafc;
    font-size: 18px;
    font-weight: 840;
}

.payment-product-card p {
    margin: 7px 0 0;
    color: #9fb0c3;
    font-size: 12px;
    line-height: 1.55;
}

.payment-card-price {
    display: flex;
    align-items: baseline;
    gap: 9px;
    color: #f8fafc;
    font-size: 21px;
    font-weight: 880;
}

.payment-card-price small {
    color: #aebccc;
    font-size: 12px;
    font-weight: 720;
}

.membership-product-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.membership-product-select {
    width: 100%;
    min-width: 0;
    height: 40px;
    border: 1px solid rgba(232, 238, 246, .18);
    border-radius: 12px;
    padding: 0 12px;
    color: #edf4ff;
    background: rgba(3, 8, 20, .38);
    font-size: 13px;
    font-weight: 760;
    outline: none;
}

.membership-product-select:focus {
    border-color: rgba(191, 219, 254, .38);
    box-shadow: 0 0 0 4px rgba(147, 197, 253, .08);
}

.membership-product-picker .payment-card-price {
    justify-self: end;
    white-space: nowrap;
}

.payment-channel-picker {
    display: grid;
    gap: 6px;
}

.payment-channel-picker span {
    color: #93a4b8;
    font-size: 11.5px;
    font-weight: 760;
}

.payment-channel-picker select {
    width: 100%;
    height: 38px;
    border: 1px solid rgba(232, 238, 246, .15);
    border-radius: 12px;
    padding: 0 11px;
    color: #edf4ff;
    background: rgba(3, 8, 20, .34);
    font-size: 12.5px;
    font-weight: 740;
    outline: none;
}

.payment-channel-picker select:focus {
    border-color: rgba(191, 219, 254, .36);
    box-shadow: 0 0 0 4px rgba(147, 197, 253, .08);
}

.payment-channel-note {
    min-height: 34px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(232, 238, 246, .14);
    border-radius: 12px;
    color: #9fb0c3;
    background: rgba(255, 255, 255, .02);
    font-size: 12px;
    font-weight: 720;
}

.membership-empty-line {
    min-height: 96px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(232, 238, 246, .14);
    border-radius: 16px;
    color: #8fa0b2;
    background: rgba(255, 255, 255, .018);
    font-size: 13px;
    font-weight: 720;
}

.membership-compare-wrap {
    overflow: auto;
    border: 1px solid rgba(232, 238, 246, .12);
    border-radius: 18px;
}

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

.membership-compare-table th,
.membership-compare-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(232, 238, 246, .09);
    color: #dcecff;
    font-size: 12.5px;
    text-align: left;
    vertical-align: middle;
}

.membership-compare-table th:first-child,
.membership-compare-table td:first-child {
    width: 140px;
}

.membership-compare-table th:nth-child(2),
.membership-compare-table td:nth-child(2) {
    width: 220px;
}

.membership-compare-table th {
    color: #f8fafc;
    background: rgba(255, 255, 255, .052);
    font-weight: 800;
}

.membership-compare-table tr:last-child td {
    border-bottom: 0;
}

.compare-feature-group {
    color: #eef5ff !important;
    font-weight: 840;
    background: rgba(5, 12, 24, .22);
}

.compare-feature-item {
    color: #cbd7e8 !important;
    font-weight: 760;
}

.membership-compare-table .compare-highlight {
    background: rgba(250, 204, 21, .055);
}

.membership-compare-table th.compare-highlight {
    color: #fde68a;
    background:
        linear-gradient(135deg, rgba(250, 204, 21, .16), rgba(255, 255, 255, .052));
}

.compare-check {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 780;
    white-space: nowrap;
}

.compare-check b {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #07111f;
    font-size: 12px;
    line-height: 1;
}

.compare-check.enabled {
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, .32);
    background:
        linear-gradient(135deg, rgba(34, 197, 94, .18), rgba(22, 163, 74, .10)),
        rgba(6, 78, 59, .18);
}

.compare-check.enabled b {
    background: #86efac;
}

.compare-check.disabled {
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, .24);
    background:
        linear-gradient(135deg, rgba(248, 113, 113, .13), rgba(127, 29, 29, .09)),
        rgba(69, 10, 10, .10);
}

.compare-check.disabled b {
    color: #fff1f2;
    background: rgba(248, 113, 113, .58);
}

.compare-metric {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgba(145, 199, 255, .20);
    border-radius: 999px;
    color: #dbeafe;
    background: rgba(59, 130, 246, .10);
    font-size: 12.5px;
    font-weight: 780;
    white-space: nowrap;
}

.compare-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.compare-chip {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 9px;
    border: 1px solid rgba(232, 238, 246, .13);
    border-radius: 999px;
    color: #dcecff;
    background: rgba(255, 255, 255, .052);
    font-size: 12px;
    font-weight: 720;
    white-space: nowrap;
}

.compare-chip.premium {
    color: #fde68a;
    border-color: rgba(250, 204, 21, .26);
    background: rgba(250, 204, 21, .12);
    font-weight: 820;
}

.compare-muted {
    color: #7f8b9a;
    font-size: 13px;
    font-weight: 700;
}

.profile-password-form {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(232, 238, 246, .14);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .040), rgba(255, 255, 255, .022));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.profile-password-form h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 15px;
    font-weight: 820;
}

.profile-password-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.profile-password-form label {
    display: grid;
    gap: 7px;
}

.profile-password-form label span {
    color: #aebccc;
    font-size: 12px;
    font-weight: 680;
}

.profile-password-form input {
    min-width: 0;
}

.profile-password-form .primary {
    justify-self: end;
}

.password-modal-card {
    width: min(520px, calc(100vw - 32px));
}

.password-modal-card .profile-password-form {
    border: 0;
    border-radius: 0;
    padding: 2px 0 0;
    background: transparent;
    box-shadow: none;
}

.password-modal-card .profile-password-grid {
    grid-template-columns: 1fr;
}

.password-modal-card .profile-password-form input {
    min-height: 40px;
}

.password-modal-card .profile-password-form .primary {
    justify-self: end;
}

.payment-qr-modal-card {
    width: min(420px, calc(100vw - 32px));
}

.payment-qr-body {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 20px;
}

.payment-qr-status {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    border: 1px solid rgba(74, 222, 128, .24);
    border-radius: 999px;
    color: #bbf7d0;
    background: rgba(34, 197, 94, .10);
    font-size: 12px;
    font-weight: 820;
}

.payment-qr-box {
    width: 258px;
    height: 258px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(232, 238, 246, .14);
    border-radius: 18px;
    background: #f8fafc;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .24);
}

.payment-qr-box img {
    width: 230px;
    height: 230px;
    object-fit: contain;
}

.payment-qr-meta {
    display: grid;
    justify-items: center;
    gap: 5px;
}

.payment-qr-meta strong {
    color: #f8fafc;
    font-size: 24px;
    font-weight: 880;
}

.payment-qr-meta span,
.payment-qr-body p {
    margin: 0;
    color: #aebccc;
    font-size: 12.5px;
    font-weight: 680;
    text-align: center;
    line-height: 1.6;
}

.payment-qr-link {
    margin-top: 2px;
}

.profile-modal-card .modal-footer {
    padding-top: 12px;
    border-top: 1px solid rgba(232, 238, 246, .10);
}

.profile-modal-card .modal-footer .ghost {
    margin-right: auto;
}

@media (max-width: 560px) {
    .profile-identity {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .profile-avatar-upload {
        margin-left: auto;
        margin-right: auto;
    }

    .profile-stat-grid,
    .profile-password-grid,
    .profile-history-grid {
        grid-template-columns: 1fr;
    }

    .profile-section-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .profile-membership-main {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-membership-entry,
    .profile-password-form .primary {
        width: 100%;
        justify-self: stretch;
    }

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

    .profile-history-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .profile-history-pager {
        justify-content: center;
    }
}

@media (max-width: 820px) {
    .profile-modal-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .membership-current {
        grid-template-columns: 1fr;
    }

    .membership-plan-grid,
    .payment-product-grid {
        grid-template-columns: 1fr;
    }

    .membership-balance {
        grid-template-columns: 1fr;
    }
}

.user-group-tag span,
.user-group-tag strong {
    font-size: 12px;
    line-height: 1;
}

.user-group-tag strong {
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    border: 1px solid rgba(218, 228, 238, .28);
    border-radius: 999px;
    color: #9ddcff;
    background: rgba(218, 228, 238, .08);
}

.user-group-tag.leader {
    color: #ffffff;
    border-color: rgba(103, 232, 249, .5);
    background:
        radial-gradient(circle at 24% 12%, rgba(255, 255, 255, .34), transparent 28%),
        linear-gradient(135deg, rgba(218, 228, 238, .32), rgba(112, 124, 138, .24)),
        rgba(255, 255, 255, .04);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .16),
        0 14px 32px rgba(214, 224, 235, .18);
}

.user-group-tag.leader strong {
    color: #06111f;
    border-color: rgba(232, 238, 246, .7);
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .7), transparent 30%),
        linear-gradient(135deg, #d8e0ea, #3b82f6);
    box-shadow: 0 8px 22px rgba(214, 224, 235, .26);
}

.notice {
    padding: 12px 14px;
    border: 1px solid rgba(218, 228, 238, .28);
    background:
        linear-gradient(135deg, rgba(218, 228, 238, .1), rgba(92, 102, 116, .08)),
        rgba(255, 255, 255, .035);
    color: #dce5ef;
    border-radius: 14px;
    margin-bottom: 14px;
    font-size: 13px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.results-section {
    border: 1px solid rgba(132, 177, 236, .14);
    border-radius: 16px;
    background: rgba(3, 8, 20, .14);
    padding: 16px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 38px;
    margin-bottom: 14px;
}

.results-header > div:first-child {
    display: flex;
    align-items: center;
    min-height: 32px;
}

.results-title {
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 600;
}

.results-count {
    margin-left: 8px;
    color: #d8e0ea;
    font-size: 13px;
    font-weight: 700;
}

.results-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
}

.compact {
    height: 32px;
    min-height: 32px;
    padding: 0 12px;
    font-size: 12px;
    white-space: nowrap;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.asset-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.asset-list-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 16px;
    border: 1px solid rgba(132, 177, 236, .16);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(17, 27, 46, .82), rgba(7, 12, 22, .9)),
        rgba(255, 255, 255, .035);
    box-shadow: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.asset-list-card:hover {
    transform: none;
    border-color: rgba(132, 177, 236, .24);
    box-shadow: none;
}

.asset-list-card.is-shared-asset,
.character-grid-card.is-shared-asset {
    border-color: rgba(34, 197, 94, .24);
}

.asset-card-left {
    min-width: 0;
    flex: 1;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.asset-card-index {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(218, 228, 238, .34);
    border-radius: 10px;
    color: #f8fbff;
    font-size: 15px;
    font-weight: 700;
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .34), transparent 28%),
        linear-gradient(145deg, rgba(214, 224, 235, .55), rgba(92, 102, 116, .42));
    box-shadow: 0 12px 28px rgba(92, 102, 116, .2);
}

.asset-card-info {
    min-width: 0;
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(132, 177, 236, .12);
    border-radius: 8px;
    background: rgba(3, 8, 20, .32);
}

.asset-source-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 0 0 8px;
}

.asset-share-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    border: 1px solid rgba(148, 190, 236, .24);
    border-radius: 999px;
    padding: 0 8px;
    color: #b9c9de;
    background: rgba(15, 23, 42, .66);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.asset-share-badge.is-shared,
.is-shared-asset .asset-share-badge {
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, .32);
    background: rgba(22, 101, 52, .32);
}

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

.asset-form-group {
    min-width: 0;
    margin-bottom: 10px;
}

.asset-form-group:last-child {
    margin-bottom: 0;
}

.asset-form-label {
    display: block;
    margin: 0 0 6px;
    color: var(--muted-strong);
    font-size: 11.5px;
}

.asset-form-input {
    width: 100%;
    min-height: 36px;
    border: 1px solid rgba(148, 190, 236, .2);
    border-radius: 10px;
    padding: 8px 10px;
    color: #edf4ff;
    background: rgba(3, 8, 20, .42);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.asset-form-input:focus {
    border-color: rgba(218, 228, 238, .58);
    box-shadow: 0 0 0 4px rgba(218, 228, 238, .1);
    background: rgba(2, 6, 23, .58);
}

.asset-form-textarea {
    min-height: 74px;
    line-height: 1.5;
    resize: vertical;
}

.asset-card-right {
    width: 180px;
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.asset-image-preview {
    position: relative;
    height: 180px;
    overflow: hidden;
    border: 1px solid rgba(132, 177, 236, .16);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(12, 20, 36, .92), rgba(214, 224, 235, .1)),
        rgba(255, 255, 255, .04);
}

.asset-preview-image-wrap,
.asset-preview-empty {
    width: 100%;
    height: 100%;
}

.asset-preview-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .22s ease, filter .22s ease;
}

.asset-image-preview:hover .asset-preview-img {
    transform: scale(1.035);
    filter: saturate(1.06);
}

.asset-preview-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #f8fbff;
    font-size: 12px;
    opacity: 0;
    background: rgba(3, 8, 20, .42);
    backdrop-filter: blur(4px);
    transition: opacity .16s ease;
}

.asset-image-preview:hover .asset-preview-overlay {
    opacity: 1;
}

.asset-preview-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(248, 113, 113, .38);
    border-radius: 50%;
    color: #fee2e2;
    background: rgba(127, 29, 29, .72);
    backdrop-filter: blur(10px);
}

.asset-preview-delete svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.asset-preview-empty {
    display: grid;
    place-items: center;
    gap: 10px;
    border: 2px dashed rgba(132, 177, 236, .2);
    border-radius: 12px;
    color: var(--muted-strong);
    font-size: 12px;
    text-align: center;
}

.asset-preview-empty-icon {
    width: 34px;
    height: 26px;
    display: block;
    border: 1px solid rgba(218, 228, 238, .4);
    border-radius: 8px;
    position: relative;
    opacity: .75;
}

.asset-preview-empty-icon::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 6px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(232, 238, 246, .85);
}

.asset-preview-empty-icon::after {
    content: "";
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    height: 9px;
    background: linear-gradient(135deg, transparent 0 32%, rgba(218, 228, 238, .7) 33% 66%, rgba(232, 238, 246, .88) 67%);
    clip-path: polygon(0 100%, 34% 42%, 50% 67%, 70% 22%, 100% 100%);
}

.asset-card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 6px;
}

.asset-action-btn {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    justify-self: stretch;
    border-radius: 9px;
    border: 1px solid transparent;
    padding: 0 6px;
    box-sizing: border-box;
    font-size: 11.5px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.asset-action-btn:hover {
    transform: none;
}

.asset-card-actions .file-btn {
    margin: 0;
}

.asset-action-btn.secondary {
    color: #d9e7fb;
    border-color: rgba(148, 190, 236, .24);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035));
}

.asset-action-btn.secondary:hover {
    border-color: rgba(218, 228, 238, .42);
    background:
        linear-gradient(135deg, rgba(218, 228, 238, .12), rgba(112, 124, 138, .08)),
        rgba(255, 255, 255, .06);
}

.asset-action-btn.danger {
    color: var(--danger);
    border-color: rgba(248, 113, 113, .3);
    background: var(--danger-soft);
}

.asset-action-btn.danger:hover {
    background: rgba(248, 113, 113, .18);
}

.asset-action-btn.muted {
    grid-column: 1 / -1;
    color: #9fb0c6;
    border-color: rgba(148, 190, 236, .16);
    background: rgba(15, 23, 42, .46);
}

.video-workspace {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(132, 177, 236, .14);
    border-radius: 16px;
    background: rgba(3, 8, 20, .14);
    overflow: hidden;
}

.video-toolbar {
    flex: 0 0 auto;
    min-height: 58px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(132, 177, 236, .14);
    background:
        linear-gradient(135deg, rgba(218, 228, 238, .08), rgba(92, 102, 116, .04)),
        rgba(7, 14, 27, .58);
}

.video-toolbar-group {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.video-toolbar-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-toolbar-main-row {
    min-height: 38px;
}

.video-toolbar-batch-row {
    min-height: 38px;
    justify-content: flex-end;
}

.video-toolbar-title {
    margin-right: auto;
    max-width: 260px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid rgba(218, 228, 238, .22);
    border-radius: 14px;
    color: #f7fbff;
    background:
        linear-gradient(135deg, rgba(218, 228, 238, .12), rgba(92, 102, 116, .08)),
        rgba(3, 8, 20, .42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
    font-size: 13px;
    font-weight: 720;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-toolbar-title::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #d8e0ea;
    box-shadow: 0 0 14px rgba(218, 228, 238, .72);
}

.video-toolbar-actions,
.toolbar-video-settings,
.toolbar-select-all,
.toolbar-range-control,
.toolbar-audio-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-divider {
    width: 1px;
    height: 28px;
    background: rgba(132, 177, 236, .16);
}

.toolbar-select-all {
    color: var(--muted-strong);
    font-size: 12px;
    margin: 0;
}

.toolbar-select-all input {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
}

.toolbar-select-all strong {
    min-width: 20px;
    color: #d8e0ea;
}

.toolbar-select,
.shot-setting-select {
    height: 38px;
    min-height: 38px;
    border: 1px solid rgba(148, 190, 236, .22);
    border-radius: 12px;
    padding: 0 10px;
    color: #edf4ff;
    background: rgba(3, 8, 20, .46);
    outline: none;
}

.toolbar-select option:disabled,
.shot-setting-select option:disabled,
.image-model-select option:disabled,
.agent-shot-param-grid select option:disabled,
.agent-shot-bulkbar select option:disabled,
.agent-shot-settings-form select option:disabled {
    color: rgba(150, 164, 182, .55);
}

.toolbar-range-control,
.toolbar-audio-toggle {
    height: 38px;
    min-height: 38px;
    color: #edf4ff;
    font-size: 12px;
    white-space: nowrap;
    margin: 0;
    box-sizing: border-box;
}

.toolbar-range-control {
    border: 1px solid rgba(148, 190, 236, .22);
    border-radius: 12px;
    padding: 0 10px;
    background: rgba(3, 8, 20, .46);
}

.toolbar-audio-toggle {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
}

.toolbar-range-control span {
    width: 28px;
    color: #d8e0ea;
    font-weight: 700;
}

.toolbar-range-control input {
    width: 88px;
    height: 4px;
    padding: 0;
    margin: 0;
    accent-color: var(--primary);
}

.video-list-container {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-workspace {
    height: 100%;
    min-height: 0;
    flex: 1;
    display: flex;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
    padding: 0;
}

.image-creator-panel {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

.image-form-column,
.image-output-column {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 24px;
    border: 1px solid rgba(132, 177, 236, .16);
    border-radius: 18px;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(17, 27, 46, .84), rgba(7, 12, 22, .92)),
        rgba(255, 255, 255, .035);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .2);
}

.image-form-column {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

.image-output-column {
    overflow: hidden;
    gap: 0;
}

.image-form-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.image-form-head strong {
    display: block;
    color: #f7fbff;
    font-size: 20px;
    font-weight: 780;
}

.image-mode-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    border-radius: 14px;
    background: rgba(3, 8, 20, .38);
}

.image-mode-tabs button {
    height: 34px;
    min-width: 74px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted-strong);
    background: transparent;
    font-size: 14px;
    font-weight: 720;
}

.image-mode-tabs button.active {
    color: #edf4ff;
    border-color: rgba(218, 228, 238, .28);
    background:
        linear-gradient(135deg, rgba(218, 228, 238, .16), rgba(120, 132, 148, .14)),
        rgba(120, 132, 148, .12);
}

.image-mode-tabs .image-history-tab-btn {
    min-width: 82px;
    margin-left: 8px;
    color: #dbeafe;
    border-color: rgba(132, 177, 236, .18);
    background: rgba(15, 23, 42, .46);
}

.image-mode-tabs .image-history-tab-btn:hover {
    color: #f8fbff;
    border-color: rgba(218, 228, 238, .34);
    background: rgba(30, 41, 59, .62);
}

.image-form-divider {
    flex: 0 0 auto;
    height: 1px;
    margin: 0 0 18px;
    background: rgba(132, 177, 236, .14);
}

.image-form-column > label {
    margin: 14px 0 10px;
    color: var(--muted-strong);
    font-size: 15px;
    font-weight: 720;
}

.image-form-column select,
.image-form-column input,
.image-form-column textarea {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid rgba(148, 190, 236, .22);
    border-radius: 12px;
    color: var(--text);
    background: rgba(3, 8, 20, .46);
    outline: none;
}

.image-form-column select,
.image-form-column input {
    flex: 0 0 48px;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 14px;
    line-height: 48px;
}

.image-form-column textarea {
    min-height: 150px;
    max-height: 240px;
    resize: vertical;
    padding: 14px;
    line-height: 1.58;
}

.image-model-select {
    display: block;
    flex: 0 0 48px;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    color: var(--muted-strong) !important;
    font-size: 15px;
    line-height: 48px;
}

.image-form-column select:focus,
.image-form-column input:focus,
.image-form-column textarea:focus {
    border-color: rgba(218, 228, 238, .48);
    box-shadow: 0 0 0 3px rgba(218, 228, 238, .1);
}

.image-param-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 18px;
}

.image-param-block,
.image-param-line {
    min-width: 0;
    display: grid;
    gap: 10px;
    margin: 0;
    color: var(--muted-strong);
    font-size: 15px;
    font-weight: 720;
}

.image-param-block > strong,
.image-param-line > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-choice-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.image-choice-group button {
    height: 42px;
    min-width: 68px;
    padding: 0 14px;
    border: 1px solid rgba(148, 190, 236, .22);
    border-radius: 11px;
    color: var(--muted-strong);
    background: rgba(3, 8, 20, .42);
    font-size: 14px;
    font-weight: 720;
}

.image-choice-group button.active {
    border-color: rgba(218, 228, 238, .52);
    color: #d8e0ea;
    background:
        linear-gradient(135deg, rgba(218, 228, 238, .14), rgba(120, 132, 148, .12)),
        rgba(3, 8, 20, .42);
}

.image-choice-group button:disabled {
    cursor: not-allowed;
    opacity: .48;
    color: rgba(165, 178, 195, .72);
    border-color: rgba(148, 190, 236, .12);
    background: rgba(3, 8, 20, .22);
}

.image-param-check {
    min-height: 24px;
    display: flex !important;
    align-items: center;
    gap: 8px;
    align-self: end;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--muted-strong);
    background: transparent;
    font-size: 14px;
    font-weight: 720;
}

.image-param-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

.image-reference-box {
    position: relative;
    display: grid;
    gap: 10px;
    cursor: pointer;
}

.image-reference-section > label {
    display: block;
    margin: 20px 0 10px;
    color: var(--muted-strong);
    font-size: 15px;
    font-weight: 720;
}

.image-reference-section > label span {
    color: var(--muted);
    font-size: 13px;
}

.image-reference-box input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.image-reference-upload {
    min-height: 188px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px dashed rgba(148, 190, 236, .28);
    border-radius: 12px;
    color: var(--muted);
    background: rgba(3, 8, 20, .36);
    text-align: center;
}

.image-reference-upload strong {
    font-size: 15px;
    font-weight: 650;
}

.image-reference-upload small {
    font-size: 12px;
}

.image-upload-icon {
    width: 34px;
    height: 34px;
    position: relative;
    display: inline-block;
    color: var(--muted-strong);
}

.image-upload-icon::before {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 4px;
    height: 12px;
    border: 4px solid currentColor;
    border-top: 0;
    border-radius: 0 0 7px 7px;
}

.image-upload-icon::after {
    content: "";
    position: absolute;
    left: 15px;
    top: 4px;
    width: 4px;
    height: 22px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: -7px 7px 0 -2px currentColor, 7px 7px 0 -2px currentColor;
}

.image-generate-wide {
    width: 100%;
    height: 52px;
    margin-top: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 760;
}

.image-reference-preview {
    width: 100%;
    height: 188px;
    border: 1px solid rgba(218, 228, 238, .32);
    border-radius: 12px;
    background: rgba(3, 8, 20, .42);
    overflow: hidden;
}

.image-reference-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.image-history-list {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    padding-right: 0;
}

.image-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid rgba(132, 177, 236, .18);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(12, 21, 38, .94), rgba(5, 10, 21, .94)),
        rgba(255, 255, 255, .025);
    overflow: hidden;
    table-layout: fixed;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.image-history-table th,
.image-history-table td {
    height: 72px;
    padding: 9px 14px;
    border-bottom: 1px solid rgba(132, 177, 236, .12);
    color: var(--muted-strong);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-history-table th:nth-child(1),
.image-history-table td:nth-child(1),
.image-history-table th:nth-child(2),
.image-history-table td:nth-child(2) {
    min-width: 0;
}

.image-history-table td:nth-child(1),
.image-history-table td:nth-child(2) {
    color: #d7e5f8;
    font-weight: 680;
}

.image-history-table th {
    height: 46px;
    color: #a9bdd8;
    background:
        linear-gradient(180deg, rgba(13, 23, 40, .92), rgba(5, 10, 20, .74));
    font-size: 12px;
    font-weight: 760;
    letter-spacing: .02em;
}

.image-history-table tbody tr:hover td {
    background: rgba(218, 228, 238, .045);
}

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

.image-history-table th:nth-child(1),
.image-history-table td:nth-child(1) {
    width: 190px;
}

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

.image-history-table th:nth-child(3),
.image-history-table td:nth-child(3) {
    width: 110px;
}

.image-history-table th:nth-child(4),
.image-history-table td:nth-child(4) {
    width: 140px;
    text-align: center;
}

.image-history-preview-cell {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.image-history-thumb {
    width: 86px;
    height: 54px;
    display: inline-block;
    border: 1px solid rgba(218, 228, 238, .18);
    border-radius: 10px;
    color: var(--muted);
    background:
        linear-gradient(135deg, rgba(12, 20, 36, .92), rgba(214, 224, 235, .08)),
        rgba(3, 8, 20, .42);
    overflow: hidden;
    vertical-align: middle;
}

.image-history-thumb-inner {
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden;
}

.image-history-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center center;
}

.image-history-thumb.is-empty {
    display: inline-grid;
    place-items: center;
    font-weight: 720;
}

.image-history-error {
    width: min(220px, 100%);
    display: inline-block;
    color: #fecaca;
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.image-history-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 52px;
    padding-top: 14px;
}

.image-history-pager span {
    min-width: 76px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    color: var(--muted);
    text-align: center;
    font-size: 15px;
    font-weight: 700;
}

.image-history-pager .compact {
    min-width: 104px;
    height: 40px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 760;
}

.image-status {
    flex: 0 0 auto;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 720;
}

.image-status-pending {
    color: #facc15;
    background: rgba(250, 204, 21, .12);
}

.image-status-running {
    color: #d8e0ea;
    background: rgba(218, 228, 238, .12);
}

.image-status-success {
    color: #86efac;
    background: rgba(34, 197, 94, .12);
}

.image-status-failed,
.image-status-cancelled {
    color: #fca5a5;
    background: rgba(248, 113, 113, .13);
}

.image-empty-state {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    min-height: 96px;
    border: 1px dashed rgba(132, 177, 236, .18);
    border-radius: 12px;
    color: var(--muted);
    background: rgba(3, 8, 20, .18);
}

.image-output-preview {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 0;
    overflow: hidden;
}

.image-output-empty {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(132, 177, 236, .16);
    border-radius: 12px;
    color: var(--muted);
    background:
        radial-gradient(circle at 50% 42%, rgba(218, 228, 238, .08), transparent 32%),
        linear-gradient(135deg, rgba(12, 20, 36, .72), rgba(3, 8, 20, .38)),
        rgba(3, 8, 20, .28);
    text-align: center;
    overflow: hidden;
}

.image-output-empty::before {
    content: "";
    position: absolute;
    inset: 26px;
    border-radius: 14px;
    pointer-events: none;
}

.image-output-empty-card {
    position: relative;
    z-index: 1;
    width: min(320px, calc(100% - 48px));
    min-height: 168px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    padding: 28px 26px;
    border: 1px solid rgba(218, 228, 238, .16);
    border-radius: 16px;
    background: rgba(3, 8, 20, .34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 18px 42px rgba(0, 0, 0, .2);
}

.image-output-empty-card .upload-icon {
    width: 42px;
    height: 42px;
    opacity: .95;
}

.image-output-empty-card strong {
    color: #edf4ff;
    font-size: 16px;
    font-weight: 760;
}

.image-output-empty-card small {
    max-width: 240px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.image-output-empty.is-running {
    gap: 12px;
    align-content: center;
    color: #d8e0ea;
}

.image-output-empty.is-running::before {
    display: none;
}

.image-output-empty.is-failed {
    gap: 10px;
    align-content: center;
    color: #fecaca;
    border-color: rgba(248, 113, 113, .22);
    background:
        radial-gradient(circle at 50% 42%, rgba(248, 113, 113, .10), transparent 34%),
        rgba(40, 8, 12, .22);
}

.image-output-empty.is-failed::before {
    display: none;
}

.image-output-empty.is-failed small {
    max-width: min(520px, calc(100% - 48px));
    color: rgba(254, 202, 202, .86);
    font-size: 12px;
    line-height: 1.55;
}

.image-output-error-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(248, 113, 113, .42);
    border-radius: 50%;
    color: #fecaca;
    background: rgba(127, 29, 29, .26);
    font-size: 20px;
    font-weight: 900;
}

.image-output-image-wrap {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    border: 1px solid rgba(218, 228, 238, .22);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(12, 20, 36, .92), rgba(214, 224, 235, .08)),
        rgba(3, 8, 20, .42);
    overflow: hidden;
}

.image-output-image-inner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.image-output-image-wrap img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    object-position: center center;
}

.image-output-delete,
.image-output-download {
    opacity: 0;
    transition: opacity .16s ease, transform .16s ease, background .16s ease;
}

.image-output-download {
    position: absolute;
    top: 8px;
    right: 42px;
    z-index: 2;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(74, 222, 128, .42);
    border-radius: 50%;
    color: #dcfce7;
    background: rgba(20, 83, 45, .76);
    backdrop-filter: blur(10px);
}

.image-output-download svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.image-output-image-wrap:hover .image-output-delete,
.image-output-image-wrap:hover .image-output-download {
    opacity: 1;
}

.image-output-view {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    cursor: pointer;
}

.image-output-view span {
    min-width: 86px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    padding: 0 14px;
    border: 1px solid rgba(248, 251, 255, .22);
    border-radius: 999px;
    background: rgba(3, 8, 20, .46);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
}

.image-output-image-wrap:hover .image-output-view {
    opacity: 1;
}

.image-history-modal-card {
    width: min(900px, calc(100vw - 44px));
    max-height: min(720px, calc(100vh - 44px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-color: rgba(218, 228, 238, .24);
    background:
        linear-gradient(180deg, rgba(18, 32, 54, .98), rgba(5, 10, 21, .98)),
        rgba(255, 255, 255, .035);
}

.image-history-modal-card .modal-head {
    padding: 24px 52px;
    border-bottom: 1px solid rgba(132, 177, 236, .16);
    background:
        linear-gradient(135deg, rgba(218, 228, 238, .08), rgba(92, 102, 116, .04)),
        rgba(7, 14, 27, .58);
}

.image-history-modal-card .modal-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.image-history-modal-card .modal-head h2 span {
    min-width: 30px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: #d8e0ea;
    background: rgba(218, 228, 238, .12);
    font-size: 12px;
    font-weight: 720;
}

.image-history-modal-card .image-history-list {
    margin: 36px auto 0;
    padding: 0 0 30px;
    overflow-y: auto;
}

.image-history-modal-card .image-empty-state {
    width: min(760px, calc(100% - 72px));
    margin: 36px auto 30px;
}

.image-history-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 10px;
    color: var(--text);
}

.image-history-title strong {
    font-size: 15px;
    font-weight: 760;
}

.image-history-title span {
    min-width: 30px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: #d8e0ea;
    background: rgba(218, 228, 238, .12);
    font-weight: 720;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
    gap: 18px;
    align-items: start;
}

.project-card {
    position: relative;
    aspect-ratio: 3 / 4;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid rgba(132, 177, 236, .15);
    border-radius: 14px;
    background:
        radial-gradient(circle at 50% 20%, rgba(120, 132, 148, .13), transparent 42%),
        linear-gradient(180deg, rgba(39, 49, 66, .86), rgba(14, 19, 30, .94)),
        rgba(255, 255, 255, .035);
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: rgba(218, 228, 238, .44);
    background:
        radial-gradient(circle at 50% 20%, rgba(218, 228, 238, .17), transparent 44%),
        linear-gradient(180deg, rgba(47, 59, 78, .9), rgba(13, 18, 29, .96)),
        rgba(255, 255, 255, .04);
    box-shadow: 0 20px 46px rgba(0, 0, 0, .26), 0 0 0 1px rgba(218, 228, 238, .08);
}

.project-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(4, 8, 17, .46));
}

.project-card-menu {
    position: absolute;
    z-index: 3;
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
}

.project-card-menu-left {
    left: 12px;
    top: 10px;
}

.project-card-menu-left::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 5px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(237, 244, 255, .92);
    box-shadow: 0 7px 0 rgba(237, 244, 255, .92), 0 14px 0 rgba(237, 244, 255, .92);
}

.project-card-menu-right {
    right: 12px;
    top: 10px;
}

.project-card-menu-right::before,
.project-card-menu-right::after {
    content: "";
    position: absolute;
    right: 4px;
    height: 2px;
    border-radius: 999px;
    background: rgba(237, 244, 255, .92);
}

.project-card-menu-right::before {
    top: 7px;
    width: 17px;
    box-shadow: 0 7px 0 rgba(237, 244, 255, .92);
}

.project-card-menu-right::after {
    top: 21px;
    width: 12px;
}

.project-create-card {
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--muted-strong);
    border: 1px dashed rgba(218, 228, 238, .42);
    background:
        radial-gradient(circle at 50% 36%, rgba(218, 228, 238, .12), transparent 40%),
        linear-gradient(180deg, rgba(13, 22, 37, .78), rgba(5, 9, 17, .94)),
        rgba(255, 255, 255, .025);
}

.project-create-card .project-card-menu-left {
    left: 14px;
    top: 12px;
}

.project-create-card:hover {
    border-color: rgba(218, 228, 238, .72);
    box-shadow: 0 24px 60px rgba(92, 102, 116, .18), 0 0 0 1px rgba(218, 228, 238, .12);
}

.project-create-folder {
    width: 72px;
    height: 52px;
    position: relative;
    border: 3px solid rgba(237, 244, 255, .9);
    border-radius: 9px;
}

.project-create-folder::before {
    content: "";
    position: absolute;
    left: 7px;
    top: -13px;
    width: 28px;
    height: 16px;
    border: 3px solid rgba(237, 244, 255, .9);
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    background: rgba(5, 9, 17, .72);
}

.project-create-plus {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
}

.project-create-plus::before,
.project-create-plus::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 3px;
    border-radius: 999px;
    background: #eaf2ff;
    transform: translate(-50%, -50%);
}

.project-create-plus::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.project-create-card strong {
    color: #eaf2ff;
    font-size: 12.5px;
    font-weight: 720;
}

.project-folder-visual {
    position: relative;
    z-index: 1;
    width: 76px;
    height: 56px;
    align-self: center;
    margin: 18px 0 8px;
}

.project-folder-back,
.project-folder-front {
    position: absolute;
    display: block;
    background:
        radial-gradient(circle at 26% 18%, rgba(255, 255, 255, .24), transparent 30%),
        linear-gradient(180deg, rgba(218, 228, 238, .82), rgba(92, 102, 116, .66));
    box-shadow: 0 18px 38px rgba(92, 102, 116, .28);
}

.project-folder-back {
    left: 12px;
    top: 0;
    width: 52px;
    height: 37px;
    border-radius: 8px 8px 7px 7px;
}

.project-folder-back::before {
    content: "";
    position: absolute;
    left: 0;
    top: -11px;
    width: 22px;
    height: 14px;
    border-radius: 7px 7px 0 0;
    background: inherit;
}

.project-folder-front {
    left: 0;
    right: 0;
    bottom: 0;
    height: 42px;
    border-radius: 8px 8px 12px 12px;
    transform: perspective(120px) rotateX(-8deg);
}

.project-card-head {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    text-align: left;
}

.project-card-head > div {
    min-width: 0;
    width: 100%;
}

.project-card h3 {
    margin: 0 0 4px;
    color: #f7fbff;
    font-size: 13.5px;
    font-weight: 680;
    line-height: 1.35;
    max-height: 1.35em;
    display: -webkit-box;
    overflow: hidden;
    word-break: break-all;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.project-card p {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.45;
    min-width: 0;
    line-clamp: 1;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.project-delete-btn {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    border: 1px solid rgba(248, 113, 113, .28);
    border-radius: 999px;
    padding: 5px 9px;
    color: var(--danger);
    background: var(--danger-soft);
    font-size: 11px;
}

.project-meta-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.project-meta-grid span {
    min-width: 0;
    display: grid;
    gap: 3px;
    padding: 7px;
    border: 1px solid rgba(132, 177, 236, .12);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(3, 8, 20, .24);
    font-size: 10.5px;
}

.project-meta-grid strong {
    overflow: hidden;
    color: #eaf2ff;
    font-size: 11.5px;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-status-row {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.project-status-row > span {
    color: #d8e0ea;
    font-size: 11.5px;
    font-weight: 620;
}

.project-status-row > strong {
    color: var(--muted);
    font-size: 11px;
    font-weight: 620;
}

.shot-card {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 44px 220px minmax(72px, auto);
    grid-template-areas:
        "toolbar"
        "body"
        "refs";
    gap: 12px;
    align-items: stretch;
    padding: 14px;
    border: 1px solid rgba(132, 177, 236, .16);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(17, 27, 46, .82), rgba(7, 12, 22, .9)),
        rgba(255, 255, 255, .035);
}

.shot-card.selected {
    border-color: rgba(218, 228, 238, .48);
    box-shadow: 0 0 0 1px rgba(218, 228, 238, .12), 0 16px 42px rgba(92, 102, 116, .12);
}

.shot-header {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 38px;
    gap: 8px;
    padding: 0 2px;
    border: 0;
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
    margin: 0;
}

.shot-checkbox {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
}

.shot-number {
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding-top: 0;
}

.shot-number-badge {
    width: 34px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(218, 228, 238, .34);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 720;
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .38), transparent 28%),
        linear-gradient(145deg, rgba(214, 224, 235, .72), rgba(92, 102, 116, .52));
    box-shadow: 0 8px 18px rgba(92, 102, 116, .16);
}

.shot-code-label {
    width: auto;
    min-width: 88px;
    height: 38px;
    min-height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    border: 1px solid rgba(218, 228, 238, .2);
    border-radius: 14px;
    color: rgba(226, 241, 255, .9);
    background:
        linear-gradient(180deg, rgba(6, 13, 28, .9), rgba(3, 8, 20, .88));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
    font-size: 12.5px;
    font-weight: 720;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
    box-sizing: border-box;
    margin: 0;
}

.shot-content,
.shot-preview,
.shot-actions {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.shot-body {
    grid-area: body;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 520px) 126px;
    grid-template-areas: "content preview actions";
    gap: 14px;
    align-items: stretch;
    height: 220px;
}

.shot-content {
    grid-area: content;
    align-self: stretch;
}

.shot-actions {
    grid-area: actions;
    height: 220px;
    display: flex;
    gap: 12px;
    justify-content: stretch;
}

.shot-preview {
    grid-area: preview;
}

.shot-description-head {
    grid-area: toolbar;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.shot-description-head .asset-form-label {
    flex: 0 0 auto;
    margin: 0;
}

.shot-description-wrap {
    position: relative;
    height: 220px;
    min-height: 220px;
    max-height: 220px;
    display: flex;
}

.director-polish-btn {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    min-width: 104px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid rgba(218, 228, 238, .48);
    border-radius: 12px;
    color: #edf4ff;
    background:
        linear-gradient(180deg, rgba(11, 24, 43, .96), rgba(4, 10, 22, .92)),
        rgba(214, 224, 235, .1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 24px rgba(130, 142, 158, .12);
    font-size: 13px;
    font-weight: 760;
    letter-spacing: 0;
    white-space: nowrap;
}

.director-polish-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(218, 228, 238, .72);
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(130, 142, 158, .24), rgba(92, 102, 116, .18)),
        rgba(4, 10, 22, .92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 12px 28px rgba(130, 142, 158, .18);
}

.shot-description {
    min-height: 220px;
    max-height: 220px;
    overflow-y: auto;
    line-height: 1.58;
}

.rich-shot-description {
    width: 100%;
    flex: 1 1 auto;
    padding: 12px 13px 62px;
    border: 1px solid rgba(120, 151, 188, .2);
    border-radius: 13px;
    color: var(--text);
    background: rgba(3, 4, 6, .44);
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
    scrollbar-gutter: stable;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
}

.rich-shot-description :not(.rich-ref-token):not(.rich-ref-token *):not(.ref-thumb):not(.ref-thumb *):not(.ref-replace-select) {
    color: inherit !important;
    font: inherit !important;
    background: transparent !important;
}

.rich-shot-description:focus {
    border-color: rgba(218, 228, 238, .46);
    box-shadow: 0 0 0 3px rgba(218, 228, 238, .1);
}

.rich-shot-description:empty::before {
    content: attr(data-placeholder);
    color: rgba(169, 187, 213, .56);
}

.rich-ref-token {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: min(260px, 72%);
    margin: 0 3px;
    min-height: 26px;
    padding: 0 5px 0 8px;
    border: 1px solid rgba(185, 208, 232, .28);
    border-radius: 8px;
    line-height: 1;
    font-size: .95em;
    font-weight: 780;
    vertical-align: baseline;
    user-select: none;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .32);
}

.rich-ref-token-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.ref-thumb {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(219, 234, 254, .34);
    border-radius: 5px;
    background: rgba(2, 8, 23, .38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.ref-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.ref-thumb-empty::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: currentColor;
    opacity: .68;
}

.rich-ref-thumb {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
    margin-left: -4px;
    border-radius: 6px;
}

.rich-ref-token-remove {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: currentColor;
    background: rgba(2, 8, 23, .28);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.rich-ref-token-remove:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, .18);
}

.shot-meta-row {
    grid-area: refs;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    min-height: 72px;
    padding-top: 2px;
    gap: 6px;
}

.shot-references {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.shot-reference-label {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.shot-reference-label small {
    color: rgba(169, 187, 213, .58);
    font-size: 11px;
    font-weight: 520;
}

.reference-tags-container {
    min-height: 30px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.ref-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 0 7px;
    border: 1px solid rgba(132, 177, 236, .22);
    border-radius: 7px;
    font-size: 11.5px;
    line-height: 1;
    white-space: nowrap;
}

.ref-tag-name {
    display: inline-block;
    max-width: 7.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.ref-replace-select {
    width: 22px;
    height: 20px;
    flex: 0 0 22px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: transparent;
    text-indent: -999px;
    background:
        linear-gradient(45deg, transparent 50%, rgba(226, 237, 249, .72) 50%) calc(50% - 3px) 50% / 6px 6px no-repeat,
        linear-gradient(135deg, rgba(226, 237, 249, .72) 50%, transparent 50%) calc(50% + 3px) 50% / 6px 6px no-repeat,
        rgba(4, 12, 24, .24);
    color-scheme: dark;
    cursor: pointer;
    opacity: .78;
    appearance: none;
}

.ref-replace-select:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, .1);
}

.ref-replace-select:disabled {
    cursor: not-allowed;
    opacity: .34;
    filter: grayscale(.5);
}

.ref-replace-select:focus {
    outline: 1px solid rgba(255, 255, 255, .48);
    outline-offset: 1px;
}

.ref-replace-select option {
    color: #e5eefc;
    background: #081426;
    text-indent: 0;
}

.rich-ref-replace-select {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
    margin-left: -4px;
}

.asset-mention-menu {
    position: fixed;
    z-index: 1200;
    width: min(320px, calc(100vw - 28px));
    max-height: 310px;
    padding: 8px;
    overflow-y: auto;
    border: 1px solid rgba(218, 228, 238, .28);
    border-radius: 12px;
    background: rgba(5, 12, 25, .96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px);
}

.asset-mention-item {
    width: 100%;
    min-height: 44px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #e8f1ff;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.asset-mention-item:hover,
.asset-mention-item.active {
    border-color: rgba(180, 190, 204, .42);
    background: rgba(92, 102, 116, .22);
}

.asset-mention-empty {
    padding: 12px 10px;
    color: rgba(186, 205, 232, .76);
    font-size: 13px;
    text-align: center;
}

.asset-mention-thumb {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 7px;
    color: #dce5ef;
    background: rgba(15, 23, 42, .78);
    border: 1px solid rgba(148, 190, 236, .28);
}

.asset-mention-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.asset-mention-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.asset-mention-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 760;
}

.asset-mention-main small {
    color: rgba(186, 205, 232, .72);
    font-size: 11px;
}

.ref-tag small {
    color: currentColor;
    opacity: .72;
    font-size: 10px;
}

.ref-tag-char {
    color: #edf4ff;
    background: rgba(3, 4, 6, .52);
    border-color: rgba(220, 230, 240, .28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.rich-ref-token.ref-tag-char {
    color: #edf4ff;
    background: rgba(3, 4, 6, .56);
    border-color: rgba(220, 230, 240, .3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .1),
        0 6px 14px rgba(0, 0, 0, .18);
}

.rich-ref-token.ref-tag-char .rich-ref-token-remove {
    color: #edf4ff;
    background: rgba(3, 10, 20, .32);
}

.ref-tag-scene {
    color: #d7f7ea;
    background: rgba(3, 4, 6, .52);
    border-color: rgba(160, 190, 178, .28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.rich-ref-token.ref-tag-scene {
    color: #eafff6;
    background: rgba(3, 4, 6, .56);
    border-color: rgba(160, 190, 178, .3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .1),
        0 6px 14px rgba(0, 0, 0, .18);
}

.rich-ref-token.ref-tag-scene .rich-ref-token-remove {
    color: #f0fdf4;
    background: rgba(3, 18, 15, .32);
}

.ref-tag-obj {
    color: #ffe9d2;
    background: rgba(3, 4, 6, .52);
    border-color: rgba(210, 178, 142, .3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.rich-ref-token.ref-tag-obj {
    color: #fff2e3;
    background: rgba(3, 4, 6, .56);
    border-color: rgba(210, 178, 142, .32);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .1),
        0 6px 14px rgba(0, 0, 0, .18);
}

.rich-ref-token.ref-tag-obj .rich-ref-token-remove {
    color: #fff7ed;
    background: rgba(28, 15, 8, .34);
}

.ref-tag-remove,
.ref-add-btn {
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 6px;
}

.ref-tag-remove {
    width: 16px;
    height: 16px;
    border: 0;
    color: inherit;
    background: rgba(2, 8, 18, .28);
}

.ref-add-btn {
    width: 26px;
    height: 26px;
    border: 1px dashed rgba(148, 190, 236, .28);
    color: var(--muted-strong);
    background: rgba(3, 8, 20, .34);
}

.ref-tag-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.shot-video-settings {
    justify-content: flex-start;
}

.ref-add-btn:hover {
    color: #d8e0ea;
    border-color: rgba(218, 228, 238, .5);
}

.ref-add-btn svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.video-preview-box,
.generating-state {
    width: 100%;
    height: 220px;
    min-height: 220px;
    aspect-ratio: auto;
    display: grid;
    place-items: center;
    border: 2px dashed rgba(132, 177, 236, .22);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(12, 20, 36, .9), rgba(214, 224, 235, .08)),
        rgba(255, 255, 255, .035);
    overflow: hidden;
}

.video-preview-box.has-video {
    border-style: solid;
    border-color: rgba(218, 228, 238, .42);
    position: relative;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, .96), rgba(3, 8, 20, .92)),
        #020617;
}

.video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    object-position: center center;
    background: #020617;
    outline: none;
}

.video-preview-icon {
    width: 42px;
    height: 32px;
    position: relative;
    border: 1px solid rgba(218, 228, 238, .42);
    border-radius: 9px;
    opacity: .78;
}

.video-preview-icon::after {
    content: "";
    position: absolute;
    left: 16px;
    top: 9px;
    border-left: 11px solid rgba(232, 238, 246, .9);
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}

.generating-state {
    gap: 12px;
    color: #d8e0ea;
}

.generating-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid rgba(120, 132, 148, .2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.generating-text {
    font-size: 12px;
    font-weight: 600;
}

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

.shot-video-settings {
    display: flex;
    align-items: center;
    align-self: center;
    height: 38px;
    flex-wrap: nowrap;
    gap: 8px;
    width: auto;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.shot-video-settings .shot-setting-select {
    width: 84px;
    height: 38px;
    min-height: 38px;
    border: 1px solid rgba(148, 190, 236, .22);
    border-radius: 14px;
    padding: 0 34px 0 14px;
    font-size: 12px;
    line-height: 38px;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    background:
        linear-gradient(45deg, transparent 50%, rgba(226, 241, 255, .88) 50%) calc(100% - 18px) 16px / 6px 6px no-repeat,
        linear-gradient(135deg, rgba(226, 241, 255, .88) 50%, transparent 50%) calc(100% - 14px) 16px / 6px 6px no-repeat,
        linear-gradient(180deg, rgba(6, 13, 28, .9), rgba(3, 8, 20, .88));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
    outline: none;
    vertical-align: top;
}

.shot-video-settings .shot-setting-select:nth-child(2) {
    width: 94px;
}

.shot-video-settings .shot-setting-select:nth-child(4) {
    width: 84px;
}

.shot-duration-control,
.shot-audio-toggle {
    height: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    align-self: center;
    border: 1px solid rgba(148, 190, 236, .22);
    border-radius: 14px;
    padding: 0 12px;
    color: #edf4ff;
    background:
        linear-gradient(180deg, rgba(6, 13, 28, .9), rgba(3, 8, 20, .88));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
    font-size: 12px;
    white-space: nowrap;
    line-height: 1;
    box-sizing: border-box;
    vertical-align: top;
    margin: 0;
}

.shot-duration-control {
    width: 150px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 8px;
    padding: 0 12px;
}

.shot-duration-control span {
    width: auto;
    color: #d8e0ea;
    font-weight: 700;
    text-align: left;
}

.shot-duration-control input {
    width: 100%;
    height: 4px;
    padding: 0;
    margin: 0;
    accent-color: var(--primary);
    appearance: none;
    -webkit-appearance: none;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(120, 132, 148, .72), rgba(218, 228, 238, .48));
    outline: none;
}

.shot-duration-control input::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .28);
}

.shot-duration-control input::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -7px;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #d8e0ea, #8c98a8);
    box-shadow: 0 0 0 3px rgba(120, 132, 148, .13), 0 4px 10px rgba(92, 102, 116, .28);
}

.shot-duration-control input::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .28);
}

.shot-duration-control input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #d8e0ea, #8c98a8);
    box-shadow: 0 0 0 3px rgba(120, 132, 148, .13), 0 4px 10px rgba(92, 102, 116, .28);
}

.shot-audio-toggle {
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.toolbar-audio-toggle input,
.shot-audio-toggle input {
    width: 16px;
    height: 16px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    display: grid;
    place-items: center;
    border: 0px solid rgba(237, 244, 255, .9);
    border-radius: 3px;
    background: rgba(255, 255, 255, .92);
    box-shadow: inset 0 0 0 2px rgba(3, 8, 20, .08);
}

.toolbar-audio-toggle input:checked,
.shot-audio-toggle input:checked {
    border-color: rgba(218, 228, 238, .86);
    background: linear-gradient(135deg, #d8e0ea, #6f7b8b);
}

.toolbar-audio-toggle input:checked::after,
.shot-audio-toggle input:checked::after {
    content: "";
    width: 7px;
    height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

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

.shot-actions .compact {
    width: 100%;
}

.icon-only {
    color: var(--muted-strong);
}

.video-workspace .video-toolbar {
    border-bottom-color: rgba(198, 207, 218, .12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .018)),
        rgba(8, 9, 12, .42);
    -webkit-backdrop-filter: blur(18px) saturate(1.02);
    backdrop-filter: blur(18px) saturate(1.02);
}

.video-workspace .video-toolbar-title {
    border-color: rgba(210, 224, 236, .2);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .028)),
        rgba(8, 9, 12, .44);
}

.video-workspace .video-toolbar-title::before {
    background: #d9e2ec;
    box-shadow: 0 0 12px rgba(217, 226, 236, .34);
}

.video-workspace .toolbar-divider {
    background: rgba(198, 207, 218, .14);
}

.video-workspace .toolbar-select-all strong,
.video-workspace .toolbar-range-control span,
.shot-duration-control span {
    color: #d8e0ea;
}

.video-workspace .toolbar-select,
.video-workspace .shot-setting-select,
.video-workspace .toolbar-range-control,
.video-workspace .toolbar-audio-toggle,
.shot-video-settings .shot-setting-select,
.shot-duration-control,
.shot-audio-toggle,
.shot-code-label {
    border-color: rgba(198, 207, 218, .18);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .018)),
        rgba(5, 6, 9, .58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055);
}

.shot-card {
    border-color: rgba(198, 207, 218, .16);
    background:
        linear-gradient(180deg, rgba(13, 14, 18, .62), rgba(5, 6, 9, .72)),
        rgba(255, 255, 255, .025);
    -webkit-backdrop-filter: blur(16px) saturate(1.02);
    backdrop-filter: blur(16px) saturate(1.02);
}

.shot-card.selected {
    border-color: rgba(218, 228, 238, .32);
    box-shadow: 0 0 0 1px rgba(218, 228, 238, .08), 0 16px 42px rgba(0, 0, 0, .18);
}

.shot-number-badge {
    border-color: rgba(220, 230, 240, .32);
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .32), transparent 28%),
        linear-gradient(145deg, rgba(229, 236, 244, .32), rgba(91, 101, 114, .32)),
        rgba(8, 9, 12, .42);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}

.director-polish-btn {
    border-color: rgba(210, 224, 236, .28);
    color: #edf4ff;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025)),
        rgba(5, 6, 9, .62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .075), 0 10px 24px rgba(0, 0, 0, .16);
}

.director-polish-btn:hover {
    border-color: rgba(230, 238, 246, .42);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .105), rgba(255, 255, 255, .035)),
        rgba(8, 9, 12, .64);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 12px 28px rgba(0, 0, 0, .2);
}

.rich-shot-description,
.video-preview-box,
.generating-state {
    border-color: rgba(198, 207, 218, .16);
    background:
        linear-gradient(135deg, rgba(12, 13, 17, .58), rgba(5, 6, 9, .68)),
        rgba(255, 255, 255, .025);
}

.video-preview-box {
    border-color: rgba(198, 207, 218, .2);
}

.video-preview-box.has-video {
    border-color: rgba(218, 228, 238, .28);
    background:
        linear-gradient(180deg, rgba(5, 6, 9, .86), rgba(3, 4, 6, .9)),
        #030406;
}

.video-player {
    background: #030406;
}

.video-preview-icon {
    border-color: rgba(218, 228, 238, .3);
}

.video-preview-icon::after {
    border-left-color: rgba(229, 236, 244, .82);
}

.shot-duration-control input,
.toolbar-range-control input {
    accent-color: #d8e0ea;
}

.shot-duration-control input {
    background: linear-gradient(90deg, rgba(218, 228, 238, .42), rgba(115, 126, 140, .36));
}

.shot-duration-control input::-webkit-slider-thumb,
.shot-duration-control input::-moz-range-thumb {
    background: linear-gradient(135deg, #f3f7fb, #8e9aaa);
    box-shadow: 0 0 0 3px rgba(218, 228, 238, .09), 0 4px 10px rgba(0, 0, 0, .28);
}

.toolbar-audio-toggle input:checked,
.shot-audio-toggle input:checked {
    border-color: rgba(230, 238, 246, .72);
    background: linear-gradient(135deg, #f3f7fb, #7f8b99);
}

@media (max-width: 1680px) {
    .image-creator-panel {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 18px;
    }

    .shot-body {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 420px) 112px;
        gap: 12px;
    }

    .shot-number-badge {
        width: 34px;
        height: 28px;
    }

    .shot-description-head {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 44px;
    }

    .shot-video-settings {
        min-width: 0;
        justify-content: flex-start;
    }

}

/* Last-mile guard: history dialogs must not inherit blue/table chip leftovers. */
#imageHistoryModal .image-history-list,
#imageHistoryModal .image-history-table,
#historyModal .history-list,
#historyModal .history-row {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

#imageHistoryModal .image-history-table {
    display: table !important;
    width: 100% !important;
    overflow: hidden !important;
    border-color: rgba(232, 238, 246, .13) !important;
    background: rgba(3, 6, 12, .40) !important;
}

#imageHistoryModal .image-history-table :where(th, td),
#historyModal .history-row {
    border-color: rgba(232, 238, 246, .10) !important;
    background-color: transparent !important;
    background-image: none !important;
}

#imageHistoryModal .image-history-pager > span {
    min-width: auto !important;
    height: auto !important;
    padding: 0 8px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Final guard for history dialogs after global glass overrides. */
#imageHistoryModal .image-history-list,
#imageHistoryModal .image-history-table,
#historyModal .history-list,
#historyModal .history-row {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

#imageHistoryModal .image-history-table {
    display: table !important;
    width: 100% !important;
    overflow: hidden !important;
    border-color: rgba(232, 238, 246, .13) !important;
    background: rgba(3, 6, 12, .40) !important;
}

#imageHistoryModal .image-history-table :where(th, td),
#historyModal .history-row {
    border-color: rgba(232, 238, 246, .10) !important;
    background-color: transparent !important;
    background-image: none !important;
}

#imageHistoryModal .image-history-pager > span {
    min-width: auto !important;
    height: auto !important;
    padding: 0 8px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Production history dialogs: keep lists contained and aligned with the black-glass UI. */
#imageHistoryModal .image-history-modal-card {
    width: min(980px, calc(100vw - 48px)) !important;
    max-height: min(760px, calc(100vh - 48px)) !important;
    overflow: hidden !important;
    border-color: rgba(232, 238, 246, .18) !important;
    background:
        linear-gradient(180deg, rgba(16, 17, 21, .42), rgba(4, 5, 7, .58)),
        rgba(0, 0, 0, .12) !important;
}

#imageHistoryModal .modal-head,
#historyModal .modal-head {
    border-bottom-color: rgba(232, 238, 246, .12) !important;
    background: transparent !important;
    box-shadow: none !important;
}

#imageHistoryModal .image-history-list {
    width: calc(100% - 64px) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 28px auto 0 !important;
    padding: 0 0 28px !important;
    overflow: hidden auto !important;
}

#imageHistoryModal .image-history-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    table-layout: fixed !important;
    border-color: rgba(232, 238, 246, .13) !important;
    background: rgba(3, 6, 12, .40) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055) !important;
}

#imageHistoryModal .image-history-table th,
#imageHistoryModal .image-history-table td {
    border-bottom-color: rgba(232, 238, 246, .10) !important;
    color: rgba(221, 231, 244, .92) !important;
    background: transparent !important;
}

#imageHistoryModal .image-history-table th {
    color: rgba(189, 203, 222, .86) !important;
    background: rgba(255, 255, 255, .028) !important;
    letter-spacing: 0;
}

#imageHistoryModal .image-history-table tbody tr:hover td {
    background: rgba(255, 255, 255, .035) !important;
}

#imageHistoryModal .image-history-table th:nth-child(1),
#imageHistoryModal .image-history-table td:nth-child(1) {
    width: 28%;
}

#imageHistoryModal .image-history-table th:nth-child(2),
#imageHistoryModal .image-history-table td:nth-child(2) {
    width: 28%;
}

#imageHistoryModal .image-history-table th:nth-child(3),
#imageHistoryModal .image-history-table td:nth-child(3) {
    width: 18%;
}

#imageHistoryModal .image-history-table th:nth-child(4),
#imageHistoryModal .image-history-table td:nth-child(4) {
    width: 26%;
}

#imageHistoryModal .image-history-pager span {
    min-width: auto !important;
    height: auto !important;
    padding: 0 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: rgba(204, 214, 224, .82) !important;
    background: transparent !important;
    box-shadow: none !important;
}

#canvasProjectModal .canvas-project-modal-card {
    width: min(760px, calc(100vw - 40px)) !important;
    max-height: min(620px, calc(100vh - 40px)) !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    border-color: rgba(232, 238, 246, .15) !important;
    background:
        linear-gradient(180deg, rgba(13, 15, 20, .52), rgba(4, 5, 7, .64)),
        rgba(0, 0, 0, .12) !important;
}

#canvasProjectModal .modal-head {
    padding: 18px 26px !important;
    border-bottom-color: rgba(232, 238, 246, .12) !important;
    background: transparent !important;
    box-shadow: none !important;
}

#canvasProjectModal .canvas-project-modal-card > .canvas-project-list {
    margin-top: 0 !important;
}

#canvasProjectModal .modal-head h2 {
    font-size: 20px !important;
}

#canvasProjectModal .modal-head h2 span {
    min-width: 26px !important;
    height: 22px !important;
    font-size: 11px !important;
}

#canvasProjectModal .canvas-project-list {
    width: calc(100% - 48px) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 28px 0 24px !important;
    overflow: hidden auto !important;
}

#canvasProjectModal .canvas-project-list:empty {
    display: none !important;
}

#canvasProjectModal #canvasProjectEmpty {
    width: calc(100% - 48px) !important;
    min-height: 404px !important;
    margin: 0 auto 24px !important;
    box-sizing: border-box !important;
    place-items: center !important;
    border: 1px dashed rgba(232, 238, 246, .18) !important;
    border-radius: 8px !important;
    color: rgba(221, 231, 244, .72) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .026), rgba(255, 255, 255, .01)),
        rgba(3, 4, 6, .22) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    text-align: center !important;
}

#canvasProjectModal #canvasProjectEmpty:not(.hide) {
    display: grid !important;
}

#canvasProjectModal .canvas-project-table {
    width: 100% !important;
    border: 0 !important;
    border-collapse: collapse !important;
    border-radius: 0 !important;
    table-layout: fixed !important;
    background: transparent !important;
    box-shadow: none !important;
}

#canvasProjectModal .canvas-project-table th,
#canvasProjectModal .canvas-project-table td {
    height: 42px !important;
    padding: 6px 12px !important;
    overflow: hidden;
    border-bottom: 1px solid rgba(232, 238, 246, .09) !important;
    color: rgba(221, 231, 244, .92) !important;
    background: transparent !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#canvasProjectModal .canvas-project-table th {
    height: 34px !important;
    color: rgba(189, 203, 222, .86) !important;
    background: rgba(255, 255, 255, .018) !important;
    font-size: 12px !important;
    letter-spacing: 0;
}

#canvasProjectModal .canvas-project-table tbody tr:hover td {
    background: rgba(255, 255, 255, .035) !important;
}

#canvasProjectModal .canvas-project-table th:nth-child(1),
#canvasProjectModal .canvas-project-table td:nth-child(1) {
    width: 12%;
}

#canvasProjectModal .canvas-project-table th:nth-child(2),
#canvasProjectModal .canvas-project-table td:nth-child(2) {
    width: 34%;
}

#canvasProjectModal .canvas-project-table th:nth-child(3),
#canvasProjectModal .canvas-project-table td:nth-child(3) {
    width: 12%;
}

#canvasProjectModal .canvas-project-table th:nth-child(4),
#canvasProjectModal .canvas-project-table td:nth-child(4) {
    width: 22%;
}

#canvasProjectModal .canvas-project-table th:nth-child(5),
#canvasProjectModal .canvas-project-table td:nth-child(5) {
    width: 20%;
    text-align: right;
}

#canvasProjectModal .canvas-project-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 6px;
}

#canvasProjectModal .canvas-project-table td:nth-child(5) :where(.ghost, .danger) {
    min-height: 30px;
    padding: 0 10px;
}

#canvasProjectModal .canvas-project-pager {
    margin-top: 14px !important;
    gap: 12px !important;
}

#canvasProjectModal .canvas-project-pager button {
    min-height: 34px !important;
    padding: 0 18px !important;
}

#canvasProjectModal .canvas-project-pager span {
    min-width: auto !important;
    height: auto !important;
    padding: 0 8px !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: rgba(204, 214, 224, .82) !important;
    background: transparent !important;
    box-shadow: none !important;
}

#historyModal .picker-modal-card {
    width: min(760px, calc(100vw - 48px)) !important;
}

#historyModal .history-list {
    width: calc(100% - 36px) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 18px !important;
    padding: 0 !important;
    overflow: auto !important;
}

#historyModal .history-row {
    width: 100% !important;
    box-sizing: border-box !important;
    grid-template-columns: minmax(120px, .9fr) minmax(180px, 1fr) max-content;
    border-color: rgba(232, 238, 246, .13) !important;
    background: rgba(3, 6, 12, .34) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055) !important;
}

#historyModal .history-row.current {
    border-color: rgba(191, 219, 254, .34) !important;
    background:
        linear-gradient(135deg, rgba(147, 197, 253, .10), rgba(255, 255, 255, .025)),
        rgba(3, 6, 12, .38) !important;
}

/* Membership tiers and active navigation clarity. */
.membership-compare-table .compare-gray {
    background:
        linear-gradient(180deg, rgba(203, 213, 225, .045), rgba(148, 163, 184, .018)),
        rgba(148, 163, 184, .025);
}

.membership-compare-table th.compare-gray {
    color: #dce6f3;
    background:
        linear-gradient(135deg, rgba(203, 213, 225, .13), rgba(255, 255, 255, .045)),
        rgba(148, 163, 184, .045);
}

.membership-compare-table .compare-blue {
    background:
        linear-gradient(180deg, rgba(96, 165, 250, .055), rgba(59, 130, 246, .018)),
        rgba(37, 99, 235, .025);
}

.membership-compare-table th.compare-blue {
    color: #bfdbfe;
    background:
        linear-gradient(135deg, rgba(96, 165, 250, .16), rgba(255, 255, 255, .045)),
        rgba(37, 99, 235, .055);
}

.membership-compare-table .compare-gold,
.membership-compare-table .compare-highlight {
    background:
        linear-gradient(180deg, rgba(250, 204, 21, .07), rgba(180, 83, 9, .025)),
        rgba(250, 204, 21, .026);
}

.membership-compare-table th.compare-gold,
.membership-compare-table th.compare-highlight {
    color: #fde68a;
    background:
        linear-gradient(135deg, rgba(250, 204, 21, .18), rgba(255, 255, 255, .052)),
        rgba(180, 83, 9, .055);
}

.sidebar .nav.active {
    position: relative;
    border-color: rgba(191, 219, 254, .54) !important;
    background:
        linear-gradient(135deg, rgba(147, 197, 253, .20), rgba(232, 238, 246, .055)),
        rgba(9, 20, 35, .58) !important;
    color: #f8fbff !important;
    box-shadow:
        inset 3px 0 0 rgba(147, 197, 253, .95),
        inset 0 1px 0 rgba(255, 255, 255, .18),
        0 14px 34px rgba(37, 99, 235, .18) !important;
}

.sidebar .nav.active .nav-icon {
    color: #dbeafe;
    filter: drop-shadow(0 0 8px rgba(147, 197, 253, .34));
}

.sidebar .nav.active strong {
    border-color: rgba(191, 219, 254, .38) !important;
    background: rgba(30, 64, 175, .26) !important;
    color: #eff6ff !important;
}

@media (max-width: 1420px) {
    .image-creator-panel {
        grid-template-columns: 1fr;
    }

    .shot-body {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 340px) 104px;
        align-items: start;
        gap: 12px;
    }

    .shot-actions {
        display: flex;
    }

    .shot-actions .compact {
        min-height: 34px;
    }

    .video-preview-box,
    .generating-state,
    .shot-description,
    .shot-description-wrap {
        height: 210px;
        min-height: 210px;
        max-height: 210px;
    }
}

.video-empty-state {
    min-height: 300px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: var(--muted-strong);
    text-align: center;
}

.video-empty-icon {
    width: 54px;
    height: 38px;
    border: 1px solid rgba(218, 228, 238, .28);
    border-radius: 12px;
    position: relative;
    opacity: .7;
}

.video-empty-icon::after {
    content: "";
    position: absolute;
    left: 21px;
    top: 10px;
    border-left: 13px solid rgba(218, 228, 238, .72);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.video-empty-text {
    color: #eaf2ff;
    font-weight: 650;
}

.video-empty-hint {
    color: var(--muted);
    font-size: 12px;
}

.character-grid {
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
    align-items: start;
    gap: 18px;
}

.character-grid-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(132, 177, 236, .18);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(17, 27, 46, .82), rgba(7, 12, 22, .9)),
        rgba(255, 255, 255, .035);
    box-shadow: 0 16px 42px rgba(0, 0, 0, .22);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease, filter .18s ease;
}

.character-grid-card:hover {
    transform: translateY(-4px);
    border-color: rgba(218, 228, 238, .46);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .32), 0 0 0 1px rgba(218, 228, 238, .08);
    filter: saturate(1.03);
}

.character-grid-card.create-card {
    border: 1px dashed rgba(218, 228, 238, .42);
    background:
        radial-gradient(circle at 50% 36%, rgba(218, 228, 238, .12), transparent 40%),
        linear-gradient(180deg, rgba(13, 22, 37, .78), rgba(5, 9, 17, .94)),
        rgba(255, 255, 255, .025);
}

.character-grid-card.create-card:hover {
    border-color: rgba(218, 228, 238, .72);
    box-shadow: 0 24px 60px rgba(92, 102, 116, .18), 0 0 0 1px rgba(218, 228, 238, .12);
}

.grid-card-image {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(12, 20, 36, .92), rgba(92, 102, 116, .15)),
        #07101f;
}

.character-grid-card.create-card .grid-card-image {
    background: transparent;
}

.character-grid-card.create-card .grid-card-image::after {
    opacity: 0;
}

.character-grid-card.create-card::after {
    content: "";
    min-height: 58px;
    display: block;
    background: rgba(7, 13, 24, .38);
    border-top: 1px solid rgba(132, 177, 236, .1);
}

.grid-card-image::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 25%),
        linear-gradient(0deg, rgba(4, 8, 17, .18), transparent 42%);
    opacity: .65;
}

.grid-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .22s ease, filter .22s ease;
}

.character-grid-card:hover .grid-card-image img {
    transform: scale(1.035);
    filter: saturate(1.08) contrast(1.02);
}

.create-character-content,
.no-character-image {
    display: grid;
    place-items: center;
    gap: 9px;
    color: var(--muted-strong);
    font-size: 12px;
    text-align: center;
}

.create-character-content strong,
.no-character-image strong {
    font-size: 12.5px;
    font-weight: 720;
}

.create-character-folder {
    position: relative;
    width: 72px;
    height: 52px;
    border: 3px solid rgba(237, 244, 255, .9);
    border-radius: 9px;
}

.create-character-folder::before {
    content: "";
    position: absolute;
    left: 7px;
    top: -13px;
    width: 28px;
    height: 16px;
    border: 3px solid rgba(237, 244, 255, .9);
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    background: rgba(5, 9, 17, .72);
}

.create-character-plus {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
}

.create-character-plus::before,
.create-character-plus::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 3px;
    border-radius: 999px;
    background: #ffffff;
    transform: translate(-50%, -50%);
}

.create-character-plus::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.no-character-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, .24);
    background:
        radial-gradient(circle at center 32%, rgba(143, 163, 191, .78) 0 17%, transparent 18%),
        radial-gradient(ellipse at center 76%, rgba(143, 163, 191, .46) 0 32%, transparent 33%),
        rgba(255, 255, 255, .04);
    opacity: .7;
}

.grid-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity .16s ease, transform .16s ease;
}

.grid-card-btn.share-btn {
    color: #dce5ef;
}

.grid-card-btn.share-btn.is-shared {
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, .34);
    background: rgba(22, 101, 52, .38);
}

.character-grid-card .asset-share-badge {
    position: absolute;
    left: 10px;
    top: auto;
    bottom: 10px;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.character-grid-card:hover .grid-card-actions {
    opacity: 1;
    transform: translateY(0);
}

.grid-card-btn {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(232, 238, 246, .36);
    border-radius: 50%;
    color: #f8fbff;
    background:
        radial-gradient(circle at 30% 18%, rgba(255, 255, 255, .28), transparent 28%),
        linear-gradient(145deg, rgba(15, 23, 42, .42), rgba(214, 224, 235, .18), rgba(92, 102, 116, .24)),
        rgba(255, 255, 255, .12);
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 8px 24px rgba(0, 0, 0, .28);
}

.grid-card-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(218, 228, 238, .68);
    background:
        radial-gradient(circle at 30% 18%, rgba(255, 255, 255, .34), transparent 28%),
        linear-gradient(145deg, rgba(214, 224, 235, .5), rgba(92, 102, 116, .36)),
        rgba(255, 255, 255, .16);
}

.grid-card-btn.danger-btn {
    border-color: rgba(248, 113, 113, .36);
    color: #fee2e2;
}

.grid-card-btn.danger-btn:hover {
    background: rgba(127, 29, 29, .62);
    border-color: rgba(248, 113, 113, .56);
}

.grid-card-btn svg,
.grid-card-audio-indicator svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.grid-card-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    max-width: calc(100% - 68px);
    border-radius: 999px;
    padding: 4px 8px;
    border: 1px solid rgba(218, 228, 238, .36);
    color: #dbeafe;
    background: rgba(8, 16, 30, .72);
    backdrop-filter: blur(12px);
    font-size: 10.5px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-card-real-badge {
    position: absolute;
    left: 0;
    top: 10px;
    z-index: 2;
    min-width: 48px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px 0 11px;
    border: 1px solid rgba(232, 238, 246, .36);
    border-left: 0;
    border-radius: 0 999px 999px 0;
    color: #f8fbff;
    background:
        linear-gradient(135deg, rgba(214, 224, 235, .88), rgba(92, 102, 116, .82)),
        rgba(8, 16, 30, .72);
    box-shadow: 0 8px 22px rgba(130, 142, 158, .24), inset 0 1px 0 rgba(255, 255, 255, .28);
    backdrop-filter: blur(12px);
    font-size: 11px;
    font-weight: 760;
    line-height: 1;
}

.grid-card-real-badge.is-active {
    border-color: rgba(232, 238, 246, .36);
    color: #f8fbff;
    background:
        linear-gradient(135deg, rgba(214, 224, 235, .88), rgba(92, 102, 116, .82)),
        rgba(8, 16, 30, .72);
    box-shadow: 0 8px 22px rgba(130, 142, 158, .24), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.grid-card-real-badge.is-pending {
    border-color: rgba(251, 191, 36, .42);
    color: #fff7d6;
    background:
        linear-gradient(135deg, rgba(245, 158, 11, .88), rgba(180, 83, 9, .82)),
        rgba(8, 16, 30, .72);
    box-shadow: 0 8px 22px rgba(245, 158, 11, .2), inset 0 1px 0 rgba(255, 255, 255, .24);
}

.grid-card-real-badge.is-rejected,
.grid-card-real-badge.is-failed {
    border-color: rgba(248, 113, 113, .42);
    color: #fff1f2;
    background:
        linear-gradient(135deg, rgba(248, 113, 113, .88), rgba(185, 28, 28, .84)),
        rgba(8, 16, 30, .72);
    box-shadow: 0 8px 22px rgba(239, 68, 68, .2), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.grid-card-footer {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 11px;
    background: rgba(7, 13, 24, .58);
    border-top: 1px solid rgba(132, 177, 236, .14);
}

.grid-card-text {
    min-width: 0;
}

.grid-card-name {
    overflow: hidden;
    color: #f7fbff;
    font-size: 13px;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grid-card-desc {
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grid-card-audio-indicator {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #c9f2ff;
    border: 1px solid rgba(218, 228, 238, .28);
    background: rgba(218, 228, 238, .1);
}

.card {
    background:
        linear-gradient(180deg, rgba(17, 27, 46, .82), rgba(8, 13, 24, .9)),
        rgba(255, 255, 255, .04);
    border: 1px solid rgba(132, 177, 236, .18);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .25);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(218, 228, 238, .42);
    box-shadow: 0 24px 62px rgba(0, 0, 0, .32);
}

.thumb {
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(135deg, rgba(12, 20, 36, .92), rgba(214, 224, 235, .12)),
        rgba(255, 255, 255, .04);
    display: grid;
    place-items: center;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

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

.card-body {
    padding: 14px;
}

.card-title {
    font-weight: 650;
    margin-bottom: 8px;
    color: #f7fbff;
    font-size: 15px;
}

.meta {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    min-height: 42px;
}

audio {
    width: 100%;
    margin-top: 10px;
    filter: invert(1) hue-rotate(180deg);
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 14px 14px;
}

.file-btn {
    position: relative;
    overflow: hidden;
}

.file-btn input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.empty {
    padding: 52px 16px;
    text-align: center;
    color: var(--muted-strong);
    border: 1px dashed rgba(180, 190, 204, .26);
    border-radius: 14px;
    font-size: 13px;
    background: rgba(255, 255, 255, .035);
}

.results-empty {
    min-height: 174px;
    display: grid;
    place-items: center;
    margin-top: 8px;
    border-color: rgba(120, 132, 148, .34);
    background: rgba(3, 8, 20, .22);
    font-weight: 600;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(3, 7, 18, .66);
    backdrop-filter: blur(18px) saturate(1.18);
    display: grid;
    place-items: center;
    padding: 18px;
}

.modal-card {
    position: relative;
    z-index: 5001;
    width: min(383px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    background:
        linear-gradient(180deg, rgba(18, 30, 52, .96), rgba(7, 12, 22, .96)),
        rgba(255, 255, 255, .04);
    border: 1px solid rgba(218, 228, 238, .24);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .52), inset 0 1px 0 rgba(255, 255, 255, .08);
    scrollbar-width: thin;
    scrollbar-color: rgba(218, 228, 238, .34) rgba(3, 8, 20, .24);
}

.agent-entry-overlay {
    position: fixed;
    inset: 0;
    z-index: 6200;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(4, 9, 18, .52), rgba(2, 5, 12, .74)),
        rgba(3, 8, 20, .48);
    backdrop-filter: blur(24px) saturate(1.24);
}

.agent-entry-card {
    width: min(360px, 100%);
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    border: 1px solid rgba(218, 228, 238, .28);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(19, 32, 55, .82), rgba(7, 13, 25, .88)),
        rgba(255, 255, 255, .04);
    box-shadow: 0 34px 110px rgba(0, 0, 0, .56), inset 0 1px 0 rgba(255, 255, 255, .12);
    transform: translateY(0);
    animation: agentEntryCardIn .42s ease both;
}

.agent-entry-orbit {
    width: 96px;
    height: 96px;
    position: relative;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--text);
}

.agent-entry-orbit::before,
.agent-entry-orbit::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-sizing: border-box;
}

.agent-entry-orbit::before {
    border: 1px solid rgba(218, 228, 238, .38);
    border-top-color: rgba(251, 191, 36, .9);
    animation: agentOrbit 1.5s linear infinite;
}

.agent-entry-orbit::after {
    inset: 10px;
    background: radial-gradient(circle, rgba(218, 228, 238, .2), transparent 62%);
    filter: blur(2px);
    animation: agentPulse 1.35s ease-in-out infinite;
}

.agent-entry-face {
    position: relative;
    z-index: 1;
    width: 62px;
    height: 62px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(120, 132, 148, .95), rgba(218, 228, 238, .82));
    color: #03111f;
    box-shadow: 0 18px 38px rgba(218, 228, 238, .22), inset 0 1px 0 rgba(255, 255, 255, .45);
    animation: agentFaceFloat 1.6s ease-in-out infinite;
}

.agent-entry-face::before,
.agent-entry-face::after {
    content: "";
    position: absolute;
    top: 22px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #03111f;
    animation: agentBlink 3s ease-in-out infinite;
}

.agent-entry-face::before {
    left: 18px;
}

.agent-entry-face::after {
    right: 18px;
}

.agent-entry-face span {
    position: absolute;
    left: 22px;
    bottom: 16px;
    width: 18px;
    height: 8px;
    border-bottom: 2.5px solid #03111f;
    border-radius: 0 0 18px 18px;
}

.agent-entry-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    text-align: center;
}

.agent-entry-copy strong {
    font-size: 17px;
    font-weight: 760;
    color: var(--text);
}

.agent-entry-copy span {
    color: var(--muted);
    font-size: 12.5px;
}

.agent-entry-progress {
    width: min(220px, 76%);
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(218, 228, 238, .14);
}

.agent-entry-progress span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--cyan), #fbbf24);
    transform-origin: left center;
    animation: agentEntryProgress 3s ease both;
}

@keyframes agentEntryCardIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes agentPulse {
    0%, 100% {
        opacity: .7;
        transform: scale(.96);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

@keyframes agentFaceFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes agentBlink {
    0%, 88%, 100% {
        transform: scaleY(1);
    }
    92% {
        transform: scaleY(.16);
    }
}

@keyframes agentEntryProgress {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

.modal-card::-webkit-scrollbar {
    width: 8px;
}

.modal-card::-webkit-scrollbar-track {
    background: rgba(3, 8, 20, .24);
    border-radius: 999px;
}

.modal-card::-webkit-scrollbar-thumb {
    border: 2px solid rgba(3, 8, 20, .42);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(218, 228, 238, .68), rgba(92, 102, 116, .45));
}

.modal-card > :not(.modal-head):not(.modal-footer) {
    margin-left: 18px;
    margin-right: 18px;
}

.modal-card > input,
.modal-card > textarea,
.modal-card > select {
    width: calc(100% - 36px);
}

.modal-card > label:first-of-type,
.modal-card > input:first-of-type,
.modal-card > textarea:first-of-type,
.modal-card > .admin-form-grid:first-of-type,
.modal-card > .project-modal-body:first-of-type,
.modal-card > .asset-modal-body:first-of-type,
.modal-card > .picker-list:first-of-type,
.modal-card > .history-list:first-of-type {
    margin-top: 18px;
}

.modal-card > .project-modal-body,
.modal-card > .asset-modal-body,
.modal-card > .auth-modal-body,
.modal-card > .character-modal-layout {
    margin-left: 0;
    margin-right: 0;
}

.auth-modal-card {
    width: min(420px, calc(100vw - 32px));
    overflow: hidden;
}

.auth-modal-card .modal-head {
    margin: 0;
}

.auth-modal-body {
    padding: 18px 18px 0;
}

.auth-modal-body label {
    margin: 0 0 7px;
}

.auth-modal-body .auth-required {
    margin-left: 3px;
    font-weight: 800;
    line-height: 1;
}

.auth-modal-body label:not(:first-child) {
    margin-top: 14px;
}

.auth-modal-body input {
    width: 100%;
    min-height: 42px;
    border-radius: 13px;
}

.captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 10px;
    align-items: center;
}

.captcha-row input {
    text-align: center;
    font-size: 16px;
    font-weight: 720;
    letter-spacing: 0;
}

.captcha-image {
    width: 132px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(218, 228, 238, .25);
    border-radius: 13px;
    background: rgba(8, 18, 34, .7);
    cursor: pointer;
    overflow: hidden;
}

.captcha-image img {
    width: 132px;
    height: 44px;
    display: block;
}

.auth-modal-body .error {
    margin: 12px 0 0;
}

.auth-modal-footer {
    margin-top: 16px;
}

.auth-modal-footer .primary {
    min-height: 42px;
}

.character-modal-card {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 36px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.asset-modal-card {
    width: min(560px, 100%);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(8, 9, 12, .82), rgba(5, 6, 9, .78)) !important;
}

.asset-modal-card .modal-head {
    margin: 0;
    background: transparent !important;
}

.asset-modal-body {
    padding: 18px;
    background: transparent !important;
}

.asset-image-field {
    margin-top: 14px;
}

.asset-upload-area {
    position: relative;
    min-height: 220px;
    border: 1px dashed rgba(218, 228, 238, .32);
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.asset-upload-area:hover {
    border-color: rgba(218, 228, 238, .58);
    background: rgba(255, 255, 255, .02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.asset-upload-area input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.asset-upload-area .upload-placeholder,
.asset-upload-area .upload-preview {
    min-height: 220px;
    height: 220px;
}

.asset-upload-area .upload-preview img {
    height: 220px;
    object-fit: cover;
}

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

.asset-modal-field {
    min-width: 0;
}

.asset-modal-card label {
    margin-top: 0;
}

.asset-modal-card textarea {
    min-height: 128px;
    line-height: 1.55;
}

.asset-modal-card .error {
    margin: 0 18px;
}

.asset-modal-card .modal-footer {
    margin-top: 0;
    background: transparent !important;
}

.project-modal-card {
    width: min(520px, 100%);
    overflow: hidden;
}

.project-modal-card .modal-head {
    margin: 0;
}

.project-modal-card .modal-head h2 {
    font-size: 17px;
}

.project-modal-body {
    padding: 18px;
}

.project-modal-body label {
    margin: 0 0 6px;
}

.project-modal-body input,
.project-modal-body select,
.project-modal-body textarea {
    width: 100%;
    border-radius: 10px;
}

.project-modal-body input,
.project-modal-body select {
    height: 42px;
}

.project-modal-body select {
    border: 1px solid rgba(148, 190, 236, .2);
    padding: 0 11px;
    color: #edf4ff;
    background: rgba(3, 8, 20, .42);
    outline: none;
}

.project-modal-body textarea {
    min-height: 112px;
    line-height: 1.55;
}

.project-description-hint {
    margin-top: 8px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.5;
}

.project-description-hint.is-agent {
    padding: 9px 11px;
    border: 1px solid rgba(218, 228, 238, .24);
    border-radius: 10px;
    color: #bfe9ff;
    background: rgba(214, 224, 235, .08);
}

.project-modal-body textarea.project-script-input {
    min-height: 280px;
    border-color: rgba(218, 228, 238, .5);
    background:
        linear-gradient(180deg, rgba(3, 8, 20, .72), rgba(5, 10, 24, .76)),
        rgba(255, 255, 255, .03);
    box-shadow: 0 0 0 4px rgba(214, 224, 235, .08);
}

.project-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 12px;
    align-items: end;
}

.project-title-row > div {
    min-width: 0;
}

.project-cover-upload {
    position: relative;
    height: 128px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px dashed rgba(218, 228, 238, .32);
    border-radius: 12px;
    background:
        linear-gradient(145deg, rgba(15, 23, 42, .56), rgba(214, 224, 235, .09)),
        rgba(255, 255, 255, .035);
    cursor: pointer;
}

.project-cover-upload:hover {
    border-color: rgba(218, 228, 238, .56);
}

.project-cover-upload input {
    display: none;
}

.project-cover-placeholder {
    display: grid;
    place-items: center;
    gap: 6px;
    color: var(--muted-strong);
    text-align: center;
}

.project-cover-placeholder strong {
    color: #eaf2ff;
    font-size: 12.5px;
    font-weight: 580;
}

.project-cover-placeholder small {
    color: var(--muted);
    font-size: 11.5px;
}

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

.project-modal-card .error {
    margin: 0 18px;
}

.project-modal-card .modal-footer {
    margin-top: 0;
}

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

.agent-workspace {
    position: relative;
    min-height: calc(100vh - 170px);
    overflow: hidden;
}

body.agent-page-active .agent-workspace {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: calc(100vh - 36px);
}

body.agent-page-active .agent-task-toolbar {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding-right: 320px;
}

body.agent-page-active #agentTaskWorkspace {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
}

body.agent-project-active .agent-workspace {
    min-height: 0;
    height: auto;
    margin-bottom: 10px;
}

body.agent-project-active #agentTaskWorkspace {
    display: none;
}

body.agent-page-active .agent-task-layout {
    min-height: 0;
    height: 100%;
}

.agent-task-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

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

.agent-config-btn {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 0;
    color: #f8fbff;
    background: transparent;
    box-shadow: none;
    font-size: 23px;
    cursor: pointer;
    transition: color .16s ease, transform .16s ease;
}

.agent-config-btn:hover {
    color: #ffffff;
    background: transparent;
    transform: translateY(-1px);
}

.agent-task-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 14px;
    min-height: calc(100vh - 218px);
}

.agent-task-layout.is-list-only {
    grid-template-columns: 300px minmax(0, 1fr);
}

.agent-task-list-panel,
.agent-task-main,
.agent-task-welcome {
    min-width: 0;
    border: 1px solid rgba(198, 207, 218, .17);
    border-radius: 8px;
    background: rgba(8, 9, 12, .42);
    -webkit-backdrop-filter: blur(18px) saturate(1.02);
    backdrop-filter: blur(18px) saturate(1.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 54px rgba(0, 0, 0, .18);
}

.agent-task-list-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.agent-task-list-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    border-bottom: 1px solid rgba(198, 207, 218, .12);
}

.agent-task-list-head strong {
    color: #f8fbff;
    font-size: 14px;
}

.agent-task-list-head span {
    color: #d7e0ea;
    font-size: 12px;
    font-weight: 760;
}

.agent-task-list {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 10px;
    overflow-y: auto;
}

.agent-task-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    grid-template-rows: auto auto;
    gap: 9px 8px;
    min-height: 72px;
    padding: 10px 10px 9px 12px;
    border: 1px solid rgba(198, 207, 218, .12);
    border-radius: 8px;
    background: rgba(12, 13, 17, .42);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, opacity .18s ease, transform .18s ease;
}

.agent-task-card.active {
    border-color: rgba(214, 224, 235, .36);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025)),
        rgba(12, 13, 17, .5);
}

.agent-task-card.is-locked:not(.is-opening) {
    cursor: wait;
    opacity: .62;
}

.agent-task-card.is-opening {
    cursor: wait;
    border-color: rgba(214, 224, 235, .48);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .035)),
        rgba(12, 13, 17, .58);
}

.agent-task-card strong {
    display: block;
    max-width: 170px;
    overflow: hidden;
    color: #f8fbff;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-task-card span {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11.5px;
}

.agent-task-card-loader {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    gap: 8px;
    border-radius: inherit;
    color: #edf4ff;
    background: rgba(3, 8, 20, .42);
    backdrop-filter: blur(5px);
    font-size: 12px;
    font-weight: 750;
}

.agent-task-card-loader i {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(210, 224, 236, .2);
    border-top-color: rgba(230, 238, 246, .86);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.agent-task-progress {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding-right: 34px;
}

.agent-task-progress-bars {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
}

.agent-task-progress-bars i {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: rgba(205, 214, 224, .18);
}

.agent-task-progress-bars i.done {
    background: linear-gradient(90deg, rgba(225, 232, 240, .88), rgba(132, 145, 160, .72));
    box-shadow: 0 0 10px rgba(225, 232, 240, .12);
}

.agent-task-progress-bars i.current {
    background: linear-gradient(90deg, #facc15, #f59e0b);
    box-shadow: 0 0 12px rgba(250, 204, 21, .34);
}

.agent-task-progress b {
    min-width: 34px;
    color: #f8fbff;
    font-size: 11px;
    font-weight: 800;
    text-align: right;
}

.agent-task-delete-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(248, 113, 113, .72);
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(248, 113, 113, .95), rgba(220, 38, 38, .92));
    box-shadow: 0 8px 18px rgba(220, 38, 38, .2), inset 0 1px 0 rgba(255, 255, 255, .22);
    transform: translateY(-50%);
}

.agent-task-delete-btn::before,
.agent-task-delete-btn::after {
    content: "";
    position: absolute;
    width: 11px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
}

.agent-task-delete-btn::before {
    transform: rotate(45deg);
}

.agent-task-delete-btn::after {
    transform: rotate(-45deg);
}

.agent-task-delete-btn:hover {
    border-color: rgba(254, 202, 202, .95);
    background: linear-gradient(180deg, #fb7185, #dc2626);
    box-shadow: 0 10px 22px rgba(220, 38, 38, .32), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.agent-task-empty,
.agent-task-welcome {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 180px;
    padding: 20px;
    color: var(--muted-strong);
    text-align: center;
}

.agent-task-welcome strong {
    color: #f8fbff;
    font-size: 20px;
}

.agent-task-welcome p {
    max-width: 460px;
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.agent-task-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
}

.agent-task-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid rgba(148, 190, 236, .12);
}

.agent-task-editor-head h2 {
    margin: 4px 0 0;
    color: #f8fbff;
    font-size: 20px;
}

.agent-task-editor-head p {
    margin: 8px 0 0;
    max-width: 720px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.55;
}

.agent-task-steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.agent-task-steps button {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(186, 205, 224, .18);
    border-radius: 999px;
    color: rgba(218, 226, 235, .78);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .028)),
        rgba(8, 14, 25, .34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
    font-size: 12px;
}

.agent-task-steps button.active {
    border-color: rgba(197, 218, 236, .46);
    color: #f8fbff;
    background:
        linear-gradient(180deg, rgba(234, 242, 248, .13), rgba(74, 112, 144, .07)),
        rgba(8, 14, 25, .42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .14),
        0 0 0 1px rgba(102, 170, 220, .08),
        0 10px 26px rgba(0, 0, 0, .18);
}

.agent-task-steps button:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.agent-task-panels,
.agent-task-panel {
    min-height: 0;
}

.agent-task-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 18px;
    overflow: hidden;
}

.agent-task-panel.hide {
    display: none;
}

.agent-modal-card {
    width: min(1180px, calc(100vw - 32px));
    height: min(820px, calc(100vh - 32px));
    max-height: min(820px, calc(100vh - 32px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.agent-modal-card .modal-head {
    margin: 0;
}

.agent-shell {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    background: rgba(3, 8, 20, .38);
    overflow: hidden;
}

.agent-rail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-right: 1px solid rgba(148, 190, 236, .12);
    background: rgba(3, 8, 20, .46);
}

.agent-step {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 10px;
    border: 1px solid rgba(148, 190, 236, .14);
    border-radius: 10px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, .035);
    text-align: left;
    cursor: pointer;
}

.agent-step span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: rgba(237, 245, 252, .9);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .045)),
        rgba(9, 17, 30, .64);
    border: 1px solid rgba(196, 217, 236, .18);
    font-size: 12px;
    font-weight: 760;
}

.agent-step strong {
    font-size: 12.5px;
    font-weight: 680;
}

.agent-step.active {
    border-color: rgba(198, 220, 238, .42);
    color: #f8fbff;
    background:
        linear-gradient(135deg, rgba(230, 240, 248, .11), rgba(88, 120, 148, .06)),
        rgba(7, 13, 24, .44);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .11),
        0 12px 30px rgba(0, 0, 0, .18);
}

.agent-step:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.agent-panel {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 18px;
    overflow: hidden;
}

.agent-panel-head {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.agent-panel-head h3 {
    margin: 0 0 6px;
    color: #f8fbff;
    font-size: 18px;
}

.agent-panel-head p {
    margin: 0;
    max-width: 620px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.agent-panel-head-compact {
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
}

.agent-asset-remove-btn:disabled {
    opacity: .62;
    cursor: wait;
    transform: none;
}

.agent-script-input {
    flex: 1 1 auto;
    width: 100%;
    min-height: 50%;
    resize: vertical;
    border-radius: 12px;
    line-height: 1.65;
}

.agent-script-label {
    display: block;
    margin: 0 0 8px;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 650;
}

.agent-script-settings {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.agent-script-settings label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 650;
}

.agent-script-settings input,
.agent-script-settings select {
    width: 100%;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(148, 190, 236, .2);
    color: #edf4ff;
    background-color: rgba(3, 8, 20, .42);
    outline: none;
}

.agent-script-settings input {
    padding: 0 11px;
}

.agent-script-settings select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0 34px 0 11px;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(193, 208, 228, .9) 50%),
        linear-gradient(135deg, rgba(193, 208, 228, .9) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 18px,
        calc(100% - 13px) 18px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.agent-script-settings input:focus,
.agent-script-settings select:focus {
    border-color: rgba(198, 207, 218, .58);
    box-shadow: 0 0 0 3px rgba(120, 132, 148, .16);
    background-color: rgba(3, 8, 20, .56);
}

.agent-empty-state {
    margin-top: 12px;
    padding: 14px;
    border: 1px dashed rgba(148, 190, 236, .22);
    border-radius: 12px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, .03);
    font-size: 12.5px;
}

.agent-tabs {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.agent-tabs button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(148, 190, 236, .16);
    border-radius: 999px;
    color: var(--muted-strong);
    background: rgba(255, 255, 255, .04);
}

.agent-tabs button.active {
    border-color: rgba(218, 228, 238, .55);
    color: #eef8ff;
    background: rgba(214, 224, 235, .14);
}

.agent-asset-grid {
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 14px;
    overflow-y: auto;
    padding-right: 8px;
}

.agent-panel::-webkit-scrollbar,
.agent-asset-grid::-webkit-scrollbar,
.agent-shot-list::-webkit-scrollbar {
    width: 8px;
}

.agent-panel::-webkit-scrollbar-track,
.agent-asset-grid::-webkit-scrollbar-track,
.agent-shot-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .035);
    border-radius: 999px;
}

.agent-panel::-webkit-scrollbar-thumb,
.agent-asset-grid::-webkit-scrollbar-thumb,
.agent-shot-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(218, 228, 238, .34);
}

.agent-asset-card,
.agent-shot-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(148, 190, 236, .14);
    border-radius: 8px;
    background: rgba(255, 255, 255, .045);
}

.agent-asset-card {
    border-top-width: 3px;
}

.agent-asset-characters {
    border-top-color: rgba(251, 146, 60, .9);
}

.agent-asset-scenes {
    border-top-color: rgba(180, 190, 204, .9);
}

.agent-asset-items {
    border-top-color: rgba(74, 222, 128, .9);
}

.agent-asset-card-head,
.agent-shot-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.agent-asset-card-head > .danger {
    flex: 0 0 auto;
}

.agent-asset-toggles {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 7px;
    min-width: 0;
    overflow: hidden;
}

.agent-toggle-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    min-width: 68px;
    height: 28px;
    margin: 0;
    padding: 0 9px;
    border: 1px solid rgba(148, 190, 236, .28);
    border-radius: 999px;
    color: #dceaff;
    background:
        linear-gradient(180deg, rgba(30, 41, 59, .72), rgba(15, 23, 42, .82));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 6px 14px rgba(0, 0, 0, .12);
    box-sizing: border-box;
    font-size: 11px;
    font-weight: 780;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.agent-toggle-pill span {
    display: inline-block;
    margin: 0;
    line-height: 14px;
    transform: none;
}

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

.agent-toggle-pill::before {
    content: "";
    flex: 0 0 14px;
    display: grid;
    place-items: center;
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    border: 1.8px solid rgba(226, 232, 240, .72);
    border-radius: 4px;
    background: rgba(255, 255, 255, .08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}

.agent-toggle-pill:has(input:checked) {
    border-color: rgba(218, 228, 238, .68);
    color: #f4fbff;
    background:
        linear-gradient(135deg, rgba(214, 224, 235, .28), rgba(92, 102, 116, .2)),
        rgba(15, 23, 42, .76);
    box-shadow: inset 0 0 0 2px rgba(214, 224, 235, .1), 0 8px 18px rgba(130, 142, 158, .1);
}

.agent-toggle-pill:has(input:checked)::before {
    content: "✓";
    border-color: rgba(218, 228, 238, .92);
    color: #04111f;
    background: linear-gradient(180deg, #d8e0ea, #38bdf8);
    font-size: 11px;
    font-weight: 900;
    line-height: 14px;
}

.agent-toggle-review {
    min-width: 92px;
}

.agent-toggle-review:has(input:checked) {
    border-color: rgba(251, 146, 60, .62);
    background:
        linear-gradient(135deg, rgba(251, 146, 60, .22), rgba(214, 224, 235, .08)),
        rgba(15, 23, 42, .76);
    box-shadow: inset 0 0 0 2px rgba(251, 146, 60, .08), 0 8px 18px rgba(251, 146, 60, .08);
}

.agent-asset-card .agent-toggle-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 28px;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    color: #dceaff;
    font-size: 11px;
    font-weight: 780;
    line-height: 1;
}

.agent-asset-card .agent-toggle-pill span {
    display: inline-block;
    margin: 0;
    line-height: 14px;
    transform: none;
}

.agent-asset-card .agent-toggle-pill::before {
    flex: 0 0 14px;
    margin: 0;
    transform: none;
}

.agent-toggle-pill,
.agent-asset-card .agent-toggle-pill {
    min-width: 0;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transition: color .16s ease;
}

.agent-toggle-pill input {
    position: static;
    width: 14px;
    height: 14px;
    margin: 0;
    opacity: 1;
    pointer-events: auto;
}

.agent-toggle-pill::before,
.agent-asset-card .agent-toggle-pill::before {
    content: none;
}

.agent-toggle-pill:has(input:checked) {
    color: #f4fbff;
    background: transparent;
    box-shadow: none;
}

.agent-toggle-review:has(input:checked) {
    color: #fed7aa;
    background: transparent;
    box-shadow: none;
}

.agent-asset-card label,
.agent-shot-card label {
    display: block;
    margin: 10px 0 6px;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 650;
}

.agent-asset-card input,
.agent-asset-card textarea,
.agent-asset-card select,
.agent-shot-card input,
.agent-shot-card textarea,
.agent-shot-card select {
    width: 100%;
    border-radius: 10px;
}

.agent-asset-card textarea,
.agent-shot-card textarea {
    line-height: 1.55;
    resize: vertical;
}

.agent-reference-model-text {
    flex: 1 1 150px;
    min-width: 120px;
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.agent-reference-slot {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    grid-template-areas:
        "preview meta"
        "preview actions";
    align-items: center;
    gap: 10px 12px;
    margin-top: 12px;
    padding: 11px;
    border: 1px solid rgba(148, 190, 236, .16);
    border-radius: 12px;
    color: var(--muted);
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .58), rgba(8, 13, 28, .76)),
        rgba(255, 255, 255, .035);
    font-size: 12px;
}

.agent-reference-slot.has-image {
    border-color: rgba(218, 228, 238, .26);
    background:
        linear-gradient(135deg, rgba(130, 142, 158, .09), rgba(8, 13, 28, .78)),
        rgba(255, 255, 255, .04);
}

.agent-reference-preview {
    position: relative;
    grid-area: preview;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid rgba(218, 228, 238, .22);
    border-radius: 10px;
    background:
        radial-gradient(circle at 50% 35%, rgba(214, 224, 235, .16), transparent 48%),
        rgba(3, 8, 20, .56);
}

.agent-reference-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .22s ease, filter .22s ease;
}

.agent-reference-preview.is-clickable {
    cursor: zoom-in;
}

.agent-reference-preview.is-clickable:hover img {
    transform: scale(1.035);
    filter: saturate(1.06);
}

.agent-reference-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #f8fbff;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    background: rgba(3, 8, 20, .42);
    backdrop-filter: blur(4px);
    text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
    transition: opacity .16s ease;
    pointer-events: none;
}

.agent-reference-preview.is-clickable:hover .agent-reference-overlay {
    opacity: 1;
}

.agent-reference-empty-icon {
    position: relative;
    width: 34px;
    height: 28px;
    border: 1.8px solid rgba(232, 238, 246, .7);
    border-radius: 7px;
}

.agent-reference-empty-icon::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(218, 228, 238, .85);
}

.agent-reference-empty-icon::after {
    content: "";
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    height: 9px;
    border-radius: 7px 7px 3px 3px;
    background: linear-gradient(135deg, rgba(218, 228, 238, .7), rgba(112, 124, 138, .55));
    clip-path: polygon(0 100%, 38% 34%, 58% 62%, 74% 42%, 100% 100%);
}

.agent-reference-meta {
    grid-area: meta;
    min-width: 0;
}

.agent-reference-meta strong {
    display: block;
    color: #edf4ff;
    font-size: 12.5px;
    font-weight: 760;
}

.agent-reference-meta span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.agent-reference-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.agent-reference-actions .ghost,
.agent-reference-actions .primary,
.agent-reference-actions .danger {
    min-height: 30px;
    padding: 7px 12px;
    font-size: 11px;
}

.agent-reference-actions button:disabled {
    cursor: wait;
    opacity: .62;
}

.agent-reference-btn {
    min-width: 62px;
}

.agent-image-status {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #f8fbff;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
    background: rgba(3, 8, 20, .42);
    backdrop-filter: blur(2px);
    pointer-events: none;
    z-index: 2;
}

.agent-shot-list {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 16px;
    overflow-y: auto;
    padding-right: 8px;
}

.agent-shot-bulk-shell {
    display: grid;
    justify-items: start;
    gap: 8px;
}

.agent-shot-bulk-toggle {
    min-width: 92px;
}

.agent-shot-bulkbar {
    width: min(100%, 100%);
    display: grid;
    grid-template-columns: auto repeat(4, minmax(96px, 1fr)) auto;
    align-items: end;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(218, 228, 238, .22);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(8, 17, 36, .96), rgba(6, 12, 26, .94)),
        rgba(255, 255, 255, .04);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 18px 36px rgba(3, 8, 20, .24);
}

.agent-shot-bulk-title {
    min-width: 0;
}

.agent-shot-bulk-title strong {
    display: block;
    color: #f4fbff;
    font-size: 12px;
    font-weight: 760;
    line-height: 30px;
    white-space: nowrap;
}

.agent-shot-bulk-title span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.agent-shot-bulkbar label,
.agent-shot-settings label,
.agent-shot-refs label,
.agent-shot-description {
    display: grid;
    gap: 6px;
    min-width: 0;
    margin: 0;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 650;
}

.agent-shot-bulkbar label > span,
.agent-shot-settings label > span,
.agent-shot-refs label > span,
.agent-shot-description > span {
    color: #a9c7e8;
    line-height: 1;
}

.agent-shot-bulkbar select,
.agent-shot-bulkbar input {
    width: 100%;
    height: 34px;
    border: 1px solid rgba(148, 190, 236, .2);
    border-radius: 10px;
    padding: 0 11px;
    color: #edf4ff;
    background: rgba(3, 8, 20, .42);
    outline: none;
    font-size: 12px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.agent-shot-bulkbar select:focus,
.agent-shot-bulkbar input:focus {
    border-color: rgba(218, 228, 238, .62);
    box-shadow: 0 0 0 4px rgba(218, 228, 238, .12);
    background: rgba(2, 6, 23, .58);
}

.agent-shot-card {
    display: grid;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-color: rgba(218, 228, 238, .18);
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .72), rgba(6, 12, 26, .88)),
        rgba(255, 255, 255, .035);
    box-shadow:
        inset 3px 0 0 rgba(214, 224, 235, .62),
        inset 0 1px 0 rgba(255, 255, 255, .06);
}

.agent-shot-table {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.agent-shot-table-head {
    position: sticky;
    top: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(112px, .7fr) minmax(260px, 2.6fr) minmax(150px, 1.1fr) minmax(130px, .9fr);
    overflow: hidden;
    border: 1px solid rgba(218, 228, 238, .24);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(8, 17, 36, .96), rgba(6, 12, 26, .94)),
        rgba(255, 255, 255, .04);
}

.agent-shot-table-head span {
    min-width: 0;
    padding: 11px 16px;
    border-right: 1px solid rgba(218, 228, 238, .22);
    color: #8fe6ff;
    font-size: 12px;
    font-weight: 820;
    line-height: 1;
}

.agent-shot-table-head span:last-child {
    border-right: 0;
}

.agent-shot-summary {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(112px, .7fr) minmax(260px, 2.6fr) minmax(150px, 1.1fr) minmax(130px, .9fr);
    padding: 0;
    border: 0;
    color: inherit;
    text-align: left;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .62), rgba(6, 12, 26, .74)),
        rgba(255, 255, 255, .025);
    cursor: pointer;
    appearance: none;
    overflow: visible;
}

.agent-shot-cell {
    min-height: 88px;
    display: grid;
    align-content: start;
    min-width: 0;
    padding: 14px 16px;
    border-right: 1px solid rgba(218, 228, 238, .22);
}

.agent-shot-cell:last-child {
    border-right: 0;
}

.agent-shot-cell b,
.agent-shot-cell span {
    min-width: 0;
    color: #f5fbff;
    font-size: 13px;
    font-weight: 740;
    line-height: 1.55;
    word-break: break-word;
}

.agent-shot-cell-description span {
    display: -webkit-box;
    overflow: hidden;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 13px;
    font-weight: 620;
}

.agent-shot-cell-assets span,
.agent-shot-cell-params span {
    font-size: 13px;
    font-weight: 720;
}

.agent-shot-param-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
}

.agent-shot-param-grid select,
.agent-shot-param-grid input {
    width: 100%;
    height: 34px;
    min-height: 34px;
    border: 1px solid rgba(148, 190, 236, .2);
    border-radius: 10px;
    padding: 0 11px;
    color: #edf4ff;
    background: rgba(3, 8, 20, .42);
    outline: none;
    font-size: 12px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.agent-shot-param-grid select:focus,
.agent-shot-param-grid input:focus {
    border-color: rgba(218, 228, 238, .62);
    box-shadow: 0 0 0 4px rgba(218, 228, 238, .12);
    background: rgba(2, 6, 23, .58);
}

.agent-shot-card.is-collapsed .agent-shot-editor {
    display: none;
}

.agent-shot-card:not(.is-collapsed) .agent-shot-summary {
    background:
        linear-gradient(135deg, rgba(214, 224, 235, .12), rgba(112, 124, 138, .08)),
        rgba(255, 255, 255, .035);
}

.agent-shot-editor {
    display: grid;
    gap: 12px;
    padding: 15px;
    border-top: 1px solid rgba(218, 228, 238, .18);
    background: rgba(3, 8, 20, .28);
}

.agent-shot-card-head {
    margin-bottom: 0;
}

.agent-shot-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.agent-shot-title > span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid rgba(218, 228, 238, .28);
    border-radius: 999px;
    color: #dff5ff;
    background: rgba(214, 224, 235, .09);
    font-size: 12px;
    font-weight: 760;
    white-space: nowrap;
}

.agent-shot-code {
    width: 124px;
    height: 32px;
    max-width: 124px;
    color: #f5fbff;
    font-weight: 760;
    text-align: center;
}

.agent-shot-delete {
    flex: 0 0 auto;
}

.agent-shot-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    justify-self: end;
    width: min(100%, 640px);
    margin-top: 2px;
}

.agent-shot-description textarea {
    min-height: 104px;
    border-color: rgba(148, 190, 236, .18);
    background: rgba(3, 8, 20, .36);
}

.agent-shot-refs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.agent-shot-refs label,
.agent-shot-settings label {
    padding: 10px;
    border: 1px solid rgba(148, 190, 236, .14);
    border-radius: 10px;
    background: rgba(255, 255, 255, .035);
}

.agent-shot-refs select {
    min-height: 88px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(3, 8, 20, .38);
}

.agent-shot-settings {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 0;
}

.agent-shot-settings select,
.agent-shot-settings input {
    height: 34px;
    border-radius: 8px;
}

.agent-shot-settings-modal {
    max-width: 760px;
}

.agent-config-modal-card {
    width: min(1120px, calc(100vw - 28px));
    max-height: min(860px, calc(100vh - 34px));
    scrollbar-width: none;
}

.agent-config-modal-card::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.agent-config-modal-card > :not(.modal-head):not(.modal-footer) {
    margin-left: 20px;
    margin-right: 20px;
}

.agent-config-body {
    display: grid;
    gap: 18px;
    overflow: auto;
    padding-right: 0;
    scrollbar-width: none;
}

.agent-config-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.agent-config-section {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(148, 190, 236, .16);
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
}

.agent-config-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.agent-config-section-head strong {
    color: #edf4ff;
    font-size: 14px;
}

.agent-config-section-head span {
    color: var(--muted);
    font-size: 12px;
}

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

.agent-config-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(270px, 1fr)) minmax(178px, .62fr);
    gap: 12px;
    min-width: 0;
}

.agent-config-grid label,
.agent-template-grid label {
    display: grid;
    gap: 8px;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 650;
}

.agent-config-grid label {
    min-width: 0;
}

.agent-config-grid .agent-config-model-pair {
    grid-template-rows: auto 34px;
    gap: 7px;
}

.agent-config-grid .agent-config-select-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) 74px 88px;
    gap: 7px;
    min-width: 0;
}

.agent-config-grid .agent-config-shot-model {
    grid-template-rows: auto 34px;
    gap: 7px;
}

.agent-config-grid select,
.agent-template-grid textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(148, 190, 236, .2);
    color: #edf4ff;
    background-color: rgba(3, 8, 20, .42);
    outline: none;
}

.agent-config-grid select {
    height: 34px;
    min-width: 0;
    padding: 0 20px 0 9px;
    font-size: 12px;
    text-overflow: ellipsis;
}

.agent-config-grid .agent-config-select-row select:nth-child(n + 2) {
    padding-left: 8px;
    padding-right: 18px;
}

.agent-template-grid textarea {
    min-height: 154px;
    padding: 11px;
    line-height: 1.55;
    resize: vertical;
}

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

.agent-shot-settings-form label {
    display: grid;
    gap: 8px;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 650;
}

.agent-shot-settings-form label:first-child {
    grid-column: 1 / -1;
}

.agent-shot-settings-form input,
.agent-shot-settings-form select {
    width: 100%;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(148, 190, 236, .2);
    color: #edf4ff;
    background-color: rgba(3, 8, 20, .42);
    outline: none;
}

.agent-shot-settings-form input {
    padding: 0 11px;
}

.agent-shot-settings-form select {
    appearance: none;
    -webkit-appearance: none;
    padding: 0 34px 0 11px;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(193, 208, 228, .9) 50%),
        linear-gradient(135deg, rgba(193, 208, 228, .9) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 18px,
        calc(100% - 13px) 18px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.agent-shot-settings-form input:focus,
.agent-shot-settings-form select:focus {
    border-color: rgba(198, 207, 218, .58);
    box-shadow: 0 0 0 3px rgba(120, 132, 148, .16);
    background-color: rgba(3, 8, 20, .56);
}

.agent-finish {
    display: grid;
    place-items: center;
    gap: 12px;
    min-height: 480px;
    text-align: center;
}

.agent-finish strong {
    color: #f8fbff;
    font-size: 22px;
}

.agent-finish p {
    max-width: 460px;
    margin: 0;
    color: var(--muted-strong);
    line-height: 1.7;
}

.agent-finish-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.agent-error {
    margin: 0 18px 18px;
}

.picker-modal-card {
    width: min(520px, 100%);
    overflow: hidden;
}

.picker-modal-card .modal-head {
    margin: 0;
}

.picker-list {
    max-height: 440px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.picker-item {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(132, 177, 236, .16);
    border-radius: 10px;
    padding: 11px 12px;
    color: var(--text);
    background: rgba(3, 8, 20, .3);
    text-align: left;
    transition: border-color .16s ease, background .16s ease;
}

.picker-item:hover,
.picker-item.selected {
    border-color: rgba(218, 228, 238, .5);
    background: rgba(120, 132, 148, .1);
}

.picker-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(218, 228, 238, .24);
    border-radius: 10px;
    color: #d8e0ea;
    background: rgba(218, 228, 238, .08);
}

.picker-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.picker-info {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 4px;
}

.picker-info strong,
.picker-info small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-info strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 620;
}

.picker-info strong em {
    flex: 0 0 auto;
    border: 1px solid rgba(148, 190, 236, .22);
    border-radius: 999px;
    padding: 2px 6px;
    color: #9dd8ff;
    background: rgba(15, 23, 42, .6);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

.picker-info small {
    color: var(--muted);
    font-size: 11.5px;
}

.picker-check {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(148, 190, 236, .32);
    border-radius: 5px;
}

.picker-item.selected .picker-check {
    border-color: rgba(218, 228, 238, .8);
    background:
        linear-gradient(135deg, rgba(218, 228, 238, .95), rgba(92, 102, 116, .9));
    box-shadow: inset 0 0 0 4px rgba(3, 8, 20, .7);
}

.picker-empty {
    margin: 16px;
}

.picker-modal-card .modal-footer {
    margin-top: 0;
}

.history-list {
    max-height: 460px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.history-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(180px, 1.4fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(132, 177, 236, .14);
    border-radius: 10px;
    background: rgba(3, 8, 20, .28);
}

.history-row.current {
    border-color: rgba(218, 228, 238, .45);
    background: rgba(120, 132, 148, .09);
}

.history-row strong {
    display: block;
    color: #f7fbff;
    font-size: 13px;
    margin-bottom: 4px;
}

.history-row span,
.history-row-meta {
    color: var(--muted);
    font-size: 12px;
}

.history-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-row-actions {
    display: flex;
    justify-content: flex-end;
}

.current-version {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(218, 228, 238, .28);
    border-radius: 999px;
    color: #d8e0ea !important;
    background: rgba(218, 228, 238, .08);
    font-weight: 620;
}

.history-unavailable {
    color: var(--muted) !important;
    font-size: 12px;
}

.history-empty {
    margin: 16px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    margin: 0 0 14px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(132, 177, 236, .14);
    background:
        linear-gradient(135deg, rgba(218, 228, 238, .1), rgba(92, 102, 116, .055)),
        rgba(255, 255, 255, .025);
}

.modal-head h2 {
    color: #f7fbff;
    font-size: 18px;
    font-weight: 650;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(148, 190, 236, .24);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
    color: #cbd5e1;
    border-radius: 999px;
    font-size: 22px;
    line-height: 1;
}

label {
    display: block;
    font-size: 12px;
    color: var(--muted-strong);
    margin: 0px 0 6px;
}

input,
textarea {
    width: 100%;
    border: 1px solid rgba(148, 190, 236, .2);
    border-radius: 11px;
    padding: 9px 11px;
    color: #edf4ff;
    background: rgba(3, 8, 20, .42);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
textarea:focus {
    border-color: rgba(218, 228, 238, .62);
    box-shadow: 0 0 0 4px rgba(218, 228, 238, .12);
    background: rgba(2, 6, 23, .58);
}

textarea {
    resize: vertical;
}

.required {
    color: #f87171;
}

.character-modal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 288px;
    gap: 16px;
    padding: 18px 18px 0;
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(218, 228, 238, .34) rgba(3, 8, 20, .24);
}

.character-modal-layout::-webkit-scrollbar {
    width: 8px;
}

.character-modal-layout::-webkit-scrollbar-track {
    background: rgba(3, 8, 20, .24);
    border-radius: 999px;
}

.character-modal-layout::-webkit-scrollbar-thumb {
    border: 2px solid rgba(3, 8, 20, .42);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(218, 228, 238, .68), rgba(92, 102, 116, .45));
}

.character-modal-main,
.character-modal-side {
    min-width: 0;
}

.character-modal-main {
    display: grid;
    align-content: start;
    gap: 14px;
    background: transparent !important;
    box-shadow: none !important;
}

.character-modal-side {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: start;
    position: sticky;
    top: 0;
    background: transparent !important;
    box-shadow: none !important;
}

.character-field {
    min-width: 0;
}

.character-modal-layout label {
    display: block;
    margin: 0 0 7px;
}

.switch-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted-strong);
    font-size: 11.5px;
    font-weight: 650;
    cursor: pointer;
    user-select: none;
}

.switch-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
}

.switch-track {
    position: relative;
    width: 42px;
    height: 22px;
    flex: 0 0 42px;
    border: 1px solid rgba(148, 190, 236, .28);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, .82), rgba(3, 8, 20, .9));
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .32);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.switch-knob {
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .92), rgba(232, 238, 246, .92) 48%, rgba(180, 190, 204, .82));
    box-shadow: 0 4px 12px rgba(0, 0, 0, .34);
    transition: transform .18s ease, background .18s ease;
}

.switch-control input:checked + .switch-track {
    border-color: rgba(218, 228, 238, .68);
    background:
        linear-gradient(135deg, rgba(214, 224, 235, .72), rgba(92, 102, 116, .82));
    box-shadow: 0 0 0 3px rgba(218, 228, 238, .1), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.switch-control input:checked + .switch-track .switch-knob {
    transform: translateX(20px);
    background:
        radial-gradient(circle at 34% 28%, #ffffff, #e0f2fe 48%, #93c5fd);
}

.switch-label {
    white-space: nowrap;
}

.switch-state {
    width: 25px;
    color: rgba(148, 163, 184, .9);
    font-size: 10.5px;
    letter-spacing: 0;
    text-align: left;
}

.switch-control input:checked ~ .switch-state {
    color: #d8e0ea;
}

.switch-control.is-disabled {
    cursor: not-allowed;
    opacity: .66;
}

.switch-control.is-disabled .switch-track,
.switch-control.is-disabled .switch-label,
.switch-control.is-disabled .switch-state {
    pointer-events: none;
}

.modal-footer-switch {
    margin-right: 10px;
}

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

.character-modal-layout input,
.character-modal-layout textarea {
    width: 100%;
}

.character-modal-layout textarea {
    min-height: 136px;
    resize: vertical;
}

.character-upload-area,
.character-audio-area {
    position: relative;
    border: 1px dashed rgba(218, 228, 238, .32);
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.character-upload-area:hover,
.character-audio-area:hover {
    border-color: rgba(218, 228, 238, .58);
    background: rgba(255, 255, 255, .02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.character-upload-area input,
.character-audio-area input {
    display: none;
}

.character-upload-area {
    min-height: 230px;
    overflow: hidden;
}

.character-modal-side .character-upload-area {
    flex: 0 0 auto;
    height: 300px;
    min-height: 300px;
    max-height: 300px;
}

.upload-placeholder,
.upload-preview,
.audio-placeholder,
.audio-preview {
    width: 100%;
    height: 100%;
}

.upload-placeholder {
    min-height: 230px;
    display: grid;
    place-items: center;
    gap: 7px;
    padding: 18px;
    color: var(--muted-strong);
    text-align: center;
}

.character-modal-side .upload-placeholder,
.character-modal-side .upload-preview {
    height: 300px;
    min-height: 300px;
    max-height: 300px;
}

.character-modal-side .upload-preview img {
    height: 300px;
}

.upload-placeholder strong,
.audio-placeholder strong {
    color: #eaf2ff;
    font-size: 12.5px;
    font-weight: 580;
}

.upload-placeholder small,
.audio-placeholder small,
.form-tip {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.5;
}

.upload-icon {
    display: block;
    width: 30px;
    height: 30px;
    opacity: .72;
    position: relative;
}

.upload-icon-image {
    border: 1px solid rgba(218, 228, 238, .58);
    border-radius: 7px;
}

.upload-icon-image::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(232, 238, 246, .85);
}

.upload-icon-image::after {
    content: "";
    position: absolute;
    left: 5px;
    right: 5px;
    bottom: 6px;
    height: 11px;
    background: linear-gradient(135deg, transparent 0 32%, rgba(218, 228, 238, .72) 33% 66%, rgba(232, 238, 246, .9) 67%);
    clip-path: polygon(0 100%, 32% 42%, 49% 68%, 68% 20%, 100% 100%);
}

.upload-icon-audio::before,
.upload-icon-audio::after {
    content: "";
    position: absolute;
    background: rgba(232, 238, 246, .84);
}

.upload-icon-audio::before {
    left: 9px;
    top: 5px;
    width: 3px;
    height: 18px;
    border-radius: 999px;
    box-shadow: 10px -3px 0 rgba(180, 190, 204, .76);
}

.upload-icon-audio::after {
    left: 4px;
    bottom: 3px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 10px -2px 0 rgba(180, 190, 204, .76);
}

.upload-preview {
    position: relative;
    min-height: 230px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: transparent;
}

.upload-preview img {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: contain;
    border-radius: 14px;
}

.btn-remove-upload {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(248, 113, 113, .38);
    border-radius: 50%;
    color: #fee2e2;
    background: rgba(127, 29, 29, .7);
    backdrop-filter: blur(10px);
    line-height: 1;
    font-size: 18px;
}

.upload-preview .btn-remove-upload {
    position: absolute;
    right: 8px;
    top: 8px;
}

.character-audio-area {
    min-height: 82px;
}

.audio-placeholder {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px;
    text-align: left;
}

.audio-preview {
    padding: 12px;
}

.audio-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: #eaf2ff;
    font-size: 12px;
}

.audio-info span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-preview audio {
    height: 32px;
    margin: 0;
}

.audio-trim-panel {
    min-height: 82px;
    margin-top: 0;
    padding: 10px 12px;
    border: 1px solid rgba(218, 228, 238, .24);
    border-radius: 14px;
    background: transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 16px 34px rgba(0, 0, 0, .16);
}

.audio-trim-head,
.audio-trim-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.audio-trim-head strong {
    display: block;
    color: #eaf2ff;
    font-size: 11.5px;
    font-weight: 680;
}

.audio-trim-head span {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 10.5px;
}

.audio-trim-player {
    display: none;
}

.audio-trim-control {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    margin: 8px 0 8px;
    color: var(--muted-strong);
    font-size: 11.5px;
}

.audio-trim-actions {
    justify-content: flex-end;
    margin-top: 0;
}

.audio-trim-actions .ghost,
.audio-trim-actions .primary {
    min-height: 28px;
    padding: 6px 10px;
    font-size: 11px;
}

.audio-trim-head .btn-remove-upload {
    flex: 0 0 auto;
}

.audio-trim-range-wrap {
    position: relative;
    display: grid;
    align-items: center;
    min-height: 30px;
    padding: 6px 8px;
    border: 1px solid rgba(214, 224, 235, .18);
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(10, 28, 48, .94), rgba(5, 15, 30, .92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 24px rgba(130, 142, 158, .08);
}

.audio-trim-range-wrap::before {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    top: 50%;
    height: 6px;
    border: 1px solid rgba(226, 232, 240, .52);
    border-radius: 999px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .16);
}

.audio-trim-range {
    position: relative;
    z-index: 4;
    grid-area: 1 / 1;
    width: 100%;
    height: 18px;
    margin: 0;
    background: transparent;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
}

.audio-trim-window {
    position: absolute;
    left: calc(12px + (100% - 24px) * var(--trim-left, 0) / 100);
    top: 50%;
    z-index: 2;
    width: calc((100% - 24px) * var(--trim-width, 0) / 100);
    height: 6px;
    border-radius: 999px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, rgba(214, 224, 235, .9), rgba(92, 102, 116, .78));
    box-shadow: 0 0 16px rgba(214, 224, 235, .2);
    pointer-events: none;
}

.audio-trim-range::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
}

.audio-trim-range::-webkit-slider-thumb {
    width: 16px;
    height: 22px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 999px;
    background: linear-gradient(180deg, #d8e0ea, #5f6876);
    box-shadow: 0 0 0 4px rgba(214, 224, 235, .12), 0 8px 18px rgba(92, 102, 116, .38);
    cursor: ew-resize;
    pointer-events: auto;
    -webkit-appearance: none;
}

.audio-trim-range::-moz-range-track {
    height: 6px;
    background: transparent;
}

.audio-trim-range::-moz-range-thumb {
    width: 16px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 999px;
    background: linear-gradient(180deg, #d8e0ea, #5f6876);
    box-shadow: 0 0 0 4px rgba(214, 224, 235, .12), 0 8px 18px rgba(92, 102, 116, .38);
    cursor: ew-resize;
    pointer-events: auto;
}

.audio-trim-range-start::-webkit-slider-thumb {
    background: linear-gradient(180deg, #67e8f9, #0284c7);
}

.audio-trim-range-end::-webkit-slider-thumb {
    background: linear-gradient(180deg, #d8e0ea, #6f7b8b);
}

.audio-trim-control strong {
    color: #dbeafe;
    font-size: 11px;
    font-weight: 680;
    text-align: center;
}

.form-tip {
    margin-top: 10px;
    padding: 9px 11px;
    border: 1px solid rgba(218, 228, 238, .2);
    border-radius: 12px;
    background: transparent;
}

.character-modal-card .form-tip {
    flex: 0 0 auto;
    margin-left: 18px;
    margin-right: 18px;
}

.character-modal-card .modal-head {
    flex: 0 0 auto;
}

.character-modal-card .error {
    flex: 0 0 auto;
    margin-left: 18px;
    margin-right: 18px;
}

.modal-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding: 16px 18px 18px;
    border-top: 1px solid rgba(132, 177, 236, .12);
    background: rgba(3, 8, 20, .16);
}

.character-modal-card .modal-footer {
    margin-top: 18px;
}

.error {
    color: var(--danger);
    min-height: 5px;
    margin: 10px 0;
    font-size: 12px;
}

.toast {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 1200;
    transform: translateX(-50%);
    max-width: min(520px, calc(100vw - 32px));
    background: rgba(10, 18, 32, .94);
    border: 1px solid rgba(218, 228, 238, .28);
    color: #fff;
    padding: 11px 16px;
    border-radius: 999px;
    font-size: 13px;
    text-align: center;
    line-height: 1.45;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(16px) saturate(1.18);
}

.image-error-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 1350;
    width: min(620px, calc(100vw - 32px));
    transform: translateX(-50%);
    padding: 14px 44px 14px 18px;
    border: 1px solid rgba(248, 113, 113, .38);
    border-radius: 14px;
    color: #fee2e2;
    background:
        linear-gradient(180deg, rgba(127, 29, 29, .72), rgba(45, 11, 16, .82)),
        rgba(7, 8, 11, .88);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, .42),
        inset 0 1px 0 rgba(255, 255, 255, .10);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
    backdrop-filter: blur(18px) saturate(1.12);
}

.image-error-toast strong {
    display: block;
    margin-bottom: 4px;
    color: #fff7f7;
    font-size: 13px;
    font-weight: 860;
}

.image-error-toast span {
    display: block;
    color: rgba(254, 226, 226, .92);
    font-size: 12.5px;
    line-height: 1.55;
}

.image-error-toast button {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(254, 226, 226, .22);
    border-radius: 50%;
    color: #fee2e2;
    background: rgba(255, 255, 255, .06);
    font-size: 17px;
    line-height: 1;
}

.shot-save-notice {
    position: fixed;
    left: 50%;
    bottom: 34px;
    z-index: 1300;
    transform: translateX(-50%);
    max-width: min(420px, calc(100vw - 32px));
    border: 1px solid rgba(218, 228, 238, .28);
    border-radius: 999px;
    padding: 10px 18px;
    color: #e8f7ff;
    background:
        linear-gradient(135deg, rgba(130, 142, 158, .24), rgba(92, 102, 116, .18)),
        rgba(3, 8, 20, .92);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .1);
    backdrop-filter: blur(14px);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    line-height: 1.35;
    pointer-events: none;
}

.hide {
    display: none !important;
}

@media (max-width: 760px) {
    .launch-topbar {
        height: auto;
        padding: 18px;
        align-items: flex-start;
        gap: 14px;
    }

    .launch-auth,
    .launch-user {
        gap: 8px;
    }

    .launch-account-pill {
        min-height: 38px;
        gap: 8px;
        padding: 3px 8px 3px 4px;
    }

    .launch-account-pill .user-credit-tag {
        min-height: 26px;
        padding: 0 9px;
        font-size: 12px !important;
    }

    .launch-pill {
        min-width: 68px;
        height: 36px;
        padding: 0 14px;
        font-size: 13px;
    }

    .launch-center {
        width: calc(100vw - 28px);
        margin-top: 4vh;
    }

    .launch-kicker {
        font-size: 10px;
        margin-bottom: 14px;
    }

    .launch-center h1 {
        font-size: clamp(42px, 17vw, 72px);
    }

    .launch-center p {
        margin-top: 18px;
        font-size: clamp(11px, 3.1vw, 14px);
        line-height: 1.45;
        white-space: nowrap;
    }

    .launch-actions {
        width: 100%;
        gap: 12px;
        margin-top: 28px;
    }

    .launch-action {
        width: min(320px, 100%);
        min-width: 0;
        height: 56px;
        font-size: 16px;
    }

    .shell {
        height: 100vh;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
    }

    .shell.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .topbar {
        grid-column: 1;
        grid-row: 1;
        flex-wrap: wrap;
        height: auto;
        gap: 12px;
        padding: 14px;
    }

    .topbar::after,
    .hero-panel::after {
        display: none;
    }

    .sidebar {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 12px;
    }

    .sidebar-title {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }

    .nav {
        min-width: 132px;
    }

    .shell.sidebar-collapsed .nav-text,
    .shell.sidebar-collapsed .nav strong {
        display: inline-grid;
    }

    .nav-divider {
        width: 1px;
        min-width: 1px;
        height: 28px;
        margin: 0 2px;
    }

    .content {
        grid-column: 1;
        grid-row: 3;
        min-height: 0;
        padding: 16px;
    }

    body.agent-page-active .shell,
    body.canvas-page-active .shell {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    body.agent-page-active .content,
    body.canvas-page-active .content {
        grid-column: 1;
        grid-row: 1;
        padding: 12px;
    }

    body.agent-page-active .agent-workspace {
        height: calc(100vh - 24px);
    }

    body.canvas-page-active .canvas-test-workspace {
        height: calc(100vh - 24px);
    }

    .hero-panel {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
        min-height: auto;
    }

    .hero-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .results-section {
        padding: 12px;
    }

    .results-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .results-actions {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }

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

    .video-toolbar-group {
        align-items: flex-start;
        flex-direction: column;
    }

    .video-toolbar-row {
        width: 100%;
        flex-wrap: wrap;
    }

    .video-toolbar-batch-row {
        justify-content: flex-start;
    }

    .video-toolbar-title {
        margin-right: 0;
    }

    .video-toolbar-actions,
    .toolbar-video-settings {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

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

    .agent-task-toolbar,
    .agent-task-editor-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .agent-task-layout,
    .agent-task-layout.is-list-only {
        grid-template-columns: 1fr;
    }

    .agent-task-list-panel {
        max-height: 260px;
    }

    .agent-task-steps {
        justify-content: flex-start;
    }

    .history-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .history-row-actions {
        justify-content: flex-start;
    }

    .toolbar-divider {
        width: 100%;
        height: 1px;
    }

    .shot-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "toolbar"
            "body"
            "refs";
        gap: 14px;
        padding: 13px;
    }

    .image-workspace {
        border-radius: 14px;
    }

    .image-form-column,
    .image-output-column {
        padding: 14px;
    }

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

    .image-form-head .primary {
        width: 100%;
    }

    .image-history-list {
        width: 100%;
    }

    .shot-body {
        grid-template-columns: 1fr;
        grid-template-areas:
            "content"
            "preview"
            "actions";
        height: auto;
        gap: 14px;
    }

    .shot-actions {
        height: auto;
    }

    .shot-header {
        flex: 0 0 auto;
        align-items: center;
    }

    .shot-checkbox {
        width: 18px;
        height: 18px;
    }

    .shot-number {
        flex-direction: row;
        align-items: center;
        padding-top: 0;
    }

    .shot-code-label {
        width: auto;
        min-width: 86px;
        height: 38px;
    }

    .shot-number-badge {
        width: 34px;
        height: 28px;
        border-radius: 10px;
        font-size: 13px;
    }

    .shot-meta-row {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch;
    }

    .shot-references {
        min-width: 0;
    }

    .shot-description-head {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        height: auto;
        overflow: visible;
    }

    .director-polish-btn {
        width: auto;
        min-width: 104px;
    }

    .shot-video-settings {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .shot-video-settings .shot-setting-select,
    .shot-video-settings .shot-setting-select:nth-child(2),
    .shot-video-settings .shot-setting-select:nth-child(4),
    .shot-duration-control,
    .shot-audio-toggle {
        width: 100%;
    }

    .shot-duration-control input {
        width: 100%;
        min-width: 0;
    }

    .shot-description,
    .shot-description-wrap {
        height: 240px;
        min-height: 240px;
        max-height: 240px;
    }

    .video-preview-box,
    .generating-state {
        height: auto;
        min-height: 180px;
        aspect-ratio: 16 / 9;
    }

    h1 {
        font-size: 22px;
    }

    .asset-list-card {
        flex-direction: column;
        gap: 12px;
        padding: 13px;
    }

    .asset-card-left {
        width: 100%;
        gap: 10px;
    }

    .asset-card-index {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 12px;
    }

    .asset-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .asset-card-right {
        width: 100%;
        flex-basis: auto;
    }

    .asset-image-preview {
        height: 180px;
    }

    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
        gap: 12px;
    }

    .grid-card-footer {
        min-height: 54px;
        padding: 9px;
    }

    .character-grid-card.create-card::after {
        min-height: 54px;
    }

    .grid-card-actions {
        opacity: 1;
        transform: none;
    }

    .character-modal-card {
        width: min(100%, 520px);
        height: auto;
        max-height: calc(100vh - 28px);
    }

    .character-modal-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .character-modal-side {
        position: static;
    }

    .character-modal-side .character-upload-area,
    .character-modal-side .upload-placeholder,
    .character-modal-side .upload-preview {
        height: 220px;
        min-height: 220px;
        max-height: 220px;
    }

    .character-modal-side .upload-preview img {
        height: 220px;
    }

    .asset-modal-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .project-title-row {
        grid-template-columns: 1fr;
    }

    .agent-modal-card {
        width: calc(100vw - 18px);
        max-height: calc(100vh - 18px);
    }

    .agent-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .agent-rail {
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(148, 190, 236, .12);
    }

    .agent-step {
        min-width: 138px;
    }

    .agent-panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .agent-script-input {
        min-height: 320px;
    }

    .agent-shot-bulkbar {
        position: static;
        grid-template-columns: 1fr;
    }

    .agent-shot-table-head,
    .agent-shot-summary,
    .agent-shot-settings-form {
        grid-template-columns: 1fr;
    }

    .agent-script-settings {
        grid-template-columns: 1fr;
    }

    .agent-shot-table-head {
        position: static;
        display: none;
    }

    .agent-shot-cell {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(218, 228, 238, .18);
    }

    .agent-shot-cell:last-child {
        border-bottom: 0;
    }

    .agent-shot-card-head,
    .agent-shot-title {
        align-items: stretch;
        flex-direction: column;
    }

    .agent-shot-actions {
        align-items: stretch;
        flex-direction: column;
        justify-self: stretch;
        width: 100%;
    }

    .agent-shot-code {
        width: 100%;
        max-width: none;
        text-align: left;
    }

    .agent-shot-delete {
        width: 100%;
    }

    .agent-asset-grid,
    .agent-shot-refs,
    .agent-shot-settings {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .modal-footer-switch {
        justify-content: center;
        margin-right: 0;
    }

    .modal-footer-actions {
        width: 100%;
        flex-direction: column-reverse;
    }

    .modal-footer .primary,
    .modal-footer .ghost {
        width: 100%;
    }
}

/* Final cinema black-glass overrides: keep this block last. */
:where(.topbar, .sidebar, .hero-panel, .video-toolbar, .modal-card, .auth-modal-card, .character-modal-card, .asset-modal-card, .project-modal-card, .picker-modal-card, .image-history-modal-card, .agent-modal-card, .agent-shot-settings-modal, .asset-list-card, .character-grid-card, .card, .project-card, .shot-card, .image-form-column, .image-output-column, .agent-task-list-panel, .agent-task-main, .agent-task-welcome, .agent-asset-card, .agent-shot-card, .history-row, .picker-item) {
    border-color: rgba(204, 214, 224, .16) !important;
    background:
        linear-gradient(180deg, rgba(14, 15, 19, .64), rgba(5, 6, 9, .72)),
        rgba(255, 255, 255, .025) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.02);
    backdrop-filter: blur(18px) saturate(1.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 18px 52px rgba(0, 0, 0, .2);
}

:where(.modal, .agent-entry-overlay) {
    background: rgba(3, 4, 6, .72) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.02);
    backdrop-filter: blur(24px) saturate(1.02);
}

:where(.primary, .launch-pill-bright, .ref-add-btn, .grid-card-btn, .agent-task-steps button.active, .agent-step.active, .agent-toggle-pill:has(input:checked), .image-mode-tabs button.active, .picker-item.selected .picker-check) {
    border-color: rgba(232, 238, 246, .34) !important;
    background: rgba(3, 4, 6, .56) !important;
    color: #f8fbff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 14px 32px rgba(0, 0, 0, .22) !important;
}

:where(.ghost, .success, .launch-pill, .toolbar-select, .shot-setting-select, .toolbar-range-control, .toolbar-audio-toggle, .shot-duration-control, .shot-audio-toggle, .shot-code-label, .director-polish-btn, .ref-replace-select, .history-row-actions button, .image-history-pager .compact, .sidebar-collapse-btn, .nav, .user-pill, .user-group-tag, .nav strong) {
    border-color: rgba(204, 214, 224, .2) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025)),
        rgba(7, 8, 11, .5) !important;
    color: #dce5ef !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055) !important;
}

:where(input, textarea, select, .asset-form-input, .asset-form-textarea, .rich-shot-description, .video-preview-box, .generating-state, .thumb, .grid-card-image, .asset-image-preview, .image-reference-box, .character-upload-area, .upload-placeholder, .upload-preview, .agent-reference-slot, .agent-reference-preview, .audio-trim-panel, .audio-trim-range-wrap, .captcha-image) {
    border-color: rgba(204, 214, 224, .17) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .014)),
        rgba(4, 5, 7, .56) !important;
    color: #edf4ff !important;
}

:where(input:focus, textarea:focus, select:focus, .rich-shot-description:focus, .ref-replace-select:focus) {
    border-color: rgba(232, 238, 246, .34) !important;
    box-shadow: 0 0 0 4px rgba(232, 238, 246, .08) !important;
}

.video-toolbar-title::before,
.asset-status-dot,
.dashboard-dot,
.agent-task-progress-bars i.done {
    background: linear-gradient(90deg, rgba(232, 238, 246, .88), rgba(132, 144, 158, .72)) !important;
    box-shadow: 0 0 12px rgba(232, 238, 246, .16) !important;
}

:where(.shot-number-badge, .asset-card-index, .grid-card-badge, .grid-card-real-badge, .agent-shot-code, .ref-tag, .rich-ref-token, .agent-entry-face) {
    border-color: rgba(220, 230, 240, .26) !important;
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, .22), transparent 28%),
        linear-gradient(145deg, rgba(229, 236, 244, .24), rgba(91, 101, 114, .28)),
        rgba(8, 9, 12, .42) !important;
    color: #edf4ff !important;
}

:where(.danger, .grid-card-btn.danger-btn, .agent-shot-delete, .agent-task-delete-btn) {
    border-color: rgba(248, 113, 113, .42) !important;
    background:
        linear-gradient(180deg, rgba(248, 113, 113, .16), rgba(127, 29, 29, .2)),
        rgba(10, 11, 14, .5) !important;
    color: #fecaca !important;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(220, 226, 233, .48), rgba(98, 108, 121, .34)) !important;
}

/* Clean black-glass pass: remove carbon texture and gray wash. */
.topbar::after,
.hero-panel::after {
    content: none !important;
    display: none !important;
}

:where(.modal-head, .modal-footer, .admin-panel-head, .agent-panel-head, .agent-task-editor-head, .agent-shot-card-head, .image-form-head, .video-toolbar, .dashboard-card-head, .api-config-section, .site-config-section) {
    background: transparent !important;
    box-shadow: none !important;
}

:where(.modal-card, .auth-modal-card, .character-modal-card, .asset-modal-card, .project-modal-card, .picker-modal-card, .image-history-modal-card, .agent-modal-card, .agent-shot-settings-modal, .hero-panel, .topbar, .sidebar, .video-toolbar, .shot-card, .agent-task-list-panel, .agent-task-main, .agent-task-welcome, .agent-asset-card, .agent-shot-card, .image-form-column, .image-output-column, .asset-list-card, .character-grid-card, .project-card, .card) {
    background:
        linear-gradient(180deg, rgba(16, 17, 21, .38), rgba(4, 5, 7, .52)),
        rgba(0, 0, 0, .08) !important;
    -webkit-backdrop-filter: blur(22px) saturate(1.08) brightness(1.04) !important;
    backdrop-filter: blur(22px) saturate(1.08) brightness(1.04) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .12),
        inset 0 -1px 0 rgba(255, 255, 255, .035),
        0 20px 58px rgba(0, 0, 0, .22) !important;
}

:where(input, textarea, select, .rich-shot-description, .video-preview-box, .generating-state, .character-upload-area, .upload-placeholder, .upload-preview, .audio-placeholder, .audio-preview, .audio-trim-panel, .audio-trim-range-wrap, .asset-image-preview, .image-reference-box, .agent-reference-slot, .agent-reference-preview, .captcha-image) {
    background: rgba(3, 4, 6, .28) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .09),
        inset 0 -1px 0 rgba(255, 255, 255, .025) !important;
}

.rich-shot-description {
    background-image: none !important;
}

:where(.character-upload-area, .upload-placeholder, .audio-placeholder, .audio-preview, .video-preview-box) {
    background-image: none !important;
}

:where(.ref-tag, .rich-ref-token, .ref-tag-char, .ref-tag-scene, .ref-tag-obj, .rich-ref-token.ref-tag-char, .rich-ref-token.ref-tag-scene, .rich-ref-token.ref-tag-obj, .grid-card-image, .asset-image-preview, .agent-reference-slot, .agent-reference-preview, .audio-trim-range-wrap) {
    background-image: none !important;
}

:where(.primary, .ghost, .success, .launch-pill, .toolbar-select, .shot-setting-select, .toolbar-range-control, .toolbar-audio-toggle, .shot-duration-control, .shot-audio-toggle, .director-polish-btn, .ref-replace-select, .sidebar-collapse-btn, .nav, .user-pill, .user-group-tag, .nav strong) {
    background: rgba(3, 4, 6, .34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .12),
        0 10px 26px rgba(0, 0, 0, .14) !important;
}

/* Refined cinema glass pass: softer modals, clearer layers, less black-block feeling. */
.site-dynamic-bg {
    opacity: .78 !important;
}

.site-dynamic-bg video {
    filter: blur(var(--dynamic-bg-blur, 7px)) saturate(1.04) brightness(var(--dynamic-bg-brightness, 1.16)) contrast(1.03) !important;
}

.site-dynamic-bg span {
    background:
        radial-gradient(circle at 50% 16%, rgba(255, 255, 255, .06), transparent 34%),
        linear-gradient(180deg, rgba(0, 0, 0, .20), rgba(0, 0, 0, .34) 62%, rgba(0, 0, 0, .48)) !important;
}

:where(.modal, .agent-entry-overlay) {
    background: rgba(2, 3, 5, .44) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.08) brightness(1.08) !important;
    backdrop-filter: blur(18px) saturate(1.08) brightness(1.08) !important;
}

:where(.modal-card, .auth-modal-card, .character-modal-card, .asset-modal-card, .project-modal-card, .picker-modal-card, .image-history-modal-card, .agent-modal-card, .agent-shot-settings-modal) {
    border-color: rgba(230, 236, 244, .24) !important;
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 255, 255, .105), transparent 38%),
        radial-gradient(circle at 92% 18%, rgba(210, 222, 236, .06), transparent 34%),
        rgba(10, 11, 15, .48) !important;
    -webkit-backdrop-filter: blur(30px) saturate(1.16) brightness(1.12) !important;
    backdrop-filter: blur(30px) saturate(1.16) brightness(1.12) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .18),
        inset 0 0 0 1px rgba(255, 255, 255, .035),
        0 34px 100px rgba(0, 0, 0, .42) !important;
}

:where(.modal-head, .modal-footer) {
    background: rgba(255, 255, 255, .028) !important;
    border-color: rgba(230, 236, 244, .14) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .09),
        0 1px 0 rgba(0, 0, 0, .12) !important;
}

:where(.character-modal-main, .character-modal-side, .project-modal-body, .asset-modal-body, .auth-modal-body, .picker-list, .history-list) {
    background: transparent !important;
    box-shadow: none !important;
}

:where(.modal-card input, .modal-card textarea, .modal-card select, .auth-modal-body input, .project-modal-body input, .project-modal-body select, .project-modal-body textarea, .asset-modal-card textarea, .character-modal-layout input, .character-modal-layout textarea, .image-form-column input, .image-form-column select, .image-form-column textarea) {
    border-color: rgba(232, 238, 246, .22) !important;
    background: rgba(5, 6, 9, .24) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .105),
        inset 0 -1px 0 rgba(255, 255, 255, .025) !important;
}

:where(.modal-card input:hover, .modal-card textarea:hover, .modal-card select:hover, .auth-modal-body input:hover, .project-modal-body input:hover, .project-modal-body select:hover, .project-modal-body textarea:hover, .asset-modal-card textarea:hover, .character-modal-layout input:hover, .character-modal-layout textarea:hover) {
    border-color: rgba(240, 245, 252, .31) !important;
    background: rgba(6, 7, 10, .30) !important;
}

:where(.character-upload-area, .character-audio-area, .upload-placeholder, .audio-placeholder, .upload-preview, .audio-preview, .audio-trim-panel, .image-reference-box, .image-output-preview, .image-output-empty-card, .video-preview-box) {
    border-color: rgba(232, 238, 246, .20) !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .08), transparent 42%),
        rgba(5, 6, 9, .24) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .11),
        0 18px 48px rgba(0, 0, 0, .13) !important;
}

:where(.form-tip, .audio-trim-meta, .character-modal-card .form-tip) {
    border-color: rgba(232, 238, 246, .14) !important;
    background: rgba(255, 255, 255, .04) !important;
    color: rgba(226, 233, 242, .78) !important;
}

:where(.image-form-column, .image-output-column, .asset-list-card, .character-grid-card, .project-card, .card, .shot-card, .agent-task-list-panel, .agent-task-main, .agent-task-welcome, .agent-asset-card, .agent-shot-card) {
    border-color: rgba(230, 236, 244, .18) !important;
    background:
        radial-gradient(circle at 16% 0%, rgba(255, 255, 255, .07), transparent 36%),
        rgba(8, 9, 13, .42) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .13),
        0 22px 62px rgba(0, 0, 0, .20) !important;
}

:where(.primary, .ghost, .success, .launch-pill, .toolbar-select, .shot-setting-select, .toolbar-range-control, .toolbar-audio-toggle, .shot-duration-control, .shot-audio-toggle, .director-polish-btn, .ref-replace-select, .sidebar-collapse-btn) {
    border-color: rgba(232, 238, 246, .22) !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .09), transparent 54%),
        rgba(9, 10, 14, .34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .16),
        0 10px 26px rgba(0, 0, 0, .14) !important;
}

/* Header identity pill: same restrained glass capsule used on the launch screen. */
.user-pill {
    min-height: 44px;
    padding: 4px 9px 4px 5px !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 999px;
    background: rgba(8, 8, 10, .34) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
    backdrop-filter: blur(18px) saturate(1.25) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .08),
        0 10px 26px rgba(0, 0, 0, .14) !important;
    cursor: pointer;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.user-pill:hover {
    border-color: rgba(255, 255, 255, .34) !important;
    background: rgba(255, 255, 255, .10) !important;
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .12),
        0 14px 30px rgba(0, 0, 0, .18) !important;
}

.user-pill #userName {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f4f8ff !important;
    font-size: 14px;
    font-weight: 780;
}

.user-credit-tag {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid rgba(74, 222, 128, .28);
    border-radius: 999px;
    color: #bbf7d0 !important;
    background: rgba(22, 101, 52, .20);
    font-size: 13px !important;
    font-weight: 820 !important;
    white-space: nowrap;
}

.user-menu-caret {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    margin-left: 2px;
    border-right: 1.8px solid rgba(220, 230, 242, .76);
    border-bottom: 1.8px solid rgba(220, 230, 242, .76);
    transform: translateY(-2px) rotate(45deg);
}

.user-group-tag {
    overflow: hidden;
    border-color: rgba(232, 238, 246, .24) !important;
    background: rgba(255, 255, 255, .035) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .12),
        0 8px 20px rgba(0, 0, 0, .12) !important;
}

.user-group-tag span,
.user-group-tag strong {
    box-shadow: none !important;
}

.user-group-tag.leader {
    border-color: rgba(235, 241, 249, .30) !important;
    background: rgba(255, 255, 255, .055) !important;
}

.user-group-tag.leader strong {
    color: #07111f !important;
    background:
        linear-gradient(180deg, rgba(243, 248, 255, .98), rgba(142, 184, 247, .92)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .72),
        0 4px 12px rgba(120, 160, 220, .20) !important;
}

.user-pill #logoutBtn {
    background: rgba(8, 9, 13, .22) !important;
    border-color: rgba(232, 238, 246, .20) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .12),
        0 8px 20px rgba(0, 0, 0, .12) !important;
}

/* Asset reference colors: calm cinema glass tokens for long editing sessions. */
:where(.ref-tag, .rich-ref-token) {
    text-shadow: 0 1px 1px rgba(0, 0, 0, .22) !important;
}

:where(.ref-tag-char, .rich-ref-token.ref-tag-char) {
    color: #edf6ff !important;
    border-color: rgba(176, 206, 238, .44) !important;
    background:
        linear-gradient(180deg, rgba(92, 123, 158, .48), rgba(45, 61, 82, .42)),
        rgba(9, 12, 17, .34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .16),
        0 8px 20px rgba(54, 87, 124, .14) !important;
}

:where(.rich-ref-token.ref-tag-char) {
    border-color: rgba(188, 216, 248, .56) !important;
    background:
        linear-gradient(180deg, rgba(106, 139, 176, .62), rgba(48, 65, 88, .54)),
        rgba(9, 12, 17, .38) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .20),
        0 8px 22px rgba(54, 87, 124, .20) !important;
}

:where(.ref-tag-scene, .rich-ref-token.ref-tag-scene) {
    color: #eaf9f1 !important;
    border-color: rgba(160, 214, 188, .42) !important;
    background:
        linear-gradient(180deg, rgba(73, 121, 102, .48), rgba(37, 66, 57, .42)),
        rgba(8, 13, 12, .34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .15),
        0 8px 20px rgba(50, 105, 82, .13) !important;
}

:where(.rich-ref-token.ref-tag-scene) {
    border-color: rgba(174, 226, 200, .54) !important;
    background:
        linear-gradient(180deg, rgba(84, 137, 115, .60), rgba(39, 72, 62, .54)),
        rgba(8, 13, 12, .38) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .19),
        0 8px 22px rgba(50, 105, 82, .18) !important;
}

:where(.ref-tag-obj, .rich-ref-token.ref-tag-obj) {
    color: #fff0ee !important;
    border-color: rgba(226, 170, 164, .42) !important;
    background:
        linear-gradient(180deg, rgba(132, 82, 90, .50), rgba(73, 43, 48, .42)),
        rgba(15, 9, 11, .34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .15),
        0 8px 20px rgba(132, 72, 78, .13) !important;
}

:where(.rich-ref-token.ref-tag-obj) {
    border-color: rgba(238, 188, 180, .54) !important;
    background:
        linear-gradient(180deg, rgba(151, 92, 100, .62), rgba(78, 46, 52, .54)),
        rgba(15, 9, 11, .38) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .19),
        0 8px 22px rgba(132, 72, 78, .18) !important;
}

:where(.ref-tag-char .ref-thumb, .rich-ref-token.ref-tag-char .ref-thumb) {
    border-color: rgba(196, 222, 250, .50) !important;
    background: rgba(32, 49, 68, .50) !important;
}

:where(.ref-tag-scene .ref-thumb, .rich-ref-token.ref-tag-scene .ref-thumb) {
    border-color: rgba(177, 226, 202, .48) !important;
    background: rgba(29, 58, 48, .50) !important;
}

:where(.ref-tag-obj .ref-thumb, .rich-ref-token.ref-tag-obj .ref-thumb) {
    border-color: rgba(238, 192, 184, .48) !important;
    background: rgba(68, 39, 44, .50) !important;
}

:where(.ref-tag-char .ref-replace-select, .rich-ref-token.ref-tag-char .ref-replace-select) {
    background-color: rgba(33, 53, 74, .42) !important;
}

:where(.ref-tag-scene .ref-replace-select, .rich-ref-token.ref-tag-scene .ref-replace-select) {
    background-color: rgba(28, 56, 47, .42) !important;
}

:where(.ref-tag-obj .ref-replace-select, .rich-ref-token.ref-tag-obj .ref-replace-select) {
    background-color: rgba(66, 38, 43, .42) !important;
}

:where(.rich-ref-token-remove, .ref-tag-remove) {
    background: rgba(4, 6, 10, .26) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08) !important;
}

/* Silver checkbox tick: visible on the black-glass theme. */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-grid;
    place-content: center;
    margin: 0;
    border: 1.5px solid rgba(222, 230, 240, .42) !important;
    border-radius: 5px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)),
        rgba(4, 6, 10, .34) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .14),
        0 6px 16px rgba(0, 0, 0, .14) !important;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

input[type="checkbox"]::after {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 3px solid #eef3f8;
    border-bottom: 3px solid #eef3f8;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35));
    opacity: 0;
    transform: rotate(-45deg) translateY(-1px) scale(.72);
    transition: opacity .14s ease, transform .14s ease;
}

input[type="checkbox"]:checked {
    border-color: rgba(245, 248, 252, .72) !important;
    background:
        linear-gradient(180deg, rgba(238, 243, 248, .22), rgba(148, 158, 172, .16)),
        rgba(8, 10, 14, .48) !important;
}

input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: rotate(-45deg) translateY(-1px) scale(1);
}

input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(238, 243, 248, .44);
    outline-offset: 2px;
}

input[type="checkbox"]:indeterminate {
    border-color: rgba(245, 248, 252, .62) !important;
    background:
        linear-gradient(180deg, rgba(238, 243, 248, .18), rgba(148, 158, 172, .12)),
        rgba(8, 10, 14, .48) !important;
}

input[type="checkbox"]:indeterminate::after {
    width: 10px;
    height: 0;
    border-left: 0;
    border-bottom: 3px solid #eef3f8;
    opacity: 1;
    transform: none;
}

/* Custom checkbox-like controls, such as asset picker cards. */
.picker-check {
    position: relative;
    flex: 0 0 20px;
    width: 20px !important;
    height: 20px !important;
    display: inline-grid;
    place-content: center;
    border: 1.5px solid rgba(222, 230, 240, .38) !important;
    border-radius: 6px !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .018)),
        rgba(4, 6, 10, .28) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .12),
        0 6px 16px rgba(0, 0, 0, .12) !important;
}

.picker-check::after {
    content: "";
    width: 10px;
    height: 6px;
    border-left: 3px solid #eef3f8;
    border-bottom: 3px solid #eef3f8;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .38));
    opacity: 0;
    transform: rotate(-45deg) translateY(-1px) scale(.72);
    transition: opacity .14s ease, transform .14s ease;
}

.picker-item.selected .picker-check {
    border-color: rgba(245, 248, 252, .78) !important;
    background:
        linear-gradient(180deg, rgba(238, 243, 248, .24), rgba(148, 158, 172, .16)),
        rgba(8, 10, 14, .52) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .26),
        0 8px 20px rgba(0, 0, 0, .16) !important;
}

.picker-item.selected .picker-check::after {
    opacity: 1;
    transform: rotate(-45deg) translateY(-1px) scale(1);
}

/* Agent boot sequence: dark cinematic system entry, no emoji face dependency. */
.agent-entry-overlay {
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 38%, rgba(120, 132, 148, .16), transparent 26%),
        radial-gradient(circle at 50% 50%, rgba(6, 8, 12, .20), transparent 48%),
        rgba(2, 3, 6, .62) !important;
    -webkit-backdrop-filter: blur(26px) saturate(1.08) brightness(1.04) !important;
    backdrop-filter: blur(26px) saturate(1.08) brightness(1.04) !important;
}

.agent-entry-overlay::before,
.agent-entry-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.agent-entry-overlay::before {
    background:
        linear-gradient(90deg, transparent, rgba(238, 243, 248, .06), transparent),
        repeating-linear-gradient(180deg, rgba(255, 255, 255, .032) 0 1px, transparent 1px 9px);
    opacity: .42;
    transform: translateY(-16%);
    animation: agentBootScan 2.6s linear infinite;
}

.agent-entry-overlay::after {
    background: radial-gradient(circle at 50% 50%, transparent 0 34%, rgba(0, 0, 0, .34) 72%, rgba(0, 0, 0, .58));
}

.agent-entry-card {
    position: relative;
    width: min(430px, calc(100vw - 42px)) !important;
    min-height: 300px !important;
    isolation: isolate;
    border-color: rgba(232, 238, 246, .22) !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .10), transparent 34%),
        linear-gradient(180deg, rgba(17, 18, 22, .54), rgba(4, 5, 8, .64)),
        rgba(0, 0, 0, .18) !important;
    -webkit-backdrop-filter: blur(34px) saturate(1.14) brightness(1.10) !important;
    backdrop-filter: blur(34px) saturate(1.14) brightness(1.10) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .18),
        inset 0 0 0 1px rgba(255, 255, 255, .035),
        0 36px 110px rgba(0, 0, 0, .58) !important;
}

.agent-entry-card::before {
    content: "AGENT";
    position: absolute;
    top: 18px;
    left: 22px;
    color: rgba(232, 238, 246, .40);
    font-size: 10px;
    font-weight: 820;
    letter-spacing: .24em;
}

.agent-entry-card::after {
    content: "";
    position: absolute;
    inset: 12px;
    z-index: -1;
    border-radius: 18px;
    border: 1px solid rgba(232, 238, 246, .09);
    background:
        linear-gradient(90deg, transparent 0 22%, rgba(232, 238, 246, .08) 50%, transparent 78%),
        linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 42%);
    opacity: .7;
}

.agent-entry-orbit {
    width: 132px !important;
    height: 132px !important;
}

.agent-entry-orbit::before {
    inset: 0 !important;
    border: 1px solid rgba(232, 238, 246, .15) !important;
    border-top-color: rgba(246, 249, 252, .92) !important;
    border-right-color: rgba(178, 188, 202, .40) !important;
    box-shadow:
        0 0 24px rgba(232, 238, 246, .10),
        inset 0 0 22px rgba(232, 238, 246, .05) !important;
    animation: agentBootRing 1.25s linear infinite !important;
}

.agent-entry-orbit::after {
    inset: 18px !important;
    border: 1px dashed rgba(232, 238, 246, .24);
    background:
        radial-gradient(circle, rgba(238, 243, 248, .15), transparent 44%),
        rgba(255, 255, 255, .018) !important;
    filter: none !important;
    animation: agentBootPulse 1.65s ease-in-out infinite !important;
}

.agent-entry-face {
    width: 72px !important;
    height: 72px !important;
    border: 1px solid rgba(232, 238, 246, .36);
    border-radius: 50% !important;
    background:
        radial-gradient(circle at 50% 42%, rgba(245, 248, 252, .94) 0 6px, rgba(176, 188, 204, .56) 7px 15px, rgba(7, 9, 13, .78) 16px 100%),
        rgba(4, 5, 8, .92) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .42),
        inset 0 -16px 30px rgba(0, 0, 0, .52),
        0 0 34px rgba(232, 238, 246, .18),
        0 18px 42px rgba(0, 0, 0, .34) !important;
    animation: agentBootCore 1.7s ease-in-out infinite !important;
}

.agent-entry-face::before,
.agent-entry-face::after,
.agent-entry-face span {
    content: "" !important;
    position: absolute;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    display: block;
    border-radius: 999px !important;
    background: rgba(238, 243, 248, .92) !important;
    transform: translate(-50%, -50%) !important;
}

.agent-entry-face::before {
    width: 38px !important;
    height: 2px !important;
    box-shadow: 0 0 16px rgba(238, 243, 248, .34);
    animation: agentBootLineH 1.55s ease-in-out infinite !important;
}

.agent-entry-face::after {
    width: 2px !important;
    height: 38px !important;
    box-shadow: 0 0 16px rgba(238, 243, 248, .34);
    animation: agentBootLineV 1.55s ease-in-out infinite !important;
}

.agent-entry-face span {
    width: 9px !important;
    height: 9px !important;
    border: 0 !important;
    background: #f2f6fa !important;
    box-shadow: 0 0 18px rgba(242, 246, 250, .58);
}

.agent-entry-copy strong {
    color: #f7fbff !important;
    font-size: 18px !important;
    letter-spacing: .02em;
}

.agent-entry-copy span {
    color: rgba(220, 229, 240, .66) !important;
}

.agent-entry-progress {
    width: min(260px, 76%) !important;
    height: 6px !important;
    padding: 1px;
    border: 1px solid rgba(232, 238, 246, .18);
    background: rgba(4, 5, 8, .42) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08) !important;
}

.agent-entry-progress span {
    background:
        linear-gradient(90deg, rgba(98, 108, 121, .65), rgba(238, 243, 248, .96), rgba(132, 144, 158, .72)) !important;
    box-shadow: 0 0 18px rgba(238, 243, 248, .26);
    animation: agentEntryProgress 3s cubic-bezier(.22, 1, .36, 1) both !important;
}

@keyframes agentBootScan {
    from {
        transform: translateY(-18%);
    }
    to {
        transform: translateY(18%);
    }
}

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

@keyframes agentBootPulse {
    0%, 100% {
        opacity: .52;
        transform: scale(.94);
    }
    50% {
        opacity: 1;
        transform: scale(1.04);
    }
}

@keyframes agentBootCore {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-3px) scale(1.035);
    }
}

@keyframes agentBootLineH {
    0%, 100% {
        width: 28px;
        opacity: .68;
    }
    50% {
        width: 44px;
        opacity: 1;
    }
}

@keyframes agentBootLineV {
    0%, 100% {
        height: 28px;
        opacity: .52;
    }
    50% {
        height: 44px;
        opacity: .92;
    }
}

/* Keep Agent task workspace visually synced with the global dynamic background. */
body.agent-page-active .content {
    background: transparent !important;
}

body.agent-page-active .content::before {
    inset: 0 !important;
    background:
        radial-gradient(circle at 68% 10%, rgba(255, 255, 255, .045), transparent 34%),
        linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .18) 68%, rgba(0, 0, 0, .24)) !important;
}

body.agent-page-active :where(.agent-task-list-panel, .agent-task-main, .agent-task-welcome) {
    -webkit-backdrop-filter: blur(calc(var(--dynamic-bg-blur, 7px) + 12px)) saturate(1.12) brightness(1.06) !important;
    backdrop-filter: blur(calc(var(--dynamic-bg-blur, 7px) + 12px)) saturate(1.12) brightness(1.06) !important;
}

/* Profile modal hard override: keep after global modal overrides to prevent narrow-card collisions. */
#profileModal .profile-modal-card {
    width: min(880px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
}

#profileModal .profile-modal-body {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    min-width: 0 !important;
}

#profileModal .profile-modal-columns {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    align-items: start !important;
    min-width: 0 !important;
}

#profileModal .profile-modal-left,
#profileModal .profile-modal-right {
    min-width: 0 !important;
    display: grid !important;
    gap: 10px !important;
    align-content: start !important;
}

#profileModal :where(.profile-identity, .profile-stat-grid, .profile-membership-card, .profile-history-card, .profile-password-form) {
    grid-column: auto !important;
    grid-row: auto !important;
}

#profileModal :where(.profile-history-card, .profile-password-form) {
    height: auto !important;
}

#profileModal .profile-history-card {
    align-content: start !important;
    gap: 12px !important;
    min-height: 0 !important;
    padding: 15px !important;
}

#profileModal .profile-identity {
    grid-template-areas:
        "avatar main membership"
        "actions main membership" !important;
    grid-template-columns: 96px minmax(160px, .72fr) minmax(320px, 1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 10px 16px !important;
    align-items: center !important;
    padding: 16px !important;
    border-radius: 18px !important;
    background:
        radial-gradient(circle at 8% 10%, rgba(96, 165, 250, .18), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, .060), rgba(255, 255, 255, .024)) !important;
}

#profileModal .profile-avatar-large {
    grid-area: avatar !important;
    width: 82px !important;
    height: 82px !important;
    border-radius: 22px !important;
    justify-self: center !important;
}

#profileModal .profile-identity-main {
    grid-area: main !important;
}

#profileModal .profile-identity-actions {
    grid-area: actions !important;
    justify-content: center !important;
}

#profileModal .profile-avatar-upload {
    min-height: 30px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
}

#profileModal .profile-eyebrow {
    margin-bottom: 6px !important;
}

#profileModal .profile-identity-main > strong {
    font-size: 20px !important;
    line-height: 1.12 !important;
}

#profileModal .profile-identity-main > span {
    margin-top: 6px !important;
    font-size: 12px !important;
}

#profileModal .profile-identity .profile-membership-card {
    grid-area: membership !important;
    width: 100% !important;
    max-width: none !important;
    justify-self: stretch !important;
    gap: 10px !important;
    padding: 13px 14px !important;
    border-radius: 16px !important;
    background:
        radial-gradient(circle at 96% 0%, rgba(96, 165, 250, .18), transparent 42%),
        linear-gradient(135deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .026)) !important;
}

#profileModal .profile-identity .profile-membership-main {
    align-items: center !important;
    gap: 12px !important;
}

#profileModal .profile-identity .profile-membership-card small {
    font-size: 11px !important;
}

#profileModal .profile-identity .profile-membership-card strong {
    margin-top: 3px !important;
    font-size: 18px !important;
    line-height: 1.15 !important;
}

#profileModal .profile-identity .profile-membership-main > div > span {
    margin-top: 4px !important;
    font-size: 11.5px !important;
}

#profileModal .profile-identity .profile-membership-benefits {
    gap: 6px !important;
}

#profileModal .profile-identity .profile-membership-benefits span {
    min-height: 26px !important;
    padding: 0 8px !important;
    font-size: 11.5px !important;
}

#profileModal .profile-identity .profile-membership-entry {
    min-height: 32px !important;
    padding: 0 12px !important;
}

#profileModal .profile-stat-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

#profileModal .profile-stat-grid span {
    min-height: 64px !important;
    padding: 12px 14px !important;
    border-radius: 16px !important;
}

#profileModal .profile-stat-grid small {
    font-size: 11px !important;
}

#profileModal .profile-stat-grid strong {
    font-size: 19px !important;
}

#profileModal .profile-section-title {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 4px !important;
}

#profileModal .profile-section-title span {
    font-size: 11.5px !important;
}

#profileModal .profile-history-grid {
    gap: 9px !important;
}

#profileModal .profile-history-grid button {
    min-height: 34px !important;
}

#profileModal .profile-inline-error:empty {
    display: none !important;
}

@media (max-width: 820px) {
    #profileModal .profile-identity {
        grid-template-areas:
            "avatar main actions"
            "membership membership membership" !important;
        grid-template-columns: 86px minmax(0, 1fr) auto !important;
    }

    #profileModal .profile-identity .profile-membership-card {
        grid-column: 1 / -1 !important;
        max-width: 100% !important;
    }

    #profileModal .profile-modal-columns {
        grid-template-columns: 1fr !important;
    }

}

@media (max-width: 560px) {
    #profileModal .profile-identity,
    #profileModal .profile-stat-grid,
    #profileModal .profile-history-grid {
        grid-template-columns: 1fr !important;
    }

    #profileModal .profile-identity {
        grid-template-areas:
            "avatar"
            "main"
            "membership"
            "actions" !important;
        justify-items: center !important;
        text-align: center !important;
    }

    #profileModal .profile-identity-main,
    #profileModal .profile-identity-actions {
        justify-self: center !important;
    }

    #profileModal .profile-identity .profile-membership-card {
        justify-self: stretch !important;
    }

    #profileModal .profile-identity .profile-membership-main {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    #profileModal .profile-identity .profile-membership-entry {
        width: 100% !important;
    }

}

/* Last-mile guard: history dialogs must not inherit blue/table chip leftovers. */
#imageHistoryModal .image-history-list,
#imageHistoryModal .image-history-table,
#historyModal .history-list,
#historyModal .history-row {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

#imageHistoryModal .image-history-table {
    display: table !important;
    width: 100% !important;
    overflow: hidden !important;
    border-color: rgba(232, 238, 246, .13) !important;
    background: rgba(3, 6, 12, .40) !important;
}

#imageHistoryModal .image-history-table :where(th, td),
#historyModal .history-row {
    border-color: rgba(232, 238, 246, .10) !important;
    background-color: transparent !important;
    background-image: none !important;
}

#imageHistoryModal .image-history-pager > span {
    min-width: auto !important;
    height: auto !important;
    padding: 0 8px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Absolute final checkbox/radio cleanup after all glass-theme overrides. */
:where(.toolbar-audio-toggle, .shot-audio-toggle, .image-param-check, .agent-toggle-pill, .agent-asset-card .agent-toggle-pill) {
    min-width: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

:where(.toolbar-audio-toggle, .shot-audio-toggle, .image-param-check, .agent-toggle-pill) {
    color: #cbd5e1 !important;
}

:where(.toolbar-audio-toggle, .shot-audio-toggle, .image-param-check, .agent-toggle-pill):hover {
    color: #f8fafc !important;
}

.agent-toggle-pill input {
    position: static !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.agent-toggle-pill::before {
    content: none !important;
}

.canvas-test-workspace {
    min-height: calc(100vh - 96px);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.canvas-page-active .canvas-test-workspace {
    height: calc(100vh - 36px);
    min-height: 0;
}

.canvas-test-exitbar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding-right: 320px;
}

.canvas-test-actions,
.agent-task-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.space-marquee {
    position: relative;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: 30px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 0;
    background: transparent;
    box-shadow: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
}

.space-marquee-track {
    display: inline-block;
    min-width: max-content;
    padding-left: 100%;
    color: rgba(232, 238, 246, .74);
    font-size: 12px;
    font-weight: 720;
    white-space: nowrap;
    animation: spaceMarquee 30s linear infinite;
}

.space-marquee:hover .space-marquee-track {
    animation-play-state: paused;
}

@keyframes spaceMarquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

.space-marquee-popover {
    position: fixed;
    top: 72px;
    left: 50%;
    z-index: 6600;
    min-width: 320px;
    padding: 12px 14px;
    border: 1px solid rgba(232, 238, 246, .18);
    border-radius: 14px;
    color: rgba(245, 248, 252, .88);
    background:
        radial-gradient(circle at 18% 0%, rgba(255, 255, 255, .10), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .024)),
        rgba(7, 8, 11, .76);
    backdrop-filter: blur(22px) saturate(1.08);
    -webkit-backdrop-filter: blur(22px) saturate(1.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .13),
        0 24px 72px rgba(0, 0, 0, .34);
    font-size: 12px;
    line-height: 1.85;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -8px);
    transition: opacity .16s ease, transform .16s ease;
}

.space-marquee:hover .space-marquee-popover {
    opacity: 1;
    transform: translate(-50%, 0);
}

.space-marquee-popover div {
    white-space: nowrap;
}

@media (max-width: 980px) {
    .canvas-test-exitbar,
    body.agent-page-active .agent-task-toolbar {
        grid-template-columns: minmax(0, 1fr);
        padding-right: 0;
    }

    .space-marquee {
        order: 2;
    }
}

.canvas-test-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 620px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, .12);
    border-radius: 8px;
    background:
        linear-gradient(rgba(148, 163, 184, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .055) 1px, transparent 1px),
        rgba(2, 6, 15, .54);
    background-size: 28px 28px;
    cursor: default;
}

.canvas-test-stage:active {
    cursor: default;
}

.canvas-test-stage.is-panning {
    cursor: grabbing;
}

.canvas-test-stage.is-linking {
    cursor: crosshair;
}

.canvas-viewport {
    position: absolute;
    inset: 0;
    z-index: 2;
    transform-origin: 0 0;
}

.canvas-connection-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 3;
}

.canvas-connection-layer path {
    fill: none;
    stroke: rgba(115, 143, 176, .34);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 4px rgba(96, 165, 250, .10));
    pointer-events: stroke;
    cursor: pointer;
}

.canvas-connection-layer path.is-output {
    stroke: rgba(115, 143, 176, .40);
    stroke-width: 2.1;
    filter: drop-shadow(0 0 4px rgba(96, 165, 250, .12));
}

.canvas-connection-layer path.is-related {
    stroke: rgba(96, 165, 250, .96);
    stroke-width: 2.8;
    stroke-dasharray: 10 8;
    animation: canvasConnectionFlow 1.1s linear infinite;
    filter:
        drop-shadow(0 0 8px rgba(96, 165, 250, .42))
        drop-shadow(0 0 18px rgba(147, 197, 253, .20));
}

.canvas-connection-layer path.is-preview {
    stroke: rgba(96, 165, 250, .96);
    stroke-dasharray: 7 6;
    stroke-width: 2.8;
    filter:
        drop-shadow(0 0 8px rgba(96, 165, 250, .42))
        drop-shadow(0 0 18px rgba(147, 197, 253, .20));
}

.canvas-connection-layer .canvas-endpoint {
    fill: rgba(82, 111, 145, .58);
    stroke: rgba(191, 219, 254, .42);
    stroke-width: 1.6;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 5px rgba(96, 165, 250, .16));
    pointer-events: auto;
    cursor: pointer;
}

.canvas-connection-layer path:hover,
.canvas-connection-layer .canvas-endpoint:hover {
    stroke: rgba(248, 113, 113, .86);
    filter: drop-shadow(0 0 8px rgba(248, 113, 113, .26));
}

.canvas-connection-layer .canvas-endpoint.is-related,
.canvas-connection-layer .canvas-endpoint.is-preview {
    fill: rgba(96, 165, 250, .94);
    stroke: rgba(219, 234, 254, .92);
    filter:
        drop-shadow(0 0 7px rgba(96, 165, 250, .46))
        drop-shadow(0 0 16px rgba(147, 197, 253, .20));
}

.canvas-selection-marquee {
    position: absolute;
    z-index: 4;
    border: 1px dashed rgba(147, 197, 253, .96);
    border-radius: 4px;
    background: rgba(59, 130, 246, .12);
    box-shadow:
        inset 0 0 0 1px rgba(15, 23, 42, .62),
        0 0 18px rgba(96, 165, 250, .18);
    pointer-events: none;
}

@keyframes canvasConnectionFlow {
    to {
        stroke-dashoffset: -18;
    }
}

.canvas-hidden-file {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.canvas-test-hint {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 14px;
    border: 1px solid rgba(226, 232, 240, .12);
    border-radius: 8px;
    color: #94a3b8;
    background: rgba(5, 10, 20, .78);
    pointer-events: none;
}

.canvas-test-hint::after {
    content: "Alt + 鼠标滚轮缩放，中键拖拽移动画布";
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
}

.canvas-context-menu {
    position: absolute;
    z-index: 20;
    width: 156px;
    padding: 6px;
    border: 1px solid rgba(226, 232, 240, .16);
    border-radius: 8px;
    background: rgba(8, 13, 24, .96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .36);
}

.canvas-context-menu button {
    width: 100%;
    min-height: 34px;
    justify-content: flex-start;
    border: 0;
    border-radius: 6px;
    padding: 0 10px;
    color: #dbeafe;
    background: transparent;
}

.canvas-context-menu button:hover {
    background: rgba(148, 163, 184, .12);
}

.canvas-minimap {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 16;
    width: 172px;
    height: 96px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 7px;
    background:
        linear-gradient(rgba(148, 163, 184, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .045) 1px, transparent 1px),
        rgba(4, 8, 16, .50);
    background-size: 14px 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .06),
        0 14px 34px rgba(0, 0, 0, .22);
    cursor: grab;
    opacity: .72;
    backdrop-filter: blur(12px) saturate(1.02);
    -webkit-backdrop-filter: blur(12px) saturate(1.02);
    transition: opacity .16s ease, border-color .16s ease, background .16s ease;
}

.canvas-minimap:hover {
    border-color: rgba(191, 219, 254, .22);
    opacity: .96;
}

.canvas-minimap:active {
    cursor: grabbing;
}

.canvas-minimap-world {
    position: absolute;
    inset: 7px;
}

.canvas-minimap-node {
    position: absolute;
    min-width: 3px;
    min-height: 3px;
    border: 1px solid rgba(191, 219, 254, .14);
    border-radius: 2px;
    background: rgba(148, 163, 184, .16);
}

.canvas-minimap-node.has-image {
    border-color: rgba(226, 232, 240, .24);
    background: rgba(226, 232, 240, .30);
}

.canvas-minimap-node.is-busy {
    border-color: rgba(96, 165, 250, .38);
    background: rgba(59, 130, 246, .28);
}

.canvas-minimap-viewport {
    position: absolute;
    min-width: 18px;
    min-height: 12px;
    border: 1px solid rgba(191, 219, 254, .92);
    border-radius: 2px;
    background: rgba(96, 165, 250, .08);
    box-shadow:
        0 0 0 1px rgba(2, 6, 23, .58),
        0 0 16px rgba(147, 197, 253, .20);
}

.canvas-node {
    position: absolute;
    z-index: 5;
    width: 288px;
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, .14);
    border-radius: 8px;
    background: rgba(7, 11, 20, .92);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .30);
    cursor: default;
}

.canvas-node-link-port {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 2px solid rgba(191, 219, 254, .80);
    border-radius: 50%;
    background: rgba(96, 165, 250, .92);
    box-shadow:
        0 0 0 2px rgba(8, 15, 28, .96),
        0 0 14px rgba(96, 165, 250, .28);
    cursor: crosshair;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
    transition: opacity .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.canvas-node-link-port-left {
    left: -8px;
}

.canvas-node-link-port-right {
    right: -8px;
}

.canvas-node-disconnect-port {
    position: absolute;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 2px solid rgba(254, 202, 202, .88);
    border-radius: 50%;
    color: #fee2e2;
    background: rgba(220, 38, 38, .92);
    box-shadow:
        0 0 0 2px rgba(8, 15, 28, .96),
        0 0 14px rgba(248, 113, 113, .30);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform .14s ease, background .14s ease, box-shadow .14s ease;
}

.canvas-node-disconnect-port-left {
    left: -9px;
}

.canvas-node-disconnect-port-right {
    right: -9px;
}

.canvas-node-disconnect-port:hover {
    background: rgba(239, 68, 68, 1);
    box-shadow:
        0 0 0 2px rgba(8, 15, 28, .96),
        0 0 18px rgba(248, 113, 113, .44);
    transform: translateY(-50%) scale(1.08);
}

.canvas-node:hover .canvas-node-link-port,
.canvas-node.is-selected .canvas-node-link-port,
.canvas-node.is-link-source .canvas-node-link-port,
.canvas-node.is-link-target .canvas-node-link-port,
.canvas-test-stage.is-linking .canvas-node-link-port {
    opacity: 1;
    pointer-events: auto;
}

.canvas-node-link-port:hover,
.canvas-node.is-link-source .canvas-node-link-port,
.canvas-node.is-link-target .canvas-node-link-port {
    border-color: rgba(255, 255, 255, .95);
    background: rgba(147, 197, 253, 1);
    box-shadow:
        0 0 0 2px rgba(8, 15, 28, .96),
        0 0 16px rgba(96, 165, 250, .38);
}

.canvas-node-image-only {
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: none;
}

.canvas-node-image-only .canvas-node-preview {
    margin: 0;
    border-color: rgba(226, 232, 240, .18);
    border-radius: 6px;
    background: transparent;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .24);
    cursor: grab;
}

.canvas-node-image-only .canvas-node-preview:active {
    cursor: grabbing;
}

.canvas-node-image-only .canvas-node-preview img {
    width: auto;
    max-width: 280px;
    max-height: 280px;
}

.canvas-node-compact {
    width: auto;
    min-width: 138px;
    padding: 9px 11px;
}

.canvas-node-text-editor {
    width: 390px;
}

.canvas-node-generator-controller {
    width: 410px;
}

.canvas-node.is-unselected {
    opacity: .68;
    transition: opacity .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.canvas-node.is-unselected:hover {
    opacity: .86;
}

.canvas-node.is-selected {
    opacity: 1;
}

.canvas-node-brief {
    display: block;
    max-width: 190px;
    overflow: hidden;
    color: rgba(203, 213, 225, .72);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.canvas-node.is-selected {
    z-index: 8;
}

.canvas-node-generating {
    display: grid;
    place-items: center;
    width: 240px;
    height: 178px;
    padding: 0;
    border: 1px solid rgba(96, 165, 250, .16);
    border-radius: 10px;
    background:
        radial-gradient(circle at 50% 42%, rgba(59, 130, 246, .18), transparent 46%),
        rgba(7, 11, 20, .52);
    box-shadow: 0 20px 52px rgba(0, 0, 0, .28);
    backdrop-filter: blur(18px) saturate(1.1);
    -webkit-backdrop-filter: blur(18px) saturate(1.1);
    overflow: hidden;
}

.canvas-node-generating::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent),
        rgba(2, 6, 23, .34);
    opacity: .5;
    pointer-events: none;
}

.canvas-generating-card {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    color: #dbeafe;
    cursor: grab;
    user-select: none;
}

.canvas-generating-card:active {
    cursor: grabbing;
}

.canvas-generating-orbit {
    width: 42px;
    height: 42px;
    border: 2px solid rgba(147, 197, 253, .18);
    border-top-color: #60a5fa;
    border-right-color: rgba(96, 165, 250, .72);
    border-radius: 50%;
    box-shadow: 0 0 28px rgba(59, 130, 246, .32);
    animation: canvasGeneratingSpin .9s linear infinite;
}

.canvas-generating-card strong {
    color: #bfdbfe;
    font-size: 18px;
    letter-spacing: 0;
}

.canvas-generating-card small {
    max-width: 180px;
    overflow: hidden;
    color: rgba(191, 219, 254, .68);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.canvas-node-image-expanded {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.canvas-node-image-expanded .canvas-node-preview {
    flex: 0 0 auto;
    margin: 0;
    border-color: rgba(226, 232, 240, .18);
    border-radius: 6px;
    background: transparent;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .24);
    cursor: grab;
}

.canvas-node-image-expanded .canvas-node-preview:active {
    cursor: grabbing;
}

.canvas-node-image-expanded .canvas-node-preview img {
    width: auto;
    max-width: 280px;
    max-height: 280px;
}

.canvas-node-side-panel {
    width: 560px;
    padding: 10px;
    border: 1px solid rgba(226, 232, 240, .14);
    border-radius: 8px;
    background: rgba(7, 11, 20, .94);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .30);
}

.canvas-node-side-panel textarea {
    min-height: 132px;
    margin: 0 0 8px;
}

.canvas-node-action-row {
    display: flex;
    gap: 6px;
    align-items: end;
    min-width: 0;
}

.canvas-node-action-row label,
.canvas-node-controls label {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.canvas-node-action-row label {
    flex: 1 1 76px;
}

.canvas-node-action-row label:first-child {
    flex-basis: 136px;
}

.canvas-node-action-row label span,
.canvas-node-controls label span {
    color: rgba(148, 163, 184, .82);
    font-size: 10px;
    font-weight: 760;
    line-height: 1;
}

.canvas-node-action-row select,
.canvas-node-controls select {
    width: 100%;
    min-height: 34px;
    border-radius: 7px;
    padding: 0 28px 0 10px;
    font-size: 12px;
    font-weight: 720;
}

.canvas-node-action-row button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
    white-space: nowrap;
}

.canvas-node-command-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.canvas-node-command-row .canvas-reference-quota {
    flex: 1 1 auto;
    min-width: 150px;
    color: rgba(147, 197, 253, .88);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
}

.canvas-node-command-row .canvas-reference-quota.is-over {
    color: #fca5a5;
}

.canvas-node-command-row [data-canvas-generate] {
    margin-left: auto;
}

.canvas-linked-inputs {
    display: flex;
    gap: 6px;
    margin: 0 0 16px;
    flex-wrap: wrap;
}

.canvas-linked-inputs span,
.canvas-linked-inputs.is-empty {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 999px;
    padding: 0 14px;
    color: rgba(203, 213, 225, .78);
    background: rgba(15, 23, 42, .34);
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.canvas-linked-inputs.is-empty {
    width: auto;
    justify-content: flex-start;
    border-style: dashed;
    border-radius: 999px;
    color: rgba(148, 163, 184, .82);
    background: rgba(15, 23, 42, .22);
}

.canvas-node-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
    margin: 8px 0 2px;
}

.canvas-node-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.canvas-node-head strong {
    color: #f8fafc;
    font-size: 14px;
    cursor: grab;
    user-select: none;
}

.canvas-node-head strong:active {
    cursor: grabbing;
}

.canvas-node-head button {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(248, 113, 113, .22);
    border-radius: 50%;
    color: #fecaca;
    background: rgba(127, 29, 29, .18);
}

.canvas-node textarea {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    margin: 10px 0 8px;
}

.canvas-node small {
    display: block;
    margin-bottom: 8px;
    color: #93c5fd;
}

.canvas-upload-drop {
    display: grid;
    place-items: center;
    min-height: 86px;
    border: 1px dashed rgba(147, 197, 253, .28);
    border-radius: 8px;
    color: #bfdbfe;
    background: rgba(15, 23, 42, .58);
    cursor: pointer;
}

.canvas-upload-drop input {
    display: none;
}

.canvas-node-preview {
    display: block;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, .12);
    border-radius: 8px;
    background: rgba(2, 6, 23, .54);
}

.canvas-node-preview {
    margin-bottom: 10px;
}

.canvas-node-preview img {
    display: block;
    width: 100%;
    max-height: 210px;
    object-fit: contain;
}

.canvas-node-status {
    margin-top: 8px;
    color: #cbd5e1;
    font-size: 12px;
}

.canvas-image-zoom-btn {
    position: absolute;
    top: 7px;
    right: 7px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(191, 219, 254, .22);
    border-radius: 50%;
    color: #dbeafe;
    background: rgba(2, 6, 23, .62);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity .16s ease, transform .16s ease, background .16s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.canvas-node-preview:hover .canvas-image-zoom-btn {
    opacity: 1;
    transform: translateY(0);
}

.canvas-image-zoom-btn:hover {
    background: rgba(15, 23, 42, .86);
}

.canvas-image-viewer {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    background: rgba(2, 6, 15, .78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.canvas-viewer-actions {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.canvas-viewer-stage {
    position: absolute;
    inset: 54px 24px 76px;
    display: grid;
    place-items: center;
    overflow: hidden;
    cursor: grab;
}

.canvas-viewer-stage:active,
.canvas-viewer-stage.is-dragging {
    cursor: grabbing;
}

.canvas-viewer-stage img {
    max-width: min(92vw, 1280px);
    max-height: calc(100vh - 160px);
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
    box-shadow: 0 22px 72px rgba(0, 0, 0, .45);
}

.canvas-viewer-download,
.canvas-viewer-import,
.canvas-viewer-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.canvas-viewer-download {
    border: 1px solid rgba(34, 197, 94, .24);
    color: #bbf7d0;
    background: rgba(20, 83, 45, .26);
}

.canvas-viewer-download svg,
.canvas-viewer-import svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.canvas-viewer-import {
    border: 1px solid rgba(96, 165, 250, .28);
    color: #dbeafe;
    background: rgba(30, 64, 175, .26);
}

.canvas-viewer-close {
    border: 1px solid rgba(248, 113, 113, .24);
    color: #fecaca;
    background: rgba(127, 29, 29, .24);
}

.canvas-viewer-import-menu {
    position: absolute;
    top: 46px;
    right: 46px;
    min-width: 176px;
    padding: 6px;
    border: 1px solid rgba(204, 214, 224, .18);
    border-radius: 14px;
    background: rgba(7, 11, 20, .92);
    box-shadow: 0 20px 48px rgba(0, 0, 0, .34);
    display: grid;
    gap: 4px;
}

.canvas-viewer-import-menu button {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    color: #e5eef9;
    background: transparent;
    text-align: left;
}

.canvas-viewer-import-menu button:hover {
    background: rgba(148, 163, 184, .14);
}

.canvas-viewer-tools {
    position: absolute;
    left: 50%;
    bottom: 22px;
    z-index: 2;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(226, 232, 240, .14);
    border-radius: 999px;
    background: rgba(7, 11, 20, .76);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .34);
    transform: translateX(-50%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.canvas-viewer-tools button {
    min-width: 42px;
    min-height: 32px;
    border: 0;
    border-radius: 999px;
    color: #dbeafe;
    background: transparent;
}

.canvas-viewer-tools button:hover {
    background: rgba(148, 163, 184, .14);
}

@media (max-width: 760px) {
    .canvas-test-stage {
        min-height: 560px;
    }

    .canvas-node-image-expanded {
        flex-direction: column;
    }

    .canvas-node-side-panel {
        width: min(420px, calc(100vw - 32px));
    }

    .canvas-node-text-editor {
        width: min(420px, calc(100vw - 32px));
    }

    .canvas-node-generator-controller {
        width: min(420px, calc(100vw - 32px));
    }

    .canvas-node-action-row {
        flex-wrap: wrap;
    }

    .canvas-node-action-row label,
    .canvas-node-action-row button {
        flex: 1 1 100%;
    }
}

.asset-modal-card {
    background: transparent !important;
    box-shadow: none !important;
}

.asset-modal-card .modal-head,
.asset-modal-card .asset-modal-body,
.asset-modal-card .modal-footer {
    background: transparent !important;
    box-shadow: none !important;
}

.character-modal-main,
.character-modal-side,
.character-upload-area,
.character-audio-area,
.upload-placeholder,
.upload-preview,
.audio-placeholder,
.audio-preview,
.audio-trim-panel,
.form-tip {
    background: transparent !important;
    box-shadow: none !important;
}

/* Final override for the character asset pane. */
.character-modal-main,
.character-modal-side,
.character-upload-area,
.character-audio-area,
.character-upload-area .upload-placeholder,
.character-upload-area .upload-preview,
.character-audio-area .audio-placeholder,
.character-audio-area .audio-preview,
.audio-trim-panel,
.form-tip {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

.asset-upload-area .upload-placeholder,
.asset-upload-area .upload-preview {
    background: rgba(3, 4, 6, .08) !important;
}

/* Final hard override for the character form pane. */
.character-modal-layout,
.character-modal-main,
.character-modal-side,
.character-field,
.character-upload-area,
.character-audio-area,
.character-upload-area .upload-placeholder,
.character-upload-area .upload-preview,
.character-audio-area .audio-placeholder,
.character-audio-area .audio-preview,
.audio-trim-panel,
.form-tip {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

@media (max-width: 768px), (prefers-reduced-motion: reduce) {
    .site-dynamic-bg {
        opacity: .48 !important;
    }

    .site-dynamic-bg video {
        filter: brightness(.72) contrast(1.02) !important;
        transform: scale(1.02);
    }
}
