:root {
    --bg: #101217;
    --panel: #171a20;
    --panel2: #1c2027;
    --line: #2b3039;
    --text: #f2f4f7;
    --muted: #9098a5;
    --danger: #ff7a7a;
    --soft: #242932;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        sans-serif;
}

body {
    min-height: 100vh;
}

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

button,
.button {
    border: 1px solid var(--line);
    background: var(--panel2);
    color: var(--text);
    border-radius: 9px;
    padding: 10px 14px;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.button:hover {
    border-color: #5f6978;
}

button:disabled {
    opacity: .4;
    cursor: default;
}

.primary {
    background: #f1f3f5;
    color: #11151a;
    border: 0;
    font-weight: 800;
    padding: 13px;
}

.shell {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

.topbar h1 {
    margin: 0;
    font-size: 31px;
    letter-spacing: -.04em;
}

.topbar p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.eyebrow,
.section-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    margin-bottom: 4px;
}

.model-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 11px;
}

.model-info strong {
    color: var(--text);
}

.status {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    padding: 8px 11px;
}

.status.error {
    color: var(--danger);
}

.layout {
    display: grid;
    grid-template-columns: 315px minmax(0, 1fr);
    gap: 18px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-self: start;
    position: sticky;
    top: 18px;
}

.workspace {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

h2 {
    margin: 0;
    font-size: 18px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

label > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    background: #111419;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    outline: none;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.checkbox {
    flex-direction: row;
    align-items: center;
}

.checkbox input {
    width: auto;
}

.upload {
    min-height: 190px;
    display: grid;
    place-items: center;
    text-align: center;
    background: #111419;
    border: 1px dashed #404754;
    border-radius: 11px;
    overflow: hidden;
    cursor: pointer;
}

.upload input {
    display: none;
}

.upload img {
    display: none;
    max-width: 100%;
    max-height: 225px;
    object-fit: contain;
}

#uploadPrompt {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#uploadPrompt span {
    color: var(--muted);
    font-size: 12px;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 15px;
}

.empty {
    color: var(--muted);
    font-size: 13px;
}

.blueprint {
    display: grid;
    gap: 15px;
}

.subject-summary {
    border: 1px solid var(--line);
    background: #12151a;
    border-radius: 10px;
    padding: 14px;
    line-height: 1.55;
    font-size: 13px;
}

.locked-features {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.lock-chip {
    padding: 6px 9px;
    background: var(--soft);
    border-radius: 999px;
    font-size: 11px;
    color: #cad0d8;
}

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

.plan-card {
    border: 1px solid var(--line);
    background: #12151a;
    border-radius: 10px;
    padding: 12px;
}

.plan-number {
    color: var(--muted);
    font-weight: 800;
    font-size: 10px;
    letter-spacing: .14em;
}

.plan-card h3 {
    margin: 5px 0 8px;
    font-size: 14px;
}

.plan-card dl {
    margin: 0;
    display: grid;
    gap: 6px;
}

.plan-card dt {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.plan-card dd {
    margin: 1px 0 0;
    font-size: 11px;
    line-height: 1.35;
}

.checker {
    background-color: #171a20;
    background-image:
        linear-gradient(
            45deg,
            #22262e 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #22262e 25%,
            transparent 25%
        ),
        linear-gradient(
            45deg,
            transparent 75%,
            #22262e 75%
        ),
        linear-gradient(
            -45deg,
            transparent 75%,
            #22262e 75%
        );
    background-size: 24px 24px;
    background-position:
        0 0,
        0 12px,
        12px -12px,
        -12px 0;
}

.sheet-stage {
    min-height: 330px;
    display: grid;
    place-items: center;
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 11px;
}

.sheet-stage img {
    display: none;
    max-width: 100%;
    max-height: 520px;
    object-fit: contain;
}

.frame-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    min-height: 175px;
}

.frame-card {
    flex: 0 0 155px;
    background: #12151a;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.frame-image {
    position: relative;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
}

.frame-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.frame-number {
    position: absolute;
    top: 7px;
    left: 7px;
    background: rgba(0,0,0,.65);
    padding: 4px 6px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
}

.playback {
    min-height: 390px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 11px;
}

.playback img {
    display: none;
    width: min(420px, 75%);
    max-height: 360px;
    object-fit: contain;
}

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

.export-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.export-actions {
    display: flex;
    gap: 8px;
}

.hidden {
    display: none;
}

@media (max-width: 900px) {

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

    .controls {
        position: static;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .model-info {
        flex-wrap: wrap;
    }
}
