:root {
    --studio-bg-1: #061423;
    --studio-bg-2: #0e2d49;
    --studio-bg-3: #163d57;
    --studio-surface: rgba(255, 255, 255, 0.1);
    --studio-surface-strong: rgba(255, 255, 255, 0.15);
    --studio-border: rgba(154, 220, 248, 0.44);
    --studio-border-strong: rgba(200, 239, 255, 0.64);
    --studio-text: #eef9ff;
    --studio-muted: #9ec2d9;
    --studio-accent-a: #8fe2ff;
    --studio-accent-b: #86efc9;
    --studio-shadow: 0 18px 34px rgba(2, 13, 26, 0.4);
    --studio-ok: #8ef5bf;
    --studio-error: #ffb5a8;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", sans-serif;
    color: var(--studio-text);
    background:
        radial-gradient(820px circle at 8% -8%, rgba(128, 228, 255, 0.33), transparent 62%),
        radial-gradient(920px circle at 102% 0%, rgba(126, 248, 207, 0.24), transparent 60%),
        linear-gradient(150deg, var(--studio-bg-1), var(--studio-bg-2) 48%, var(--studio-bg-3));
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(24px);
}

body::before {
    width: 420px;
    height: 420px;
    left: -140px;
    bottom: -150px;
    background: rgba(120, 214, 255, 0.2);
}

body::after {
    width: 360px;
    height: 360px;
    right: -90px;
    top: 120px;
    background: rgba(124, 244, 198, 0.15);
}

.studio-page {
    width: min(1720px, calc(100% - 24px));
    margin: 12px auto 22px;
    display: grid;
    gap: 12px;
    position: relative;
}

.studio-project-status {
    border-radius: 16px;
    border: 1px solid var(--studio-border);
    background: linear-gradient(146deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03));
    box-shadow: var(--studio-shadow);
    backdrop-filter: blur(10px);
    padding: 14px;
    display: grid;
    gap: 12px;
    position: relative;
}

.studio-lang-switch {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(180, 231, 255, 0.34);
    background: rgba(255, 255, 255, 0.06);
    padding: 3px;
    gap: 3px;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.studio-lang-switch__btn {
    border: 1px solid transparent;
    background: transparent;
    color: #d8effd;
    border-radius: 999px;
    min-height: 28px;
    min-width: 40px;
    padding: 0 10px;
    font-family: "Sora", sans-serif;
    font-size: 0.72rem;
    cursor: pointer;
}

.studio-lang-switch__btn.is-active {
    color: #04253a;
    background: linear-gradient(145deg, var(--studio-accent-b), var(--studio-accent-a));
    border-color: rgba(181, 238, 210, 0.8);
}

.studio-fullscreen-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid rgba(189, 235, 255, 0.26);
    background: rgba(255, 255, 255, 0.06);
    color: #dff5ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    top: 12px;
    right: 130px;
    z-index: 2;
}

.studio-fullscreen-btn svg {
    width: 16px;
    height: 16px;
}

.studio-fullscreen-btn:hover,
.studio-fullscreen-btn:focus-visible {
    border-color: rgba(173, 232, 255, 0.52);
    background: rgba(120, 195, 255, 0.14);
    color: #ffffff;
}

.studio-fullscreen-btn.is-active {
    border-color: rgba(188, 236, 255, 0.62);
    background: rgba(120, 195, 255, 0.22);
    color: #ffffff;
}

.studio-refresh-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid rgba(189, 235, 255, 0.26);
    background: rgba(255, 255, 255, 0.06);
    color: #dff5ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.studio-refresh-btn svg {
    width: 16px;
    height: 16px;
}

.studio-refresh-btn:hover,
.studio-refresh-btn:focus-visible {
    border-color: rgba(173, 232, 255, 0.52);
    background: rgba(120, 195, 255, 0.14);
    color: #ffffff;
}

.studio-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.studio-project-status__head {
    display: grid;
    gap: 4px;
    padding-right: 110px;
}

.studio-project-status__eyebrow {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--studio-muted);
}

.studio-project-status__title {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: clamp(1.28rem, 2vw, 1.72rem);
    line-height: 1.2;
}

.studio-project-status__subtitle {
    margin: 0;
    color: #cae6f6;
    font-size: 0.82rem;
}

