.shell-app.is-script-view .shell-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0;
    min-height: calc(100vh - var(--shell-header-height));
}

.shell-app.is-script-view .shell-content,
.shell-app.is-script-view .shell-panel {
    min-width: 0;
    min-height: 0;
}

.shell-app.is-script-view .shell-panel {
    width: 100%;
    min-height: calc(100vh - var(--shell-header-height));
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.shell-app.is-script-view .explorer-shell[data-explorer-view="script"] {
    grid-template-columns: 300px minmax(0, 1fr) 340px;
    width: 100%;
    min-height: calc(100vh - var(--shell-header-height));
    height: calc(100vh - var(--shell-header-height));
}

.shell-app.is-script-view .explorer-shell[data-explorer-view="script"].explorer-shell--left-collapsed {
    grid-template-columns: 52px minmax(0, 1fr) 340px;
}

.shell-app.is-script-view .explorer-shell[data-explorer-view="script"].explorer-shell--right-collapsed {
    grid-template-columns: 300px minmax(0, 1fr) 52px;
}

.shell-app.is-script-view .explorer-shell[data-explorer-view="script"].explorer-shell--left-collapsed.explorer-shell--right-collapsed {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
}

.shell-app.is-script-view .explorer-shell[data-explorer-view="script"] .explorer-shell__panel {
    position: static;
    align-self: stretch;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.shell-app.is-script-view .explorer-shell[data-explorer-view="script"] .explorer-shell__panel-body {
    min-height: 0;
    max-height: none;
    overflow: auto;
}

.shell-app.is-script-view .explorer-shell[data-explorer-view="script"] .explorer-shell__main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.shell-app.is-script-view .explorer-shell[data-explorer-view="script"] .explorer-shell__content {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.script-editor__left-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    height: 100%;
}

.script-editor__navigation {
    min-height: 0;
    overflow: auto;
}

.script-editor__inspector {
    min-height: 0;
}

.script-editor__tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 10px 10px 8px;
    border-bottom: 1px solid var(--shell-line);
}

.script-editor__tab {
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--shell-text-soft);
    padding: 8px 4px;
    font: inherit;
    font-size: 12px;
    cursor: default;
}

.script-editor__tab.is-active {
    border-color: var(--shell-accent);
    color: var(--shell-text);
}

.script-editor__tab:disabled {
    opacity: 0.58;
}

.script-editor__search {
    display: grid;
    gap: 6px;
    padding: 12px;
}

.script-editor__search input {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background: var(--shell-control);
    color: var(--shell-text);
    padding: 0 10px;
}

.script-editor__nav-act,
.script-editor__nav-group {
    display: grid;
    gap: 6px;
}

.script-editor__nav-act {
    padding: 4px 8px 10px;
}

.script-editor__nav-act-title,
.script-editor__nav-group-title {
    border: 0;
    background: transparent;
    color: var(--shell-text-soft);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0;
    font-size: 11px;
    padding: 8px 6px 4px;
}

.script-editor__nav-list {
    display: grid;
    gap: 4px;
}

.script-editor__nav-scene {
    display: grid;
    grid-template-columns: 14px 44px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 52px;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--shell-text);
    padding: 5px 7px;
    text-align: left;
    cursor: pointer;
}

.script-editor__nav-scene:hover,
.script-editor__nav-scene.is-active {
    border-color: color-mix(in srgb, var(--shell-accent) 48%, transparent);
    background: color-mix(in srgb, var(--shell-accent) 16%, transparent);
}

.script-editor__nav-grip {
    color: var(--shell-text-soft);
    font-size: 11px;
    letter-spacing: 0;
}

.script-editor__nav-thumb {
    display: grid;
    place-items: center;
    width: 44px;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--shell-control);
    color: var(--shell-text-soft);
    font-size: 11px;
}

.script-editor__nav-thumb img,
.script-editor__scene-gutter img,
.script-editor__inspector-thumb,
.script-editor__character-chip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.script-editor__nav-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.script-editor__nav-title,
.script-editor__nav-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.script-editor__nav-title {
    font-size: 12px;
    font-weight: 650;
}

.script-editor__nav-meta {
    color: var(--shell-text-soft);
    font-size: 11px;
}

.script-editor__block-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.script-editor__block-type .shell-field-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.script-editor__toolbar-note,
.script-editor__save-state,
.script-editor__zoom {
    color: var(--shell-text-soft);
    font-size: 12px;
    white-space: nowrap;
}

.script-editor__format-preview {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.script-editor__format-preview button,
.script-editor__icon-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background: var(--shell-control);
    color: var(--shell-text);
}

.script-editor__format-preview button:disabled,
.script-editor__icon-button:disabled {
    opacity: 0.72;
}

.script-editor__paper-shell {
    height: 100%;
    overflow: auto;
    padding: 28px 42px 56px;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--shell-control) 86%, transparent), transparent 34%),
        var(--shell-panel);
}

.script-editor__paper {
    display: grid;
    gap: 0;
    max-width: 920px;
    margin: 0 auto;
}

.script-editor__paper-scene {
    display: grid;
    grid-template-columns: 96px minmax(0, 720px);
    gap: 20px;
    align-items: start;
    padding: 20px 0;
    scroll-margin-top: 18px;
}

