/* =============================================================================
   SignageCreator editor
   ============================================================================= */

/* The PE Systems colors: teal and mint from the company banner. */
:root {
    --font: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    --brand-teal: #095450;
    --brand-mint: #7cfcbc;
    --bg: #f3f6f6;
    --surface: #ffffff;
    --surface-2: #f7faf9;
    --surface-3: #ebf1f0;
    --border: #dde6e4;
    --border-strong: #c7d3d1;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --accent: #0f766e;
    --accent-hover: #115e59;
    --accent-soft: #e3f5f0;
    --accent-2: #14b8a6;
    --on-accent: #ffffff;
    /* Main call-to-action buttons. The text sits on the middle stop, which keeps it readable. */
    --gradient: linear-gradient(135deg, #0b5f59 0%, #0f766e 45%, #14a090 100%);
    --on-gradient: #ffffff;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --sidebar: #07141a;
    --sidebar-hover: #0f2229;
    --sidebar-active: #123232;
    --sidebar-text: #a7bdb9;
    --canvas: #121a1e;
    /* The designer's workspace around the canvas: lighter than the dark backgrounds most layouts use, with an
       outline around the canvas, so its edge shows whatever the layout's background. */
    --workspace: #e2e8e8;
    --workspace-dots: rgba(15, 23, 42, .14);
    --workspace-edge: rgba(15, 23, 42, .3);
    --workspace-shadow: 0 14px 40px rgba(15, 23, 42, .22);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --shadow: 0 6px 20px rgba(15, 23, 42, .08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, .22);
    --focus: 0 0 0 3px rgba(20, 184, 166, .3);
}

/* Dark: brighter teal for text and outlines, and mint buttons with teal text, as on the sign-in screen. */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0a1115;
        --surface: #111a1f;
        --surface-2: #152027;
        --surface-3: #1c2a31;
        --border: #22333b;
        --border-strong: #30454e;
        --text: #e6eef0;
        --text-2: #c1ced2;
        --muted: #87999e;
        --accent: #2dd4bf;
        --accent-hover: #5eead4;
        --accent-soft: #0f2e2b;
        --accent-2: #7cfcbc;
        --on-accent: #04201d;
        --gradient: linear-gradient(135deg, #2dd4bf, #7cfcbc);
        --on-gradient: #032824;
        --focus: 0 0 0 3px rgba(45, 212, 191, .3);
        --success-soft: #0f2e1d;
        --warning-soft: #33250b;
        --danger-soft: #3a1416;
        --shadow: 0 6px 20px rgba(0, 0, 0, .35);
        --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
        --workspace: #121a1e;
        --workspace-dots: rgba(255, 255, 255, .06);
        --workspace-edge: rgba(255, 255, 255, .24);
        --workspace-shadow: 0 20px 60px rgba(0, 0, 0, .55);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

#app { height: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
code, kbd { font-family: 'Cascadia Code', Consolas, monospace; font-size: .92em; }
kbd { padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.danger-text { color: var(--danger); }
.success-text { color: var(--success); }

/* ---------- Boot screen ---------- */
.boot { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--bg); }
.boot-logo { animation: boot-pulse 1.6s ease-in-out infinite; }
.boot-title { font-size: 22px; font-weight: 700; }
.boot-bar { width: 220px; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.loading-progress-fill { height: 100%; width: var(--blazor-load-percentage, 10%); background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
@keyframes boot-pulse { 50% { transform: scale(1.06); } }

#blazor-error-ui {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000;
    padding: 10px 16px;
    background: #fef3c7; color: #78350f;
    box-shadow: 0 -2px 10px rgba(0,0,0,.15);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 8px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; height: 100%; }
.sidebar {
    /* The sign-in screen's teal glow, at the top. */
    background: radial-gradient(160% 32% at 0% 0%, rgba(9, 84, 80, .65), transparent 72%), var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 14px 10px;
    gap: 4px;
    overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; color: #fff; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-server { font-size: 11px; color: var(--sidebar-text); opacity: .8; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #5b7773; padding: 14px 12px 6px; }
.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--sidebar-text);
    font-weight: 500;
    text-decoration: none !important;
    transition: background .12s, color .12s;
}
.nav-link .sc-icon { font-size: 18px; opacity: .9; }
.nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.nav-link.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--brand-mint); }
.nav-link.active .sc-icon { color: var(--brand-mint); opacity: 1; }
.nav-badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #fff; }
.sidebar-footer { margin-top: auto; padding: 12px 6px 4px; border-top: 1px solid #17292f; display: flex; flex-direction: column; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 9px; }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    /* Teal letters on mint, like the "PE" circle. */
    background: linear-gradient(135deg, #2dd4bf, var(--brand-mint));
    color: var(--brand-teal); font-weight: 800; font-size: 13px; flex: none;
}
.connection { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 0 6px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; }
.page { flex: 1; overflow-y: auto; padding: 28px 32px 48px; }
.subscription-banner { display: flex; align-items: center; gap: 10px; padding: 10px 32px; font-size: 13.5px; font-weight: 600; }
.subscription-banner a { margin-left: auto; font-weight: 600; }
.subscription-banner.warning { background: var(--warning-soft); color: var(--warning); }
.subscription-banner.danger { background: var(--danger-soft); color: var(--danger); }
.subscription-banner.info { background: var(--accent-soft); color: var(--accent); }
.text-danger { color: var(--danger); font-weight: 600; }
.page-narrow { max-width: 1000px; }
.page-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header .subtitle { color: var(--muted); margin-top: 4px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 36px; padding: 0 14px;
    border-radius: 9px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: 600 13.5px var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, border-color .12s, box-shadow .12s, transform .05s;
    text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn .sc-icon { font-size: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-gradient { background: var(--gradient); border: 0; color: var(--on-gradient); }
.btn-gradient:hover { filter: brightness(1.08); background: var(--gradient); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-block { width: 100%; }
.btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 9px 9px 0; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field-help { font-size: 12px; color: var(--muted); line-height: 1.4; }
.input, .select, .textarea {
    width: 100%;
    height: 36px;
    padding: 0 11px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: 14px var(--font);
    transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input-sm, .select-sm { height: 30px; font-size: 13px; padding: 0 8px; }
.input[type=color] { padding: 2px; width: 44px; cursor: pointer; }
.input-group { display: flex; align-items: center; gap: 6px; }
.password-input { position: relative; }
.password-input .input { padding-right: 40px; }
/* Edge adds its own reveal button to password boxes; ours replaces it. */
.password-input .input::-ms-reveal { display: none; }
.password-toggle {
    position: absolute; top: 0; right: 0; width: 38px; height: 100%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 0 8px 8px 0; background: transparent; color: var(--muted); cursor: pointer;
}
.password-toggle:hover { color: var(--text); }
.password-toggle:focus-visible { outline: none; box-shadow: var(--focus); }
.password-toggle .sc-icon { font-size: 17px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
    width: 38px; height: 22px; border-radius: 999px; flex: none;
    background: var(--border-strong); position: relative; transition: background .15s;
}
.toggle-track::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s;
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-track { box-shadow: var(--focus); }

.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); gap: 2px; }
.segmented button {
    border: 0; background: transparent; color: var(--muted);
    padding: 6px 12px; border-radius: 8px; font: 600 13px var(--font); cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--surface);
    font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; user-select: none;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; white-space: nowrap;
    background: var(--surface-3); color: var(--text-2);
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.dot-online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.dot-offline { background: #94a3b8; }
.dot-warning { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.2); }

/* ---------- Cards & grids ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-body { padding: 18px 20px; }
.card-header { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 650; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.grid-cards-sm { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }

/* Cards don't clip their contents, so a card's "…" menu can open past its edge. Their pictures round their own corners. */
.tile { position: relative; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s, border-color .15s; }
.tile:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.tile-clickable { cursor: pointer; }
.tile-clickable:hover { transform: translateY(-2px); }
.tile-media { position: relative; background: var(--canvas); aspect-ratio: 16 / 9; overflow: hidden; border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0; }
.tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-media .tile-overlay { position: absolute; left: 8px; top: 8px; display: flex; gap: 6px; }
.tile-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-title { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tile-actions { display: flex; gap: 4px; padding: 0 10px 10px; }
/* A card with its menu open stays above its neighbours. Its lift uses top, not transform: a transformed card would
   hold the menu's full-page backdrop (position: fixed) inside itself, so clicking elsewhere wouldn't close the menu. */
.tile:has(.menu), .asset-card:has(.menu) { z-index: 20; }
.tile-clickable:has(.menu), .asset-card:has(.menu) { transform: none; top: -2px; }

.thumb-box { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.thumb-frame { position: relative; box-shadow: 0 4px 14px rgba(0,0,0,.35); overflow: hidden; }

.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 30px; font-weight: 750; letter-spacing: -.02em; }
.stat-sub { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }

.empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px;
    padding: 56px 24px; color: var(--muted);
    border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
    background: var(--surface);
}
.empty > .sc-icon { font-size: 44px; color: var(--accent); opacity: .85; }
.empty h3 { color: var(--text); font-size: 17px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }

/* ---------- Menus ---------- */
.menu-host { position: relative; display: inline-block; }
.menu {
    position: absolute; z-index: 300; min-width: 210px;
    padding: 6px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.menu-right { right: 0; }
.menu-fixed { position: fixed; }
.menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; border: 0; border-radius: 8px;
    background: transparent; color: var(--text); font: 500 13.5px var(--font); text-align: left; cursor: pointer;
}
.menu-item:hover { background: var(--surface-3); }
a.menu-item { text-decoration: none; }
.menu-item:disabled { opacity: .45; cursor: default; background: transparent; }
.menu-item .sc-icon { font-size: 16px; color: var(--muted); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .sc-icon { color: var(--danger); }
.menu-item .shortcut { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.menu-sep { height: 1px; margin: 5px 4px; background: var(--border); }
.menu-backdrop { position: fixed; inset: 0; z-index: 299; }

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    animation: fade-in .15s ease;
}
.modal {
    width: 100%; max-width: 560px; max-height: calc(100vh - 48px);
    display: flex; flex-direction: column;
    background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
    animation: modal-in .18s cubic-bezier(.2,.8,.2,1);
}
.modal-lg { max-width: 860px; }
.modal-xl { max-width: 1180px; }
.modal-full { max-width: none; height: calc(100vh - 48px); }
.modal-header { display: flex; align-items: center; gap: 12px; padding: 18px 22px 12px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.modal-body { padding: 8px 22px 18px; overflow-y: auto; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--border); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1500; display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 40px); }
.toast {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 13px 14px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
    animation: toast-in .25s cubic-bezier(.2,.8,.2,1);
    border-left: 4px solid var(--accent);
}
.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-error { border-left-color: var(--danger); }
.toast-title { font-weight: 700; margin-bottom: 2px; }
.toast-close { margin-left: auto; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } }

/* ---------- Auth screens ---------- */
/* Sign-in, sign-up, setup and the emailed-link screens. Always dark, whatever the editor's theme, in
   the PE Systems colors: the banner's teal and mint on the midnight of pesystemsllc.com. */
.form-error { padding: 10px 12px; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.auth {
    --auth-mint: #7cfcbc;
    --auth-teal: #095450;
    --auth-text: #d3e4e1;
    --auth-muted: #93aeaa;
    position: relative; isolation: isolate; overflow: hidden;
    min-height: 100%;
    display: grid; grid-template-columns: minmax(0, 640px) minmax(360px, 440px);
    justify-content: center; align-items: center; align-content: center; gap: clamp(40px, 8vw, 140px);
    padding: 48px clamp(24px, 7vw, 112px);
    background: #07121a;
    color: #fff;
    color-scheme: dark;
}
/* Glows in the banner's colors (and a little of the website's blue), drifting slowly. */
.auth::before {
    content: ""; position: absolute; inset: -25%; z-index: -2;
    background:
        radial-gradient(38% 45% at 24% 28%, rgba(9, 84, 80, .95), transparent 70%),
        radial-gradient(30% 40% at 78% 72%, rgba(45, 212, 191, .28), transparent 70%),
        radial-gradient(28% 34% at 72% 24%, rgba(96, 165, 250, .18), transparent 70%),
        radial-gradient(26% 30% at 36% 82%, rgba(124, 252, 188, .13), transparent 70%);
    animation: auth-drift 28s ease-in-out infinite alternate;
}
/* A faint grid, like a wall of screens, fading out toward the edges. */
.auth::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background-image:
        linear-gradient(rgba(124, 252, 188, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 252, 188, .05) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 30% 45%, #000 30%, transparent 80%);
    mask-image: radial-gradient(ellipse 70% 70% at 30% 45%, #000 30%, transparent 80%);
}
@keyframes auth-drift {
    from { transform: translate3d(-3%, 2%, 0) rotate(-4deg); }
    to { transform: translate3d(3%, -2%, 0) rotate(6deg) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) { .auth::before { animation: none; } }

.auth-hero { display: flex; flex-direction: column; max-width: 620px; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 28px; font-weight: 700; letter-spacing: -.015em; }
.auth-banner { display: block; width: 300px; max-width: 100%; height: auto; margin-top: 22px; }
.auth-hero h1 { font-size: clamp(36px, 3.8vw, 54px); line-height: 1.06; margin-top: 44px; letter-spacing: -.03em; font-weight: 800; }
.auth-hero p { color: var(--auth-text); font-size: 17px; margin-top: 16px; max-width: 500px; line-height: 1.55; }
.auth-points { display: grid; gap: 14px; margin-top: 30px; }
.auth-point { display: flex; gap: 12px; align-items: center; color: #eef7f5; font-size: 15px; }
.auth-point-icon {
    flex: none; width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(124, 252, 188, .12); border: 1px solid rgba(124, 252, 188, .35); color: var(--auth-mint);
}
.auth-point-icon .sc-icon { font-size: 17px; }
.auth-note { margin-top: 44px; font-size: 12.5px; color: var(--auth-muted); }

/* The form floats on the background in a dark glass card. */
.auth-form { display: flex; justify-content: center; }
.auth-card {
    width: 100%; max-width: 440px; padding: 36px 34px;
    border-radius: 20px;
    background: rgba(6, 16, 22, .74);
    border: 1px solid rgba(124, 252, 188, .16);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.auth-card.stack { gap: 16px; }
.auth-card h2 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card .muted, .auth-card .field-help { color: var(--auth-muted); }
.auth-card strong { color: #fff; }
.auth-card a:not(.btn) { color: var(--auth-mint); font-weight: 600; }
.auth-card code { color: var(--auth-mint); }
.auth-card .field > label { color: #e6f2ef; font-size: 13px; font-weight: 700; }
.auth-card .input {
    height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
    background: #eef6f4; color: #0f172a; font-size: 15px;
}
.auth-card .input::placeholder { color: #7b8d8a; }
.auth-card .input:focus { border-color: var(--auth-mint); box-shadow: 0 0 0 3px rgba(124, 252, 188, .35); }
.auth-card .password-input .input { padding-right: 46px; }
.auth-card .password-toggle { width: 44px; border-radius: 0 10px 10px 0; color: #5f7471; }
.auth-card .password-toggle:hover { color: #0f172a; }
.auth-card .checkbox { color: var(--auth-text); }
.auth-card .checkbox input { accent-color: #2dd4bf; }
/* Mint with teal text, like the "PE" circle. */
.auth-card .btn-gradient, .auth-card .btn-gradient:hover {
    height: 50px; border-radius: 12px;
    background: linear-gradient(135deg, #2dd4bf, var(--auth-mint)); color: #032824;
    font-size: 14.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    box-shadow: 0 10px 24px rgba(45, 212, 191, .22);
}
.auth-card .btn-gradient:hover { filter: brightness(1.07); }
.auth-card .btn-gradient:focus-visible { box-shadow: 0 0 0 3px rgba(124, 252, 188, .45); }
.auth-card .form-error { background: rgba(239, 68, 68, .14); border: 1px solid rgba(248, 113, 113, .35); color: #fecaca; }
.auth-options { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: 13px; }
.auth-footer { text-align: center; color: var(--auth-text); font-size: 13px; }

/* Narrow windows: the card, with the brand and banner above it. */
@media (max-width: 1023px) {
    .auth { grid-template-columns: minmax(0, 440px); justify-content: center; gap: 28px; padding: 32px 16px; }
    .auth-hero { align-items: center; text-align: center; }
    .auth-intro, .auth-note { display: none; }
    .auth-banner { width: 220px; margin-top: 14px; }
}
@media (max-width: 480px) {
    .auth-card { padding: 28px 20px; }
}

/* ---------- Designer ---------- */
.designer { display: grid; grid-template-rows: 54px 1fr; height: 100%; background: var(--bg); }
.designer-top {
    display: flex; align-items: center; gap: 8px; padding: 0 12px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    z-index: 5; min-width: 0;
}
.designer-name {
    border: 1px solid transparent; background: transparent; color: var(--text);
    font: 650 15px var(--font); padding: 6px 8px; border-radius: 8px; width: 240px;
}
.designer-name:hover { border-color: var(--border); }
.designer-name:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); background: var(--surface); }
.top-sep { width: 1px; height: 26px; background: var(--border); margin: 0 4px; }
.saved-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.saved-state.dirty { color: var(--warning); font-weight: 600; }
.designer-body { display: grid; grid-template-columns: 252px 1fr 330px; min-height: 0; }

.panel { background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.panel-left { border-right: 1px solid var(--border); }
.panel-right { border-left: 1px solid var(--border); }
.panel-tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--border); }
.panel-tab {
    flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 8px 8px 0 0;
    font: 600 13px var(--font); color: var(--muted); cursor: pointer;
    border-bottom: 2px solid transparent; display: inline-flex; justify-content: center; align-items: center; gap: 6px;
}
.panel-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.panel-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.panel-section { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.panel-heading { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }

.toolbox-group { padding: 10px 12px 4px; }
.toolbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toolbox-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 6px; border-radius: 11px;
    border: 1px solid var(--border); background: var(--surface-2);
    font-size: 12px; font-weight: 600; color: var(--text-2); text-align: center;
    cursor: grab; user-select: none; transition: border-color .12s, background .12s, transform .12s;
}
.toolbox-item .sc-icon { font-size: 22px; color: var(--accent); }
.toolbox-item:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.toolbox-item:active { cursor: grabbing; }

.layers { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.layer {
    display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px;
    cursor: pointer; user-select: none; font-size: 13px;
}
.layer:hover { background: var(--surface-3); }
.layer.selected { background: var(--accent-soft); color: var(--accent); }
.layer .sc-icon { font-size: 15px; flex: none; }
.layer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-btn { border: 0; background: none; color: var(--muted); padding: 2px; cursor: pointer; border-radius: 5px; display: grid; place-items: center; }
.layer-btn:hover { background: var(--surface); color: var(--text); }
.layer.hidden-layer .layer-name { opacity: .45; text-decoration: line-through; }

.canvas-area { position: relative; min-width: 0; min-height: 0; background: var(--workspace); display: flex; flex-direction: column; }
.dz-viewport {
    position: relative; flex: 1; min-height: 0; overflow: auto;
    background-color: var(--workspace);
    background-image: radial-gradient(var(--workspace-dots) 1px, transparent 1px);
    background-size: 22px 22px;
}
.dz-viewport.dz-drop-target { box-shadow: inset 0 0 0 3px var(--accent); }
.dz-pad { min-width: 100%; min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 48px; width: max-content; }
.dz-surface { position: relative; flex: none; box-shadow: var(--workspace-shadow), 0 0 0 1px var(--workspace-edge); }
.dz-stage-wrap { position: absolute; inset: 0; overflow: hidden; }
.dz-stage-wrap .sc-stage-host { position: absolute; inset: 0; }
.dz-overlay { position: absolute; inset: 0; }
.dz-surface.dz-grid .dz-overlay {
    background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: var(--grid-px) var(--grid-px);
}
.dz-item { position: absolute; cursor: move; outline: 1px solid transparent; transform-origin: 50% 50%; }
.dz-item:hover { outline: 1px solid rgba(45,212,191,.85); }
.dz-item.dz-selected { outline: 2px solid #2dd4bf; z-index: 2; }
.dz-item.dz-primary { outline: 2px solid var(--brand-mint); }
.dz-item.dz-locked { cursor: default; }
.dz-item.dz-locked.dz-selected { outline-style: dashed; }
.dz-handle {
    position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px;
    background: #fff; border: 2px solid #14b8a6; border-radius: 3px; z-index: 3;
}
.dz-handle[data-handle=nw] { left: 0; top: 0; cursor: nwse-resize; }
.dz-handle[data-handle=n] { left: 50%; top: 0; cursor: ns-resize; }
.dz-handle[data-handle=ne] { left: 100%; top: 0; cursor: nesw-resize; }
.dz-handle[data-handle=e] { left: 100%; top: 50%; cursor: ew-resize; }
.dz-handle[data-handle=se] { left: 100%; top: 100%; cursor: nwse-resize; }
.dz-handle[data-handle=s] { left: 50%; top: 100%; cursor: ns-resize; }
.dz-handle[data-handle=sw] { left: 0; top: 100%; cursor: nesw-resize; }
.dz-handle[data-handle=w] { left: 0; top: 50%; cursor: ew-resize; }
.dz-tag {
    position: absolute; left: -2px; top: -22px;
    padding: 2px 7px; border-radius: 5px 5px 5px 0;
    background: #0f766e; color: #fff; font-size: 11px; font-weight: 600; white-space: nowrap;
    pointer-events: none;
}
.dz-lock { position: absolute; right: 4px; top: 4px; color: #fff; background: rgba(15,23,42,.7); border-radius: 5px; padding: 2px; font-size: 12px; pointer-events: none; }
.dz-guides { position: absolute; inset: 0; pointer-events: none; }
.dz-guide { position: absolute; background: #f472b6; }
.dz-guide-x { top: -2000px; bottom: -2000px; width: 1px; }
.dz-guide-y { left: -2000px; right: -2000px; height: 1px; }
.dz-marquee { position: absolute; display: none; border: 1px solid #2dd4bf; background: rgba(45,212,191,.15); pointer-events: none; }
.dz-marquee.dz-visible { display: block; }

/* Zoom, snap and grid under the canvas, in the theme's colors like the panels beside it. */
.canvas-bar {
    display: flex; align-items: center; gap: 6px; padding: 7px 12px;
    background: var(--surface); color: var(--muted); font-size: 12px; border-top: 1px solid var(--border);
}

.inspector-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.inspector-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 18px; flex: none; }
.geo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.geo-grid .field > label { font-size: 11.5px; }
.align-bar { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- Property grid ---------- */
.prop-section { border-bottom: 1px solid var(--border); }
.prop-section-header {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 11px 14px; border: 0; background: transparent; cursor: pointer;
    font: 700 11.5px var(--font); text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.prop-section-header .sc-icon { margin-left: auto; transition: transform .15s; }
.prop-section.collapsed .prop-section-header .sc-icon { transform: rotate(-90deg); }
.prop-section-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.prop-section.collapsed .prop-section-body { display: none; }
.prop-inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prop-inline > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.slider-row { display: flex; align-items: center; gap: 8px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--accent); }
.slider-row .input { width: 74px; }

.color-field { display: flex; align-items: center; gap: 6px; }
.swatch {
    position: relative; width: 34px; height: 34px; border-radius: 8px; flex: none; cursor: pointer; overflow: hidden;
    border: 1px solid var(--border-strong);
    background-image: linear-gradient(45deg, #cbd5e1 25%, transparent 25%), linear-gradient(-45deg, #cbd5e1 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #cbd5e1 75%), linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
    background-size: 10px 10px; background-position: 0 0, 0 5px, 5px -5px, -5px 0;
    background-color: #fff;
}
.swatch-fill { position: absolute; inset: 0; }
.swatch input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.swatch-none::after { content: ''; position: absolute; left: -4px; right: -4px; top: 50%; height: 2px; background: #ef4444; transform: rotate(-45deg); }
.color-presets { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.color-preset { width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }

.list-editor { display: flex; flex-direction: column; gap: 8px; }
.list-item { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.list-item-header { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; }
.list-item-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.list-item-body { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); }
.string-row { display: flex; gap: 4px; align-items: center; }

.asset-field { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); }
.asset-thumb { width: 52px; height: 40px; border-radius: 7px; background: var(--surface-3) center/cover no-repeat; flex: none; display: grid; place-items: center; color: var(--muted); font-size: 18px; overflow: hidden; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }

.slides-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slide-cell { position: relative; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: var(--surface-3) center/cover no-repeat; border: 1px solid var(--border); }
.slide-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-cell .slide-tools { position: absolute; inset: auto 3px 3px 3px; display: none; justify-content: space-between; }
.slide-cell:hover .slide-tools { display: flex; }
.slide-cell .slide-tools button { border: 0; border-radius: 6px; background: rgba(15,23,42,.8); color: #fff; padding: 3px; display: grid; place-items: center; cursor: pointer; }
.slide-index { position: absolute; left: 4px; top: 4px; font-size: 10px; font-weight: 700; background: rgba(15,23,42,.75); color: #fff; padding: 1px 5px; border-radius: 5px; }
.slide-add { aspect-ratio: 4/3; border-radius: 8px; border: 2px dashed var(--border-strong); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; font-size: 20px; }
.slide-add:hover { border-color: var(--accent); color: var(--accent); }

.table-editor { overflow: auto; max-height: 340px; border: 1px solid var(--border); border-radius: 10px; }
.table-editor table { border-collapse: collapse; width: 100%; }
.table-editor th, .table-editor td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0; min-width: 90px; }
.table-editor input { width: 100%; border: 0; padding: 7px 8px; background: transparent; font: 13px var(--font); color: var(--text); }
.table-editor th input { font-weight: 700; background: var(--surface-3); }
.table-editor input:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--surface); }
.table-editor .row-tools { min-width: 0; width: 30px; text-align: center; }

/* ---------- Asset library ---------- */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.asset-card { position: relative; border-radius: 13px; border: 2px solid transparent; background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .12s, transform .12s; }
.asset-card:hover { transform: translateY(-2px); }
.asset-card.selected { border-color: var(--accent); }
.asset-card .check { position: absolute; right: 8px; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 14px; }
.asset-preview { aspect-ratio: 4/3; background: var(--canvas); display: grid; place-items: center; color: #94a3b8; font-size: 34px; position: relative; overflow: hidden; border-radius: 11px 11px 0 0; }
.asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.asset-kind { position: absolute; left: 8px; bottom: 8px; }
.asset-info { padding: 9px 11px; }
.asset-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-meta { font-size: 11.5px; color: var(--muted); }
.dropzone { position: relative; }
.dropzone.drop-active::after {
    content: 'Drop files to upload'; position: absolute; inset: 0; z-index: 10;
    display: grid; place-items: center; font-size: 20px; font-weight: 700; color: var(--accent);
    background: rgba(20,184,166,.08); border: 3px dashed var(--accent); border-radius: 16px;
}
.upload-progress { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }

/* ---------- Displays ---------- */
.display-card .tile-media { background: #0b0f19; }
.display-status { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; }
.display-now { font-size: 12.5px; color: var(--text-2); display: flex; gap: 6px; align-items: center; min-width: 0; }
.pair-code {
    font: 700 28px 'Cascadia Code', Consolas, monospace; letter-spacing: .25em; text-align: center; text-transform: uppercase;
    height: 58px;
}
.screenshot-big { width: 100%; border-radius: 12px; background: #000; display: block; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.command-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

/* ---------- Playlists & schedules ---------- */
.playlist-item {
    display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface);
}
.playlist-item.drag-over { border-color: var(--accent); box-shadow: var(--focus); }
.playlist-thumb { position: relative; width: 120px; aspect-ratio: 16/9; flex: none; border-radius: 8px; overflow: hidden; background: var(--canvas); }
.drag-handle { cursor: grab; color: var(--muted); font-size: 18px; display: grid; place-items: center; }
.week { display: grid; grid-template-columns: 44px repeat(7, 1fr); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.week-head { padding: 8px 4px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.week-hours { position: relative; border-right: 1px solid var(--border); }
.week-hour-label { position: absolute; right: 6px; font-size: 10px; color: var(--muted); transform: translateY(-50%); }
.week-day { position: relative; border-right: 1px solid var(--border); background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% calc(100% / 12); }
.week-day:last-child { border-right: 0; }
.week-block {
    position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 3px 5px;
    font-size: 10.5px; font-weight: 700; color: #fff; overflow: hidden; line-height: 1.2;
    box-shadow: 0 2px 6px rgba(0,0,0,.18); opacity: .92;
}
.week-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; }
.rule {
    border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 14px;
    display: flex; flex-direction: column; gap: 12px; border-left: 5px solid var(--rule-color, var(--accent));
}
.rule-active { box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.day-chip {
    width: 40px; height: 32px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface);
    font: 700 12px var(--font); color: var(--muted); cursor: pointer;
}
.day-chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Alerts ---------- */
.alert-preview {
    border-radius: 14px; padding: 22px; color: #fff; text-align: center;
    display: flex; flex-direction: column; gap: 8px; min-height: 160px; justify-content: center;
}
.alert-preview h3 { font-size: 24px; }
.sev-info { background: linear-gradient(135deg, #1d4ed8, #0ea5e9); }
.sev-warning { background: linear-gradient(135deg, #b45309, #f59e0b); }
.sev-emergency { background: linear-gradient(135deg, #991b1b, #ef4444); }
.alert-presets { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Template gallery ---------- */
.template-card { cursor: pointer; }
.template-card.selected { border-color: var(--accent); box-shadow: var(--focus); }
.template-blank { display: grid; place-items: center; font-size: 34px; color: var(--accent); background: var(--accent-soft); }
.preset-card { padding: 14px; display: flex; gap: 12px; align-items: center; cursor: pointer; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.preset-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.preset-shape { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-radius: 4px; flex: none; }

/* ---------- Getting started ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.step { display: flex; gap: 12px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--accent-soft); color: var(--accent); flex: none; }
.step.done .step-num { background: var(--success-soft); color: var(--success); }

.preview-stage { position: relative; width: 100%; height: 100%; background: #000; border-radius: 12px; overflow: hidden; }

@media (max-width: 1100px) {
    .designer-body { grid-template-columns: 210px 1fr 290px; }
}
@media (max-width: 860px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .page { padding: 20px 16px 40px; }
}