.studio-project-status__metrics {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.studio-metric {
    border: 1px solid rgba(171, 227, 251, 0.34);
    border-radius: 10px;
    padding: 7px 9px;
    background: rgba(255, 255, 255, 0.07);
    display: grid;
    gap: 2px;
}

.studio-metric__label {
    color: var(--studio-muted);
    font-size: 0.63rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.studio-metric__value {
    font-size: 0.84rem;
    color: #ecf9ff;
    font-family: "Sora", sans-serif;
    line-height: 1.2;
}

.studio-project-status__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.studio-mode-tabs {
    position: sticky;
    top: 8px;
    z-index: 30;
    border-radius: 14px;
    border: 1px solid var(--studio-border);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(8px);
    padding: 12px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.studio-mode-tab {
    border-radius: 10px;
    border: 1px solid rgba(172, 229, 255, 0.36);
    background: rgba(255, 255, 255, 0.05);
    color: var(--studio-text);
    min-height: 34px;
    padding: 0 12px;
    font-family: "Sora", sans-serif;
    font-size: 0.75rem;
    white-space: nowrap;
    cursor: pointer;
}

.studio-mode-tab__icon {
    display: none;
}

.studio-mode-tab__label {
    display: inline;
}

.studio-mode-tab.is-active,
.studio-mode-tab[aria-selected="true"] {
    color: #04253a;
    background: linear-gradient(145deg, var(--studio-accent-b), var(--studio-accent-a));
    border-color: rgba(181, 238, 210, 0.8);
}

.studio-mode-tabs--production {
    /* Production tabs in main column */
    margin-bottom: 12px;
}

.studio-mode-tabs--info {
    /* Info tabs in info column */
    position: static;
    margin-bottom: 12px;
}

.studio-shell {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 12px;
    align-items: start;
}

.studio-main-column {
    min-width: 0;
    display: grid;
    gap: 12px;
}

.studio-chat-box {
    border-radius: 14px;
    border: 1px solid var(--studio-border);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(8px);
    padding: 12px;
}

.studio-panels-wrapper {
    border-radius: 14px;
    border: 1px solid var(--studio-border);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(8px);
    padding: 12px;
}

.studio-info-column {
    min-width: 0;
    border-radius: 14px;
    border: 1px solid var(--studio-border);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(8px);
    padding: 12px;
}

.studio-workspace {
    min-width: 0;
    border-radius: 14px;
    border: 1px solid var(--studio-border);
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(8px);
    padding: 12px;
}

.studio-workspace--stack {
    display: grid;
    gap: 16px;
}

.studio-workspace--stack .studio-panel--workflow {
    border-radius: 12px;
    border: 1px solid rgba(172, 229, 255, 0.28);
    background: rgba(255, 255, 255, 0.04);
    padding: 12px;
    grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
    gap: 12px 16px;
}

.studio-workspace--stack .studio-panel--workflow>* {
    grid-column: 1;
}

.studio-workspace--stack .studio-panel--workflow::after {
    content: attr(data-panel-info);
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: stretch;
    border-radius: 12px;
    border: 1px solid rgba(171, 227, 251, 0.28);
    background: rgba(7, 30, 48, 0.45);
    color: #c9e7f8;
    padding: 10px;
    font-size: 0.76rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.studio-workspace--stack .studio-panel--workflow.studio-panel--info-left {
    grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
}

.studio-workspace--stack .studio-panel--workflow.studio-panel--info-left>* {
    grid-column: 2;
}

.studio-workspace--stack .studio-panel--workflow.studio-panel--info-left::after {
    grid-column: 1;
}

.studio-panel {
    display: grid;
    gap: 10px;
}

.studio-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.studio-panel__title {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: 1.02rem;
    letter-spacing: 0.01em;
}

.studio-section {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(154, 220, 248, 0.25);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.studio-section__title {
    margin: 0 0 14px 0;
    font-family: "Sora", sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--studio-accent-a);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.studio-divider {
    margin: 12px 0;
    padding: 8px 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--studio-muted);
    position: relative;
}

.studio-divider::before,
.studio-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: calc(50% - 24px);
    height: 1px;
    background: rgba(154, 220, 248, 0.2);
}

.studio-divider::before {
    left: 0;
}

.studio-divider::after {
    right: 0;
}

.studio-info-box {
    background: rgba(4, 20, 34, 0.6);
    border: 1px solid rgba(194, 237, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    color: rgba(194, 237, 255, 0.9);
}

.studio-info-box p {
    margin: 6px 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.studio-info-box strong {
    color: rgb(194, 237, 255);
}

.studio-overview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.studio-overview-card {
    border-radius: 10px;
    border: 1px solid rgba(172, 229, 255, 0.28);
    background: rgba(255, 255, 255, 0.06);
    padding: 10px;
    display: grid;
    gap: 8px;
    flex: 1 1 280px;
}

.studio-overview-card__title {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: 0.8rem;
}

.studio-overview-card__text {
    margin: 0;
    color: #d8ecf8;
    font-size: 0.76rem;
}

.studio-overview-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.studio-placeholder {
    border-radius: 10px;
    border: 1px dashed rgba(172, 229, 255, 0.35);
    background: rgba(7, 30, 48, 0.4);
    padding: 12px;
}

.studio-placeholder__title {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: 0.88rem;
}

.studio-placeholder__text {
    margin: 6px 0 0;
    color: #c8e5f6;
    font-size: 0.76rem;
}

.studio-copilot {
    min-width: 0;
    border-radius: 14px;
    border: 1px solid var(--studio-border);
    background: linear-gradient(152deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.05));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(8px);
    padding: 10px;
    display: grid;
    gap: 10px;
    max-height: calc(100dvh - 24px);
    overflow: auto;
}

.studio-copilot__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.studio-copilot__title {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: 0.95rem;
}

.studio-copilot__context {
    margin: 4px 0 0;
    color: #c9e7f8;
    font-size: 0.72rem;
}

.studio-copilot__chat-wrap {
    min-height: min(64vh, 700px);
}

.studio-copilot__section {
    border-radius: 10px;
    border: 1px solid rgba(172, 229, 255, 0.28);
    background: rgba(7, 30, 48, 0.32);
    padding: 14px;
    display: grid;
    gap: 14px;
}

.studio-copilot__section-title {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: 0.78rem;
    color: #dff3ff;
}

.studio-copilot__section-summary {
    cursor: pointer;
    font-family: "Sora", sans-serif;
    font-size: 0.78rem;
    color: #dff3ff;
}

.studio-copilot__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.studio-copilot__chip {
    border-radius: 999px;
    border: 1px solid rgba(190, 234, 255, 0.35);
    background: rgba(11, 52, 78, 0.42);
    color: #e1f4ff;
    min-height: 28px;
    padding: 0 11px;
    font-size: 0.73rem;
    cursor: pointer;
}

.studio-copilot__chip--empty {
    cursor: default;
    opacity: 0.86;
}

.studio-copilot__library {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.studio-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(180, 231, 255, 0.34);
    background: rgba(255, 255, 255, 0.06);
}

.studio-user__initials {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--studio-accent-a), var(--studio-accent-b));
    color: #04253a;
    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
}

.studio-user__label {
    color: #d8effd;
    font-size: 0.82rem;
}

.studio-btn {
    border: 1px solid rgba(174, 233, 255, 0.5);
    border-radius: 11px;
    min-height: 40px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--studio-text);
    font-family: "Sora", sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: filter 170ms ease, transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.studio-btn:hover,
.studio-btn:focus-visible {
    filter: brightness(1.08);
    transform: translateY(-1px);
    border-color: var(--studio-border-strong);
    box-shadow: 0 0 0 3px rgba(138, 223, 255, 0.18);
}

.studio-btn:focus-visible,
.studio-input:focus-visible {
    outline: 2px solid rgba(137, 224, 255, 0.62);
    outline-offset: 1px;
}

.studio-btn--primary {
    color: #04253a;
    background: linear-gradient(145deg, var(--studio-accent-b), var(--studio-accent-a));
}

.studio-btn--ghost {
    background: rgba(255, 255, 255, 0.05);
    color: #d6efff;
}

.studio-btn--danger {
    background: linear-gradient(145deg, #ff4444, #cc0000);
    color: #ffffff;
    border: 1px solid rgba(255, 100, 100, 0.5);
}

.studio-btn--danger:hover {
    background: linear-gradient(145deg, #ff6666, #ee1111);
    border-color: rgba(255, 120, 120, 0.7);
}

.studio-btn--info {
    background: linear-gradient(145deg, #4488ff, #0066cc);
    color: #ffffff;
    border: 1px solid rgba(100, 150, 255, 0.5);
}

.studio-btn--info:hover {
    background: linear-gradient(145deg, #6699ff, #1177ee);
    border-color: rgba(120, 170, 255, 0.7);
}

.studio-auth {
    border-radius: 14px;
    border: 1px solid rgba(255, 197, 180, 0.4);
    background: linear-gradient(145deg, rgba(255, 210, 185, 0.15), rgba(255, 255, 255, 0.05));
    padding: 14px;
}

.studio-auth__title {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: 1rem;
}

.studio-auth__desc {
    margin: 8px 0 14px;
    color: #f7ded3;
}

.studio-field-group {
    display: grid;
    gap: 5px;
}

.studio-label {
    font-size: 0.71rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--studio-muted);
}

.studio-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.studio-row>.studio-input,
.studio-row>select.studio-input {
    flex: 1 1 180px;
}

.studio-row--between {
    justify-content: space-between;
}

.studio-input {
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(173, 229, 255, 0.33);
    background: rgba(255, 255, 255, 0.08);
    color: var(--studio-text);
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.84rem;
    padding: 8px 10px;
}

select.studio-input {
    color: #e9f6ff;
    background: rgba(15, 50, 76, 0.72);
}

select.studio-input option {
    color: #082338;
    background: #eef7ff;
}

select.studio-input option:checked {
    color: #082338;
    background: #cfe7ff;
}

.studio-input::placeholder {
    color: #9fc5da;
}

.studio-input--short {
    max-width: 110px;
}

.studio-input--speed {
    min-height: 34px;
    max-width: 92px;
    margin-left: 6px;
}

.studio-textarea {
    min-height: 102px;
    resize: vertical;
}

.studio-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #beddf0;
}

.studio-list,
.studio-ops {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 7px;
    overflow: auto;
}

.studio-list {
    max-height: 170px;
}

.studio-list li,
.studio-ops__item {
    border-radius: 10px;
    border: 1px solid rgba(170, 229, 255, 0.27);
    background: rgba(255, 255, 255, 0.06);
    color: #ddf2fe;
    font-size: 0.78rem;
    padding: 8px;
}

.studio-list-item--clickable {
    cursor: pointer;
}

.studio-list-item--clickable:hover,
.studio-list-item--clickable:focus-visible {
    border-color: rgba(194, 237, 255, 0.64);
}

.studio-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.studio-list-item__thumbnail {
    flex-shrink: 0;
    width: 64px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(194, 237, 255, 0.2);
}

.studio-list-item__icon {
    flex-shrink: 0;
    width: 64px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border-radius: 4px;
    background: rgba(194, 237, 255, 0.1);
    border: 1px solid rgba(194, 237, 255, 0.2);
}

.studio-list-item__icon--video {
    cursor: pointer;
    background: rgba(100, 200, 255, 0.15);
    transition: all 0.2s ease;
}

.studio-list-item__icon--video:hover {
    background: rgba(100, 200, 255, 0.25);
    transform: scale(1.05);
}

.studio-list-item__content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.studio-list-item__delete {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 87, 87, 0.4);
    border-radius: 6px;
    background: rgba(255, 87, 87, 0.15);
    color: #ff8585;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.studio-list-item__delete:hover {
    background: rgba(255, 87, 87, 0.3);
    border-color: rgba(255, 87, 87, 0.6);
    color: #ffb3b3;
}

.studio-list-item__delete:active {
    transform: scale(0.95);
}

.studio-list-item__delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.studio-list-item__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

.studio-btn--small {
    padding: 4px 10px;
    font-size: 11px;
    min-height: 24px;
    border-radius: 4px;
    white-space: nowrap;
}

.studio-video {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(176, 230, 255, 0.24);
    background: rgba(0, 8, 15, 0.64);
    min-height: 188px;
}

.studio-range {
    width: 100%;
    accent-color: #8ed8ff;
}

.studio-time {
    margin: 0;
    font-size: 0.8rem;
    color: #d6ecfb;
}

.studio-ops {
    max-height: 320px;
}

.studio-ops__meta {
    margin: 0;
    color: #cbe8f8;
    font-size: 0.8rem;
}

.studio-ops__item {
    border-left: 3px solid rgba(150, 212, 242, 0.7);
}

.studio-ops__item--success {
    border-left-color: rgba(124, 242, 181, 0.84);
}

.studio-ops__item--error {
    border-left-color: rgba(255, 173, 157, 0.95);
}

.studio-ops__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.studio-ops__action {
    font-family: "Sora", sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #d8f2ff;
}

.studio-ops__time {
    color: #96bed5;
    font-size: 0.72rem;
}

.studio-ops__message {
    margin-top: 4px;
    color: #d7eefc;
    font-size: 0.78rem;
    line-height: 1.35;
}

.studio-status {
    margin: 0;
    min-height: 1.2em;
    color: #bfddee;
    font-size: 0.84rem;
}

.studio-status--success {
    color: var(--studio-ok);
}

.studio-status--error {
    color: var(--studio-error);
}

.studio-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.studio-chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 560px;
    width: 100%;
}

.studio-chat__sidebar {
    border-radius: 12px;
    border: 1px solid rgba(166, 223, 249, 0.3);
    background: rgba(4, 20, 34, 0.5);
    padding: 10px;
    display: grid;
    gap: 9px;
    align-content: start;
}

.studio-chat__search {
    min-height: 38px;
}

.studio-chat__history-status {
    margin: 0;
    min-height: 1.15em;
    color: #b8d9ee;
    font-size: 0.76rem;
}

.studio-chat__history-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
    max-height: 420px;
    overflow: auto;
}

.studio-chat__history-empty {
    margin: 0;
    color: #aacde0;
    font-size: 0.8rem;
}

.studio-chat__main {
    min-width: 0;
    border-radius: 12px;
    border: 1px solid rgba(166, 223, 249, 0.3);
    background: rgba(4, 20, 34, 0.42);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.studio-chat__main--full {
    /* Full width when sidebar is removed */
    flex: 1;
    width: 100%;
}

.studio-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.studio-chat__title {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    color: #ddf2ff;
}

.studio-chat__guide {
    border: 1px solid rgba(180, 229, 251, 0.25);
    border-radius: 10px;
    background: rgba(6, 32, 52, 0.52);
    padding: 9px;
    display: grid;
    gap: 7px;
}

.studio-chat__guide-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.studio-chat__guide-prompts-title,
.studio-chat__guide-subtitle {
    margin: 0;
    color: #c7e7fa;
    font-size: 0.78rem;
}

.studio-chat__guide-toggle {
    border-radius: 9px;
    border: 1px solid rgba(190, 234, 255, 0.35);
    background: rgba(11, 52, 78, 0.46);
    color: #e1f4ff;
    min-height: 30px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    cursor: pointer;
}

.studio-chat__guide-toggle-arrow {
    display: inline-block;
    transition: transform 150ms ease;
}

.studio-chat__guide-toggle[aria-expanded="false"] .studio-chat__guide-toggle-arrow {
    transform: rotate(-90deg);
}

.studio-chat__guide-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.studio-chat__guide-chip {
    border-radius: 999px;
    border: 1px solid rgba(190, 234, 255, 0.35);
    background: rgba(11, 52, 78, 0.42);
    color: #e1f4ff;
    min-height: 28px;
    padding: 0 11px;
    font-size: 0.73rem;
    cursor: pointer;
}

.studio-chat__guide-body {
    display: grid;
    gap: 8px;
    overflow: hidden;
    max-height: 420px;
    opacity: 1;
    transition: max-height 220ms ease, opacity 170ms ease;
}

.studio-chat__guide.is-collapsed .studio-chat__guide-body {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.studio-chat__guide-steps {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 7px;
}

.studio-chat__guide-step {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.studio-chat__guide-index {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(194, 237, 255, 0.62);
    display: inline-grid;
    place-items: center;
    color: #e8f7ff;
    font-size: 0.69rem;
}

.studio-chat__guide-step-title {
    margin: 0;
    color: #e4f4ff;
    font-size: 0.78rem;
}

.studio-chat__guide-step-desc {
    margin: 2px 0 0;
    color: #b8d8ea;
    font-size: 0.74rem;
    line-height: 1.35;
}

.studio-chat__messages {
    border-radius: 10px;
    border: 1px solid rgba(180, 229, 251, 0.25);
    background: rgba(2, 15, 27, 0.54);
    padding: 10px;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 8px;
    flex: 1;
    min-height: 200px;
    max-height: 420px;
}

.studio-chat__form {
    display: grid;
    gap: 8px;
    flex-shrink: 0;
}

.studio-chat__composer {
    position: relative;
    width: 100%;
}

.studio-chat__file-input {
    display: none !important;
}

.studio-chat__input {
    min-height: 120px;
    resize: vertical;
    max-height: 280px;
    width: 100%;
    padding: 12px 110px 14px 14px;
}

.studio-chat__input.has-attachments {
    padding-bottom: 52px;
}

.studio-chat__actions {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.studio-chat__action {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: transparent;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 200ms ease;
    color: #9ac8de;
}

.studio-chat__action:hover {
    color: #8ef5bf;
    transform: scale(1.12);
}

.studio-chat__action:focus-visible {
    outline: 2px solid #8ef5bf;
    outline-offset: 2px;
    color: #8ef5bf;
}

.studio-chat__action svg {
    width: 24px;
    height: 24px;
    display: block;
    flex-shrink: 0;
}

.studio-chat__attachments-overlay {
    /* Legacy - kept for backward compatibility if needed */
    display: none;
}

.studio-chat__attachments-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 0;
    min-height: 0;
}

.studio-chat__attachments-preview:empty {
    display: none;
    padding: 0;
}

.studio-chat__attachment-item {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid rgba(176, 230, 255, 0.32);
    background: rgba(7, 35, 53, 0.72);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 180ms ease;
    overflow: hidden;
}

.studio-chat__attachment-item:hover {
    border-color: rgba(176, 230, 255, 0.58);
    transform: scale(1.08);
}

.studio-chat__attachment-item[data-file-type="pdf"] .studio-chat__attachment-thumb {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.3), rgba(255, 159, 28, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: #ffcbcb;
}

.studio-chat__attachment-thumb {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 7px;
    display: block;
}

.studio-chat__attachment-info {
    display: none;
}

.studio-chat__attachment-name {
    display: none;
}

.studio-chat__attachment-size {
    display: none;
}

.studio-chat__attachment-item-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    background: rgba(220, 38, 38, 0.95);
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0;
    transition: all 160ms ease;
    z-index: 3;
}

.studio-chat__attachment-item:hover .studio-chat__attachment-item-remove {
    opacity: 1;
}

.studio-chat__attachment-item-remove:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.15);
}

.studio-chat__attachment-item-remove:focus-visible {
    outline: 2px solid #8ef5bf;
    outline-offset: 1px;
}

.studio-chat__hint {
    margin: 0;
    color: #a8cbe1;
    font-size: 0.75rem;
}

/* Lightbox for image preview */
.studio-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.studio-lightbox.is-active {
    display: flex;
}

.studio-lightbox__image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.studio-lightbox__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    border: none;
    color: #fff;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 200ms ease;
}

