/* Poliquicks site editor — chrome mirrors the platform admin (docs/admin/admin.css)
   so signing in and editing feel like one product: cool-gray surface, indigo
   primary, system font, 8px cards / 6px controls, near-invisible shadows.
   The indigo is deliberate (see admin.css) — it reads as the platform, not as a
   campaign page. Brand purple lives in the logo lockup only.

   Editor-only dark mode: every color is a token, flipped under
   :root[data-theme="dark"] and by system preference when the user hasn't chosen.
   Anything that shows the CANDIDATE's site (preview iframe, party preview) stays
   light in both modes — it's their content, not our chrome. */

:root {
    /* The brandnewsite look (owner, 2026-11-08): its paper, navy ink and the
       logo's yellow as a marker, Inter headings over Public Sans (owner,
       2026-11-10: Inter, not brandnewsite's Newsreader, which stays only on the
       Brand New Site wordmark). Colours match
       brandnewsite/site/index.html's :root. */
    --bg: #f3ede1;            /* paper */
    --surface: #fffdf9;       /* cards on the paper */
    --surface-2: #fbf8f1;
    --surface-3: #ebe3d3;     /* paper-2: hovers, wells */
    --text: #1d2236;          /* ink */
    --muted: #5c5a55;
    --border: #dad1bf;        /* rule */
    --border-strong: #bfb4a0;
    --primary: #1f2a4a;       /* accent navy */
    --primary-hover: #2c3a63;
    --primary-light: #1f2a4a; /* flat, like brandnewsite's buttons (was a gradient's second stop) */
    --primary-soft: #f7edbf;  /* the marker yellow, softened: active tabs, selected rows */
    --on-primary: #fbf8f1;    /* text on a primary fill */
    --sun: #f5e38f;
    --ring: rgba(31, 42, 74, 0.18);
    --danger: #9c2c1b;
    --danger-soft: #f7e6df;
    --success: #1f5a43;
    --warning: #8a5a12;
    --warning-soft: #f6ecd2;
    --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-logo: "Newsreader", Georgia, "Times New Roman", serif;   /* the Brand New Site wordmark only, as on brandnewsite.org */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 999px;
    --shadow: 0 1px 2px rgba(29,34,54,0.05);
    --shadow-lg: 0 18px 40px -18px rgba(31,42,74,0.45);
    --transition: 0.15s ease;
    --topbar-h: 56px;
    /* Shell width. Wide enough that the form column reaches its cap and the
       preview pane still lands within a hair of a 1280px desktop viewport
       (832 form + 20 gap + 1220 + 48 padding = 2120, so the preview renders
       at ~95%); narrower screens scale the preview down further. */
    --page-max: 2120px;
    /* The editor's two columns, shared with .tabs so the tab groups line up.
       The 52rem cap is where form fields stop gaining from more width; every
       pixel past it goes to the preview, which is the thing that gets
       unreadable when scaled down. The 48% keeps laptop widths at roughly an
       even split — only wide screens have surplus to hand the preview. */
    --editor-cols: minmax(0, min(48%, 52rem)) minmax(0, 1fr);
}

/* Dark mode — explicit choice wins. */
/* DARK MODE OFF (owner, 2026-11-08) — explicit dark tokens:
:root[data-theme="dark"] {
    --bg: #141829;
    --surface: #1b2036;
    --surface-2: #20263f;
    --surface-3: #272e4a;
    --text: #f3ede1;
    --muted: #b9b1a2;
    --border: #2f3756;
    --border-strong: #424b70;
    --primary: #f5e38f;
    --primary-hover: #f8eaa8;
    --primary-light: #f5e38f;
    --primary-soft: #2e3352;
    --on-primary: #141829;
    --ring: rgba(245, 227, 143, 0.25);
    --danger: #f0a08f;
    --danger-soft: #3a2226;
    --success: #8fd0b0;
    --warning: #f0c86a;
    --warning-soft: #3a3020;
    --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
}
*/

/* System preference, only when the user hasn't explicitly picked light. */
/* DARK MODE OFF (owner, 2026-11-08) — system-preference dark tokens:
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #141829;
        --surface: #1b2036;
        --surface-2: #20263f;
        --surface-3: #272e4a;
        --text: #f3ede1;
        --muted: #b9b1a2;
        --border: #2f3756;
        --border-strong: #424b70;
        --primary: #f5e38f;
        --primary-hover: #f8eaa8;
        --primary-light: #f5e38f;
        --primary-soft: #2e3352;
        --on-primary: #141829;
        --ring: rgba(245, 227, 143, 0.25);
        --danger: #f0a08f;
        --danger-soft: #3a2226;
        --success: #8fd0b0;
        --warning: #f0c86a;
    --warning-soft: #3a3020;
        --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
        --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
    }
}
*/

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Load-bearing: JS toggles the `hidden` ATTRIBUTE on #editor, which is
   display:grid — this needs !important to win. Do not remove. */
[hidden] { display: none !important; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--text); }
.muted { color: var(--muted); }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Same Safari select fix as the platform admin: native <select> ignores our
   padding, so normalise appearance and draw the chevron ourselves. The gray
   is picked to stay legible in both light and dark themes. */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* =============== TOPBAR =============== */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-inner {
    max-width: var(--page-max);
    margin: 0 auto;
    height: var(--topbar-h);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}
.topbar-brand img { height: 26px; width: auto; display: block; }
.topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    flex-shrink: 0;
}
.topbar-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}
#tenant-label a { color: inherit; text-decoration: none; }
#tenant-label a:hover { color: var(--text); text-decoration: underline; }
#tenant-label {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    text-decoration: none;
    font-size: 1rem;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}
.back-link:hover { background: var(--surface-3); color: var(--text); }

.topbar-right { display: flex; gap: 0.6rem; align-items: center; }

/* Profile menu: initials button → Settings / Sign out. */
.profile { position: relative; }
.profile-btn {
    width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-soft); color: var(--primary);
    border: 1px solid transparent;
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em;
    cursor: pointer;
    transition: box-shadow var(--transition), border-color var(--transition);
}
.profile-btn:hover, .profile-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--ring); }
.profile-btn .ico { width: 1.05rem; height: 1.05rem; }
.profile-btn.active { border-color: var(--primary); }
.profile-menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    min-width: 13rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,0.12));
    padding: 0.35rem;
    z-index: 50;
}
.profile-menu-head {
    font-size: 0.78rem; color: var(--muted);
    padding: 0.45rem 0.65rem 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.3rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-menu-head:empty { display: none; }
.profile-menu button {
    display: flex; align-items: center; gap: 0.55rem;
    width: 100%; text-align: left;
    padding: 0.5rem 0.65rem;
    background: transparent; border: 0; border-radius: var(--radius-sm);
    color: var(--text); font-size: 0.9rem; cursor: pointer;
}
.profile-menu button:hover { background: var(--surface-2); }
.profile-menu .ico { width: 1rem; height: 1rem; color: var(--muted); }

/* Visitor count (loadVisits): who's looking at the site, always in view. */
.visits-chip {
    display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
    font-size: 0.85rem; font-weight: 500; color: var(--text);
    padding: 0.3rem 0.7rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2);
    cursor: default;
}
.visits-chip .ico { width: 1rem; height: 1rem; color: var(--muted); }
.visits-chip strong { font-weight: 700; }
@media (max-width: 760px) { .visits-chip { display: none !important; } }

/* JS overwrites #dirty-status.className ('muted' | ''), so style by ID only and
   key the "unsaved" look off :not(.muted). Never add a persistent class here. */
#dirty-status {
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
#dirty-status:not(.muted) { color: var(--warning); font-weight: 500; }
#dirty-status:not(.muted)::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--warning);
    flex-shrink: 0;
}


#save-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--on-primary);
    border: 1px solid var(--primary);
    padding: 0.5rem 1.05rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 1px 2px var(--ring);
    transition: box-shadow var(--transition), background var(--transition), opacity var(--transition);
}
#save-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    box-shadow: 0 3px 10px var(--ring);
}
#save-btn:disabled {
    background: var(--surface-3);
    color: var(--muted);
    border-color: var(--border);
    box-shadow: none;
    cursor: not-allowed;
}

button.ghost {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border-strong);
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
button.ghost:hover { color: var(--text); background: var(--surface-3); }

.icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn-danger:hover { color: var(--danger); background: var(--danger-soft); }

/* =============== LOADING / ERROR SCREEN =============== */
.connect {
    min-height: calc(100vh - var(--topbar-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.connect-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
}
.connect-card h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.error {
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: left;
}

/* =============== SPLIT EDITOR LAYOUT =============== */
#editor {
    display: grid;
    grid-template-columns: var(--editor-cols);
    gap: 0 1.25rem;          /* rows own their spacing via padding/margin */
    padding: 0 1.5rem 2rem;
    max-width: var(--page-max);
    margin: 0 auto;
    align-items: start;
}
/* Tabs navigate the whole editor, so they span both columns; the form and the
   preview sit side by side beneath them. */
#editor > .tabs { grid-column: 1 / -1; }
.editor-left { min-width: 0; }
/* Graphics tab: the canvas is the preview, so the site preview pane is dropped
   and the panel spans the full width. */
#editor.no-preview { grid-template-columns: minmax(0, 1fr); }
#editor.no-preview .editor-right { display: none; }
/* ...but with no preview beside it there's nothing to spend the extra width
   on, so cap the panel rather than stretch a form across the whole shell. */
#editor.no-preview .editor-left { max-width: 1400px; }
#editor.no-preview.wide-panel .editor-left { max-width: none; }
.editor-right {
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h) - 14px);
    display: flex;
    flex-direction: column;
    padding-top: 1.1rem;     /* matches .panels so form and preview line up */
    min-width: 0;
}

/* =============== PREVIEW =============== */
#preview-close { display: none; margin-left: auto; }
#preview-fab { display: none; }

