/* =================================================================
   Vibrand Invite — dashboard styles
   Order: tokens → base → layout → components → pages → responsive
   ================================================================= */

/* ---------- Tokens ---------- */
:root {
    --ink: #1d1d1b;
    --ink-2: #4a4f53;
    --muted: #6f6a66;
    --line: #e7e1d8;
    --line-strong: #d6cec2;
    --bg: #f7f4ef;
    --surface: #ffffff;
    --surface-2: #fbf9f6;
    --accent: #c4473e;          /* Vibrand red, darkened for text contrast */
    --accent-hover: #a83a32;
    --on-accent: #ffffff;

    --yes: #2f7d4f;
    --yes-bg: #e5f2e9;
    --no: #a33a32;
    --no-bg: #f8e6e4;
    --pending: #8a6100;
    --pending-bg: #fbf0d6;
    --wa: #128c4b;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgb(29 29 27 / .04), 0 4px 18px rgb(29 29 27 / .05);
    --focus: 0 0 0 3px rgb(196 71 62 / .3);

    --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --serif: 'Noto Serif', Georgia, serif;
    --wrap: 1180px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 400 15px/1.55 var(--font);
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font: 500 clamp(1.7rem, 3vw, 2.3rem)/1.15 var(--serif); letter-spacing: -.01em; }
h1 em, .brand em { font-style: italic; color: var(--accent); }
h2 { font-size: 1.02rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
code { font: .86em/1.4 ui-monospace, 'SFMono-Regular', Consolas, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); }
q { quotes: '“' '”'; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.block { display: block; }
.top-gap { margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 28px 24px 64px; display: flex; flex-direction: column; gap: 18px; }

.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px 24px;
    background: rgb(247 244 239 / .9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.topbar-nav { display: flex; align-items: center; gap: 18px; font-size: .88rem; font-weight: 500; }
.topbar-nav a { color: var(--ink-2); text-decoration: none; }
.topbar-nav a:hover { color: var(--ink); }
.topbar-nav form { margin: 0; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.brand em { font-family: var(--serif); font-weight: 500; }
.brand-mark {
    display: grid; place-items: center;
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--ink); color: #f5f0e8;
    font: 500 1rem/1 var(--serif);
}
.brand-lg { font-size: 1.1rem; }
.brand-lg .brand-mark { width: 36px; height: 36px; font-size: 1.15rem; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.page-head p.muted { margin-top: 6px; }
.head-actions, .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { display: flex; gap: 8px; margin: 0; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: -8px; }
.crumbs a { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 12px;
    min-width: 0;
}
.card.narrow { max-width: 520px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card.callout { border-color: var(--line-strong); background: #fffaf0; }
.card.danger { border-color: #efd3cf; }
.card.danger h2 { color: var(--no); }
.card.empty, .empty { text-align: center; padding: 40px 20px; align-items: center; gap: 8px; }
.empty p { max-width: 460px; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; padding: 8px 16px;
    font: 600 .86rem/1.2 var(--font);
    color: var(--ink); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: 999px;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-2); color: var(--ink); }
.btn-sm { min-height: 34px; padding: 6px 13px; font-size: .8rem; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #383e42; border-color: #383e42; color: #fff; }
.btn-light { background: #f5f0e8; border-color: #f5f0e8; color: var(--ink); }
.btn-light:hover { background: #fff; color: var(--ink); }
.btn-block { width: 100%; min-height: 46px; }
.btn-danger { background: var(--no); border-color: var(--no); color: #fff; }
.btn-danger:hover { background: #8a2f28; border-color: #8a2f28; color: #fff; }
.btn-danger-ghost { color: var(--no); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: #0e7a40; border-color: #0e7a40; color: #fff; }
.btn.is-copied { border-color: var(--yes); color: var(--yes); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; }
.link-btn:hover { color: var(--ink); text-decoration: underline; }

.icon-btn {
    display: inline-grid; place-items: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: transparent; border: 1px solid transparent; color: var(--ink-2);
    cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn.wa { color: var(--wa); }
.icon-btn.wa svg { fill: currentColor; }
.icon-btn.is-copied { color: var(--yes); background: var(--yes-bg); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, legend { font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.field small, legend small { font-weight: 400; color: var(--muted); margin-left: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url],
input[type=number], input[type=date], input[type=search], select, textarea {
    width: 100%; min-height: 42px; padding: 9px 12px;
    font: 400 .92rem/1.4 var(--font); color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink-2); box-shadow: var(--focus); }
input[type=file] { font: inherit; font-size: .86rem; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; cursor: pointer; align-self: end; padding-bottom: 10px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.form-error { color: var(--no); font-size: .86rem; font-weight: 500; }
.hint { font-size: .8rem; color: var(--muted); text-align: center; }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.inline-form input { flex: 1 1 200px; width: auto; }

.copy-field { display: flex; gap: 8px; min-width: 0; }
.copy-field input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: .84rem; background: var(--surface-2); }

fieldset.reply-set { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin: 0; display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
legend { padding: 0 6px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; background: var(--surface-2); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 16px; border-radius: 999px; font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { box-shadow: var(--focus); }
.field-inline { width: 150px; }

/* ---------- Flash messages ---------- */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500; border: 1px solid; }
.flash-ok { background: var(--yes-bg); border-color: #c4e0cd; color: #1f5e39; }
.flash-error { background: var(--no-bg); border-color: #efc9c4; color: #7e2a24; }
.flash-warn { background: var(--pending-bg); border-color: #f0dcaa; color: #6b4b00; }

/* ---------- Pills, tags ---------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill-yes { background: var(--yes-bg); color: var(--yes); border-color: transparent; }
.pill-no { background: var(--no-bg); color: var(--no); border-color: transparent; }
.pill-pending { background: var(--pending-bg); color: var(--pending); border-color: transparent; }
.tag { font-size: .72rem; font-weight: 500; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.tag-warn { background: var(--pending-bg); border-color: transparent; color: var(--pending); }
.count { font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; margin-left: 6px; vertical-align: 2px; }

/* ---------- Login page ---------- */
.login-page { background: var(--ink); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-card {
    background: var(--bg);
    display: flex; flex-direction: column; justify-content: center; gap: 22px;
    padding: 48px max(32px, 8vw);
}
.login-card h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-top: 18px; }
.login-card form { max-width: 380px; }
.login-card .hint { max-width: 380px; text-align: left; }
.login-aside {
    display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 14px;
    padding: 48px max(32px, 6vw);
    color: #f5f0e8;
    background:
        radial-gradient(circle at 80% 15%, rgb(196 71 62 / .35), transparent 45%),
        radial-gradient(circle at 15% 85%, rgb(245 240 232 / .08), transparent 40%),
        var(--ink);
}
.login-aside .eyebrow { color: #c9bfb2; }
.login-aside h2 { font: 500 clamp(1.6rem, 3vw, 2.3rem)/1.15 var(--serif); }
.login-aside p:not(.eyebrow) { color: #d9d1c6; max-width: 380px; }
.login-aside .btn { margin-top: 8px; }

/* ---------- Admin: couples ---------- */
.couple-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 16px; }
.couple.is-archived { opacity: .7; }
.couple-main { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.couple-names { font: 500 1.35rem/1.2 var(--serif); }
.couple-names a { color: var(--ink); text-decoration: none; }
.couple-names a:hover { text-decoration: underline; }
.couple-main p { margin-top: 4px; font-size: .86rem; }
.mini-stats { display: flex; gap: 18px; margin: 0; }
.mini-stats div { text-align: right; }
.mini-stats dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.mini-stats dd { margin: 0; font: 500 1.3rem/1.2 var(--serif); }
.couple-api { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.couple-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }

.creds { margin: 0; padding: 14px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); font: .88rem/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.api-doc summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.api-doc[open] summary { margin-bottom: 10px; }
.api-doc p { margin-top: 8px; }
table.plain { border-collapse: collapse; width: 100%; font-size: .84rem; }
table.plain td, table.plain th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.plain th { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.api-doc table.plain { display: block; overflow-x: auto; }
.api-doc td:nth-child(2) code { white-space: nowrap; }

ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
ul.rows li div { display: flex; flex-direction: column; }

/* ---------- Couple dashboard ---------- */
.names { font-size: clamp(2rem, 4.2vw, 3rem); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow);
    display: flex; flex-direction: column; gap: 2px;
    border-top: 3px solid var(--line-strong);
}
.stat-yes { border-top-color: var(--yes); }
.stat-no { border-top-color: var(--no); }
.stat-pending { border-top-color: #d9a520; }
.stat-label { font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat-value { font: 500 2.3rem/1.15 var(--serif); }
.stat-sub { font-size: .8rem; color: var(--muted); }
.meter { display: block; height: 6px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 4px; }
.meter span { display: block; height: 100%; background: var(--ink); border-radius: 99px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.activity { position: sticky; top: 76px; }

.add-guest { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.grid-add { display: grid; grid-template-columns: 2fr .6fr 1.2fr 1.2fr 1fr 1.4fr; gap: 12px; width: 100%; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select { width: auto; flex: 0 0 auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: 600 .8rem/1 var(--font); padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--ink-2); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

table.guests { width: 100%; border-collapse: collapse; font-size: .88rem; }
.guests th { text-align: left; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-strong); }
.guests td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.guests tbody tr:hover { background: var(--surface-2); }
.guests .num { text-align: center; width: 60px; }
.guests td .small { margin-left: 4px; }
.guests td .small.block { margin-left: 0; margin-top: 3px; }
.guest-cell { display: flex; flex-direction: column; gap: 4px; }
.guest-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.guest-name:hover { text-decoration: underline; color: var(--ink); }
.guest-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: .78rem; color: var(--muted); }
.guest-msg { font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: .86rem; }
.guest-note { font-size: .78rem; color: var(--muted); }
.row-actions { white-space: nowrap; text-align: right; width: 1%; padding-top: 6px !important; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.feed li:last-child { border-bottom: 0; }
.feed q { display: block; font-family: var(--serif); font-style: italic; color: var(--ink-2); margin-top: 3px; }
.feed-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--line-strong); }
.feed-yes .feed-dot { background: var(--yes); }
.feed-no .feed-dot { background: var(--no); }

table.example td { white-space: nowrap; }
.card:has(table.example) { overflow-x: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
    .dash-grid { grid-template-columns: 1fr; }
    .activity { position: static; }
    .grid-add { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 760px) {
    .wrap { padding: 20px 16px 48px; gap: 14px; }
    .topbar { padding: 10px 16px; }
    .topbar-nav { gap: 14px; }
    .card { padding: 18px 16px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 14px; }
    .stat-value { font-size: 1.9rem; }
    .grid-2, .grid-add { grid-template-columns: 1fr; }
    .add-guest .grid-add { grid-template-columns: 1fr 1fr; }
    .add-guest .grid-add .field:first-child { grid-column: 1 / -1; }
    .page-head { align-items: flex-start; }
    .mini-stats div { text-align: left; }

    .login-shell { grid-template-columns: 1fr; }
    .login-card { padding: 40px 20px; min-height: auto; }
    .login-card h1 { margin-top: 6px; }
    .login-aside { padding: 36px 20px 44px; }

    /* Guest table → stacked cards */
    table.guests thead { display: none; }
    table.guests, .guests tbody, .guests tr, .guests td { display: block; width: auto; }
    .guests tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas: "guest actions" "reply seen";
        gap: 8px 12px;
        padding: 14px 0;
        border-bottom: 1px solid var(--line);
    }
    .guests tbody tr:hover { background: none; }
    .guests td { padding: 0; border: 0; }
    .guests td.guest-cell { grid-area: guest; }
    .guests td.num { display: none; }
    .guests td[data-label="Reply"] { grid-area: reply; }
    .guests td[data-label="Seen"] { grid-area: seen; text-align: right; }
    .guests td.row-actions { grid-area: actions; padding: 0 !important; }
    .filters select { flex: 1 1 40%; }
}

/* ---------- Invitation editor ---------- */
.editor-page .wrap { max-width: 1600px; }
.editor-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.editor-shell.with-preview { grid-template-columns: 240px minmax(0, 1fr) 420px; }

.files-panel { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; padding: 16px; gap: 14px; }
.file-list { list-style: none; margin: 0 -8px; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.file-list a {
    display: flex; align-items: center; gap: 9px;
    padding: 6px 8px; border-radius: 8px;
    color: var(--ink-2); text-decoration: none; font-size: .84rem;
}
.file-list a:hover { background: var(--surface-2); color: var(--ink); }
.file-list .is-current a { background: var(--ink); color: #fff; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-icon {
    flex: none; width: 34px; text-align: center;
    font: 700 .6rem/1.9 var(--font); letter-spacing: .04em;
    border-radius: 5px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.file-icon.ext-php { background: #ecebfa; color: #4f4a9e; border-color: transparent; }
.file-icon.ext-css { background: #e3f0fa; color: #22629a; border-color: transparent; }
.file-icon.ext-js { background: #fbf3d6; color: #7d6200; border-color: transparent; }
.is-current .file-icon { background: rgb(255 255 255 / .16); color: #fff; border-color: transparent; }
.lock { font-size: .7rem; opacity: .7; }
.side-form { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.side-form input[type=file] { font-size: .78rem; }
.side-form .btn { align-self: flex-start; }

.code-panel { padding: 16px; gap: 10px; }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.code-head > div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.code-file { font: 600 .9rem/1.3 ui-monospace, Consolas, monospace; }
.code-head select { width: auto; min-height: 34px; padding: 5px 10px; font-size: .8rem; }
.save-state.is-dirty { color: var(--pending); font-weight: 600; }
kbd { font: 500 .68rem/1 var(--font); opacity: .7; margin-left: 4px; padding: 2px 4px; border: 1px solid rgb(255 255 255 / .4); border-radius: 4px; }

.code-panel .CodeMirror {
    height: calc(100vh - 290px); min-height: 420px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    font: 13px/1.55 ui-monospace, 'Cascadia Code', Consolas, monospace;
}
.CodeMirror-gutters { background: var(--surface-2); border-right-color: var(--line); }
.CodeMirror-activeline-background { background: #f6f2ea; }
.cm-error-line { background: #fde3df !important; }
.CodeMirror-readonly .CodeMirror-cursor { display: none; }

.media-preview { display: grid; place-items: center; min-height: 240px; padding: 20px; border-radius: var(--radius-sm); border: 1px solid var(--line);
    background: repeating-conic-gradient(#f3efe8 0 25%, #fff 0 50%) 0 0 / 20px 20px; }
.media-preview img, .media-preview video { max-width: 100%; max-height: 60vh; border-radius: 6px; }
.media-preview audio { width: min(100%, 420px); }
.delete-file { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.danger-link { color: var(--no); font-size: .82rem; }

.preview-panel { position: sticky; top: 76px; padding: 14px; gap: 10px; }
.phone-frame { border: 1px solid var(--line-strong); border-radius: 22px; overflow: hidden; background: #fff; height: calc(100vh - 170px); }
.phone-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 1100px) {
    .editor-shell, .editor-shell.with-preview { grid-template-columns: 1fr; }
    .files-panel, .preview-panel { position: static; max-height: none; }
    .preview-panel { order: 3; }
    .phone-frame { height: 640px; max-width: 420px; margin: 0 auto; width: 100%; }
}
@media (max-width: 760px) {
    .code-panel .CodeMirror { height: 60vh; min-height: 320px; font-size: 12px; }
}