.studio-lightbox__close:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

.studio-chat__attachment {
    border-radius: 10px;
    border: 1px solid rgba(176, 230, 255, 0.32);
    background: rgba(7, 35, 53, 0.47);
    padding: 8px;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.studio-chat__attachment-image {
    width: 62px;
    height: 62px;
    object-fit: cover;
    border-radius: 9px;
    border: 1px solid rgba(174, 231, 255, 0.35);
}

.studio-chat__attachment-meta {
    color: #d3ecfb;
    font-size: 0.76rem;
    word-break: break-word;
}

.studio-chat__attachment-remove {
    border-radius: 8px;
    border: 1px solid rgba(255, 169, 158, 0.6);
    background: rgba(96, 22, 16, 0.43);
    color: #ffd8d3;
    min-width: 30px;
    min-height: 30px;
    cursor: pointer;
}

.studio-chat__row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.studio-chat__row--user {
    justify-content: flex-end;
}

.studio-chat__row--assistant {
    justify-content: flex-start;
}

.studio-chat__bubble {
    max-width: min(74ch, 100%);
    border-radius: 12px;
    border: 1px solid rgba(172, 229, 255, 0.32);
    padding: 8px 10px;
    font-size: 0.79rem;
    line-height: 1.45;
    color: #e4f5ff;
    background: rgba(9, 41, 63, 0.55);
    white-space: pre-wrap;
    word-break: break-word;
}

.studio-chat__row--user .studio-chat__bubble {
    background: rgba(17, 66, 99, 0.64);
    border-color: rgba(165, 221, 248, 0.52);
}

.studio-chat__row--typing .studio-chat__bubble {
    font-style: italic;
    color: #b5d8ee;
}

.studio-chat__confirm-card {
    width: min(72ch, 100%);
    border-radius: 12px;
    border: 1px solid rgba(170, 228, 255, 0.36);
    background: rgba(8, 35, 56, 0.62);
    padding: 10px;
    display: grid;
    gap: 8px;
}

.studio-chat__confirm-title {
    margin: 0;
    font-family: "Sora", sans-serif;
    font-size: 0.79rem;
    color: #e5f6ff;
}

.studio-chat__confirm-text {
    margin: 0;
    color: #c8e7f8;
    font-size: 0.76rem;
    line-height: 1.4;
}

.studio-chat__message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.studio-chat__message-attachment {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(176, 230, 255, 0.25);
    transition: all 180ms ease;
}

.studio-chat__message-attachment:hover {
    transform: scale(1.05);
    border-color: rgba(176, 230, 255, 0.5);
}

.studio-chat__message-attachment img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.studio-chat__message-attachment[data-type="pdf"] {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.25), rgba(255, 159, 28, 0.25));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #ffcbcb;
}