.preview-bar {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 0;
    font-size: 0.85rem;
}
.preview-label { display: flex; align-items: baseline; gap: 0.4rem; min-width: 0; white-space: nowrap; }
.preview-label strong { font-size: 0.85rem; font-weight: 600; }
.preview-label span { font-size: 0.85rem; color: var(--muted); }
.preview-bar select {
    padding: 0.3rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.preview-bar select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
/* The page picker as a tab — drawn as a button so it reads as THE control. */
.page-picker { position: relative; align-self: center; margin: 0.25rem 0.35rem 0.25rem 0; }
.tabs .tab-select {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.45rem 0.6rem 0.45rem 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.tabs .tab-select:hover, .tabs .tab-select.active:hover { border-color: var(--muted); }
/* The page being edited: the rule border every other card uses, its name marked with
   brandnewsite's highlighter rather than a dark outline (owner, 2026-11-08). */
.tabs .tab-select.active { border-color: var(--border-strong); color: var(--text); box-shadow: none; }
.tabs .tab-select.active #page-name {
    background: linear-gradient(transparent 58%, var(--sun) 58%, var(--sun) 92%, transparent 92%);
    padding-inline: 0.12em;
}
/* The picker spans the form column it governs, so its edges line up with the
   fields below and the on/off switch has a fixed home beside it. The "Back to
   editor" state (.away) stays a compact link. */
.tabs-left { width: 100%; }
.page-picker { flex: 1; display: flex; min-width: 0; }
.tabs .tab-select:not(.away) { flex: 1; }
.tabs .tab-select:not(.away) .chev { margin-left: auto; }
.tabs .tab-select.away { flex: none; }
.page-picker:has(.tab-select.away) { flex: none; }
/* The menu drops to exactly the picker's width. */
.page-picker { position: relative; }
.page-picker .menu { width: 100%; }
/* Home's switch is on and locked — muted so it doesn't invite a click. */
.page-live.locked { cursor: default; }
.page-live.locked input[type="checkbox"] { cursor: default; }
.tabs .tab-select .ico { width: 1.05rem; height: 1.05rem; }
.tabs .tab-select .chev { width: 0.9rem; height: 0.9rem; color: var(--muted); }
.tabs .tab-select .tab-select-back { display: none; }
.tabs .tab-select.away #page-name, .tabs .tab-select.away .chev, .tabs .tab-select.away > .ico:first-child { display: none; }
.tabs .tab-select.away .tab-select-back { display: inline; }
/* Away from the editor it's a back link, not a button — the boxed control
   competed with the page's own buttons and with the boxless tabs beside it. */
.tabs .tab-select.away {
    color: var(--muted);
    border-color: transparent;
    background: none;
    box-shadow: none;
    font-weight: 500;
    padding-left: 0;
}
.tabs .tab-select.away:hover { color: var(--primary); border-color: transparent; }

.tab-select .back-short { display: none; }
/* Page on/off switch right beside the page picker — no box, just label + switch. */
.page-live {
    display: inline-flex; align-items: center; gap: 0.5rem;
    align-self: center; margin-left: 0.6rem; cursor: pointer;
    padding: 0.25rem 0.35rem; border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.page-live:hover { background: var(--surface-3); }
.page-live .toggle-label { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.page-live:has(input:checked) .toggle-label { color: var(--text); }

/* Shared dropdown menu (profile menu, page menu). */
.menu {
    position: absolute; left: 0; top: calc(100% + 6px);
    min-width: 12rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,0.12));
    padding: 0.35rem;
    z-index: 50;
}
.menu button {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    width: 100%; text-align: left;
    padding: 0.45rem 0.65rem;
    background: transparent; border: 0; border-radius: var(--radius-sm);
    color: var(--text); font-size: 0.9rem; cursor: pointer;
}
.menu button:hover { background: var(--surface-2); }
.menu button.active { color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.menu-sep { height: 1px; background: var(--border); margin: 0.35rem 0.25rem; }
.menu-tag { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.menu button[hidden], .menu-sep[hidden] { display: none; }

/* Search in the page menu (features.editorSearch; owner, 2026-11-10): the box filters the pages, and
   matching fields list under them as "Field: <label>" with the page that edits them. */
#page-menu:has(.page-search) { max-height: min(72vh, 36rem); overflow-y: auto; overscroll-behavior: contain; padding-top: 0; }
.page-search { position: sticky; top: 0; z-index: 1; background: var(--surface); padding: 0.4rem 0.1rem 0.35rem; }
.page-search input { width: 100%; padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.9rem; }
.page-search input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--ring); }
.page-search-results { border-top: 1px solid var(--border); margin-top: 0.35rem; padding-top: 0.3rem; }
.menu-results-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 0.3rem 0.65rem 0.2rem; }
.page-search-results button { align-items: baseline; }
.page-search-results .hit-label { min-width: 0; }
.page-search-results .hit-kind, .page-search-results .hit-within { color: var(--muted); }
.page-search-results .hit-within { font-size: 0.8rem; }
.page-search-results .menu-tag { flex: none; white-space: nowrap; }
.menu-empty { padding: 0.5rem 0.65rem; color: var(--muted); font-size: 0.85rem; }
/* Where a search result lands: a brief ring around the field. */
.search-hit { animation: section-flash 2.4s ease-out; border-radius: var(--radius-sm); }

.preview-bar a {
    margin-left: auto;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.8rem;
    white-space: nowrap;
    padding: 0.25rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}
.preview-bar a:hover { color: var(--text); background: var(--surface-3); }

/* Segmented device switcher */
.preview-devices {
    display: flex;
    gap: 2px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px;
}
.device-btn {
    background: transparent;
    border: 0;
    color: var(--muted);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transition: background var(--transition), color var(--transition);
}
.device-btn .ico { width: 1rem; height: 1rem; }
.device-btn[data-device="tablet"] .ico { width: 0.9rem; height: 0.9rem; }
.device-btn[data-device="mobile"] .ico { width: 0.8rem; height: 0.8rem; }
.device-btn:hover { color: var(--text); }
.device-btn.active {
    color: var(--primary);
    background: var(--surface);
    box-shadow: var(--shadow);
}

#preview-shell {
    flex: 1;                /* must resolve non-zero — applyPreviewScale bails at 0 */
    position: relative;
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
    background: var(--surface-3);
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
/* Logical viewport: JS sets its pixel width/height to the scaled size; the
   iframe inside renders at the device's true width and is transform-scaled
   to fit, so the candidate site sees a real desktop/tablet/mobile viewport.
   position/overflow/flex:none and the frame's transform-origin are required
   by applyPreviewScale() — do not change. */
#preview-viewport {
    position: relative;
    overflow: hidden;
    background: #fff;       /* the candidate's site is light in both modes */
    flex: none;
}
#preview-viewport[data-device="tablet"],
#preview-viewport[data-device="mobile"] {
    box-shadow: 0 0 0 1px var(--border), var(--shadow-lg);
}
#preview-frame {
    position: absolute;
    top: 0;
    left: 0;
    border: 0;
    display: block;
    background: #fff;
    transform-origin: top left;
}
.preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 0.9rem;
    pointer-events: none;
    transition: opacity 0.2s;
}
.preview-loading.hidden { opacity: 0; pointer-events: none; }

@media (max-width: 1100px) {
    #editor { grid-template-columns: minmax(0, 1fr); padding: 0 1rem 2rem; }
    .editor-left, .editor-right { min-width: 0; max-width: 100%; }
    /* Tab row: let the tools drop to a second line rather than push the page wide. */
    .tabs { flex-wrap: wrap; row-gap: 0.25rem; }
    .tabs-right { margin-left: auto; }
    .page-picker .menu { left: 0; }
    .editor-right { position: static; height: 70vh; padding-top: 0.5rem; }
    #editor.reader-mode .editor-right { height: auto; }
}

/* =============== TABS =============== */
.tabs {
    margin: 1rem 0 0;
    display: grid;
    grid-template-columns: var(--editor-cols);   /* = #editor's columns */
    gap: 0 1.25rem;
    border-bottom: 1px solid var(--border);
}
.tabs-left, .tabs-right { display: flex; align-items: center; gap: 0.15rem; min-width: 0; }
.tabs-right { justify-content: flex-end; }
@media (max-width: 1100px) {
    /* Single-column editor: one flex row that wraps. No overflow clipping —
       the page menu drops down out of this row and must not be cut off. */
    .tabs { display: flex; overflow: visible; }
    .tabs-right { margin-left: auto; }
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.tab-icon { display: inline-flex; align-items: center; gap: 0.4rem; }
.tab-icon .ico { width: 1rem; height: 1rem; }
.tab:hover { color: var(--text); background: var(--surface-3); }
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* =============== SETTINGS =============== */
/* One column, capped so fields don't stretch across the full-width tab. */
.settings-stack { max-width: 1000px; }

/* =============== TOOLTIP =============== */
/* Instant replacement for native title tooltips (see TOOLTIPS in admin.js). */
.tip {
    position: fixed;
    z-index: 1000;
    max-width: 18rem;
    padding: 0.4rem 0.6rem;
    background: var(--text);
    color: var(--bg);
    font-size: 0.78rem;
    line-height: 1.35;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    pointer-events: none;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 80ms ease, transform 80ms ease;
}
.tip.show { opacity: 1; transform: none; }
.tip::after {
    content: "";
    position: absolute;
    left: 50%; bottom: -4px;
    width: 8px; height: 8px;
    background: inherit;
    transform: translateX(-50%) rotate(45deg);
}
.tip.below::after { bottom: auto; top: -4px; }

/* =============== PANELS & SECTIONS =============== */
.panels { padding: 1.1rem 0 0; }
.panel.hidden { display: none; }

.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 0.85rem;
}
.section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

.see-it {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}
.see-it:hover { background: var(--primary-soft); color: var(--primary-hover); }
/* Stat figures (Donate button clicks). */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.75rem 0.9rem; }
.stat b { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.78rem; color: var(--muted); }

/* When a section leads with an intro, the heading hugs it and the pair share
   an underline — same rhythm as the admin's .card-header. */
.section h3:has(+ .section-intro) { margin-bottom: 0.2rem; }
.section-intro {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}
.section h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.6rem;
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
/* A label that opens its card sits on the card's own padding, not padding plus a gap (owner, 2026-11-10:
   Dietary key and Online ordering had double space above them). */
.section > h4:first-child { margin-top: 0; }

/* Collapsible list row (an issue, event, …). Collapsed by default so the panel
   reads as a short list; the summary shows the row's title. */
.row-card { padding: 0; }
.row-card > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 1.1rem;
    margin: 0;
    border-radius: var(--radius);
    transition: background var(--transition);
}
.row-card > summary::-webkit-details-marker { display: none; }
.row-card > summary:hover { background: var(--surface-2); }
.row-card[open] > summary {
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
}
/* Chevron that rotates open/closed */
.row-card > summary .list-item-title::before {
    content: "";
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    margin-right: 0.6rem;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    transform: rotate(-45deg) translate(-1px, -1px);
    transition: transform var(--transition);
}
.row-card[open] > summary .list-item-title::before { transform: rotate(45deg) translate(-2px, -2px); }
.row-card > *:not(summary) { margin-left: 1.1rem; margin-right: 1.1rem; }
.row-card > *:nth-last-child(1):not(summary) { margin-bottom: 1.1rem; }
.row-card > summary + * { margin-top: 1.1rem; }

/* Optional/advanced group tucked behind a disclosure. */
.advanced { margin-top: 1.25rem; border-top: 1px solid var(--border); padding-top: 0.9rem; }
.advanced > summary {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    list-style: none;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before {
    content: "+";
    display: inline-block;
    width: 1rem;
    font-size: 0.95rem;
    color: var(--muted);
}
.advanced[open] > summary::before { content: "\2212"; }
.advanced > summary:hover { color: var(--text); }
.advanced > *:not(summary) { margin-top: 0.85rem; }

/* =============== FIELDS =============== */
.field { margin-bottom: 0.85rem; }
.field-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 0.3rem;
}
/* Plain-language helper text under a label — the main "explain itself" hook. */
.field-hint {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--muted);
    margin: -0.15rem 0 0.4rem;
    line-height: 1.4;
}
/* A hint that follows its input (rather than the label) needs air above it. */
.field input + .field-hint, .field select + .field-hint, .field textarea + .field-hint { margin-top: 0.45rem; margin-bottom: 0; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field input[type="url"], .field input[type="date"], .field input[type="datetime-local"],
.field input[type="number"], .field textarea, .field select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.7; }

