/* ===========================================================================
   App Store Screenshot Designer - application styles
   Dark studio theme layered on top of Bootstrap 5.
   =========================================================================== */

:root {
    --bg-0: #07070c;
    --bg-1: #0e0e17;
    --bg-2: #14141f;
    --bg-3: #1c1c2a;
    --bg-4: #262636;
    --line: #2b2b3d;
    --txt-0: #f4f4f7;
    --txt-1: #b8b8c8;
    --txt-2: #82829a;
    --accent: #8b5cf6;
    --accent-2: #a855f7;
    --accent-soft: rgba(139, 92, 246, .13);
    --gold: #d4af37;
    --ok: #22c55e;
    --warn: #f59e0b;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, .4);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg-0);
    color: var(--txt-0);
    font-family: var(--font);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #c4a4ff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: #33334a; border-radius: 6px; border: 2px solid var(--bg-1); }
::-webkit-scrollbar-thumb:hover { background: #45455f; }

/* ---------------------------------------------------------------- helpers */
.text-dim { color: var(--txt-2) !important; }
.text-mid { color: var(--txt-1) !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.tiny { font-size: 11px; }
.label-xs {
    font-size: 10px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--txt-2);
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

/* ------------------------------------------------------------------- topbar */
.topbar {
    height: 58px;
    background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -.2px;
    color: var(--txt-0);
    white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand-mark {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: linear-gradient(140deg, #4c1d95, #a855f7 55%, #f472b6);
    display: grid; place-items: center;
    font-size: 13px; font-weight: 800; color: #fff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, .45);
}

.topnav { display: flex; align-items: center; gap: 4px; }
.topnav a {
    color: var(--txt-1);
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13px;
    transition: background .15s, color .15s;
}
.topnav a:hover { background: var(--bg-3); color: #fff; }
.topnav a.active { background: var(--accent-soft); color: #c4b5fd; }

/* -------------------------------------------------------------- containers */
.page { padding: 26px 26px 60px; max-width: 1500px; margin: 0 auto; }
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin: 0; }
.page-sub { color: var(--txt-2); font-size: 13px; margin: 5px 0 0; }

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

.step-flow {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 11.5px; color: var(--txt-2); margin-bottom: 18px;
}
.step-flow .step {
    padding: 5px 11px; border-radius: 20px;
    background: var(--bg-2); border: 1px solid var(--line);
}
.step-flow .step.done { color: #86efac; border-color: #14532d; background: rgba(20, 83, 45, .18); }
.step-flow .step.active { color: #c4b5fd; border-color: var(--accent); background: var(--accent-soft); }
.step-flow .arrow { opacity: .45; }

/* ------------------------------------------------------------------ buttons */
.btn { font-size: 13px; font-weight: 600; border-radius: var(--radius-sm); padding: 8px 15px; border: 1px solid transparent; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }

.btn-brand {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    box-shadow: 0 6px 18px rgba(139, 92, 246, .32);
}
.btn-brand:hover, .btn-brand:focus { background: linear-gradient(135deg, #8b5cf6, #b366f9); color: #fff; }
.btn-brand:disabled { opacity: .55; box-shadow: none; }

.btn-ghost { background: var(--bg-3); color: var(--txt-0); border-color: var(--line); }
.btn-ghost:hover, .btn-ghost:focus { background: var(--bg-4); color: #fff; border-color: #3a3a52; }

.btn-outline-soft { background: transparent; color: var(--txt-1); border-color: var(--line); }
.btn-outline-soft:hover, .btn-outline-soft:focus { background: var(--bg-3); color: #fff; }

.btn-danger-soft { background: rgba(127, 29, 29, .2); color: #fca5a5; border-color: #7f1d1d; }
.btn-danger-soft:hover, .btn-danger-soft:focus { background: rgba(153, 27, 27, .35); color: #fecaca; }

.btn-gold { background: linear-gradient(135deg, #b8860b, #d4af37); color: #211703; border: none; }
.btn-gold:hover, .btn-gold:focus { background: linear-gradient(135deg, #c8951a, #e0bf47); color: #211703; }

.btn-xs { padding: 4px 9px; font-size: 11.5px; border-radius: 6px; }

/* ------------------------------------------------------------------- forms */
.form-label { font-size: 12px; font-weight: 600; color: var(--txt-1); margin-bottom: 6px; }
.form-control, .form-select {
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--txt-0);
    border-radius: var(--radius-sm);
    font-size: 13px;
    padding: 9px 12px;
}
.form-control:focus, .form-select:focus {
    background: var(--bg-2);
    border-color: var(--accent);
    color: var(--txt-0);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-control::placeholder { color: #5c5c74; }
.form-control:disabled, .form-select:disabled { background: var(--bg-1); color: var(--txt-2); }
.form-select { background-image: linear-gradient(45deg, transparent 50%, var(--txt-2) 50%), linear-gradient(135deg, var(--txt-2) 50%, transparent 50%); background-position: calc(100% - 16px) 15px, calc(100% - 11px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.form-select option { background: var(--bg-2); color: var(--txt-0); }
.form-text { color: var(--txt-2); font-size: 11.5px; }
.form-check-input { background-color: var(--bg-3); border-color: var(--line); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-check-label { font-size: 13px; color: var(--txt-1); }
.input-group-text { background: var(--bg-3); border-color: var(--line); color: var(--txt-2); font-size: 12px; }

input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 4px; border-radius: 3px;
    background: var(--bg-4); outline: none; padding: 0; margin: 7px 0;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent-2); cursor: pointer;
    border: 2px solid #12121c; box-shadow: 0 0 0 1px var(--accent);
}
input[type="range"]::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent-2); cursor: pointer; border: 2px solid #12121c;
}
input[type="color"] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 32px; padding: 0;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--bg-2); cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }

/* ------------------------------------------------------------------- login */
.auth-wrap {
    min-height: 100vh;
    display: grid; place-items: center;
    padding: 30px;
    background:
        radial-gradient(1000px 620px at 12% -10%, rgba(76, 29, 149, .35), transparent 60%),
        radial-gradient(900px 560px at 92% 8%, rgba(168, 85, 247, .2), transparent 62%),
        radial-gradient(760px 620px at 50% 118%, rgba(244, 114, 182, .18), transparent 60%),
        var(--bg-0);
}
.auth-card {
    width: 100%; max-width: 400px;
    background: rgba(16, 16, 25, .88);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(43, 43, 61, .8);
    border-radius: 18px;
    padding: 34px 30px;
    box-shadow: var(--shadow-lg);
}
.auth-logo {
    width: 50px; height: 50px; border-radius: 14px;
    background: linear-gradient(140deg, #4c1d95, #a855f7 55%, #f472b6);
    display: grid; place-items: center; margin: 0 auto 16px;
    font-size: 21px; box-shadow: 0 10px 26px rgba(139, 92, 246, .45);
}
.auth-title { font-size: 19px; font-weight: 800; text-align: center; margin: 0 0 4px; letter-spacing: -.3px; }
.auth-sub { font-size: 12.5px; color: var(--txt-2); text-align: center; margin: 0 0 24px; }
.auth-hint {
    margin-top: 20px; padding: 11px 13px;
    background: var(--bg-2); border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    font-size: 11.5px; color: var(--txt-2); line-height: 1.65;
}
.auth-foot { text-align: center; margin-top: 18px; font-size: 11px; color: #55556b; }

/* ------------------------------------------------------------------- alerts */
.alert { border-radius: var(--radius-sm); font-size: 13px; border: 1px solid transparent; padding: 10px 13px; }
.alert-danger { background: rgba(127, 29, 29, .18); border-color: rgba(127, 29, 29, .55); color: #fca5a5; }
.alert-success { background: rgba(20, 83, 45, .18); border-color: rgba(20, 83, 45, .55); color: #86efac; }
.alert-info { background: rgba(30, 58, 138, .18); border-color: rgba(30, 58, 138, .55); color: #93c5fd; }
.alert-warning { background: rgba(120, 53, 15, .2); border-color: rgba(120, 53, 15, .6); color: #fcd34d; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* ------------------------------------------------------- dashboard cards */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 18px;
}
.project-card {
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .16s, border-color .16s, box-shadow .16s;
    display: flex; flex-direction: column;
}
.project-card:hover {
    transform: translateY(-3px);
    border-color: #46466a;
    box-shadow: var(--shadow-md);
}
.project-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(150deg, #14141f, #1c1c2a);
    display: grid; place-items: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}
.project-thumb img {
    max-width: 56%; max-height: 84%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .5);
}
.project-thumb .empty-mark { font-size: 30px; opacity: .28; }
.project-badge {
    position: absolute; top: 9px; right: 9px;
    background: rgba(5, 5, 11, .8); backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, .1);
    color: var(--txt-1);
    font-size: 10.5px; font-weight: 600;
    padding: 3px 8px; border-radius: 20px;
}
.project-body { padding: 13px 14px; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.project-name {
    font-weight: 700; font-size: 14px; letter-spacing: -.2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-meta { font-size: 11.5px; color: var(--txt-2); }
.project-actions {
    display: flex; gap: 6px; padding: 11px 14px;
    border-top: 1px solid var(--line); background: #0b0b13;
}
.project-actions .btn { flex: 0 0 auto; }
.project-actions .btn.grow { flex: 1; }

.empty-state {
    padding: 60px 24px; text-align: center;
    border: 1px dashed var(--line); border-radius: var(--radius);
    background: var(--bg-1);
}
.empty-state .icon { font-size: 40px; opacity: .32; margin-bottom: 12px; }

/* ------------------------------------------------- screenshot upload strip */
.dropzone {
    border: 2px dashed var(--line);
    border-radius: var(--radius);
    background: var(--bg-1);
    padding: 34px 22px;
    text-align: center;
    transition: border-color .16s, background .16s;
    cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: #16101f; }
.dropzone .dz-icon { font-size: 32px; opacity: .5; margin-bottom: 8px; }

.shot-strip {
    display: flex; gap: 14px; overflow-x: auto;
    padding: 6px 4px 16px; align-items: stretch; min-height: 60px;
}
.shot-item {
    flex: 0 0 auto; width: 170px;
    background: var(--bg-1); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden;
    display: flex; flex-direction: column;
}
.shot-item.sortable-ghost { opacity: .35; border-style: dashed; }
.shot-item.sortable-chosen { border-color: var(--accent); }
.shot-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 9px; background: #0b0b13; border-bottom: 1px solid var(--line);
    font-size: 11px; color: var(--txt-2); font-weight: 600;
}
.shot-drag { cursor: grab; opacity: .6; font-size: 13px; }
.shot-drag:hover { opacity: 1; }
.shot-preview {
    aspect-ratio: 9 / 19.5; background: #05050a;
    display: grid; place-items: center; overflow: hidden;
}
.shot-preview img { width: 100%; height: 100%; object-fit: contain; }
.shot-preview .missing { font-size: 11px; color: var(--txt-2); text-align: center; padding: 10px; }
.shot-foot { padding: 8px 9px; display: flex; flex-wrap: wrap; gap: 5px; border-top: 1px solid var(--line); }
.shot-title-input { font-size: 11.5px !important; padding: 5px 7px !important; }

.upload-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 11px; border-radius: var(--radius-sm);
    background: var(--bg-2); border: 1px solid var(--line);
    font-size: 12px; margin-bottom: 7px;
}
.upload-row .bar { flex: 1; height: 4px; border-radius: 3px; background: var(--bg-4); overflow: hidden; }
.upload-row .bar > i { display: block; height: 100%; width: 0; background: var(--accent-2); transition: width .2s; }

/* --------------------------------------------------------------- templates */
.tpl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
    gap: 16px;
}
.tpl-card {
    background: var(--bg-1); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; cursor: pointer;
    transition: transform .16s, border-color .16s, box-shadow .16s;
    text-align: left; padding: 0; color: inherit; width: 100%; display: block;
}
.tpl-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.tpl-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tpl-swatch {
    aspect-ratio: 9 / 13; position: relative;
    display: grid; place-items: center; overflow: hidden;
}
.tpl-swatch .tpl-phone {
    width: 44%; aspect-ratio: 9 / 19.5;
    border-radius: 14px;
    background: #0c0c12;
    border: 2px solid rgba(255, 255, 255, .18);
    box-shadow: 0 12px 26px rgba(0, 0, 0, .5);
    margin-top: 16%;
}
.tpl-swatch .tpl-heading {
    position: absolute; top: 9%; left: 16%; right: 16%;
    height: 7px; border-radius: 4px; opacity: .95;
}
.tpl-swatch .tpl-heading::after {
    content: ''; position: absolute; top: 12px; left: 22%; right: 22%;
    height: 4px; border-radius: 3px; background: inherit; opacity: .55;
}
.tpl-body { padding: 11px 12px; }
.tpl-name { font-size: 13px; font-weight: 700; letter-spacing: -.15px; }
.tpl-tag { font-size: 10.5px; color: var(--txt-2); }
.tpl-card .tpl-actions { display: flex; gap: 5px; padding: 0 12px 11px; }

/* =========================================================================
   EDITOR
   ========================================================================= */
.editor-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.ed-toolbar {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 5px;
    padding: 8px 12px;
    background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
    border-bottom: 1px solid var(--line);
    overflow-x: auto; overflow-y: hidden;
}
.ed-toolbar::-webkit-scrollbar { height: 0; }
.ed-divider { width: 1px; height: 24px; background: var(--line); margin: 0 5px; flex: 0 0 auto; }
.ed-spacer { flex: 1 1 auto; }

.ed-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 1px solid transparent;
    color: var(--txt-1); font-size: 12.5px; font-weight: 600;
    padding: 7px 11px; border-radius: var(--radius-sm);
    white-space: nowrap; cursor: pointer;
    transition: background .14s, color .14s, border-color .14s;
}
.ed-btn:hover:not(:disabled) { background: var(--bg-3); color: #fff; }
.ed-btn:disabled { opacity: .38; cursor: not-allowed; }
.ed-btn.active { background: var(--accent-soft); color: #c4b5fd; border-color: rgba(139, 92, 246, .45); }
.ed-btn .ic { font-size: 14px; line-height: 1; }

.ed-btn-primary {
    background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff;
    box-shadow: 0 5px 16px rgba(139, 92, 246, .3);
}
.ed-btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #8b5cf6, #b366f9); color: #fff; }
.ed-btn-gold { background: linear-gradient(135deg, #b8860b, #d4af37); color: #1e1503; }
.ed-btn-gold:hover:not(:disabled) { background: linear-gradient(135deg, #c8951a, #e0bf47); color: #1e1503; }

.save-status {
    font-size: 11.5px; color: var(--txt-2); min-width: 76px;
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.save-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--txt-2); }
.save-status.saving .dot { background: var(--warn); animation: pulse 1s infinite; }
.save-status.saved .dot { background: var(--ok); }
.save-status.error .dot { background: var(--danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.ed-select {
    background: var(--bg-2); border: 1px solid var(--line); color: var(--txt-0);
    border-radius: var(--radius-sm); font-size: 12.5px; padding: 6px 10px;
    max-width: 168px;
}
.ed-select:focus { outline: none; border-color: var(--accent); }

/* --------------------------------------------------------------- ed layout */
.ed-main { flex: 1 1 auto; display: flex; min-height: 0; }

.ed-stage {
    flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0;
    background:
        radial-gradient(700px 420px at 30% 0%, rgba(76, 29, 149, .12), transparent 60%),
        var(--bg-0);
}
.ed-canvas-area {
    flex: 1 1 auto; display: grid; place-items: center;
    overflow: auto; padding: 22px;
    min-height: 0;
}
.ed-canvas-holder {
    position: relative;
    border-radius: 4px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, .65);
    background: #000;
    line-height: 0;
}
.ed-canvas-holder canvas { border-radius: 3px; }
.ed-canvas-holder .canvas-container { border-radius: 3px; overflow: hidden; }
.ed-canvas-caption {
    position: absolute; top: -22px; left: 0; right: 0;
    font-size: 11px; color: var(--txt-2); display: flex; justify-content: space-between;
    line-height: 1.4;
}

.ed-loading {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: rgba(7, 7, 12, .78); color: var(--txt-1); font-size: 12.5px;
    border-radius: 3px; z-index: 5;
}

/* ------------------------------------------------------------- filmstrip */
.ed-filmstrip {
    flex: 0 0 auto;
    border-top: 1px solid var(--line);
    background: var(--bg-1);
    padding: 10px 12px 12px;
}
.film-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; font-size: 11px; color: var(--txt-2);
}
.film-track { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; align-items: flex-start; }
.film-item {
    flex: 0 0 auto; width: 92px; cursor: pointer;
    border-radius: 9px; border: 2px solid transparent;
    background: var(--bg-2); padding: 4px;
    transition: border-color .14s, transform .14s;
    position: relative;
}
.film-item:hover { transform: translateY(-2px); border-color: #3f3f5c; }
.film-item.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.film-item.sortable-ghost { opacity: .35; }
.film-item canvas { width: 100%; height: auto; display: block; border-radius: 5px; background: #05050a; }
.film-item .film-label {
    font-size: 10px; color: var(--txt-2); text-align: center; margin-top: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.film-item .film-index {
    position: absolute; top: 6px; left: 6px; z-index: 2;
    background: rgba(5, 5, 11, .8); color: var(--txt-1);
    font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 10px;
}

/* --------------------------------------------------------------- sidebar */
.ed-sidebar {
    flex: 0 0 328px; width: 328px;
    border-left: 1px solid var(--line);
    background: var(--bg-1);
    display: flex; flex-direction: column; min-height: 0;
}
.ed-sidebar-head {
    flex: 0 0 auto; padding: 13px 15px;
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
}
.ed-sidebar-title { font-size: 13px; font-weight: 800; letter-spacing: -.2px; }
.ed-sidebar-body { flex: 1 1 auto; overflow-y: auto; padding: 15px; min-height: 0; }
.ed-panel { display: none; }
.ed-panel.active { display: block; }

.grp { margin-bottom: 20px; }
.grp:last-child { margin-bottom: 4px; }
.grp-title {
    font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--txt-2); font-weight: 700; margin-bottom: 10px;
    padding-bottom: 6px; border-bottom: 1px solid var(--line);
}

.ctrl { margin-bottom: 12px; }
.ctrl:last-child { margin-bottom: 0; }
.ctrl-label {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11.5px; color: var(--txt-1); font-weight: 500; margin-bottom: 5px;
}
.ctrl-value { font-size: 10.5px; color: var(--txt-2); font-variant-numeric: tabular-nums; }
.ctrl-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ctrl-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.mini-input {
    background: var(--bg-2); border: 1px solid var(--line); color: var(--txt-0);
    border-radius: 6px; font-size: 12px; padding: 6px 8px; width: 100%;
}
.mini-input:focus { outline: none; border-color: var(--accent); }
select.mini-input { padding: 6px 6px; }
textarea.mini-input { resize: vertical; min-height: 54px; line-height: 1.4; }

.seg { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 7px; padding: 2px; gap: 2px; }
.seg-btn {
    flex: 1; background: transparent; border: none; color: var(--txt-2);
    font-size: 11px; font-weight: 600; padding: 5px 4px; border-radius: 5px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg-btn:hover { color: var(--txt-0); }
.seg-btn.active { background: var(--accent); color: #fff; }

.swatches { display: flex; gap: 7px; }
.swatches > div { flex: 1; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    background: var(--bg-2); border: 1px solid var(--line); color: var(--txt-1);
    font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 20px; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: #fff; }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: #c4b5fd; }

.preset-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.preset-swatch {
    height: 40px; border-radius: 7px; border: 2px solid transparent; cursor: pointer;
    padding: 0; position: relative; overflow: hidden;
}
.preset-swatch:hover { border-color: #ffffff44; }
.preset-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.screen-list-item {
    display: flex; gap: 9px; align-items: center;
    padding: 8px; border-radius: 9px; border: 1px solid var(--line);
    background: var(--bg-2); margin-bottom: 8px; cursor: pointer;
}
.screen-list-item:hover { border-color: #3f3f5c; }
.screen-list-item.active { border-color: var(--accent); background: rgba(139, 92, 246, .08); }
.screen-list-item .sli-thumb {
    width: 30px; height: 56px; border-radius: 4px; background: #05050a;
    overflow: hidden; flex: 0 0 auto; display: grid; place-items: center;
}
.screen-list-item .sli-thumb img { width: 100%; height: 100%; object-fit: cover; }
.screen-list-item .sli-body { min-width: 0; flex: 1; }
.screen-list-item .sli-title {
    font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.screen-list-item .sli-meta { font-size: 10.5px; color: var(--txt-2); }
.screen-list-item.sortable-ghost { opacity: .4; }

.help-note {
    font-size: 11px; color: var(--txt-2); line-height: 1.55;
    background: var(--bg-2); border: 1px solid var(--line);
    border-radius: 7px; padding: 9px 10px;
}

/* -------------------------------------------------------------- modals */
.modal-content {
    background: var(--bg-1); border: 1px solid var(--line);
    border-radius: var(--radius); color: var(--txt-0);
}
.modal-header, .modal-footer { border-color: var(--line); }
.modal-title { font-size: 15px; font-weight: 800; letter-spacing: -.2px; }
.btn-close { filter: invert(1) grayscale(1) brightness(1.6); opacity: .6; }
.btn-close:hover { opacity: 1; }
.modal-backdrop.show { opacity: .78; }

.preview-track {
    display: flex; gap: 3px; overflow-x: auto; padding: 6px 2px 14px;
    background: #05050a; border-radius: var(--radius-sm);
}
.preview-track img { height: 460px; width: auto; display: block; flex: 0 0 auto; }
.preview-hint { font-size: 11.5px; color: var(--txt-2); margin-bottom: 9px; }

.export-progress {
    font-size: 12px; color: var(--txt-1);
    background: var(--bg-2); border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 11px 13px; margin-top: 12px;
}
.export-progress .bar { height: 5px; border-radius: 3px; background: var(--bg-4); overflow: hidden; margin-top: 8px; }
.export-progress .bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7c3aed, #a855f7); transition: width .25s; }
.export-log { max-height: 128px; overflow-y: auto; font-size: 11px; color: var(--txt-2); margin-top: 8px; line-height: 1.6; }

.device-check {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--bg-2); margin-bottom: 7px; cursor: pointer;
}
.device-check:hover { border-color: #3f3f5c; }
.device-check input { margin: 0; }
.device-check .dc-label { font-size: 12.5px; font-weight: 600; }
.device-check .dc-size { font-size: 10.5px; color: var(--txt-2); }

/* -------------------------------------------------------------- toasts */
.toast-stack {
    position: fixed; bottom: 18px; right: 18px; z-index: 2000;
    display: flex; flex-direction: column; gap: 8px; max-width: 340px;
}
.toast-item {
    background: var(--bg-3); border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm); padding: 11px 14px;
    font-size: 12.5px; color: var(--txt-0);
    box-shadow: var(--shadow-md);
    animation: toastIn .2s ease-out;
}
.toast-item.ok { border-left-color: var(--ok); }
.toast-item.err { border-left-color: var(--danger); }
.toast-item.warn { border-left-color: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
    .ed-sidebar { flex-basis: 296px; width: 296px; }
}
@media (max-width: 992px) {
    .desktop-only-note { display: block; }
}
.desktop-only-note {
    display: none;
    background: rgba(120, 53, 15, .2); border-bottom: 1px solid rgba(120, 53, 15, .6);
    color: #fcd34d; font-size: 12px; padding: 8px 14px; text-align: center;
}

@media print { body { background: #fff; } }