.studio-chat__confirm-risk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    border-radius: 999px;
    border: 1px solid rgba(255, 211, 150, 0.55);
    background: rgba(121, 72, 16, 0.32);
    color: #ffe2bf;
    font-size: 0.71rem;
    padding: 3px 9px;
}

.studio-chat__confirm-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.studio-chat__confirm-button {
    border-radius: 9px;
    border: 1px solid rgba(177, 232, 255, 0.45);
    background: rgba(18, 64, 95, 0.45);
    color: #e6f6ff;
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.73rem;
    cursor: pointer;
}

.studio-chat__confirm-button--confirm {
    border-color: rgba(149, 236, 196, 0.58);
    background: rgba(18, 85, 63, 0.48);
}

.studio-chat__confirm-button--cancel {
    border-color: rgba(255, 184, 171, 0.56);
    background: rgba(96, 29, 21, 0.44);
}

.studio-chat__history-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.studio-chat__history-item {
    border-radius: 10px;
    border: 1px solid rgba(170, 229, 255, 0.28);
    background: rgba(255, 255, 255, 0.05);
    color: #dcf3ff;
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    min-height: 40px;
}

.studio-chat__history-item.is-active {
    border-color: rgba(181, 234, 255, 0.7);
    background: rgba(19, 74, 110, 0.48);
}