/* Inline "that doesn't look right" note — advisory, never blocks saving. */
.field-warn {
    font-size: 0.8rem;
    color: var(--warning);
    margin: -0.5rem 0 0.85rem;
    line-height: 1.4;
}
.field.invalid input { border-color: var(--warning); }
.field-warn[data-auto] { margin-top: 0.35rem; }
.field input[readonly] { background: var(--surface-2); color: var(--muted); cursor: default; }
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}
.field textarea { min-height: 84px; resize: vertical; font-family: inherit; line-height: 1.5; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
/* Two fields side by side line their boxes up even when one hint wraps to more lines (owner, 2026-11-10). */
.field-row > .field { display: flex; flex-direction: column; }
.field-row > .field > input, .field-row > .field > select, .field-row > .field > textarea { margin-top: auto; }

.field-checkbox {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background var(--transition);
}
.field-checkbox:hover { background: var(--surface-2); }
.field-checkbox input { width: auto; accent-color: var(--primary); cursor: pointer; }
/* Site details → Opening hours */
.hours-grid { display: grid; gap: 0.35rem; margin-bottom: 0.8rem; }
.hours-row { display: grid; grid-template-columns: 6.5rem 5.5rem auto auto auto; align-items: center; justify-content: start; gap: 0.6rem; }
.hours-row input[type="time"] { width: auto; min-width: 7.5rem; }
.hours-row.is-closed .hours-day { color: var(--muted); }
.hours-day { font-weight: 500; font-size: 0.9rem; }
.hours-closed { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; cursor: pointer; }
.hours-closed input { width: auto; accent-color: var(--primary); }
@media (max-width: 560px) { .hours-row { grid-template-columns: 5.5rem auto auto auto; } .hours-closed { grid-column: 2 / -1; } }
/* Settings → Privacy policy */
.radio-row { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }
.field-radio { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; cursor: pointer; }
.field-radio input { width: auto; accent-color: var(--primary); cursor: pointer; }
.privacy-preview { border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 0.2rem 0 0.6rem; background: var(--surface-2); }
.privacy-preview summary { cursor: pointer; padding: 0.6rem 0.8rem; font-size: 0.9rem; font-weight: 500; }
.privacy-text { max-height: 340px; overflow-y: auto; padding: 0 0.9rem 0.8rem; font-size: 0.88rem; line-height: 1.55; }
.privacy-text h4 { font-size: 0.92rem; margin: 0.9rem 0 0.3rem; }
.privacy-text p { margin: 0 0 0.5rem; }
.privacy-text mark { background: transparent; color: inherit; font-weight: 600; border-bottom: 2px solid var(--primary); }
.privacy-disclaimer { margin: 0.9rem 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--muted); }
/* A checkbox directly after a field belongs to it — close the gap. */
.field + .field-checkbox { margin-top: -0.45rem; }
/* Checkbox beside a field in a row: sit level with the input, not the label. */
.field-row > .field-checkbox { align-self: end; margin-top: 0; margin-bottom: 1.05rem; }
.field-row-cell { align-self: end; margin-bottom: 0.85rem; }
.field-row-cell .field-checkbox { margin-top: 0; }
/* A lone switch after a field (popup, monthly giving) keeps the field rhythm. */
.section > .toggle-row { margin-top: 0.25rem; }
.toggle-grid + .field, .toggle-grid + .image-picker { margin-top: 1rem; }
.field + .toggle-row, .field-row + .toggle-row { margin-top: 0; }
/* Fields that follow a switch (popup heading etc.) get room above them. */
.toggle-row + .field, .toggle-row + .field-row { margin-top: 1rem; }

/* Page on/off switches — a control panel rather than a form. */
/* Homepage layout tiles: little wireframes of the hero. */
.layout-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.6rem; }
.layout-tile {
    display: flex; flex-direction: column; gap: 0.4rem; align-items: stretch;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.82rem; font-weight: 500;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.layout-tile svg { width: 100%; height: auto; display: block; border-radius: 4px; background: var(--surface-2); fill: var(--text); }
.layout-tile svg .photo { fill: var(--primary); opacity: 0.55; }
.layout-tile svg .accent { fill: #e8c547; }
.layout-tile:hover { border-color: var(--primary); }
.layout-tile.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--ring); background: var(--primary-soft); }
.layout-tile.active svg .photo { opacity: 0.8; }
/* Graphics layout tiles use the graphic's own palette words. */
.gfx-layout-tiles { grid-template-columns: repeat(4, 1fr); }
.gfx-layout-tiles svg .primary { fill: #1a3a5c; }
.gfx-layout-tiles svg .accent { fill: #e8c547; }
.gfx-layout-tiles svg .ink { fill: #1a3a5c; }
.gfx-layout-tiles svg .photo { fill: #6b7280; opacity: 0.7; }

/* Segmented control (Graphics photo source). */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.gfx-photo-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.gfx-photo-menu { position: relative; }
.gfx-photo-menu .menu { min-width: 13rem; white-space: nowrap; }
.gfx-photo-menu .menu button { justify-content: flex-start; }
.gfx-photo-menu .menu .ico { width: 0.95rem; height: 0.95rem; color: var(--muted); }
.gfx-photo-menu .btn-quiet .ico:last-child { width: 0.8rem; height: 0.8rem; margin-left: 0.1rem; }
.image-controls .link-btn { display: inline-flex; align-items: center; gap: 0.3rem; }
.image-controls .link-btn .ico { width: 0.9rem; height: 0.9rem; }

/* Draggable toggle list (homepage shortcut order). */
.toggle-list { display: flex; gap: 0.5rem; flex-wrap: wrap; }
/* The homepage's page previews: short label + switch each, so they pair up
   two to a row rather than stretching across the card. Drag-reorder reads
   left-to-right, then down. */
.toggle-list.vertical {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 44rem;
}
.toggle-list.vertical .toggle-drag { flex: none; min-width: 0; }
.toggle-drag { display: flex; align-items: center; gap: 0.2rem; flex: 1 1 10rem; min-width: 0; }
.toggle-drag .toggle-row { flex: 1; min-width: 0; }
.toggle-drag.dragging { opacity: 0.4; }
.drag-handle {
    color: var(--muted);
    cursor: grab;
    font-size: 0.9rem;
    letter-spacing: -0.2em;
    padding: 0.4rem 0.2rem 0.4rem 0.35rem;
    user-select: none;
}
.toggle-drag:active .drag-handle { cursor: grabbing; }
.toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 0.5rem;
}
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.toggle-row:hover { border-color: var(--border-strong); }
.toggle-row:has(input:checked) { background: var(--surface); border-color: var(--primary); }
.toggle-label { font-size: 0.9rem; font-weight: 500; }
.toggle-row:has(input:checked) .toggle-label { color: var(--text); }
.toggle-row input[type="checkbox"], .page-live input[type="checkbox"] {
    /* A minimal switch (owner, 2026-11-08): a thin track, a flat knob, ink when on. */
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    flex-shrink: 0;
    width: 30px;
    height: 18px;
    margin: 0;
    border-radius: var(--radius-pill);
    background: var(--border);
    box-shadow: inset 0 0 0 1px var(--border-strong);
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.toggle-row input[type="checkbox"]::before, .page-live input[type="checkbox"]::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--border-strong);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.toggle-row input[type="checkbox"]:checked, .page-live input[type="checkbox"]:checked { background: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.toggle-row input[type="checkbox"]:checked::before, .page-live input[type="checkbox"]:checked::before { transform: translateX(12px); box-shadow: none; }
.toggle-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Toggle whose target page is off in Settings — inert, with a why. */
.toggle-row.disabled { opacity: 0.55; cursor: not-allowed; }
.toggle-row.disabled input[type="checkbox"] { cursor: not-allowed; }

.field input[type="color"] {
    width: 100%;
    height: 38px;
    padding: 2px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

@media (max-width: 700px) {
    .field-row { grid-template-columns: 1fr; }
}

/* =============== LIST CARDS (issues, endorsements, …) =============== */
.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
    gap: 0.5rem;
}
.list-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.list-item-actions { display: flex; gap: 0.15rem; flex-shrink: 0; }
.list-item-actions button {
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.4;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.list-item-actions button:hover { color: var(--text); background: var(--surface-3); }
.list-item-actions button.danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
}

/* Icon-only row action (delete / reorder). Square, quiet until hovered. */
.icon-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0 !important;
}
.icon-act svg { width: 15px; height: 15px; display: block; }

/* =============== SOCIAL LINKS =============== */
.social-row {
    display: grid;
    grid-template-columns: auto 9.5rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}
.social-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    flex-shrink: 0;
}
.social-icon svg { width: 16px; height: 16px; display: block; }
.social-platform {
    padding: 0.5rem 0.5rem;
    font-size: 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.social-platform:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

/* Prefix addon: the fixed profile URL sits inline, the candidate types only
   their username. Focus ring applies to the whole group. */
.input-prefix {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
    min-width: 0;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.input-prefix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.input-prefix .prefix {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 0 0.55rem;
    background: var(--surface-2);
    border-right: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
}
.input-prefix input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
}
.input-prefix input:focus { outline: none; }
/* Every network's address box is one width, the longest (bsky.app/profile/), so the rows line up (owner, 2026-11-10). */
.social-row .input-prefix .prefix { width: 9.4rem; }
.social-row .input-prefix .prefix-blank { font-style: italic; }
.social-row > button.danger {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--muted);
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.social-row > button.danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

@media (max-width: 700px) {
    .social-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .social-row .input-prefix { grid-column: 1 / -1; }
}

/* Single-line repeatable entry (quick facts, record bullets): the input and its
   delete button share one row — no card, no "Item N" header. */
.compact-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}
.compact-row .field { flex: 1; min-width: 0; margin-bottom: 0; }
.compact-row .icon-act { flex-shrink: 0; }

/* Compact page-intro row atop content panels: info icon + single field. */
.intro-row { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.85rem; }
.intro-row .field { flex: 1; min-width: 0; margin-bottom: 0; }
.intro-row .field textarea { min-height: 0; }   /* a page's intro is two rows (refIntroRow), not the 84px of a story */

/* Shown above the "+ Add" button when a list is empty. */
.empty-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.875rem;
    padding: 1.25rem 1rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
}

.add-btn {
    background: transparent;
    border: 1px dashed var(--border-strong);
    color: var(--muted);
    padding: 0.7rem;
    border-radius: var(--radius-sm);
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.add-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* =============== IMAGE PICKER =============== */
.image-picker { display: flex; gap: 1rem; align-items: center; }
.image-preview {
    width: 96px;
    height: 96px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.7rem;
    text-align: center;
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
/* Compact variant (Graphics tab photo): small square, one row. */
.image-picker.compact { align-items: center; }
.image-picker.compact .image-preview { width: 48px; height: 48px; font-size: 0.65rem; color: var(--muted); }
.image-picker.compact .image-preview .ico { width: 1.2rem; height: 1.2rem; }
.image-picker.compact .image-controls { gap: 0.2rem; }
.image-controls { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.45rem; align-items: flex-start; }
/* =============== PHOTO FIELD (content) =============== */
/* One fixed thumbnail size for every photo — the editor's layout never
   follows the site's. The controls sit on the picture: click it (or drop a
   file) to change it; the strip along its bottom edge holds Crop and Replace. Empty, the thumbnail is the file picker. */
.photo-field { --thumb-w: 160px; display: flex; }
.photo-thumb {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: var(--thumb-w); max-width: 100%;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); overflow: hidden;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity var(--transition); }
.photo-thumb:hover img { opacity: 0.9; }
.photo-thumb:hover, .photo-thumb:focus-visible, .photo-thumb.dragover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.photo-thumb:focus-visible { outline: none; }
.photo-thumb.dragover img { opacity: 0.5; }
.photo-field.empty .photo-thumb {
    flex-direction: column; gap: 0.3rem;
    border: 1.5px dashed var(--border-strong); color: var(--muted);
    font-size: 0.8rem; font-weight: 500;
}
.photo-field.empty .photo-thumb .ico { width: 1.4rem; height: 1.4rem; }
.photo-field.empty .photo-thumb:hover, .photo-field.empty .photo-thumb:focus-within { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); box-shadow: none; }
/* The strip on the picture: Crop · Replace, white on a dark fade. */
.photo-bar {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; justify-content: center; gap: 0.25rem;
    padding: 1.2rem 0.3rem 0.35rem;
    overflow: hidden;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.6));
}
.photo-act {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.26rem 0.45rem; min-width: 0;
    font-size: 0.7rem; font-weight: 600; font-family: inherit; line-height: 1;
    color: #fff; background: rgba(15, 23, 42, 0.55); border: 0; border-radius: var(--radius-pill); margin: 0;
    cursor: pointer; white-space: nowrap;
    transition: background var(--transition);
}
.photo-act .ico { width: 12px; height: 12px; flex-shrink: 0; }
.photo-act:hover { background: var(--primary); }
.photo-act:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
/* Compact (tab icon): a small square; the strip would not fit, so Crop and
   Replace go beside it as plain text. */
