/* The artwork, progress and actions belong to the entire creation screen. */
.mivo-play-design .script-entry-stage.entry-fullscreen {
    padding:0;
    background:var(--body-bg-color);
}
.script-character-card.script-entry-wizard {
    --entry-accent:var(--focus-color);
    --entry-ink:var(--main-color);
    --entry-muted:var(--muted-color);
    --entry-line:var(--script-line,var(--main-border-color));
    --entry-control:var(--script-surface,var(--main-bg-color));
    --entry-canvas:var(--body-bg-color);
    --entry-on-accent:var(--beauty-on-accent,#fff);
    --entry-gutter:clamp(16px,2.15vw,44px);
    --entry-width:610px;
    --entry-left:max(var(--entry-gutter),var(--mivo-cutout-left,env(safe-area-inset-left,0px)));
    --entry-right:max(var(--entry-gutter),var(--mivo-cutout-right,env(safe-area-inset-right,0px)));
    position:relative;isolation:isolate;display:flex;flex-direction:column;
    width:100%;height:100%;min-height:0;max-width:none;max-height:100%;margin:0;
    border:0;border-radius:0;box-shadow:none;color:var(--entry-ink);
    background:var(--entry-canvas);
    font-family:inherit;
}
.script-entry-wizard .entry-cover,.script-entry-wizard::before {
    position:absolute;inset:0;width:100%;height:100%;pointer-events:none;
}
.script-entry-wizard .entry-cover {z-index:-2;object-fit:cover;object-position:center 40%;filter:blur(4px);opacity:.36;transform:scale(1.025)}
.script-entry-wizard::before {
    content:"";z-index:-1;
    background:linear-gradient(to bottom,var(--entry-canvas),transparent 28%);
}
.script-entry-wizard .entry-topbar {
    flex:none;display:flex;align-items:center;gap:14px;
    padding:calc(4px + var(--mivo-cutout-top,env(safe-area-inset-top,0px))) var(--entry-right) 0 var(--entry-left);
    background:var(--entry-canvas);
}
/* Carry the visible cover color behind the controls and through the system inset. */
.entry-fullscreen > .script-entry-wizard {
    --entry-safe-top:var(--mivo-cutout-top,env(safe-area-inset-top,0px));
}
.entry-fullscreen > .script-entry-wizard::before {
    background:var(--entry-edge-color,var(--entry-canvas));
    -webkit-mask-image:linear-gradient(#000 var(--entry-safe-top),transparent calc(var(--entry-safe-top) + max(110px,17%)));
    mask-image:linear-gradient(#000 var(--entry-safe-top),transparent calc(var(--entry-safe-top) + max(110px,17%)));
}
.entry-fullscreen > .script-entry-wizard > .entry-topbar {background:transparent}
.script-entry-wizard .entry-progress {flex:1;min-width:0;display:flex;gap:clamp(2px,.35vw,7px);margin:8px 0}
.entry-progress>span {min-width:0;flex:1;height:3px;border-radius:2px;background:var(--entry-line)}
.entry-progress>.is-lit {background:var(--entry-accent)}
.mivo-play-design #mivo-script-root>.entry-header {display:none}
.script-entry-wizard .entry-exit {
    display:inline-flex;align-items:center;justify-content:center;gap:6px;
    flex:none;min-height:40px;padding:0 8px;color:var(--entry-ink);font-size:13px;line-height:1;
    background:transparent;border:0;box-shadow:none;text-decoration:none;
}
.script-entry-wizard .entry-exit .script-exit-icon {display:grid;place-items:center;width:14px;height:14px}
.script-entry-wizard .entry-exit svg {display:block;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.script-entry-wizard .entry-exit:hover,.script-entry-wizard .entry-exit:focus-visible {color:var(--entry-accent)}
.script-entry-wizard .entry-scroll {
    flex:1;min-height:0;display:flex;flex-direction:column;overflow:auto;overscroll-behavior:contain;
    padding:clamp(14px,2.7vh,28px) var(--entry-right) 12px var(--entry-left);
    scrollbar-width:none;
}
.script-entry-wizard :is(.entry-scroll,textarea,.script-character-presets)::-webkit-scrollbar {display:none}
.script-entry-wizard .entry-content {
    flex:1 0 auto;display:flex;flex-direction:column;min-width:0;width:min(100%,var(--entry-width));margin:0 auto;
}
.script-entry-wizard .entry-heading {flex:none;margin:0 0 clamp(14px,2.8vh,28px);color:var(--entry-accent);text-align:center}
.script-entry-wizard .entry-caption {display:flex;justify-content:center;align-items:baseline;flex-wrap:wrap;gap:12px;margin:0 0 5px;font-size:13px;letter-spacing:.12em;line-height:1.55;color:var(--entry-ink)}
.script-entry-wizard .entry-caption span {font-size:12px;font-variant-numeric:tabular-nums;letter-spacing:.1em}
.script-entry-wizard .entry-heading h2 {margin:0;color:var(--entry-accent);font-family:"Songti SC","Noto Serif CJK SC","STSong",serif;font-size:clamp(26px,2.7vw,40px);font-weight:650;line-height:1.25;overflow-wrap:anywhere;outline:0}
.script-entry-wizard .entry-fields {
    display:grid;align-content:start;gap:clamp(18px,2.8vh,28px);min-width:0;
    width:100%;margin:auto 0;
}
.script-entry-wizard .script-character-avatar-row {display:flex;align-items:center;justify-content:flex-start;gap:12px;margin:0}
.script-entry-wizard .script-character-upload {
    display:flex;flex-direction:row;justify-content:flex-start;align-items:center;gap:12px;margin:0;
    padding:0 14px 0 0;border:0;background:transparent;color:var(--entry-ink);
}
.script-entry-wizard .script-character-avatar {
    width:54px;height:54px;border:1px solid var(--entry-line);border-radius:50%;
    background:var(--entry-control);color:var(--entry-accent);
}
.script-entry-wizard .script-character-avatar svg {width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.5}
.script-entry-wizard .script-character-upload>span {color:inherit;font-size:14px}
.script-entry-wizard .script-character-field,.script-entry-wizard .script-character-info {min-width:0;margin:0;padding:0}
.script-entry-wizard .script-character-field legend,.script-entry-wizard .script-character-label,.script-entry-wizard label>.script-field-heading {margin:0 0 9px;font-size:15px;color:var(--entry-ink)}
.script-entry-wizard .script-field-heading {display:flex;gap:7px;align-items:baseline;color:inherit}
.script-entry-wizard .script-field-requirement {font-size:12px;color:var(--entry-ink)}
.script-entry-wizard .script-field-requirement.is-required {color:var(--entry-accent)}
.script-entry-wizard .script-character-help,.script-entry-wizard .script-subtle {color:var(--entry-muted);overflow-wrap:anywhere}
.script-entry-wizard :is(.script-character-choices):not(.script-mode-options) {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.script-entry-wizard .script-character-choice.is-long {grid-column:1/-1}
.script-character-card.script-entry-wizard .script-character-choice>span,
.script-character-card.script-entry-wizard .script-input {
    display:flex;align-items:center;justify-content:flex-start;min-height:45px;height:auto;
    padding:10px 14px;border:1px solid var(--entry-line);border-radius:9px;
    background:var(--entry-control);color:var(--entry-ink);font-size:16px;
    line-height:1.55;text-align:left;white-space:pre-wrap;overflow-wrap:anywhere;
}
.script-entry-wizard .script-input::placeholder {color:var(--entry-muted)}
.script-character-card.script-entry-wizard .script-character-choice>input:checked+span,
.script-entry-wizard .script-mode-choice>input:checked+.script-mode-card {
    border-color:var(--entry-accent);color:var(--entry-on-accent);background:var(--entry-accent);
    box-shadow:inset 0 0 0 1px var(--entry-accent);
}
.script-character-card.script-entry-wizard .script-mode-choice>input:checked+.script-mode-card .script-mode-summary {color:inherit}
.script-character-card.script-entry-wizard .script-mode-choice>input:checked+.script-mode-card::after {border-color:currentColor}
.script-entry-wizard .script-mode-card {background:var(--entry-control);border-color:var(--entry-line)}
@supports not (color:color-mix(in srgb,red,blue)) {
    .script-entry-wizard .script-mode-wireframe {--wire-ink:var(--entry-line)}
}
.script-entry-wizard .script-character-presets {margin-top:8px;max-height:none;overflow:visible}
.script-entry-wizard .script-character-presets .but,.script-entry-wizard .script-character-avatar-row .but {
    background:var(--entry-control);border:1px solid var(--entry-line);color:var(--entry-accent);
}
.script-entry-wizard .entry-field-help {margin:0 0 8px;font-size:13px;font-weight:400;line-height:1.6;color:var(--entry-ink);white-space:pre-wrap;overflow-wrap:anywhere}
.script-entry-wizard .script-attribute-roll-all,.script-entry-wizard .script-attribute-dice {min-height:38px;padding:4px 10px;white-space:nowrap;background:var(--entry-control);color:var(--entry-accent);border:1px solid var(--entry-line);border-radius:8px;font-size:13px}
.script-entry-wizard .script-attribute-roll-all {display:block;min-height:44px;margin:4px 0 0 auto}
.script-entry-wizard .script-attribute-dice {width:auto;min-width:48px;line-height:1.45}
.script-entry-wizard .script-character-presets .but[aria-pressed="true"] {color:var(--entry-on-accent);background:var(--entry-accent);border-color:var(--entry-accent)}
.script-entry-wizard .entry-presets {margin-top:8px;color:var(--entry-ink);font-size:13px}
.script-entry-wizard .entry-presets summary {cursor:pointer;display:inline-flex;align-items:center;gap:8px}
.entry-presets summary::after {content:'';width:6px;height:6px;border:solid currentColor;border-width:0 1px 1px 0;transform:rotate(45deg)}
.entry-presets[open] summary::after {transform:rotate(225deg)}
.script-entry-wizard .script-character-attribute {padding:8px 0;border-bottom:1px solid var(--entry-line);color:var(--entry-ink)}
.script-entry-wizard .script-character-attribute {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,120px);gap:10px;align-items:center}
.script-entry-wizard .script-character-attribute.has-dice {grid-template-columns:minmax(0,1fr) minmax(54px,120px) auto}
.script-entry-wizard .script-attribute-range {font-size:11px;color:var(--entry-ink)}
.script-entry-wizard .script-character-attribute>label {font-size:14px;overflow-wrap:anywhere}
.script-entry-wizard .script-character-attribute .script-input {width:100%;min-width:0}
.script-entry-wizard .script-character-attribute select.script-input {display:block}
.script-entry-wizard .script-mode-guide,.script-entry-wizard .script-opening-cost {margin:0;text-align:center;color:var(--entry-ink);line-height:1.7}
.script-entry-wizard .script-mode-guide {font-size:14px}
/* Fallback mode radios appear directly in the form when the gallery is unavailable. */
.script-entry-wizard[data-category="settings"] .entry-fields>.script-character-field:not([data-entry-field]) .script-character-choices {
    grid-template-columns:repeat(auto-fit,minmax(48px,1fr));gap:clamp(4px,1.5vw,8px);
}
.script-entry-wizard[data-category="settings"] .entry-fields>.script-character-field:not([data-entry-field]) .script-character-choice>span {
    justify-content:center;padding-inline:2px;text-align:center;font-size:clamp(13px,3.5vw,16px);
}
/* Keep the enlarged cover from scrolling the whole form when WebKit focuses a mode. */
.script-character-card.script-entry-wizard[data-category="settings"] {overflow:clip}
.script-entry-wizard[data-category="settings"] .entry-fields {gap:12px}
.script-entry-wizard .entry-play-settings,.script-entry-wizard .entry-play-settings :is(.mode-specific-settings,.entry-otome-options) {
    display:grid;min-width:0;gap:2px;
}
/* The tallest alternative sizes the shared row at the current width and text size. */
.script-entry-wizard .entry-mode-panels {display:grid;min-width:0}
.script-entry-wizard .entry-mode-panels>* {grid-area:1 / 1;align-self:center;min-width:0}
.script-entry-wizard .entry-mode-panels>[inert] {visibility:hidden}
.script-entry-wizard .entry-play-settings .script-character-field {min-width:0;margin:0}
.script-entry-wizard .entry-play-settings legend {
    float:left;display:flex;align-items:center;width:4.5em;min-height:44px;
    margin:0 .35em 0 0;padding:0;color:var(--entry-ink);font-size:14px;line-height:1.35;
}
/* All four groups already have a selection; the radios retain their required state. */
.script-entry-wizard .entry-play-settings .script-field-requirement {display:none}
.script-entry-wizard .entry-play-settings .script-character-choices {
    position:relative;isolation:isolate;display:grid;grid-template-columns:none;
    grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:0;padding:0 2px;
}
.script-entry-wizard .entry-play-settings .script-character-choices::before {
    content:"";position:absolute;z-index:-1;inset:4px 0;pointer-events:none;border:1px solid var(--entry-line);
    border-radius:9px;background:var(--entry-control);
}
.script-entry-wizard .entry-play-settings .script-character-choice {min-width:0;min-height:44px;align-items:center;margin:0}
.script-entry-wizard .entry-play-settings .script-character-choice>span {
    width:100%;min-height:32px;justify-content:center;padding:4px 1px;background:transparent;
    border:1px solid transparent;border-radius:7px;color:var(--entry-ink);font-size:13px;line-height:1.4;text-align:center;
}
.script-entry-wizard .entry-play-settings .script-character-choice>input:checked+span {
    background:var(--entry-accent);border-color:var(--entry-accent);color:var(--entry-on-accent);
}
.script-entry-wizard .entry-play-settings .script-mode-guide {margin:0 0 4px;font-size:13px;line-height:1.5}
@media(max-width:360px) {
    .script-entry-wizard .entry-play-settings legend {font-size:13px;width:4.1em}
}
@media(max-height:740px) {
    .script-entry-wizard[data-category="settings"] .entry-scroll {padding-block:6px}
    .script-entry-wizard[data-category="settings"] .entry-heading {margin-bottom:8px}
    .script-entry-wizard[data-category="settings"] .script-play-modes>legend {margin-bottom:4px}
    .script-entry-wizard[data-category="settings"] .mode-gallery[data-layout="column"] {height:clamp(196px,calc(100vh - 450px),290px)}
    .script-entry-wizard[data-category="settings"] .mode-gallery[data-layout="column"] .mode-gallery-panel {min-height:44px}
}
.script-entry-wizard .script-character-footer .script-opening-cost {flex:0 0 100%;font-size:12px}
.script-character-card.script-entry-wizard .script-character-footer {position:relative;z-index:1;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;flex:none;align-self:center;display:flex;flex-wrap:wrap;gap:8px 10px;width:min(var(--entry-width),calc(100% - var(--entry-left) - var(--entry-right)));margin:0;border:0;padding:8px 0 max(14px,var(--mivo-cutout-bottom,env(safe-area-inset-bottom,0px)));background:transparent}
.script-entry-wizard .script-character-footer .but {min-height:46px;padding:8px 20px;border-radius:5px;color:var(--entry-ink);border:1px solid var(--entry-line);background:var(--entry-control);box-shadow:none}
.script-entry-wizard .script-character-footer .script-character-next {
    flex:1;background:var(--entry-accent);color:var(--entry-on-accent);border:1px solid var(--entry-accent);
    letter-spacing:.06em;font-weight:600;transform:none;
}
.script-entry-wizard :is(a,button,input,select,textarea,summary):focus-visible {outline:2px solid var(--entry-accent)!important;outline-offset:2px}
#script-preview:has(>.script-entry-wizard)>.script-entry-wizard {width:100%;height:100%;min-height:0;border-radius:inherit}
@media(max-width:640px) {
    .script-entry-wizard .entry-scroll {padding-top:8px}
    .script-character-card.script-entry-wizard .script-input {font-size:16px}
}
