/* 32-deckstudio.css — the Deck Studio, rebuilt in the library's
 * language.
 *
 * The old studio used a mixture of `.icon-btn`, `.btn-outline`,
 * `.deck-studio-btn` and `.premium-toggle` — none of which matched
 * the library, so it looked like a different app. It is now built
 * from the same primitives as the rest of QUAD: `.icbtn`, `.btnx`,
 * `.sw` (switch-spring), `.sel` (the custom dropdown) and the
 * square, hairline, copper-accented surface treatment.
 */

/* ── The shell ──────────────────────────────────────────────── */

.deckstudio-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: transparent;
}

/* ── The bar ────────────────────────────────────────────────── */

.ds-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-2);
    flex-shrink: 0;
}

.ds-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.ds-bar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ds-bar-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ds-bar-label {
    font: 700 11px var(--mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-ink);
}

.ds-bar-sub {
    font: 500 10px var(--mono);
    letter-spacing: 0.08em;
    color: var(--c-ink-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── The body ───────────────────────────────────────────────── */

.deckstudio-main-wrapper {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.deckstudio-body {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.deckstudio-side-panel {
    width: min(460px, 42vw);
    flex-shrink: 0;
    border-left: 1px solid var(--border-2);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.deckstudio-side-panel.is-hidden {
    display: none;
}

/* ── The panels ─────────────────────────────────────────────── */

.ds-panel {
    border: 1px solid var(--border-2);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: var(--shadow-inset-light);
    padding: 14px;
}

.ds-panel-label {
    font: 700 9px var(--mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-ink-muted);
    margin-bottom: 9px;
}

/* ── The prompt input ───────────────────────────────────────── */

.ds-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-2);
    color: var(--c-ink);
    font: 400 13px/1.6 var(--body);
    outline: none;
    resize: vertical;
    min-height: 88px;
    transition: border-color 150ms, background 150ms, box-shadow 150ms;
}
.ds-input:focus {
    border-color: var(--c-accent);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 1px var(--c-accent), 0 0 14px var(--c-accent-wash);
}
.ds-input::placeholder {
    color: var(--c-ink-muted);
}

/* ── The action row ─────────────────────────────────────────── */

.ds-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* ── The versions ───────────────────────────────────────────── */

.ds-versions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-2);
}
.ds-versions.hidden {
    display: none;
}

.ds-native-select {
    display: none;
}

/* ── The settings ───────────────────────────────────────────── */

.ds-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
}

.ds-switch-label {
    font: 600 12px var(--body);
    color: var(--c-ink-dim);
}

.ds-settings {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-2);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ds-settings.disabled {
    opacity: 0.38;
    pointer-events: none;
}

.ds-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.ds-group-label {
    font: 600 12px var(--body);
    color: var(--c-ink-dim);
}

.ds-group-value {
    font: 700 10px var(--mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-accent-bright);
}

/* ── The slider ─────────────────────────────────────────────── */

.ds-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-2);
    outline: none;
    cursor: pointer;
}
.ds-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 18px;
    background: var(--c-accent);
    border: 1px solid var(--c-accent);
    box-shadow: var(--shadow-inset-light);
    cursor: pointer;
    transition: transform 200ms var(--spring), box-shadow 150ms;
}
.ds-slider::-webkit-slider-thumb:hover {
    transform: scaleY(1.12);
    box-shadow: 0 0 12px rgba(204, 144, 80, 0.5);
}
.ds-slider::-moz-range-thumb {
    width: 14px;
    height: 18px;
    border-radius: 0;
    background: var(--c-accent);
    border: 1px solid var(--c-accent);
    cursor: pointer;
}

/* ── The preview side ───────────────────────────────────────── */

.ds-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-2);
    flex-shrink: 0;
}

.ds-side-label {
    font: 700 9px var(--mono);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-ink-muted);
}

.ds-side-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-2);
    flex-shrink: 0;
}
.ds-side-actions .btnx {
    flex: 1;
}

.ds-preview {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    min-height: 0;
    cursor: pointer;
}
.ds-preview:focus-visible {
    outline: 1px solid var(--c-accent);
    outline-offset: -1px;
}

/* ── The preview cards ──────────────────────────────────────── */

.ds-preview .deckstudio-card {
    border: 1px solid var(--border-2);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: var(--shadow-inset-light);
    padding: 12px;
    margin-bottom: 8px;
    transition: border-color 150ms, background 150ms;
}
.ds-preview .deckstudio-card:hover {
    border-color: var(--border-accent);
    background: rgba(255, 255, 255, 0.035);
}

.ds-preview .deckstudio-card-q {
    font: 600 13px/1.5 var(--body);
    color: var(--c-ink);
    margin-bottom: 8px;
}
.ds-preview .deckstudio-card-hint {
    font: 500 11px/1.5 var(--body);
    color: var(--c-ink-dim);
    font-style: italic;
    margin-bottom: 8px;
}
.ds-preview .deckstudio-card-a {
    font: 400 12px/1.6 var(--body);
    color: var(--c-ink-dim);
    border-left: 2px solid var(--border-accent);
    padding-left: 10px;
}
.ds-preview .deckstudio-card-cat {
    font: 700 8px var(--mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-accent);
    margin-bottom: 6px;
}

/* ── The old class names, kept alive ────────────────────────── */
/*
 * The JS in app.js still refers to a few of the old class names.
 * Rather than rewrite the JS, these aliases map the old names onto
 * the new treatment. The old rounded `.premium-toggle` is gone —
 * the switch-spring `.sw` replaces it, and the JS was updated to
 * drive the `aria-checked` attribute the switch-spring uses.
 */

.deckstudio-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-2);
    color: var(--c-ink);
    font: 700 10px var(--mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: var(--shadow-inset-light);
    transition: background 150ms, border-color 150ms, color 150ms, transform 220ms var(--ease);
}
.deckstudio-btn.primary {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #000;
}
.deckstudio-btn.primary:hover {
    background: var(--c-accent-bright);
    border-color: var(--c-accent-bright);
}
.deckstudio-btn:hover {
    border-color: var(--border-accent);
}
.deckstudio-btn:active {
    transform: translateY(1px);
}

.deckstudio-editor {
    width: 100%;
    min-height: 220px;
    resize: vertical;
    padding: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-2);
    color: var(--c-ink);
    font: 400 12px/1.6 var(--mono);
    outline: none;
}

/* ── Mobile ─────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .deckstudio-main-wrapper {
        flex-direction: column;
    }
    .deckstudio-side-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-2);
        max-height: 46vh;
    }
    .deckstudio-body {
        padding: 12px;
    }
    .ds-bar {
        padding: 10px 12px;
    }
}