.image-field-compact { margin-bottom: 0; }
.photo-field.compact { --thumb-w: 56px; align-items: center; gap: 0.5rem; }
.photo-field.compact .photo-thumb { aspect-ratio: 1; }
.photo-field.compact .photo-thumb { font-size: 0.7rem; }
.photo-field.compact .photo-bar { position: static; padding: 0; background: none; gap: 0.4rem; }
.photo-field.compact .photo-act { color: var(--muted); background: var(--surface); border: 1px solid var(--border-strong); }
.photo-field.compact .photo-act:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
/* Two cards in one row (Home: photo + tagline). A `.fit` card hugs its
   content and the other takes the rest; too narrow and they stack. The
   lopsided grow factors mean the fit card only fills a line it has to
   itself. */
.section-row { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 0.85rem; }
.section-row > .section { margin-bottom: 0; }
.section-row > .section.fit { flex: 1 0 auto; }
.section-row > .section:not(.fit) { flex: 999 1 16rem; min-width: 0; }
.section-row > .section > .field:last-child { margin-bottom: 0; }
/* Uploading: dim the thumbnail and spin a ring over it until the re-render
   after the upload replaces the field. */
.photo-field.uploading .photo-thumb { pointer-events: none; }
.photo-field.uploading .photo-thumb > * { opacity: 0.3; }
.photo-field.uploading .photo-act { opacity: 0.5; pointer-events: none; }
.photo-field.uploading .photo-thumb::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 26px; height: 26px; margin: -13px 0 0 -13px;
    border: 3px solid var(--border-strong); border-top-color: var(--primary);
    border-radius: 50%;
    animation: upload-spin 0.8s linear infinite;
}
.photo-field.compact.uploading .photo-thumb::after { width: 18px; height: 18px; margin: -9px 0 0 -9px; border-width: 2px; }
@keyframes upload-spin { to { transform: rotate(360deg); } }

/* =============== IMAGE CROPPER =============== */
/* The crop box lives in the image's displayed box; four shade rects darken
   the rest (not a 9999px box-shadow, which Chrome can skip painting). */
.modal.crop-modal { max-width: 760px; max-height: 94vh; }
.crop-presets { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.7rem 0 0.8rem; }
.crop-presets button {
    font-size: 0.78rem; font-weight: 500; font-family: inherit;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.crop-presets button:hover { border-color: var(--primary); color: var(--primary); }
.crop-presets button[aria-checked="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.crop-stage-wrap {
    --hs: 14px;   /* handle size; the padding keeps the outer handles inside the clip */
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: calc(var(--hs) / 2 + 4px);
    margin-top: 0.75rem;
    overflow: hidden;
}
.crop-stage {
    position: relative; display: inline-block; line-height: 0;
    touch-action: none; user-select: none; -webkit-user-select: none;
}
.crop-stage img { display: block; width: auto; height: auto; max-width: 100%; max-height: 60vh; pointer-events: none; -webkit-user-drag: none; }
.crop-shade { position: absolute; background: rgba(0, 0, 0, 0.5); pointer-events: none; }
.crop-box {
    position: absolute; box-sizing: border-box;
    border: 1.5px solid #fff;
    outline: 1px solid rgba(0, 0, 0, 0.45);
    cursor: move;
    /* rule-of-thirds guides */
    background-image: linear-gradient(to right, rgba(255,255,255,0.35) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255,255,255,0.35) 1px, transparent 1px);
    background-size: 33.34% 100%, 100% 33.34%;
    background-position: -1px 0, 0 -1px;
}
.crop-box:focus-visible { outline: 2px solid var(--primary); }
.crop-handle {
    position: absolute; width: var(--hs); height: var(--hs);
    background: #fff; border: 1px solid rgba(0, 0, 0, 0.45); border-radius: 3px;
    box-sizing: border-box;
}
.crop-handle[data-h="nw"] { top: calc(var(--hs) / -2); left: calc(var(--hs) / -2); cursor: nwse-resize; }
.crop-handle[data-h="n"]  { top: calc(var(--hs) / -2); left: calc(50% - var(--hs) / 2); cursor: ns-resize; }
.crop-handle[data-h="ne"] { top: calc(var(--hs) / -2); right: calc(var(--hs) / -2); cursor: nesw-resize; }
.crop-handle[data-h="e"]  { top: calc(50% - var(--hs) / 2); right: calc(var(--hs) / -2); cursor: ew-resize; }
.crop-handle[data-h="se"] { bottom: calc(var(--hs) / -2); right: calc(var(--hs) / -2); cursor: nwse-resize; }
.crop-handle[data-h="s"]  { bottom: calc(var(--hs) / -2); left: calc(50% - var(--hs) / 2); cursor: ns-resize; }
.crop-handle[data-h="sw"] { bottom: calc(var(--hs) / -2); left: calc(var(--hs) / -2); cursor: nesw-resize; }
.crop-handle[data-h="w"]  { top: calc(50% - var(--hs) / 2); left: calc(var(--hs) / -2); cursor: ew-resize; }
@media (pointer: coarse) { .crop-stage-wrap { --hs: 24px; } }
.crop-size { font-size: 0.75rem; color: var(--muted); margin-top: 0.5rem; min-height: 1em; }
.crop-modal .modal-actions { flex-wrap: wrap; }
.crop-modal .modal-actions .spacer { flex: 1; }
@media (max-width: 640px) {
    .crop-stage img { max-height: 48vh; }
    .crop-modal .modal-actions .spacer { display: none; }
}

/* =============== MODAL =============== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    max-width: 560px;
    width: 100%;
    /* Fits the window (owner, 2026-11-10): the dialog scrolls inside itself, never the page behind it, and its
       button row stays pinned to the bottom edge. */
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.modal > .modal-actions { position: sticky; bottom: -1.5rem; z-index: 1; }
.modal h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.modal .changes-list {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    font-size: 0.875rem;
    color: var(--text);
}
/* Ticked list — reads as "here's what's going live", not a diff. */
.modal .changes-list li {
    list-style: none;
    padding: 0.25rem 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.modal .changes-list li::before {
    content: "✓";
    color: var(--success);
    font-weight: 700;
    flex-shrink: 0;
}
.modal code {
    background: var(--surface-2);
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 0.85em;
}
/* Tinted footer bar, bled to the modal edges — matches the platform admin. */
/* Publish dialog: pages that will go live with example content. A callout,
   not a muted footnote — publishing "Example Issue #1" should be a choice. */
.example-note {
    margin: 0.9rem 0 0;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    background: var(--warning-soft);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    color: var(--text);
}
.example-note::before { content: "⚠ "; color: var(--warning); font-weight: 600; }
.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin: 1.25rem -1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
}
.modal-actions button {
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.modal-actions button:hover { background: var(--surface-3); }
.modal-actions button.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--on-primary);
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 2px var(--ring);
}
.modal-actions button.primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    box-shadow: 0 3px 10px var(--ring);
}
.modal-checks { display: flex; flex-direction: column; gap: 0.2rem; margin: 0.9rem 0 0.3rem; }
.modal-actions button.danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    font-weight: 600;
}
.modal-actions button.danger:hover { filter: brightness(1.08); background: var(--danger); }
.modal-actions button:disabled { opacity: 0.55; cursor: not-allowed; }
/* Shared dialogs (../common.js confirmDialog/promptDialog) use the platform
   admin's markup (.modal-overlay > .modal > .modal-body + .modal-footer) with
   this file's classes beside it; these lines give it the editor's look. */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}