.studio-chat__history-title {
    margin: 0;
    font-size: 0.82rem;
    color: #e5f6ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.studio-chat__history-meta {
    display: none;
}

.studio-chat__history-delete {
    border-radius: 9px;
    border: 1px solid rgba(255, 181, 171, 0.44);
    background: rgba(111, 27, 20, 0.36);
    color: #ffd9d3;
    min-width: 34px;
    min-height: 34px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.studio-chat__history-delete.is-confirm {
    border-color: rgba(255, 136, 122, 0.85);
    background: rgba(138, 25, 15, 0.58);
}

@keyframes studio-rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1120px) {
    .studio-chat {
        grid-template-columns: 1fr;
    }

    .studio-chat__sidebar {
        order: 2;
        background: rgb(4, 20, 34);
    }

    .studio-chat__main {
        order: 1;
        min-height: 0;
    }
}

/* ============================================
   MOBILE STYLES (< 760px)
   Touch-optimized UI with proper spacing
   ============================================ */
@media (max-width: 760px) {

    /* Layout adjustments */
    .studio-shell {
        grid-template-columns: 1fr;
    }

    .studio-info-column {
        display: none;
    }

    .studio-row {
        flex-direction: column;
        align-items: stretch;
    }

    .studio-input--short,
    .studio-input--speed {
        max-width: none;
    }

    /* Chat container */
    .studio-chat {
        min-height: 0;
    }

    .studio-chat__main {
        min-height: 0;
        padding: 16px !important;
        gap: 16px;
    }

    /* Chat header */
    .studio-chat__header {
        margin-bottom: 12px;
    }

    /* Chat messages area */
    .studio-chat__messages {
        margin-bottom: 16px;
    }

    /* Chat form */
    .studio-chat__form {
        gap: 12px;
    }

    /* Copilot header on mobile */
    .studio-copilot__head {
        padding: 12px 16px !important;
    }

    /* Copilot context text (project subtitle) - proper wrapping */
    .studio-copilot__context {
        font-size: 0.7rem !important;
        line-height: 1.4 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
        margin-top: 6px !important;
    }

    /* Sidebar (Chat History Drawer) - HIDDEN ON MOBILE */
    .studio-chat__sidebar {
        display: none !important;
    }

    /* Guide (production steps) - HIDDEN ON MOBILE */
    .studio-chat__guide {
        display: none !important;
    }

    /* Copilot sections (Suggested Actions, Command Search, Library, Backend History) - HIDDEN ON MOBILE */
    .studio-copilot__section {
        display: none !important;
    }

    /* Composer */
    .studio-chat__composer {
        position: relative;
    }

    .studio-chat__actions {
        right: 8px;
        bottom: 8px;
        gap: 6px;
    }

    .studio-chat__attachments-overlay {
        right: 62px;
        bottom: 8px;
        gap: 4px;
        max-width: calc(100% - 170px);
    }

    .studio-chat__attachment-item {
        width: 34px;
        height: 34px;
    }

    .studio-chat__attachment-thumb {
        width: 34px;
        height: 34px;
    }

    .studio-chat__attachment-item-remove {
        width: 14px;
        height: 14px;
        font-size: 10px;
        top: 1px;
        right: 1px;
    }

    .studio-chat__action {
        width: 40px;
        height: 40px;
    }

    .studio-chat__action svg {
        width: 16px;
        height: 16px;
    }

    .studio-chat__input {
        padding: 10px 100px 12px 12px;
    }

    .studio-chat__input.has-attachments {
        padding-right: 170px;
    }

    /* Attachment preview */
    .studio-chat__attachment {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .studio-chat__attachment-remove {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 44px;
    }
}

@media (min-width: 1440px) {
    .studio-page {
        width: min(1760px, calc(100% - 28px));
    }
}

@media (max-width: 1439px) {
    .studio-shell {
        grid-template-columns: 1fr;
    }

    .studio-workspace {
        min-height: 56vh;
    }

    .studio-copilot__chat-wrap {
        min-height: 0;
    }

    .studio-chat {
        min-height: 0;
    }

    .studio-chat__main {
        min-height: 0;
        grid-template-rows: auto auto minmax(160px, 1fr) auto;
    }

    .studio-chat__messages {
        min-height: 160px;
        max-height: 34dvh;
    }
}

@media (max-width: 1260px) {
    .studio-project-status__metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

}

@media (max-width: 1023px) {
    .studio-page {
        width: min(calc(100% - 16px), 100%);
        margin: 10px auto 16px;
        gap: 10px;
    }

    .studio-mode-tabs {
        top: 6px;
        justify-content: space-between;
    }

    .studio-mode-tab {
        min-width: 38px;
        padding: 0 8px;
    }

    .studio-mode-tab__icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        border-radius: 999px;
        border: 1px solid rgba(184, 231, 255, 0.42);
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 0.02em;
    }

    .studio-mode-tab__label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .studio-copilot {
        width: min(520px, calc(100vw - 8px));
    }

}