.script-editor__paper-scene + .script-editor__paper-scene {
    border-top: 1px solid color-mix(in srgb, var(--shell-line) 70%, transparent);
}

.script-editor__paper-scene.is-active .script-editor__scene-page {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--shell-accent) 28%, transparent), 0 18px 60px rgba(0, 0, 0, 0.18);
}

.script-editor__scene-gutter {
    position: sticky;
    top: 18px;
    display: grid;
    place-items: center;
    width: 88px;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--shell-control);
    color: var(--shell-text-soft);
    font-size: 12px;
}

.script-editor__scene-page {
    min-height: 420px;
    background: #f8f7f2;
    color: #171717;
    padding: 54px 64px;
    border-radius: 2px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
    line-height: 1.42;
}

.script-editor__block {
    margin: 0 0 14px;
    white-space: pre-wrap;
}

.script-editor__block-wrap {
    position: relative;
    margin: 0 0 14px;
    border-radius: 4px;
}

.script-editor__block-wrap--virtual {
    opacity: 0.72;
}

.script-editor__block-wrap.is-selected {
    outline: 1px solid rgba(47, 129, 247, 0.45);
    outline-offset: 3px;
}

.script-editor__block-editor {
    display: block;
    width: 100%;
    min-height: 22px;
    margin: 0;
    padding: 0;
    border: 0;
    resize: none;
    overflow: hidden;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    outline: 0;
}

.script-editor__block-editor::placeholder {
    color: rgba(23, 23, 23, 0.42);
}

.script-editor__block-wrap--parenthetical {
    display: flex;
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
}

.script-editor__block-wrap--parenthetical::before {
    content: "(";
}

.script-editor__block-wrap--parenthetical::after {
    content: ")";
}

.script-editor__block-wrap--parenthetical .script-editor__block--parenthetical {
    display: inline-block;
    width: auto;
    min-width: 1ch;
    max-width: 34ch;
    margin-bottom: 0;
    text-align: left;
    vertical-align: top;
}

.script-editor__block-save-state {
    position: absolute;
    right: -52px;
    top: 0;
    color: #6b6b6b;
    font-family: Arial, sans-serif;
    font-size: 10px;
    opacity: 0;
    pointer-events: none;
}

.script-editor__block-wrap.is-selected .script-editor__block-save-state,
.script-editor__block-save-state.is-error {
    opacity: 1;
}

.script-editor__block-save-state.is-error {
    color: #b42318;
}

.script-editor__scene-heading-button {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.script-editor__block--scene-heading,
.script-editor__block--scene_heading,
.script-editor__block--transition,
.script-editor__block--shot,
.script-editor__block--act {
    text-transform: uppercase;
    font-weight: 700;
}

.script-editor__block--scene-heading,
.script-editor__block--scene_heading {
    background: #d7e8ff;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    display: block;
    padding: 1px 3px;
}

.script-editor__block--character {
    width: 48%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
}

.script-editor__dialogue-block {
    width: 58%;
    margin: 0 auto 14px;
}

.script-editor__block-wrap--dialogue {
    width: 58%;
    margin-left: auto;
    margin-right: auto;
}

.script-editor__block--dialogue,
.script-editor__block--parenthetical {
    margin-bottom: 8px;
}

.script-editor__block--parenthetical {
    text-align: center;
}

.script-editor__block--transition {
    text-align: right;
}

.script-editor__block--act {
    text-align: center;
    border-top: 1px solid #171717;
    border-bottom: 1px solid #171717;
    padding: 7px 0;
}

.script-editor__empty-scene {
    margin: 18px 0 0;
    color: #6b6b6b;
    font-family: Arial, sans-serif;
    font-size: 12px;
}

.script-editor__inspector {
    display: grid;
    gap: 14px;
    padding: 14px;
}

.script-editor__inspector-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background: var(--shell-control);
}

.script-editor__inspector-section {
    display: grid;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--shell-line);
}

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

.script-editor__character-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.script-editor__character-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    border: 1px solid var(--shell-line);
    border-radius: 999px;
    background: var(--shell-control);
    padding: 5px 9px 5px 5px;
    font-size: 12px;
}

.script-editor__character-chip img {
    width: 24px;
    height: 24px;
    border-radius: 999px;
}

@media (max-width: 980px) {
    .shell-app.is-script-view .explorer-shell[data-explorer-view="script"],
    .shell-app.is-script-view .explorer-shell[data-explorer-view="script"].explorer-shell--left-collapsed,
    .shell-app.is-script-view .explorer-shell[data-explorer-view="script"].explorer-shell--right-collapsed,
    .shell-app.is-script-view .explorer-shell[data-explorer-view="script"].explorer-shell--left-collapsed.explorer-shell--right-collapsed {
        grid-template-columns: 1fr;
        height: auto;
        min-height: calc(100vh - var(--shell-header-height));
    }

    .shell-app.is-script-view .explorer-shell[data-explorer-view="script"] .explorer-shell__panel,
    .shell-app.is-script-view .explorer-shell[data-explorer-view="script"] .explorer-shell__main {
        height: auto;
    }

    .script-editor__paper-shell {
        padding: 18px;
    }

    .script-editor__paper-scene {
        grid-template-columns: minmax(0, 1fr);
    }

    .script-editor__scene-gutter {
        position: static;
        width: 112px;
    }

    .script-editor__scene-page {
        padding: 36px 24px;
    }
}