.modal-overlay .modal { padding: 0; max-width: 480px; display: flex; flex-direction: column; overflow: hidden; }
.modal-overlay .modal-body { padding: 1.5rem 1.5rem 0; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.modal-overlay .modal > .modal-actions { position: static; flex: none; }
.modal-overlay .modal-body h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.modal-overlay .modal-actions { margin: 1.25rem 0 0; }
.modal-overlay .field label { display: block; font-weight: 500; margin-bottom: 0.3rem; }

/* =============== TOAST =============== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--success);
    color: var(--text);
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius-sm);
    max-width: 360px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    animation: toast-in 0.25s ease;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.toast.error { border-left-color: var(--danger); }

/* Sticky variant (optimistic-lock conflict): no auto-dismiss, has a button. */
.toast-sticky { line-height: 1.45; }
.toast-sticky button {
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--on-primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.toast-sticky button:hover { background: var(--primary-hover); }

/* =============== PARTY THEME PREVIEW (Site panel) ===============
   Renders the CANDIDATE's palette via --p-* custom properties set inline by JS.
   Those names are a JS contract; and this block intentionally does NOT follow
   our dark mode — it's a preview of their public site. */
.party-preview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
    margin-top: 0.85rem;
}
.party-preview-card {
    background: var(--p-bg);
    color: var(--p-ink);
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.party-preview-eyebrow {
    font: 600 0.7rem/1 var(--p-body, system-ui, sans-serif);
    letter-spacing: 0.18em;
    color: var(--p-primary);
    margin-bottom: 0.55rem;
}
.party-preview-name {
    font: 800 1.7rem/1.05 var(--p-heading, 'Merriweather', Georgia, serif);
    color: var(--p-primary);
    letter-spacing: -0.025em;
}
.party-preview-tag {
    font: 400 0.95rem/1.4 var(--p-body, 'Inter', system-ui, sans-serif);
    margin-top: 0.45rem;
    color: var(--p-ink);
    opacity: 0.85;
}
.party-preview-actions { display: flex; gap: 0.5rem; margin-top: 0.85rem; }
.party-preview-btn {
    background: var(--p-primary);
    color: var(--p-bg);
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.8rem;
}
.party-preview-pill {
    border: 1.5px solid var(--p-primary);
    color: var(--p-primary);
    padding: 0.25rem 0.85rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.8rem;
}
.theme-row { display: grid; grid-template-columns: 4.5rem 1fr; align-items: start; gap: 0.6rem; }
.theme-row-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding-top: 0.45rem; }
.theme-party { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.theme-party-btn {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.4rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: 0.85rem; font-weight: 500;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.theme-party-btn:hover { border-color: var(--primary); }
.theme-party-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.theme-dots { display: inline-flex; }
.theme-dots i { width: 0.8rem; height: 0.8rem; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); display: inline-block; }
.theme-dots i + i { margin-left: -0.25rem; }
.font-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.5rem; }
.font-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
    padding: 0.6rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.font-tile:hover { border-color: var(--primary); }
.font-tile.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--ring); background: var(--primary-soft); }
.font-tile-sample { font-size: 1.35rem; font-weight: 800; line-height: 1.1; color: var(--text); overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.font-tile-body { font-size: 0.78rem; color: var(--muted); }
.party-preview-swatches { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.party-preview-swatch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.6rem;
    background: var(--surface-2);
}
.party-preview-swatch { cursor: pointer; }
.party-preview-swatch .dot {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    display: inline-block;
    padding: 0;
    border: 1px solid var(--border-strong);
    background: none;
    cursor: pointer;
}
/* Native color input: make the swatch itself round and borderless. */
.party-preview-swatch .dot::-webkit-color-swatch-wrapper { padding: 0; }
.party-preview-swatch .dot::-webkit-color-swatch { border: none; border-radius: 50%; }
.party-preview-swatch .dot::-moz-color-swatch { border: none; border-radius: 50%; }
/* Small actions (Reset colors, Disconnect, Copy instructions): a quiet button
   like every other secondary action, never an underlined link (2026-11-10). */
.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.55rem;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.link-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); text-decoration: none; }

/* =============== GRAPHICS TAB =============== */
.gfx-sizes { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.gfx-sizes-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.gfx-templates { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.gfx-template-btn { display: inline-flex; align-items: center; gap: 0.45rem; }
.gfx-template-btn .ico { width: 1rem; height: 1rem; }
.gfx-template-btn {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--muted);
    padding: 0.5rem 0.95rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.gfx-template-btn:hover { color: var(--text); border-color: var(--muted); }
.gfx-template-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 1px 2px var(--ring);
}

.gfx-layout {
    display: grid;
    /* Same split as the editor: the form stops gaining past its cap, the rest
       goes to the canvas (which is height-capped, so the card centres). */
    grid-template-columns: var(--editor-cols);
    gap: 1rem;
    align-items: start;
}
.gfx-form { min-width: 0; }   /* grid child — keep wide canvases from blowing out */
.gfx-preview { position: sticky; top: calc(var(--topbar-h) + 14px); width: 100%; max-width: 1100px; margin-inline: auto; }
.gfx-preview .section { margin-bottom: 0; }
.gfx-canvas {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    /* Never taller than what's visible under the tab row + size row + card
       header, so the whole graphic (even a story) fits without scrolling. */
    max-height: calc(100vh - var(--topbar-h) - 250px);
    margin: 0 auto;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.gfx-themes { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.gfx-theme-label { font-size: 0.75rem; color: var(--muted); margin-right: 0.25rem; }
.gfx-theme {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.6rem;
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    transition: border-color var(--transition), background var(--transition);
}
.gfx-theme:hover { border-color: var(--primary); background: var(--primary-soft); }
.gfx-theme .swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.gfx-color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

/* Both outputs of the Graphics preview: Download, and (when social posting is
   on) Post this. Same affordance — one saves the image, the other sends it. */
#gfx-download, #gfx-post {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
#gfx-download:hover, #gfx-download:focus-visible, #gfx-download:active,
#gfx-post:hover, #gfx-post:focus-visible, #gfx-post:active { background: var(--primary); color: var(--on-primary); }
#gfx-download .ico, #gfx-post .ico { width: 0.95rem; height: 0.95rem; }
.gfx-dims { font-size: 0.78rem; font-weight: 400; margin-left: 0.4rem; }
.gfx-reset {
    background: none;
    border: none;
    color: var(--primary);
    padding: 0;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: underline;
}
.gfx-reset:hover { color: var(--primary-hover); }

@media (max-width: 860px) {
    .gfx-layout { grid-template-columns: 1fr; }
    .gfx-preview { position: static; }
}

@media (max-width: 640px) {
    .toggle-list.vertical { grid-template-columns: minmax(0, 1fr); }
    .topbar-inner { padding: 0 0.85rem; gap: 0.5rem; }
    .topbar-title, #tenant-label { display: none; }
    #dirty-status { font-size: 0.8rem; }
    .section { padding: 1.1rem; }
}

/* Chevron for the appearance-stripped selects (see top of file). Lives at the
   end with matching specificity because those components set `background:`
   shorthand, which would otherwise erase a background-image set earlier. */
.field select, .preview-bar select, .social-platform {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%238a94a5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    background-size: 13px;
    padding-right: 1.9rem;
}

/* =============== SUBMISSIONS TAB =============== */
/* Unread count on the tab itself — mirrors the chip badges below. */
.tab-badge {
    display: inline-block;
    min-width: 1.15rem;
    padding: 0 0.35rem;
    margin-left: 0.3rem;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.15rem;
    text-align: center;
    vertical-align: middle;
}
.tab-badge[hidden] { display: none; }

.sub-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}
.sub-head h3 { margin: 0; display: flex; align-items: center; gap: 0.45rem; }
.sub-head-actions { display: flex; gap: 0.15rem; }
.section h3 .ico { width: 1rem; height: 1rem; color: var(--muted); vertical-align: -0.15rem; margin-right: 0.35rem; }
.sub-head h3 .ico { margin-right: 0; }

/* Generic inline icon: sized by the parent's font, never a layout item. */
.ico { width: 1em; height: 1em; flex: none; }
.icon-btn .ico { width: 1rem; height: 1rem; }

/* Quiet text+icon button — the reader's actions and the inbox's Delete all.
   One style for every secondary action so nothing competes with Save & Publish. */
.btn-quiet {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.btn-quiet .ico { width: 0.9rem; height: 0.9rem; color: var(--muted); }
.btn-quiet:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-quiet:hover .ico { color: inherit; }
.btn-quiet.danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
/* Disabled quiet/icon buttons look it. */
.btn-quiet:disabled, .icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-quiet:disabled:hover, .icon-btn:disabled:hover { border-color: var(--border-strong); color: var(--text); background: transparent; }

.sub-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.sub-unread-toggle { margin: 0 0 0 auto; font-size: 0.82rem; padding: 0.25rem 0.4rem; }

.chips { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--muted);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 500;
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.chip .ico { width: 0.85rem; height: 0.85rem; }
.chip:hover { color: var(--text); background: var(--surface-3); }
.chip.active { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.chip-badge {
    min-width: 1.1rem;
    padding: 0 0.3rem;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--on-primary);
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
}

/* The message list: one tappable row per message, like a mail client. */
.sub-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.sub-list .empty-hint { margin: 0; border-radius: 0; }
.sub-list .add-btn { margin: 0; border: 0; border-top: 1px dashed var(--border-strong); border-radius: 0; }
.sub-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.7rem;
    align-items: center;
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--surface);
    border: 0;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: background var(--transition);
}
.sub-row:last-of-type { border-bottom: 0; }
.sub-row:hover { background: var(--surface-2); }
.sub-row.selected { background: var(--primary-soft); border-left-color: var(--primary); }
.sub-row.unread .sub-who { font-weight: 700; }
.sub-row.unread .sub-line { color: var(--text); }
.sub-row-main { display: flex; flex-direction: column; min-width: 0; gap: 0.1rem; }
.sub-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; min-width: 0; }
.sub-who { font-size: 0.9rem; font-weight: 500; }
.sub-line { font-size: 0.82rem; color: var(--muted); }
.sub-who, .sub-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-when { font-size: 0.75rem; color: var(--muted); white-space: nowrap; flex: none; }