@media (max-width: 767px) {
    .studio-project-status {
        padding: 10px;
    }

    .studio-project-status__subtitle {
        font-size: 0.76rem;
    }

    .studio-project-status__metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .studio-metric {
        padding: 6px 8px;
    }

    .studio-metric__value {
        font-size: 0.78rem;
    }

    .studio-project-status__actions {
        gap: 6px;
    }

    .studio-project-status__head {
        padding-right: 104px;
    }

    .studio-lang-switch {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 3;
    }

    .studio-fullscreen-btn {
        top: 10px;
        right: 115px;
    }

    .studio-btn {
        min-height: 36px;
        font-size: 0.73rem;
    }

    #bcgAiCheckModels {
        display: none !important;
    }

    .studio-copilot {
        width: 100vw;
        max-width: 100vw;
    }

    .studio-copilot__chat-wrap {
        min-height: 0;
    }

    .studio-chat__history-list {
        max-height: 30dvh;
    }

    .studio-chat__messages {
        max-height: 28dvh;
    }
}

@media (min-width: 1280px) {
    .studio-shell {
        grid-template-columns: minmax(0, 70%) minmax(0, 30%);
        gap: 16px;
    }

    .studio-workspace {
        padding: 14px;
    }
}

/* Media Preview Modal */
.studio-media-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.studio-media-modal[hidden] {
    display: none;
}

.studio-media-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.studio-media-modal__content {
    position: relative;
    z-index: 1;
    max-width: 95vw;
    max-height: 95vh;
    width: min(1100px, 95vw);
    background: rgba(4, 20, 34, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(194, 237, 255, 0.3);
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.studio-media-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgb(194, 237, 255);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
}

.studio-media-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.studio-media-modal__body {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: calc(95vh - 72px);
    min-height: 0;
    overflow-y: auto;
}

.studio-media-modal__body img,
.studio-media-modal__body video {
    max-width: 100%;
    max-height: calc(95vh - 40px);
    object-fit: contain;
    border-radius: 8px;
}

.studio-media-modal__body video {
    background: #000;
}

/* Make thumbnails clickable */
.studio-list-item__thumbnail {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.studio-list-item__thumbnail:hover {
    transform: scale(1.05);
    opacity: 0.9;
}