/* Kind icon in a tinted circle — one colour per form type, same in list & reader. */
.sub-kind-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem; height: 2rem;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--muted);
    flex: none;
}
.sub-kind-ico .ico { width: 1rem; height: 1rem; }
.sub-kind-ico.lg { width: 2.6rem; height: 2.6rem; }
.sub-kind-ico.lg .ico { width: 1.25rem; height: 1.25rem; }
.sub-kind-contact { background: var(--primary-soft); color: var(--primary); }
.sub-kind-volunteer { background: #ecfdf5; color: #047857; }
.sub-kind-newsletter { background: #fffbeb; color: #b45309; }
:root[data-theme="dark"] .sub-kind-volunteer { background: #14312a; color: #6ee7b7; }
:root[data-theme="dark"] .sub-kind-newsletter { background: #332a14; color: #fcd34d; }
/* DARK MODE OFF (owner, 2026-11-08) — system-preference inbox chips:
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .sub-kind-volunteer { background: #14312a; color: #6ee7b7; }
    :root:not([data-theme="light"]) .sub-kind-newsletter { background: #332a14; color: #fcd34d; }
}
*/

.sub-subs-note { font-size: 0.85rem; color: var(--muted); margin-top: 1rem; line-height: 1.5; }
/* Plain list rows (subscribers): not clickable, delete appears on hover. */
.sub-row-plain { cursor: default; grid-template-columns: auto minmax(0, 1fr) auto; }
.sub-row-plain:hover { background: var(--surface); }
.sub-row-del { opacity: 0; transition: opacity var(--transition); }
.sub-row-plain:hover .sub-row-del, .sub-row-del:focus-visible { opacity: 1; }
.sub-reader .stat-row { margin-top: 0.25rem; }
/* The right column can now be far wider than a comfortable line length, so
   the message keeps a prose measure of its own. */
.sub-reader-body { max-width: 46rem; }

/* Reader pane — takes the right column's place on the Submissions tab. */
#editor.reader-mode .preview-bar,
#editor.reader-mode #preview-shell { display: none; }
.sub-reader {
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.4rem;
}
.sub-reader-empty {
    height: 100%;
    min-height: 16rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.sub-reader-empty .ico { width: 2.4rem; height: 2.4rem; opacity: 0.5; stroke-width: 1.5; }
/* Back arrow beside the open item's name. */
.sub-back { align-self: center; flex: none; margin-right: 0.1rem; }
.sub-back .ico { width: 1.05rem; height: 1.05rem; }
/* Titled intro at the top of the reader pane. */
.pane-intro { margin-bottom: 0.75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
/* Opened item under the pane intro: one slim row — arrow, name · meta, actions. */
.sub-reader-head.compact { align-items: center; gap: 0.5rem; padding-bottom: 0.65rem; margin-bottom: 0.75rem; }
.sub-reader-head.compact h2 { font-size: 1rem; }

.sub-reader-head.compact .sub-reader-title .muted { font-size: 0.8rem; white-space: nowrap; }
.sub-reader-empty.short { min-height: 10rem; height: auto; }
.sub-reader-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.sub-reader-title { flex: 1; min-width: 10rem; }
.sub-reader-title h2 { font-size: 1.1rem; font-weight: 600; line-height: 1.3; word-break: break-word; }
.sub-reader-title .muted { font-size: 0.82rem; }
.sub-reader-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.sub-message { white-space: pre-wrap; word-break: break-word; font-size: 0.95rem; line-height: 1.6; margin-bottom: 1rem; }
.sub-fields {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1.1rem;
    font-size: 0.88rem;
}
.sub-fields dt { color: var(--muted); font-weight: 500; }
.sub-fields dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.sub-reader-foot { font-size: 0.78rem; margin-top: 1.25rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.sub-reader-foot:empty { display: none; }

/* Inbox settings is a collapsed card: the heading is the disclosure. */
.sub-settings > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
.sub-settings > summary::-webkit-details-marker { display: none; }
.sub-settings > summary h3 { margin: 0; display: flex; align-items: center; gap: 0.45rem; }
.sub-settings > summary::after {
    content: "";
    margin-left: auto;
    width: 0.5rem; height: 0.5rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg);
    transition: transform var(--transition);
}
.sub-settings[open] > summary::after { transform: rotate(-135deg); }
.sub-settings[open] > summary { margin-bottom: 0.9rem; }
.sub-settings > summary:hover h3 { color: var(--primary); }

/* Solid red for the one truly destructive action on the tab. */
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    background: var(--danger);
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: filter var(--transition);
}
.btn-danger .ico { width: 0.9rem; height: 0.9rem; }
.btn-danger:hover { filter: brightness(1.08); }

.sub-delete-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}
.sub-delete-all .field-hint { margin: 0; }

/* Retention select under the inbox: tighter than the page forms. */
.compact-fields .field { margin-bottom: 0.6rem; }
.compact-fields .field-label { font-size: 0.82rem; }
.compact-fields .field input, .compact-fields .field select { padding: 0.45rem 0.65rem; font-size: 0.9rem; }

/* =============== CUSTOM DOMAIN (admins) =============== */
.dom-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    padding: 0.9rem 1rem;
}
.dom-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.dom-host { font-weight: 600; color: var(--text); text-decoration: none; }
.dom-host:hover { text-decoration: underline; }
.dom-checked { font-size: 0.75rem; }
.dom-pill {
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    padding: 0.15rem 0.6rem;
    border: 1px solid transparent;
}
.dom-pill.active  { color: var(--success); border-color: var(--success); }
.dom-pill.pending { color: var(--warning); border-color: var(--warning); }
.dom-pill.error   { color: var(--danger);  border-color: var(--danger); background: var(--danger-soft); }
.dom-ok strong { color: var(--text); }
.dom-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; flex-wrap: wrap; }
.dom-actions .add-btn { margin: 0; }
.dom-instructions {
    margin-top: 0.9rem;
    padding: 0.9rem 1rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    font-size: 0.85rem;
}
.dom-instructions-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.dom-instructions ol { margin: 0; padding-left: 1.2rem; }
.dom-instructions li { margin: 0.3rem 0; line-height: 1.45; }
.dom-instructions code {
    font-size: 0.8rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
}

/* =============== SMALL SCREENS =============== */
@media (max-width: 900px) {
    /* Graphics: one column, preview first. */
    .gfx-layout { grid-template-columns: minmax(0, 1fr); }
    .gfx-preview { order: -1; position: static; }
    /* Sizes and styles: single horizontally scrolling rows. */
    .gfx-sizes { align-items: flex-start; flex-direction: column; gap: 0.4rem; }
    .gfx-sizes .gfx-templates, .gfx-layout-tiles, .chips {
        display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
        -webkit-overflow-scrolling: touch; padding-bottom: 2px;
    }
    .gfx-sizes .gfx-templates::-webkit-scrollbar, .gfx-layout-tiles::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
    .gfx-sizes .gfx-templates { width: 100%; }
    .gfx-templates .gfx-template-btn, .chips .chip { flex: none; }
    .gfx-layout-tiles .layout-tile { flex: 0 0 8.5rem; }
    /* Inbox: filters on one scrolling line, unread toggle beneath; open items replace the list. */
    .sub-toolbar { flex-direction: column; align-items: stretch; }
    .chips { width: 100%; }
    .sub-unread-toggle { margin-left: 0; align-self: flex-start; }
    #editor.reader-mode .editor-right { display: none; }
    .sub-mobile-reader { padding-top: 0.25rem; }
    .sub-mobile-reader .pane-intro { display: none; }   /* the card is the context on a phone */
    /* Live preview: hidden behind a floating eye button; tapping it slides the
       pane (same iframe) up over the whole screen. */
    #editor:not(.reader-mode):not(.no-preview) .editor-right { display: none; }
    #preview-fab:not([hidden]) {
        display: flex; align-items: center; justify-content: center;
        position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom));
        z-index: 60; width: 3.2rem; height: 3.2rem; border-radius: 50%;
        background: var(--primary); color: var(--on-primary); border: none; cursor: pointer;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    }
    #preview-fab .ico { width: 1.35rem; height: 1.35rem; }
    body.preview-open #editor:not(.reader-mode):not(.no-preview) .editor-right {
        display: flex; position: fixed; inset: 0; z-index: 70; height: 100%;
        max-width: none; margin: 0; background: var(--bg);
        padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom));
        animation: preview-up 0.22s ease;
    }
    body.preview-open { overflow: hidden; }
    body.preview-open #preview-fab { display: none; }
    body.preview-open .preview-devices { display: none; }   /* the phone IS the device */
    body.preview-open #preview-close { display: inline-flex; }
    body.preview-open #preview-open { margin-left: auto; }
    body.preview-open #preview-close { margin-left: 0; }
    /* Theme card rows stack their label above the controls. */
    .theme-row { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
    .theme-row-label { padding-top: 0; }
    .font-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-row { grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr)); }
    .settings-stack { max-width: 100%; }
}
@media (max-width: 640px) {
    /* Everything on one line: short back label, compact tabs, switch without its text. */
    .tabs { flex-wrap: nowrap; gap: 0.15rem; }
    .tabs-left { gap: 0.25rem; min-width: 0; }
    .tabs-right { margin-left: auto; flex: none; }
    .tabs .tab { padding: 0.5rem 0.55rem; font-size: 0.85rem; }
    .tabs .tab-icon { gap: 0.3rem; }
    .tabs .tab-select { padding: 0.4rem 0.5rem 0.4rem 0.55rem; font-size: 0.9rem; }
    .tabs .tab-select .back-long { display: none; }
    .tabs .tab-select .back-short { display: inline; }
    /* Long page names ("Campaign details") must not shove the tabs off-screen,
       and the picker never stretches here — the row is already full. */
    .tabs .tab-select { max-width: 48vw; }
    .page-picker, .tabs .tab-select:not(.away) { flex: none; }
    .tabs .tab-select #page-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
    .page-live { margin-left: 0.25rem; padding: 0.25rem; }
    .page-live .toggle-label { display: none; }
    .topbar-right { gap: 0.4rem; }
    #dirty-status { display: none; }          /* the Save button's state says it */
    #save-btn { padding-left: 0.8rem; padding-right: 0.8rem; }
    /* Small screens: the compact PQ mark instead of the full wordmark. */
    .topbar-brand .brand-full { display: none; }
    .topbar-brand .brand-mark { display: block !important; height: 26px; width: auto; }
    .topbar-divider, .topbar-title { display: none; }
    .layout-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sub-reader { padding: 1rem; }
    .sub-reader-actions { width: 100%; }
    .modal { margin: 0 0.75rem; }
}

@keyframes preview-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { body.preview-open .editor-right { animation: none; } }

/* =============== WELCOME TOUR =============== */
#tour-root { position: fixed; inset: 0; z-index: 400; }
.tour-scrim { position: absolute; inset: 0; }   /* click-to-skip catcher under the shades */
.tour-shade { position: absolute; background: rgba(10, 12, 20, 0.55); pointer-events: none; }
.tour-spot {
    position: absolute;
    border-radius: 10px;
    box-shadow: 0 0 0 2px var(--primary);
    pointer-events: none;
}
.tour-card {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    padding: 0.9rem 1rem 0.75rem;
}
.tour-card p { margin: 0 0 0.75rem; font-size: 0.9rem; line-height: 1.45; }
.tour-foot { display: flex; align-items: center; gap: 0.6rem; }
.tour-skip { background: none; border: 0; color: var(--muted); font-size: 0.8rem; cursor: pointer; padding: 0.25rem 0; }
.tour-skip:hover { color: var(--text); text-decoration: underline; }
.tour-dots { display: flex; gap: 0.3rem; margin: 0 auto; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.tour-dots i.on { background: var(--primary); }
.tour-nav { display: flex; gap: 0.4rem; }
.tour-nav button {
    font-size: 0.85rem; padding: 0.35rem 0.8rem; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer;
}
.tour-nav button.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tour-nav button.primary:hover { background: var(--primary-strong, var(--primary)); }

/* =============== HELP =============== */
#help-search {
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
}
#help-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.btn-line {
    padding: 0.55rem 0.9rem; font-size: 0.9rem; white-space: nowrap; cursor: pointer;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    transition: color var(--transition), border-color var(--transition);
}
.btn-line:hover { color: var(--primary); border-color: var(--primary); }
.help-stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 0 1.25rem;
    align-items: start;
}
.help-side { position: sticky; top: calc(var(--topbar-h) + 1rem); display: flex; flex-direction: column; }
.help-card { text-align: center; padding: 1.25rem 1rem; }
.help-card .ico { width: 1.5rem; height: 1.5rem; color: var(--primary); }
.help-card h3 { margin: 0.4rem 0 0.15rem; }
.help-card p { margin: 0 0 0.8rem; font-size: 0.85rem; }
.help-card .btn-line { display: inline-block; text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
    .help-stack { grid-template-columns: minmax(0, 1fr); }
    .help-side { position: static; order: -1; }
}
.help-group h3 { margin-bottom: 0.35rem; }
.help-item { border-bottom: 1px solid var(--border); }
.help-item:last-child { border-bottom: 0; }
.help-item summary {
    cursor: pointer; padding: 0.6rem 0.25rem; font-size: 0.92rem; font-weight: 500;
    list-style: none;
    display: flex; align-items: center; gap: 0.65rem;
}
.help-item summary::-webkit-details-marker { display: none; }
/* A quiet chevron instead of the stock triangle — smaller, spaced, rotates open. */
.help-item summary::before {
    content: ""; flex: none;
    width: 0.4rem; height: 0.4rem; margin-left: 0.2rem;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}
.help-item[open] summary::before { transform: rotate(45deg); }
.help-item summary:hover { color: var(--primary); }
.help-item summary:hover::before { border-color: var(--primary); }
.help-item p { margin: 0 0 0.7rem; padding: 0 0.25rem 0 1.5rem; font-size: 0.88rem; color: var(--muted); line-height: 1.5; }

.help-empty { text-align: center; padding: 1rem 0; }

/* A card whose intro is its whole content shouldn't end on a dangling rule. */
.section .section-intro:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }


/* Site visibility */
.vis-row { display: flex; gap: 0.6rem; align-items: center; }
/* Unpublish sits under the timed hide, set apart: it lasts until the owner publishes again. */
.vis-unpublish { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.vis-unpublish .field-hint { margin-top: 0; }
#vis-unpublish:hover { color: var(--danger); border-color: var(--danger); }
.vis-row select {
    padding: 0.5rem 2rem 0.5rem 0.6rem; font-size: 0.9rem;
    color: var(--text);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    appearance: none; -webkit-appearance: none;
    background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 0.6rem center;
    cursor: pointer;
}
/* The action next to it is a real button, not another bordered box. */
.btn-solid {
    padding: 0.55rem 0.9rem; font-size: 0.9rem; font-weight: 500; cursor: pointer;
    background: var(--primary); color: var(--on-primary);
    border: 1px solid var(--primary); border-radius: var(--radius-sm);
    transition: filter var(--transition);
}
.btn-solid:hover { filter: brightness(1.1); }
.section-slim { padding-top: 1rem; padding-bottom: 0.35rem; }
.section-slim h3 { font-size: 0.95rem; margin-bottom: 0.4rem; }

/* Press Kit: a switch per element, two to a row. A switch with nothing behind
   it yet is disabled; its tooltip says where to add the missing piece. */
.pk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; max-width: 44rem; }
@media (max-width: 640px) { .pk-grid { grid-template-columns: minmax(0, 1fr); } }

/* ============ SOCIAL POSTING ============
   The Social tab (cross-vertical; drawn only when features.social is on for
   this vertical AND both in-code flags are flipped — see admin.js).
   Full-width like Graphics: there is no site preview to sit beside. */
.soc-cards { display: grid; gap: 0.75rem; }
.soc-card {
    display: flex; align-items: center; gap: 0.9rem;
    padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface);
}
.soc-card.soc-on { border-color: var(--primary-light); background: var(--primary-soft); }
.soc-card.soc-off { opacity: 0.65; }
.soc-card-main { flex: 1; min-width: 0; }
.soc-card-main strong { display: block; }
.soc-card-main p { margin: 0.15rem 0 0; font-size: 0.88rem; }
.soc-meta { display: block; margin-top: 0.3rem; font-size: 0.8rem; color: var(--muted); }
.soc-glyph { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: var(--radius-sm); flex: none; }
.soc-glyph svg { width: 20px; height: 20px; }
/* The networks' own colors — the one place in the editor that isn't indigo,
   because a campaign scans for the logo, not for our chrome. */
.soc-glyph.soc-facebook { background: #e7f0fd; color: #1877f2; }
.soc-glyph.soc-instagram { background: #fdecf3; color: #c13584; }
:root[data-theme="dark"] .soc-glyph.soc-facebook { background: #12233d; color: #6aa9ff; }
:root[data-theme="dark"] .soc-glyph.soc-instagram { background: #331a26; color: #f472b6; }
.soc-page-pick { display: block; margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.soc-page-pick select { margin-left: 0.4rem; }

.soc-compose.soc-disabled { opacity: 0.6; }
.soc-targets { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.soc-target {
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
    padding: 0.5rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-pill);
    background: var(--surface); font-size: 0.9rem;
}
.soc-target:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.soc-target.off { cursor: not-allowed; opacity: 0.55; }
.soc-target .soc-glyph { width: 22px; height: 22px; }
.soc-target .soc-glyph svg { width: 14px; height: 14px; }

.soc-image { margin: 1rem 0; }
.soc-image-pick { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.45rem; }
.soc-upload { cursor: pointer; }
.soc-image-picked { display: flex; gap: 1rem; align-items: flex-start; margin-top: 0.45rem; }
.soc-image-picked img { width: 160px; border-radius: var(--radius); border: 1px solid var(--border); }
.soc-image-picked p { margin: 0.2rem 0 0.5rem; font-size: 0.85rem; }
.soc-photo-strip { margin-top: 0.8rem; font-size: 0.85rem; }
.soc-thumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.soc-thumb { width: 64px; height: 64px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); cursor: pointer; }
.soc-thumb:hover { border-color: var(--primary); }
.soc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.soc-actions { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; }
.soc-actions .muted { font-size: 0.85rem; }

.soc-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.soc-history li { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); }
.soc-hist-thumb { width: 52px; height: 52px; flex: none; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); }
.soc-hist-text { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.soc-hist-main { min-width: 0; flex: 1; }
.soc-hist-caption { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.soc-hist-meta { margin: 0.3rem 0 0; display: flex; gap: 0.6rem; flex-wrap: wrap; font-size: 0.8rem; }
.soc-res.ok { color: var(--success); }
.soc-res.bad { color: var(--danger); }

/* Graphics preview header: Download sat alone before "Post this" joined it. */
.gfx-out { display: flex; gap: 0.4rem; }

/* A deep link (#settings/report from the weekly email) briefly highlights its card. */
.section.flash { animation: section-flash 2.4s ease-out; }
@keyframes section-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--primary); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* =============== MENU EDITOR (features.menu) =============== */
/* Menus as folder tabs over one panel (owner, 2026-11-10). */
.menu-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.25rem 0 0; padding-left: 0.5rem; position: relative; z-index: 1; }
.menu-tab {
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    padding: 0.45rem 0.85rem 0.4rem;
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: -1px;
}
.menu-tab:hover { color: var(--text); }
.menu-tab.active { background: var(--surface); border-color: var(--border-strong); color: var(--text); font-weight: 600; padding-bottom: calc(0.4rem + 1px); }
.menu-tab-add { background: transparent; border: 1px dashed var(--border-strong); border-bottom: 0; color: var(--muted); }
.menu-panel { border: 1px solid var(--border-strong); border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm); background: var(--surface); padding: 0.9rem 1rem 1rem; margin-bottom: 0.9rem; }
.menu-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.9rem; }
.menu-panel-name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.menu-panel-sub { font-size: 0.85rem; }
.menu-panel-head .btn-quiet svg { width: 14px; height: 14px; }
.menu-count { color: var(--muted); font-size: 0.78rem; margin-left: 0.15rem; }
.menu-settings { margin-bottom: 0.9rem; }
.menu-settings .danger { margin-top: 0.4rem; }
.menu-cat { margin-bottom: 1.1rem; }
.menu-cat-head { display: flex; align-items: center; gap: 0.35rem; border-bottom: 2px solid var(--border); padding-bottom: 0.35rem; margin-bottom: 0.35rem; }
.menu-cat-name { flex: 1; min-width: 0; font-weight: 700; font-size: 1rem; border-color: transparent; background: transparent; }
.menu-cat-name:hover, .menu-cat-name:focus { border-color: var(--border-strong); background: var(--surface); }
/* These inputs and buttons sit outside .field / .list-item-actions, so they get those looks here. */
.menu-dish-row input, .menu-cat-name {
    padding: 0.4rem 0.6rem;
    color: var(--text);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.menu-dish-row input { font-size: 0.95rem; background: var(--surface); border: 1px solid var(--border-strong); }
.menu-cat-name { border: 1px solid transparent; }
.menu-dish-row input:focus, .menu-cat-name:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.menu-ed .icon-act {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}
.menu-ed .icon-act:not([disabled]):hover { color: var(--text); background: var(--surface-3); }
.menu-ed .icon-act.danger:not([disabled]):hover { color: var(--danger); background: var(--danger-soft); }
.menu-settings button.danger {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--danger);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}
.menu-settings button.danger:hover { background: var(--danger-soft); }
.menu-dish { border-bottom: 1px dotted var(--border); }
.menu-dish-row { display: flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0; }
.menu-dish-name { flex: 1; min-width: 0; }
.menu-dish-price { width: 6.5rem; flex-shrink: 0; text-align: right; }
.menu-dish-toggle svg { transform: rotate(-90deg); transition: transform var(--transition); }
.menu-dish.open .menu-dish-toggle svg { transform: none; }
.menu-dish-more { padding: 0.4rem 0 0.9rem 2.1rem; }
.menu-tags { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
.menu-tags .field-checkbox { margin: 0; }
/* "+ Add dish": a small solid button, not a full-width dashed one (owner, 2026-11-10). */
.menu-add-dish { margin-top: 0.45rem; padding: 0.35rem 0.85rem; font-size: 0.85rem; font-weight: 600; color: var(--on-primary); background: var(--primary); border: 1px solid var(--primary); border-radius: var(--radius-pill); cursor: pointer; }
.menu-add-dish:hover { background: var(--primary-hover); }
.menu-add-cat { margin-top: 0.4rem; }
.menu-star.on { color: #c98a00; }
.menu-star.on:hover { color: #a87300; }
/* The dish / menu form (renderMenuModal). */
/* The dialog fits the window (owner, 2026-11-10): its fields scroll inside, the title and buttons stay put. */
.menu-modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, 0.45); display: flex; align-items: center; justify-content: center; padding: 1rem; overflow: hidden; }
.menu-modal { width: 100%; max-width: 560px; background: var(--surface); border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3); display: flex; flex-direction: column; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow: hidden; }
.menu-modal h3 { margin: 0; padding: 1.3rem 1.4rem 0.9rem; flex: none; }
.menu-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 1.4rem 0.4rem; }
.menu-modal .field-row { display: grid; grid-template-columns: minmax(0, 1fr) 8rem; gap: 0.75rem; }
.menu-modal-actions { flex: none; display: flex; align-items: center; gap: 0.5rem; margin: 0; border-top: 1px solid var(--border); padding: 0.9rem 1.4rem 1.1rem; }
.menu-modal-actions .spacer { flex: 1; }
.menu-modal-actions .btn-quiet svg { width: 14px; height: 14px; }
.menu-modal-done { background: var(--primary); color: var(--on-primary); border: 1px solid var(--primary); border-radius: var(--radius-pill); padding: 0.5rem 1.1rem; font-weight: 600; cursor: pointer; }
.menu-modal-done:hover { background: var(--primary-hover); }
.icon-act[disabled] { opacity: 0.35; cursor: default; }
@media (max-width: 520px) {
    /* Name gets the whole first line; price and the row buttons drop under it. */
    .menu-dish-row { flex-wrap: wrap; }
    .menu-dish-name { flex-basis: calc(100% - 28px - 0.35rem); }
    .menu-dish-price { width: 5.5rem; margin: 0 auto 0 calc(28px + 0.35rem); }
    .menu-dish-more { padding-left: 0; }
}

/* Import from Square card + imported dishes */
.square-card { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 0.8rem 0.9rem; margin: 0 0 0.9rem; display: flex; gap: 0.8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.square-card.connected { display: block; }
.square-card .field-hint { margin: 0.2rem 0 0; }
.square-head { display: flex; align-items: baseline; gap: 0.6rem; justify-content: space-between; flex-wrap: wrap; }
.square-row { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; margin: 0.6rem 0 0.2rem; }
.square-row .field-label { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; }
.square-row select, .square-row input { padding: 0.4rem 0.6rem; font-size: 0.9rem; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.square-btn { background: var(--primary); border: 1px solid var(--primary); color: var(--on-primary); border-radius: var(--radius-sm); padding: 0.45rem 0.9rem; font-weight: 600; }
.square-btn[disabled] { opacity: 0.6; cursor: default; }
/* The pressed button keeps full strength while it works: its spinner is the point. */
.square-btn.is-working[disabled], .link-btn.is-working[disabled] { opacity: 1; cursor: progress; }
.menu-sq-badge { flex-shrink: 0; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.menu-dish-row input[disabled] { background: var(--surface-2); color: inherit; cursor: not-allowed; }
.menu-cat-name[disabled] { color: var(--text); background: transparent; border-color: transparent; cursor: default; }
.menu-sq-note { margin: 0 0 0.4rem; }
.menu-sq-desc { margin: 0 0 0.8rem; }
@media (max-width: 520px) { .menu-sq-badge { order: 1; } }   /* to the end of the wrapped second line, where the delete button would be */

/* Referral options under an empty vendor-link field (referrals.json) */
.referral-box { margin-top: 0.6rem; padding: 0.75rem 0.9rem; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.referral-box ul { margin: 0.4rem 0; padding-left: 1.1rem; }
.referral-box li { margin: 0.2rem 0; font-size: 0.9rem; }
.referral-disclosure { margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--muted); }
/* Definition verticals' homepage section list (renderHomeSections): one row
   per switchable section; a row can carry a link to the page whose content it
   shows, and the fields of a section this page edits (shown while it's on). */
.toggle-list.home-sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; max-width: 44rem; }
.toggle-drag.with-fields { flex-wrap: wrap; }
/* Sections on your homepage (owner, 2026-11-10): two to a line, each a compact row — drag handle,
   pencil, name, switch. Only the switch toggles; a row whose fields are open takes the full width. */
.toggle-list.home-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
.toggle-list.home-sections .toggle-drag.sec-open { grid-column: 1 / -1; }
.toggle-row.sec-item { cursor: default; gap: 0.5rem; justify-content: flex-start; }
.toggle-row.sec-item .toggle-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toggle-row.sec-item input[type="checkbox"] { cursor: pointer; flex: none; }
.sec-edit { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--muted); }
.sec-edit svg { width: 15px; height: 15px; }
.sec-edit:hover:not(:disabled), .sec-edit.active { color: var(--primary); background: var(--primary-soft); }
.sec-edit-spacer { flex: none; width: 28px; }
@media (max-width: 640px) { .toggle-list.home-sections { grid-template-columns: minmax(0, 1fr); } }
.toggle-drag .section-fields { flex: 1 1 100%; min-width: 0; box-sizing: border-box; padding: 0.25rem 0 0.25rem 1.6rem; }
.toggle-drag .section-fields > .section { margin: 0.5rem 0 0; box-shadow: none; }
.toggle-row.static { cursor: grab; }
.list-item-title .shop-price-warn { display: block; margin: 0.15rem 0 0; font-size: 0.8rem; font-weight: 500; white-space: normal; overflow: visible; }
.list-item-title .shop-price-warn[hidden] { display: none; }

/* =============== brandnewsite look (owner, 2026-11-08) ===============
   Headings in Inter (--font-display), the main actions as pills, like brandnewsite's
   buttons. Colour comes from the tokens at the top. */
h1, h2, h3, .section h3, .topbar-title, .modal h2, .modal h3 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.section h3 { font-size: 1.2rem; }
#save-btn, .modal-actions button, .square-btn, .tour-nav button, button.ghost { border-radius: var(--radius-pill); }
#save-btn, .modal-actions button.primary, .square-btn { background: var(--primary); }
#save-btn:hover:not(:disabled), .modal-actions button.primary:hover { background: var(--primary-hover); }
::selection { background: var(--sun); color: #1d2236; }

/* Brand (owner, 2026-11-08): the editor wears Brand New Site, the mascot and the name
   in Newsreader (--font-logo) as on brandnewsite.org — the wordmark keeps its face though the
   editor's headings are Inter (owner, 2026-11-10); a candidate's editor keeps the Poliquicks logo.
   html[data-brand] is set once the site's vertical is known (renderTenantLabel). */
.topbar-brand.bns { display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none; color: var(--text); }
.topbar-brand.bns img { height: 30px; width: auto; }
.bns-name { font: 600 1.25rem/1 var(--font-logo); letter-spacing: -0.02em; white-space: nowrap; }
html:not([data-brand="poliquicks"]) .topbar-brand.pq { display: none; }
html[data-brand="poliquicks"] .topbar-brand.bns, html[data-brand="poliquicks"] .editor-foot { display: none; }
.editor-foot { display: flex; justify-content: center; align-items: center; gap: 0.4rem; padding: 1.5rem 0 2rem; color: var(--muted); font-size: 0.75rem; }
.editor-foot img { height: 13px; width: auto; opacity: 0.7; }
.editor-foot a { display: inline-flex; align-items: center; gap: 0.4rem; color: inherit; text-decoration: none; }
.editor-foot a:hover img { opacity: 1; }
@media (max-width: 640px) { .bns-name { display: none; } }

/* =============== No blue links (owner, 2026-11-10) ===============
   Every link in the editor is drawn as a button. In-app jumps are
   <button data-go> (goBtn in core.js); outside links and mail are <a> with the
   same class; anything left unclassed in the editor's content falls under the
   same look rather than the browser's blue underline. */
.btn-inline,
.panels a:not([class]), .modal a:not([class]), .toast a:not([class]), .tour-card a:not([class]) {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.05rem 0.5rem;
    margin: 0 0.1rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: 0.92em;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: baseline;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.btn-inline:hover,
.panels a:not([class]):hover, .modal a:not([class]):hover, .toast a:not([class]):hover, .tour-card a:not([class]):hover {
    border-color: var(--primary); color: var(--primary); background: var(--primary-soft); text-decoration: none;
}
#dirty-status .btn-inline { color: inherit; font-weight: 600; }

/* =============== Topbar at every width (owner, 2026-11-10) ===============
   Save & Publish never wraps or squeezes (it broke onto two lines into an oval
   around 820px). The left side gives way instead, in order: the site address,
   then the editor's title, then (640px, above) the wordmark and the status. */
.topbar-left { flex: 1 1 auto; }
.topbar-right { flex: none; }
#tenant-label { min-width: 0; flex: 0 1 auto; }
#save-btn { white-space: nowrap; flex: none; }
@media (max-width: 1080px) { #tenant-label { display: none; } }
@media (max-width: 900px) { .topbar-divider, .topbar-title { display: none; } }

/* A photo field still empty shows the vertical's sample photo, as the site does (2026-11-10), marked so nobody
   mistakes it for their own: a "Sample" tag, and the strip says "Add your own". Clicking anywhere picks a file. */
.photo-thumb.sample img { opacity: 0.85; }
.photo-sample-tag {
    position: absolute; top: 0.4rem; left: 0.4rem;
    padding: 0.15rem 0.45rem; border-radius: var(--radius-pill);
    background: rgba(15, 23, 42, 0.7); color: #fff;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}

/* The font tiles and sample card show a one-weight face (Celtic, Editorial) as it is, not fake-bolded. */
.font-tile-sample, .party-preview-name { font-synthesis-weight: none; }

/* Chips (owner, 2026-11-10): a list of short one-line items — tags, a dietary key, quick facts — as
   small tiles several to a line; the pencil edits one in place (renderChipList in core.js). */
.chip-list .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 0.15rem; max-width: 100%; padding: 0.15rem 0.2rem 0.15rem 0.15rem; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 0.85rem; line-height: 1.3; }
.chip .chip-text { padding: 0 0.25rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .icon-act { width: 24px; height: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border: 0; background: transparent; border-radius: 5px; }
.chip .icon-act svg { width: 13px; height: 13px; }
.chip .chip-pencil:hover { color: var(--primary); background: var(--primary-soft); }
.chip .chip-del:hover { color: var(--danger); background: var(--danger-soft); }
.chip.editing { padding: 0.2rem; gap: 0.3rem; border-color: var(--primary); background: var(--surface); }
.chip .chip-input { width: 8.5rem; padding: 0.25rem 0.45rem; font-size: 0.85rem; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: var(--text); }
.chip .chip-input:first-child:not(:only-of-type) { width: 4.5rem; }
.chip .chip-done { color: var(--primary); font-weight: 700; }
.chip.chip-add { cursor: pointer; color: var(--muted); border-style: dashed; padding: 0.3rem 0.7rem; background: transparent; }
.chip.chip-add:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* =============== SEO page (owner, 2026-11-10) ===============
   A Google result as the bake will build it, and what Google reads from the site. */
.serp { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.85rem 1rem; font-family: Arial, Helvetica, sans-serif; }
.serp-url { color: #4d5156; font-size: 0.8rem; margin-bottom: 0.15rem; overflow-wrap: anywhere; }
.serp-title { color: #1a0dab; font-size: 1.15rem; line-height: 1.3; margin-bottom: 0.2rem; }
.serp-desc { color: #4d5156; font-size: 0.85rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.seo-preview h4 { margin-top: 1.1rem; }
.seo-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.seo-checks li { display: flex; align-items: center; gap: 0.55rem; font-size: 0.9rem; min-height: 1.9rem; }
.seo-check-mark { width: 1.2rem; text-align: center; font-weight: 700; }
.seo-checks li.ok .seo-check-mark { color: var(--success); }
.seo-checks li.missing .seo-check-mark { color: var(--muted); }
.seo-check-label { min-width: 8.5rem; font-weight: 500; }
.seo-check-value { color: var(--muted); overflow-wrap: anywhere; }

/* =============== Look picker (owner, 2026-11-11) ===============
   One tile per look the vertical offers: a picture of the site wearing it, its name, a line about it. */
.look-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 0.7rem; }
.look-tile { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.5rem 0.5rem 0.65rem; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; color: var(--text); font: inherit; }
.look-tile:hover { border-color: var(--primary); }
.look-tile.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--ring); background: var(--primary-soft); }
.look-thumb { display: block; aspect-ratio: 4 / 3; border-radius: 5px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
.look-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.look-name { font-weight: 600; font-size: 0.92rem; padding: 0.15rem 0.2rem 0; }
.look-blurb { color: var(--muted); font-size: 0.78rem; line-height: 1.35; padding: 0 0.2rem; }

/* The Look picker's question about what a short look suggests switching off: a plain list of names. */
.look-off-list { margin: 0.25rem 0 0.9rem; padding-left: 1.25rem; }
.look-off-list li { margin: 0.2rem 0; font-weight: 600; }

/* Something is on its way: the Publish button while it saves, the dialog while a first publish goes live. */
.btn-spin { display: inline-block; width: 0.85em; height: 0.85em; margin-right: 0.55em; vertical-align: -0.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: upload-spin 0.7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .btn-spin { animation-duration: 2.4s; } }
